* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { font: 13px/1.45 "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; color: #2b2b2b; background: #eceae4; display: grid; grid-template-rows: 48px minmax(0, 1fr); --c: #e8730c; --line: #dcd8ce; }
button { font: inherit; cursor: pointer; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 5px 11px; white-space: nowrap; }
.btn:hover { background: #fbf4ea; }
.btn.primary { background: var(--c); border-color: var(--c); color: #fff; }
#top { display: flex; align-items: center; gap: 12px; padding: 0 12px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { font-size: 16px; } .brand b { color: var(--c); } .brand .sub { font-size: 12px; color: #888; margin-left: 6px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; margin-left: auto; }
.seg button { border: 0; background: transparent; padding: 6px 12px; color: #555; } .seg button + button { border-left: 1px solid var(--line); } .seg button.on { background: var(--c); color: #fff; }
#main { display: flex; min-height: 0; }
#side { width: 360px; flex: none; overflow-y: auto; background: #fff; border-right: 1px solid var(--line); padding: 8px 12px 30px; }
section { padding: 8px 0 10px; border-bottom: 1px dashed var(--line); }
section.hi { background: #fff7ec; margin: 0 -12px; padding: 8px 12px 10px; }
h3 { margin: 0 0 6px; font-size: 13px; color: #8a5a2b; }
.row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.row label { flex: 0 0 118px; color: #555; font-size: 12.5px; }
.row input[type=number], .row input[type=date], .row select { flex: 1; min-width: 0; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font: inherit; }
.row input.sm { flex: 0 0 56px; }
.row input[type=range] { flex: 1; }
.row b { min-width: 34px; text-align: right; }
.row.btns { gap: 10px; flex-wrap: wrap; }
.chk { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: #555; }
.row label.chk { flex: 1 1 auto; display: flex; flex-wrap: wrap; } .row .chk b { min-width: 0; text-align: left; }
.tip { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: #eee; text-align: center; font-size: 11px; line-height: 16px; cursor: help; }
.total { margin-top: 4px; color: #444; } .total b { color: var(--c); font-size: 15px; }
.hint { color: #777; font-size: 12px; margin: 4px 0; }
.chips { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 4px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 3px 10px; font-size: 12px; }
.chips button.on { background: var(--c); border-color: var(--c); color: #fff; }
table.st { width: 100%; border-collapse: collapse; font-size: 12.5px; margin-bottom: 8px; }
table.st th, table.st td { border-bottom: 1px solid #eee; padding: 4px 4px; text-align: right; }
table.st td:first-child, table.st th:first-child { text-align: left; color: #555; }
table.st th { color: #888; font-weight: normal; }
#yearTbl table { margin-top: 8px; }
#yearTbl .up { color: #2e7d32; } #yearTbl .dn { color: #c62828; }
#rules .rule { font-size: 13px; padding: 4px 6px; margin: 3px 0; border-radius: 5px; line-height: 1.45; }
#rules .rule.ok { background: #eef8ee; } #rules .rule.bad { background: #fdecec; color: #8a1f1f; } #rules .rule.info { background: #f3f3f3; color: #555; }
#view { flex: 1; position: relative; min-width: 0; }
#c3d { display: block; width: 100%; height: 100%; }
#legend { position: absolute; left: 10px; bottom: 10px; background: rgba(255,255,255,.9); padding: 5px 10px; border-radius: 8px; font-size: 12px; display: flex; gap: 6px; align-items: center; }
#legend .lg { display: inline-block; width: 140px; height: 12px; border-radius: 3px; background: linear-gradient(90deg, #1b2a49, #3a6ea5, #9ccf7a, #f3e35a, #ffb300); }
#clock { position: absolute; right: 12px; top: 10px; background: rgba(255,255,255,.9); padding: 6px 12px; border-radius: 8px; font-size: 14px; }
#clock b { color: var(--c); font-size: 18px; }
#nowCmp { position: absolute; right: 12px; top: 52px; background: rgba(255,255,255,.92); padding: 6px 12px; border-radius: 8px; font-size: 13px; max-width: 420px; }
#nowCmp:empty { display: none; }
#nowCmp b { font-size: 15px; }
#nowCmp .lossTxt { color: #c62828; font-weight: bold; }
#legend #lgBase { display: inline-flex; gap: 6px; align-items: center; margin-left: 8px; padding-left: 8px; border-left: 1px solid #ccc; }
#legend .lgLine { display: inline-block; width: 28px; height: 0; border-top: 3px dashed #e0c300; }
#legend .lgLost { display: inline-block; width: 14px; height: 12px; border-radius: 2px; background: rgba(220,40,40,.6); margin-left: 4px; }
#legend .lgSun, #legend .lgShade { display: inline-block; width: 14px; height: 12px; border-radius: 2px; border: 1px solid #999; margin: 0 2px 0 4px; vertical-align: -1px; }
#legend .lgSun { background: #ecdfbc; } #legend .lgShade { background: #6e7078; }
#legend #lgMoment, #legend #lgHeat { display: inline-flex; align-items: center; gap: 4px; }
#groundSeg { margin-left: 0; } #groundSeg button { padding: 4px 10px; font-size: 13px; }
#groundHint { margin: -2px 0 6px; }
#s_dayLoss { margin: 6px 0 8px; padding: 6px 8px; border-radius: 6px; background: #fff3f3; color: #8a1f1f; font-size: 13px; }
#s_dayLoss:empty { display: none; }
#s_dayLoss b { color: #c62828; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 9; padding: 16px; }
.modal[hidden] { display: none; }
.modal .card { background: #fff; border-radius: 14px; padding: 18px 22px; max-width: 620px; max-height: 90vh; overflow-y: auto; }
.modal h2 { margin: 0 0 8px; color: var(--c); } .modal ol { padding-left: 20px; } .modal li { margin: 5px 0; }
@media (max-width: 820px) { #main { flex-direction: column; } #side { width: auto; max-height: 55vh; border-right: 0; border-bottom: 1px solid var(--line); } }
