:root {
  color-scheme: light;
  --ink: #131717;
  --secondary: #4a5152;
  --muted: #647070;
  --line: #c8cece;
  --accent: #004c50;
  --danger: #9d342b;
  font: 16px/1.55 "Inter", "Microsoft YaHei UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: white;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.topbar {
  border-bottom: 1px solid var(--line);
  min-height: 60px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px clamp(20px, 3vw, 50px);
  font-weight: 700;
  font-size: clamp(17px, 1.55vw, 24px);
  letter-spacing: .02em;
}
.brand-icon { width: 1.35em; height: 1.35em; stroke-width: 1.9; }
main { width: min(75%, 1170px); margin: 0 auto; padding: clamp(35px, 4vw, 65px) 0 80px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(32px, 3.37vw, 54px); line-height: 1.25; letter-spacing: -.035em; font-weight: 750; }
h2 { font-size: clamp(23px, 2.12vw, 34px); line-height: 1.35; font-weight: 700; letter-spacing: -.025em; }
.intro { color: #3c4142; margin-top: 11px; font-size: clamp(16px, 1.57vw, 24px); }
form { margin-top: clamp(32px, 3.05vw, 50px); }
.files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 1.65vw, 26px); margin-top: clamp(16px, 1.7vw, 25px); }
.upload {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px dashed #85918f;
  border-radius: 9px;
  padding: 22px 16px;
  min-height: clamp(170px, 15.8vw, 250px);
  cursor: pointer;
  overflow-wrap: anywhere;
  transition: background-color .14s, border-color .14s;
}
.upload:hover, .upload.dragover, .upload:focus-within { background: #f3f8f7; border-color: var(--accent); }
.upload.selected { border-style: solid; background: #f7faf9; }
.upload input, .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.file-icon { width: clamp(42px, 4.7vw, 74px); height: clamp(48px, 5.4vw, 85px); stroke-width: 2.15; }
.excel .file-icon { color: #16833c; }
.pdf .file-icon { color: #db4938; }
.upload strong { margin-top: 8px; font-size: clamp(19px, 1.95vw, 31px); line-height: 1.35; letter-spacing: -.035em; }
.file-note { margin-top: 8px; max-width: 100%; color: var(--secondary); font-size: clamp(14px, 1.4vw, 21px); }
.selected .file-note { font-size: 15px; }
.actions { margin-top: clamp(22px, 2.6vw, 42px); display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.primary {
  display: inline-flex; justify-content: center; align-items: center; gap: 18px;
  padding: 11px clamp(19px, 2.45vw, 38px); min-height: 44px; background: var(--accent); color: white;
  border: 1px solid transparent; border-radius: 7px; font-size: clamp(16px, 1.5vw, 24px);
  line-height: 1.45; font-weight: 650; cursor: pointer;
}
.primary:hover { background: #003c40; }
.primary:disabled { background: #d9e0de; color: #52605c; cursor: default; }
.primary svg { width: 1.14em; height: 1.14em; stroke-width: 2; }
:where(button, select, input, summary):focus-visible, .upload:has(input:focus-visible) {
  outline: 3px solid #27797d; outline-offset: 3px;
}
#progress { color: var(--secondary); font-size: 15px; }
.results { margin-top: clamp(30px, 2.7vw, 43px); padding-top: clamp(23px, 2.15vw, 34px); border-top: 1px solid #a7aeac; }
#result-title:focus { outline: none; }
.secondary { margin-top: 12px; color: var(--secondary); }
#empty { font-size: clamp(15px, 1.42vw, 22px); }
.result-controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px; margin-top: 22px; }
.company-label { display: grid; gap: 5px; color: var(--secondary); font-size: 14px; font-weight: 600; max-width: 100%; min-width: min(325px, 100%); }
select { border: 1px solid #abb8b6; border-radius: 5px; color: var(--ink); background: white; max-width: 100%; min-width: 0; padding: 9px 12px; font-size: 16px; min-height: 44px; }
#export { font-size: 16px; gap: 10px; padding: 9px 18px; }
.table-frame { overflow-x: auto; margin-top: 16px; }
table { border-collapse: collapse; width: 100%; text-align: left; font-variant-numeric: tabular-nums; font-size: 15px; }
th { font-size: 13px; color: #4a5655; background: #f2f5f4; white-space: nowrap; font-weight: 650; }
td, th { padding: 12px 14px; border-bottom: 1px solid #dce2e0; vertical-align: top; }
td:nth-child(2) { font-family: "IBM Plex Mono", Consolas, monospace; overflow-wrap: anywhere; }
td:first-child { color: var(--muted); }
.matched { color: #156747; }
.mismatch { color: var(--danger); }
.warning-box, .extra-block, .error { margin-top: 16px; padding: 12px 16px; border-left: 3px solid; font-size: 15px; }
.warning-box { color: #495957; background: #f3f6f5; border-color: #83938e; overflow-wrap: anywhere; }
.warning-box.needs-review, .error { color: #85332b; background: #fff4ef; border-color: #ba5c46; overflow-wrap: anywhere; }
.warning-box ul { margin: 4px 0 0; padding-left: 1.4em; }
.extra-block { background: #f3f7f6; border-color: #6e9390; }
.extra-block summary { cursor: pointer; font-weight: 600; }
.extra-block details p { max-height: 10rem; overflow: auto; color: var(--secondary); margin-top: 6px; }
.check { display: flex; align-items: flex-start; margin-top: 8px; gap: 7px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 4px 0 0; flex-shrink: 0; }
#export-status:not(:empty) { margin-top: 12px; }
@media (max-width: 780px) {
  main { width: calc(100% - 48px); }
  .topbar { min-height: 54px; }
}
@media (max-width: 540px) {
  main { width: calc(100% - 36px); padding-top: 28px; }
  .intro { line-height: 1.65; }
  .files { grid-template-columns: 1fr; gap: 12px; }
  .upload { min-height: 104px; display: grid; grid-template-columns: 42px 1fr; padding: 18px; align-content: center; column-gap: 15px; text-align: left; }
  .file-icon { grid-row: span 2; width: 40px; height: 47px; }
  .upload strong, .file-note { margin: 0; }
  .file-note { margin-top: 4px; }
  .result-controls { align-items: stretch; flex-direction: column; gap: 12px; }
  .company-label { min-width: 0; }
  td, th { padding: 10px 7px; }
  table { font-size: 13px; }
  th { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
