:root {
  color-scheme: light;
  font-family: system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #17293b;
  background: #f3f6f8;
  font-size: 100%;
  line-height: 1.65;
  --text: #17293b;
  --muted: #485d70;
  --border: #d9e2e8;
  --primary: #125b58;
  --light: #e5f3ef;
  --white: #fff;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
main { flex: 1; }
.wrap { width: min(100% - 3rem, 70rem); margin-inline: auto; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: clamp(2rem, 5vw, 3.15rem); letter-spacing: -.045em; font-weight: 760; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.15rem; }
a { color: var(--primary); text-underline-offset: .18em; }
a:hover { color: #0a4543; }
:focus-visible { outline: 3px solid #007f78; outline-offset: 3px; }

.site-header { background: var(--white); border-bottom: 1px solid var(--border); }
.header-inner { min-height: 4rem; display: flex; align-items: center; justify-content: space-between; gap: .9rem; }
.brand { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: .65rem; font-weight: 740; }
.brand-mark { width: 1.65rem; height: 1.65rem; border-radius: .42rem; background: var(--primary); display: flex; align-items: end; justify-content: center; gap: 2px; padding-bottom: .4rem; }
.brand-mark i { width: 3px; border-radius: 1px; background: #fff; height: .38rem; }
.brand-mark i:nth-child(2) { height: .56rem; }
.brand-mark i:nth-child(3) { height: .78rem; }
nav { display: flex; gap: .25rem; }
nav a { padding: .35rem .65rem; text-decoration: none; border-radius: .35rem; color: var(--muted); font-size: .9rem; }
nav a:hover, nav a[aria-current="page"] { color: var(--primary); background: var(--light); }

.intro { padding-block: clamp(2rem, 6vw, 4rem) 1.85rem; }
.intro p { margin-top: .65rem; color: var(--muted); font-size: 1.06rem; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: .75rem; min-width: 0; }
.workspace, .result-card, .guide-card, .error-card { padding: clamp(1rem, 3vw, 1.65rem); }
.workspace-heading, .section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .55rem 1rem; }
.local-note { color: var(--primary); font-size: .9rem; }
fieldset { border: 0; margin: 1rem 0 0; padding: 0; min-width: 0; }
.drop-zone {
  min-height: 13rem;
  padding: 1.2rem;
  border-radius: .6rem;
  border: 2px dashed #98b7b5;
  background: #f5faf9;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .65rem;
  text-align: center;
}
.drop-zone.dragging { background: #daefea; border-color: var(--primary); }
.upload-mark { position: relative; display: block; width: 2.45rem; height: 2.45rem; border-radius: .5rem; background: var(--light); }
.upload-mark::before { content: ""; position: absolute; left: .66rem; right: .66rem; bottom: .56rem; height: .55rem; border: 2px solid var(--primary); border-top: 0; border-radius: 0 0 .2rem .2rem; }
.upload-mark::after { content: ""; position: absolute; left: .93rem; top: .59rem; width: .58rem; height: .58rem; border-top: 2px solid var(--primary); border-left: 2px solid var(--primary); transform: rotate(45deg); }
.drop-copy { display: grid; gap: .12rem; }
.drop-copy span { font-size: .9rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .55rem; }
button, .button, select { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: .42rem; padding: .45rem .85rem; font-weight: 650; line-height: 1.5; text-decoration: none; cursor: pointer; }
.primary { background: var(--primary); color: #fff; }
.primary:hover { background: #0a4744; color: #fff; }
.secondary, select { background: #fff; color: var(--text); border: 1px solid #b7c7d1; }
.secondary:hover { background: #eef4f5; }
button:disabled, fieldset:disabled .button { cursor: default; opacity: .55; }
select { border-radius: .4rem; padding: .33rem .45rem; max-width: 100%; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.sr-only:focus-visible + label { outline: 3px solid #007f78; outline-offset: 3px; }
.file-status { margin-top: .65rem; color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.file-status[data-phase="done"] { color: var(--primary); }
.file-status[data-phase="error"] { color: #9a3827; }
.notice { margin-block: 1rem; padding: .7rem .9rem; color: #674518; background: #fcf4e5; border: 1px solid #e9d5ae; border-radius: .5rem; font-size: .95rem; }

.results { display: grid; gap: 1rem; margin-block: 1.65rem 2rem; }
.section-heading p, .fine-print, .empty { color: var(--muted); font-size: .9rem; }
.summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 0; }
.summary div { padding: .75rem 1rem; }
.summary dt { color: var(--muted); font-size: .9rem; }
.summary dd { margin: 0; font-size: clamp(1.1rem, 3vw, 1.7rem); font-weight: 720; font-variant-numeric: tabular-nums; }
.result-grid, .guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
.fine-print { margin-block: .5rem; }
.result-card h3 + table { margin-top: .7rem; }
.funnel-results { list-style: none; padding: 0; margin: 1rem 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.funnel-results li { display: grid; align-content: start; gap: .25rem; }
.funnel-results strong { font-size: 1.28rem; font-variant-numeric: tabular-nums; }
progress { display: block; appearance: none; border: 0; border-radius: 10px; overflow: hidden; width: 100%; height: .55rem; color: var(--primary); background: var(--light); }
progress::-webkit-progress-bar { background: var(--light); }
progress::-webkit-progress-value { background: var(--primary); }
progress::-moz-progress-bar { background: var(--primary); }
.status-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.35rem; align-items: start; }
.status-grid td:has(progress) { width: 44%; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; text-align: left; }
caption { text-align: left; color: var(--muted); padding-block: .3rem; }
th, td { border-bottom: 1px solid #e3ebee; padding: .45rem .55rem; vertical-align: middle; }
thead th { font-weight: 650; background: #f0f5f7; }
tbody th { font-weight: 550; text-align: left; }
tbody td[data-value], thead th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
#status-groups thead th:last-child { text-align: left; }
#top-table th[scope="row"] { overflow-wrap: anywhere; }
#bot-totals tr[data-kind="category"] { background: #f4faf8; }
#bot-totals tr[data-kind="category"] th { font-weight: 700; }
#bot-totals tr[data-kind="bot"] th { padding-left: 1.1rem; }
.daily-table { white-space: nowrap; }
.daily-table th:first-child { position: sticky; left: 0; background: #f0f5f7; }
.empty { margin-top: .6rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .65rem; align-items: center; justify-content: end; margin-top: .75rem; }
.pagination span { color: var(--muted); font-size: .9rem; }

.guide { margin-block: 1.3rem 2.5rem; }
.guide-card p, .guide-card ul, .guide-card ol { margin: .65rem 0 0; color: var(--muted); }
.guide-card li + li { margin-top: .35rem; }
.guide-table { margin-top: .65rem; }
.guide-table th, .guide-table td { text-align: left; }
.guide-table th:first-child { min-width: 7.1em; }
.guide-table td { overflow-wrap: anywhere; }
.guide-table th[scope="row"], .guide-card strong { color: var(--text); }
.funnel-guide { grid-column: 1 / -1; }
code { padding: .05em .18em; color: var(--text); background: #eef3f6; overflow-wrap: anywhere; }
.error-card { max-width: 37rem; margin-block: clamp(2rem, 8vw, 6rem); }
.error-code { color: var(--primary); font-weight: 750; font-size: 1.1rem; }
.error-card p:not(.error-code) { color: var(--muted); margin-block: .5rem 1rem; }
.error-card .actions { justify-content: start; }
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .55rem; padding-block: 1rem; }
.footer-inner a { margin-left: .75rem; }

@media (max-width: 45rem) {
  .wrap { width: calc(100% - 1.75rem); }
  .guide, .result-grid, .status-grid { grid-template-columns: 1fr; }
  .funnel-results { grid-template-columns: 1fr; gap: .8rem; }
  .summary { grid-template-columns: 1fr 1fr; gap: .5rem; }
}
@media (max-width: 23rem) {
  .header-inner { flex-wrap: wrap; padding-block: .45rem; gap: .2rem; }
  nav a { padding-inline: .45rem; }
}
