:root {
  color-scheme: light;
  --navy: #0b2336;
  --ink: #152d40;
  --muted: #516778;
  --line: #d9e3e9;
  --surface: #f3f7f9;
  --teal: #007769;
  --red: #c6252b;
  font-family: "Geist", "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  background: var(--surface);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 310px; }
a { color: inherit; }
button, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #007fbb; outline-offset: 3px; }
.shell { width: min(1440px, calc(100% - 80px)); margin: 0 auto; }
.masthead { background: var(--navy); color: white; border-bottom: 1px solid #ffffff25; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 70px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 17px; font-weight: 700; }
.brand small { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; color: #adc0cf; }
.brand-mark { width: 37px; height: 37px; border-radius: 8px; background: #174456; display: grid; place-content: center; gap: 3px; }
.brand-mark i { display: block; width: 18px; height: 2px; border-radius: 6px; background: #6fdec7; transform: skewY(-14deg); }
.brand-mark i:nth-child(2) { width: 15px; }
.brand-mark i:nth-child(3) { width: 12px; }
nav { display: flex; align-items: center; gap: 21px; font-size: 13px; white-space: nowrap; }
nav a { color: #e3edf2; text-decoration: none; }
nav a:hover { color: #7eecd4; }
.nav-download { padding: 8px 12px; border: 1px solid #71909e; border-radius: 6px; }
.nav-download span { margin-left: 4px; }
.intro { background: #0e2b40; color: white; position: relative; overflow: hidden; }
.intro::before {
  position: absolute; inset: 0; content: ""; pointer-events: none;
  background: radial-gradient(ellipse at 85% 10%, #1c58694d, transparent 60%),
    repeating-linear-gradient(90deg, #c8f9f610 0 1px, transparent 1px 35px),
    repeating-linear-gradient(0deg, #c8f9f610 0 1px, transparent 1px 35px);
  mask-image: linear-gradient(90deg, transparent 4%, #000 85%);
}
.intro-inner { position: relative; display: flex; align-items: end; justify-content: space-between; padding-block: 44px; gap: 30px; }
.overline { font-size: 12px; letter-spacing: .17em; color: #9bddcf; margin: 0 0 13px; font-weight: 700; }
.overline span { display: inline-block; width: 17px; height: 2px; background: #6bd5bb; margin-right: 4px; vertical-align: middle; }
h1 { font-size: clamp(31px, 4vw, 56px); line-height: 1.12; letter-spacing: -.035em; margin: 0; }
.intro-text { color: #c5d7e2; font-size: 14px; margin: 15px 0 0; line-height: 1.6; }
.intro-stats { display: flex; margin: 0; gap: 0; }
.intro-stats div { padding: 2px 22px; border-left: 1px solid #7d9caa73; }
.intro-stats div:last-child { padding-right: 0; }
.intro-stats dt { color: #b6cad5; font-size: 12px; white-space: nowrap; }
.intro-stats dd { margin: 7px 0 0; color: #f2fbff; font-size: clamp(20px, 2.3vw, 32px); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.intro-stats small { font-size: 12px; font-weight: 400; color: #b6cad5; }
main { padding-block: 28px 48px; }
section { scroll-margin-top: 15px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
h2, h3 { margin: 0; }
h2 { font-size: 24px; letter-spacing: -.02em; }
.section-head p, .panel-head p { margin: 6px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.month-control, .map-actions label, .reading-controls label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
select, .outline { background: white; border: 1px solid #c9d8e2; border-radius: 6px; min-height: 35px; padding: 5px 9px; }
select:hover, .outline:hover { border-color: #619990; }
.project-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 16px; gap: 8px; }
.project-tabs button { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 12px 16px; font-weight: 700; font-size: 15px; white-space: nowrap; }
.project-tabs button[aria-pressed="true"] { background: #0e3447; border-color: #0e3447; color: white; box-shadow: inset 3px 0 #51c5ad; }
.project-tabs button:not([aria-pressed="true"]):hover { border-color: #62a99e; }
.monitor-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 9px; min-width: 0; box-shadow: 0 3px 9px #23465c08; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; }
.panel-head h3 { font-size: 17px; }
.outline { font-size: 12px; white-space: nowrap; }
.type-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 0 18px 12px; }
.type-tabs button { background: #f2f6f8; border: 1px solid transparent; border-radius: 5px; color: #465e70; padding: 7px 8px; font-size: 12px; }
.type-tabs button[aria-pressed="true"] { color: #005f53; background: #dbf3ee; border-color: #a8dbd0; font-weight: 700; }
.type-tabs button:hover { border-color: #69b0a4; }
.drawing-scroll { overflow: auto; background: #fff; margin: 0 18px; border: 1px solid #dce6ea; border-radius: 5px; }
.drawing { position: relative; width: 100%; min-width: 650px; }
.drawing img { display: block; width: 100%; height: auto; }
.map-pin {
  position: absolute; transform: translate(-50%, -50%); border-radius: 50%;
  width: max(11px, var(--pin-width)); aspect-ratio: 1; padding: 0;
  border: 1px solid transparent; background: transparent; color: transparent;
  touch-action: manipulation; font: bold clamp(8px, 1vw, 13px)/1 "Geist", sans-serif;
}
.map-pin:hover, .map-pin:focus-visible, .map-pin[aria-pressed="true"] {
  background: #006f62; color: #fff; border-color: #fff;
  box-shadow: 0 0 0 2px #18a693; z-index: 1; min-width: 17px;
}
.map-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 11px 18px 14px; }
.legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 100%; background: var(--red); }
.legend-dot.selected { background: var(--teal); margin-left: 7px; }
.reading-head { border-bottom: 1px solid #e6edf1; }
.reading-head h3 { font-size: 22px; line-height: 1.3; }
.reading-head .reading-category { margin: 0 0 3px; }
.count { font-size: 11px; background: #edf3f6; color: #385365; padding: 5px 7px; border-radius: 5px; white-space: nowrap; }
.reading-controls { margin: 12px 16px 0; display: flex; flex-wrap: wrap; gap: 6px 15px; }
.reading-controls:empty { display: none; }
.reading-controls select { font-size: 12px; min-height: 29px; }
.reading-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin: 13px 16px 0; }
.reading-stats div { padding: 8px 7px; border: 1px solid #e1eaef; border-radius: 5px; background: #f8fafb; min-width: 0; }
.reading-stats dt { font-size: 11px; color: var(--muted); }
.reading-stats dd { margin: 4px 0 0; font-weight: 700; font-size: 16px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.reading-stats small { font-size: 10px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.chart-box { margin: 6px 12px 0; }
canvas { display: block; width: 100%; height: 148px; }
.empty { margin: 15px 16px; padding: 22px 12px; font-size: 13px; text-align: center; color: var(--muted); background: #f3f7f9; border-radius: 5px; }
.reading-details { margin: 4px 16px 14px; font-size: 13px; }
summary { padding: 9px 4px; color: #006358; font-weight: 700; }
.table-scroll { max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
th, td { padding: 6px; text-align: right; white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
thead { position: sticky; top: 0; background: #e9f1f5; }
tbody tr:nth-child(even) { background: #f5f8fa; }
.archives { margin-top: 30px; }
.download-panel { padding: 15px 18px; display: flex; align-items: end; gap: 16px 24px; justify-content: space-between; flex-wrap: wrap; }
.download-picker, .download-result { display: flex; align-items: end; gap: 10px 14px; flex-wrap: wrap; }
.download-picker label { display: grid; gap: 5px; font-size: 12px; color: var(--muted); }
.download-picker select { min-width: 107px; color: var(--ink); }
.download-result { align-items: center; }
.download-result p { margin: 0; font-size: 12px; color: var(--muted); }
.download-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; background: #007366; color: white; text-decoration: none; font-weight: 700; font-size: 13px; min-height: 35px; border-radius: 6px; }
.download-button:hover { background: #00594e; }
footer { color: var(--muted); border-top: 1px solid var(--line); padding: 18px 0; font-size: 12px; }
footer .shell { display: flex; gap: 9px 16px; justify-content: space-between; flex-wrap: wrap; }
dialog { background: white; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); padding: 0; width: min(1430px, calc(100% - 24px)); max-width: none; max-height: calc(100% - 24px); }
dialog::backdrop { background: #0b2336c9; }
.dialog-scroll .drawing { min-width: 1100px; }
.dialog-hint { margin: 12px 18px 16px; color: var(--muted); font-size: 13px; }
noscript { display: block; padding: 16px; }
.monitor-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: end; gap: 8px 12px; }
.entry-button {
  font: inherit; font-size: 13px; font-weight: 700; line-height: 1.3;
  min-height: 35px; padding: 5px 12px; border: 1px solid #00675a; border-radius: 6px;
  background: var(--teal); color: #fff; white-space: nowrap;
}
.entry-button:hover { background: #00594e; }
.entry-button:disabled { background: #edf3f6; color: #516778; border-color: var(--line); cursor: default; }
.entry-notice { margin: 0 0 12px; color: #006358; font-size: 13px; }
#entry-dialog { width: min(540px, calc(100% - 24px)); }
#entry-dialog .dialog-head { border-bottom: 1px solid var(--line); }
#entry-form { padding: 0 18px 18px; }
.entry-hint, .entry-error { margin: 12px 0; font-size: 13px; line-height: 1.5; }
.entry-hint { color: var(--muted); }
.entry-error { color: #9a1c22; }
.upload-file { display: grid; gap: 8px; padding: 12px; font-size: 13px; border: 1px dashed #a9c2ca; border-radius: 6px; background: #f5faf9; }
.upload-file input { width: 100%; min-width: 0; font: inherit; }
.import-review { font-size: 13px; }
.import-review ul { max-height: 180px; overflow: auto; margin-top: 0; padding-left: 24px; overflow-wrap: anywhere; }
.entry-actions { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; padding-top: 4px; }
.manual-reading { margin-left: 6px; font-size: 10px; color: #006358; }
#project-dialog { width: min(820px, calc(100% - 24px)); }
#project-dialog .dialog-head { border-bottom: 1px solid var(--line); }
#project-form { padding: 14px 18px 18px; }
.project-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.project-fields label { display: grid; align-content: start; gap: 5px; font-size: 13px; }
.project-fields input, .recognized-points input {
  min-height: 35px; min-width: 0; width: 100%; padding: 5px 8px; font: inherit;
  border: 1px solid #c9d8e2; border-radius: 6px; background: white; color: inherit;
}
.project-preview { position: relative; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; cursor: crosshair; }
.project-preview > img { display: block; width: 100%; height: auto; }
.review-pin, .map-pin.imported-pin {
  min-width: 22px; width: auto; padding: 3px 5px; aspect-ratio: auto; color: white;
  background: #007366; border: 1px solid white; border-radius: 5px;
  font: 700 11px/1.1 "Geist", sans-serif; white-space: nowrap;
}
.review-pin { position: absolute; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px #007366; }
.point-review-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0; font-size: 13px; }
.recognized-points { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; max-height: 160px; overflow: auto; }
.recognized-points label { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.recognized-points .outline { min-height: 30px; padding-inline: 6px; }
.map-pin.imported-pin[aria-pressed="true"] { background: #0e3447; }
.map-panel .map-pin.imported-pin, .dialog-scroll .map-pin.imported-pin { width: auto; }
.project-tabs { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
@media (max-width: 640px) {
  .project-fields { grid-template-columns: minmax(0, 1fr); }
  .project-tabs { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
}
@media (width > 980px) {
  .monitor-grid { container-type: inline-size; --previous-map-share: 0.655172; }
  .map-panel .drawing { min-width: 0; }
  .map-panel .map-pin {
    /* Keep the clickable diameter from the original two-column layout. */
    --previous-drawing-width: max(650px, calc((100cqw - 16px) * var(--previous-map-share) - 38px));
    width: max(11px, calc(var(--previous-drawing-width) * var(--pin-scale)));
  }
  .chart-box canvas { height: clamp(210px, 18vw, 260px); }
}
@media (980px < width <= 1150px) { .monitor-grid { --previous-map-share: 0.622642; } }
@media (max-width: 980px) {
  .shell { width: calc(100% - 42px); }
  .monitor-grid { grid-template-columns: minmax(0, 1fr); }
  .reading-panel { max-width: none; }
  canvas { height: 170px; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 26px); }
  .topbar { min-height: 58px; }
  .brand { gap: 7px; font-size: 14px; }
  .brand-mark { width: 31px; height: 31px; }
  .brand small { font-size: 10px; }
  nav { gap: 6px; }
  nav a:first-child { display: none; }
  .nav-download { font-size: 12px; padding: 6px 7px; }
  .intro-inner { flex-direction: column; align-items: flex-start; padding-block: 27px; gap: 19px; }
  .intro-text { margin-top: 9px; }
  .intro-stats div { padding-inline: 13px; }
  .intro-stats div:first-child { padding-left: 0; border-left: 0; }
  .section-head { align-items: flex-start; }
  .section-head p { font-size: 12px; }
  .month-control { gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
  main { padding-block: 21px 30px; }
  .project-tabs { gap: 4px; }
  .project-tabs button { text-align: center; padding: 9px 2px; font-size: 12px; }
  .panel-head { padding-inline: 11px; }
  .type-tabs, .drawing-scroll, .map-actions { margin-inline: 11px; }
  .map-actions label { font-size: 11px; }
  .map-actions select { padding-inline: 3px; }
  .legend { font-size: 10px; gap: 3px; }
  .legend-dot { width: 7px; height: 7px; }
}
