:root {
  --paper: #f4f2eb;
  --ink: #17212b;
  --muted: #68727c;
  --blue: #1457d9;
  --blue-dark: #0a358e;
  --orange: #ff5a2a;
  --line: rgba(23, 33, 43, .16);
  --panel: rgba(255, 255, 255, .7);
}

* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.grid-field {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(20,87,217,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(20,87,217,.055) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, #000 0, transparent 82%);
}

.site-header, main, footer { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.site-header { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; font: 800 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.brand-mark { position: relative; width: 24px; height: 24px; border: 2px solid var(--blue); }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; right: -2px; bottom: -2px; background: var(--paper); }
.brand-mark::before { width: 10px; height: 4px; border-top: 2px solid var(--orange); }
.brand-mark::after { width: 4px; height: 10px; border-left: 2px solid var(--orange); }
.system-status { color: var(--muted); font: 600 11px/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: .08em; text-transform: uppercase; }
.system-status span { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: #21a167; box-shadow: 0 0 0 4px rgba(33,161,103,.12); }

main { padding: 82px 0 110px; }
.hero { display: grid; grid-template-columns: 1.2fr .8fr; column-gap: 72px; align-items: end; margin-bottom: 70px; }
.eyebrow { grid-column: 1 / -1; display: flex; justify-content: space-between; color: var(--blue); border-top: 2px solid var(--blue); padding-top: 10px; margin-bottom: 40px; font: 700 10px/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: .14em; }
h1 { margin: 0; font-size: clamp(46px, 6.2vw, 82px); line-height: 1.06; letter-spacing: -.065em; font-weight: 800; }
h1 em { color: var(--blue); font-style: normal; }
.lead { align-self: start; max-width: 480px; margin: 9px 0 34px; color: #46515d; font-size: 17px; line-height: 1.8; }
.specs { grid-column: 2; display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; padding: 0; margin: -100px 0 0; border-top: 1px solid var(--line); }
.specs li { padding: 20px 12px 0 0; }
.specs b, .specs span { display: block; }
.specs b { margin-bottom: 8px; font: 700 16px/1 ui-monospace, SFMono-Regular, monospace; }
.specs span { color: var(--muted); font-size: 11px; }

.workbench, .results { border: 1px solid var(--line); background: var(--panel); box-shadow: 8px 8px 0 rgba(20,87,217,.08); backdrop-filter: blur(8px); }
.panel-heading { min-height: 92px; padding: 20px 26px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading > div { display: flex; align-items: center; gap: 18px; }
.panel-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.04em; }
.step, .file-count, .result-total { color: var(--blue); font: 700 10px/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: .1em; }
.step { writing-mode: vertical-rl; transform: rotate(180deg); }
.file-count { font-size: 14px; }

.drop-zone { position: relative; margin: 26px; min-height: 315px; overflow: hidden; border: 1px dashed rgba(20,87,217,.55); background: rgba(20,87,217,.025); transition: background .2s, border-color .2s, transform .2s; }
.drop-zone.drag-active { border-color: var(--orange); background: rgba(255,90,42,.06); transform: translateY(-2px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop-zone label { position: absolute; inset: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.drop-zone label:focus-within, .drop-zone:has(input:focus-visible) { outline: 3px solid var(--orange); outline-offset: 4px; }
.drop-zone strong { margin-top: 25px; font-size: 22px; letter-spacing: -.02em; }
.drop-zone label > span:not(.corner-demo) { margin-top: 8px; color: var(--muted); font-size: 13px; }
.corner-demo { position: relative; display: block; width: 74px; height: 54px; border: 2px solid var(--blue); background: white; }
.corner-demo i { position: absolute; right: 5px; bottom: 5px; width: 26px; height: 8px; background: var(--ink); }
.corner-demo b { position: absolute; right: -15px; bottom: -17px; display: grid; place-items: center; width: 28px; height: 28px; color: white; background: var(--orange); font: 400 22px/1 sans-serif; }
.sweep-line { position: absolute; left: 0; right: 0; bottom: 22px; height: 1px; background: linear-gradient(90deg, transparent, var(--blue), transparent); transform: translateX(-100%); opacity: 0; }
.drop-zone.drag-active .sweep-line { opacity: 1; animation: sweep 1.5s infinite; }
@keyframes sweep { to { transform: translateX(100%); } }

.queue-wrap { margin: 0 26px 26px; border-top: 1px solid var(--line); }
.queue-label { padding: 16px 0 10px; display: flex; justify-content: space-between; color: var(--muted); font: 700 10px/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: .1em; text-transform: uppercase; }
.queue-label button { padding: 0; border: 0; color: var(--blue); background: none; cursor: pointer; }
.file-queue, .result-list { margin: 0; padding: 0; list-style: none; }
.file-item, .result-item { min-height: 54px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; border-top: 1px solid rgba(23,33,43,.09); font-size: 13px; }
.file-index { color: var(--muted); font: 11px/1 ui-monospace, SFMono-Regular, monospace; }
.file-meta { min-width: 0; display: flex; justify-content: space-between; gap: 16px; }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { color: var(--muted); font: 10px/1 ui-monospace, SFMono-Regular, monospace; white-space: nowrap; }
.remove-file { width: 32px; height: 32px; border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 18px; }
.remove-file:hover { color: var(--orange); }

.action-row { padding: 0 26px 26px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.action-row p { margin: 0; color: var(--muted); font-size: 11px; }
.action-row p span { color: var(--orange); margin-right: 7px; }
.primary-button, .zip-button { border: 0; cursor: pointer; color: white; background: var(--blue); text-decoration: none; font-weight: 700; }
.primary-button { min-width: 224px; height: 62px; padding: 0 22px; display: flex; align-items: center; justify-content: space-between; box-shadow: 5px 5px 0 var(--blue-dark); transition: transform .15s, box-shadow .15s; }
.primary-button:not(:disabled):hover { transform: translate(2px,2px); box-shadow: 3px 3px 0 var(--blue-dark); }
.primary-button:disabled { cursor: not-allowed; background: #aeb5bd; box-shadow: 5px 5px 0 #7f8790; }
.primary-button i { font-style: normal; font-size: 20px; }
.notice { min-height: 0; margin: -8px 26px 22px; color: #b12f16; font-size: 12px; }

.results { margin-top: 30px; }
.progress-track { height: 4px; margin: 26px 26px 0; background: rgba(20,87,217,.12); }
.progress-track i { display: block; width: 0; height: 100%; background: var(--orange); transition: width .35s ease; }
.progress-copy { margin: 12px 26px 22px; color: var(--muted); font-size: 12px; }
.result-list { margin: 0 26px 24px; border-bottom: 1px solid var(--line); }
.result-item { grid-template-columns: 34px 1fr auto; }
.status-dot { width: 9px; height: 9px; border: 2px solid var(--blue); border-radius: 50%; }
.status-dot.processing, .status-dot.queued { border-top-color: transparent; animation: spin .8s linear infinite; }
.status-dot.completed { border-color: #21a167; background: #21a167; }
.status-dot.failed, .status-dot.skipped { border-color: var(--orange); background: var(--orange); }
@keyframes spin { to { transform: rotate(360deg); } }
.result-message { color: var(--muted); font-size: 11px; }
.download-link { color: var(--blue); font-weight: 700; text-decoration: none; }
.zip-button { margin: 0 26px 26px auto; width: min(260px, calc(100% - 52px)); height: 58px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }

footer { min-height: 84px; padding: 20px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; color: var(--muted); font: 10px/1.5 ui-monospace, SFMono-Regular, monospace; letter-spacing: .04em; }
footer p { margin: 0; }

button:focus-visible, a:focus-visible { outline: 3px solid var(--orange); outline-offset: 3px; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
  .site-header, main, footer { width: min(100% - 28px, 600px); }
  .site-header { height: 68px; }
  .system-status { font-size: 0; }
  .system-status span { margin: 0; }
  main { padding: 48px 0 72px; }
  .hero { display: block; margin-bottom: 44px; }
  .eyebrow { margin-bottom: 28px; }
  .eyebrow span:last-child { display: none; }
  h1 { font-size: clamp(38px, 11vw, 48px); letter-spacing: -.055em; }
  .lead { margin-top: 28px; font-size: 15px; }
  .specs { margin: 28px 0 0; }
  .specs li { padding-right: 5px; }
  .specs b { font-size: 13px; }
  .specs span { font-size: 9px; }
  .panel-heading { min-height: 78px; padding: 16px 18px; }
  .drop-zone { margin: 18px; min-height: 260px; }
  .queue-wrap, .result-list { margin-left: 18px; margin-right: 18px; }
  .action-row { padding: 0 18px 20px; display: block; }
  .action-row p { margin-bottom: 18px; }
  .primary-button { width: 100%; }
  .notice { margin-left: 18px; margin-right: 18px; }
  .file-meta { display: block; }
  .file-size { display: block; margin-top: 5px; }
  footer { display: block; }
  footer p { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
