:root {
  --paper: #f6f9fd;
  --surface: #ffffff;
  --ink: #112744;
  --muted: #5d6f85;
  --line: #d6e1ee;
  --blue: #0969e7;
  --blue-deep: #0755bb;
  --blue-surface: #edf5ff;
  --green: #087a4f;
  --green-surface: #e9f8f0;
  --amber: #9f6500;
  --amber-surface: #fff7e5;
  --red: #b42318;
  --red-surface: #fff1f0;
  --console-border: #bfd1e6;
  --console-shadow: 0 18px 48px rgb(29 77 126 / 9%);
  --result-shadow: 0 12px 36px rgb(29 77 126 / 6%);
}

:root[data-theme="dark"] {
  --paper: #0a1424;
  --surface: #11203a;
  --ink: #e6edf7;
  --muted: #93a5be;
  --line: #23395b;
  --blue: #4d9aff;
  --blue-deep: #2a7ce0;
  --blue-surface: #15263f;
  --green: #2dbb7f;
  --green-surface: #10312a;
  --amber: #e5b65c;
  --amber-surface: #3a2d10;
  --red: #ff6b5e;
  --red-surface: #3a1816;
  --console-border: #1f3354;
  --console-shadow: 0 18px 48px rgb(0 0 0 / 40%);
  --result-shadow: 0 12px 36px rgb(0 0 0 / 30%);
}

:root[data-theme="dark"] .verification-console { background: linear-gradient(180deg, #11203a 0%, #0d192c 100%); }
:root[data-theme="dark"] .result { background: linear-gradient(180deg, #11203a 0%, #0d192c 100%); }
:root[data-theme="dark"] code { color: #b6cdf2; }

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Avenir Next", "Microsoft YaHei UI", "Segoe UI", system-ui, sans-serif;
}

a { color: inherit; text-decoration: none; }

.site-header, .footer {
  width: min(1080px, calc(100% - 48px));
  margin-inline: auto;
}

.site-header {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.organization, .product {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.theme-toggle {
  position: absolute;
  left: clamp(20px, 3vw, 36px);
  bottom: clamp(20px, 3vw, 36px);
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
.theme-toggle:hover, .theme-toggle:focus-visible { border-color: var(--ink); color: var(--ink); outline: none; }
.theme-toggle .theme-icon { width: 17px; height: 17px; display: none; }
:root[data-theme="light"] .theme-toggle .theme-icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-icon-sun { display: block; }

.organization img { width: 29px; height: 31px; object-fit: contain; }
.product img { width: 31px; height: 31px; object-fit: contain; }
.organization span, .product { color: var(--ink); font-size: 13px; }
.organization b, .product > span { display: block; font-size: 14px; letter-spacing: 0; }
.organization small, .product small { display: block; margin-top: 2px; color: var(--muted); font: 11px/1.2 "Cascadia Code", Consolas, monospace; }

.inspection {
  width: min(1080px, calc(100% - 48px));
  margin: clamp(44px, 7vh, 88px) auto 0;
}

.verification-console {
  display: grid;
  grid-template-columns: minmax(320px, .92fr) minmax(380px, 1.08fr);
  min-height: 494px;
  border: 1px solid var(--console-border);
  background: var(--surface);
  box-shadow: var(--console-shadow);
}

.console-brief { position: relative; padding: clamp(34px, 5vw, 64px); border-top: 5px solid var(--blue); }
.section-label { margin: 0; color: var(--blue); font: 700 12px/1.35 "Cascadia Code", Consolas, monospace; letter-spacing: 0; }
h1 { margin: 16px 0 0; font-size: clamp(38px, 4.5vw, 62px); line-height: 1.05; font-weight: 760; letter-spacing: 0; }
.lead { max-width: 31em; margin: 22px 0 0; color: var(--muted); font-size: 15px; line-height: 1.72; }
.console-footnote { margin: 26px 0 0; color: var(--muted); font-size: 12px; }
code { color: var(--ink); font: 12px/1.4 "Cascadia Code", Consolas, monospace; }

.console-action {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(26px, 4vw, 48px);
  background: var(--blue);
  color: white;
}

.action-topline, .result-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font: 700 11px/1.4 "Cascadia Code", Consolas, monospace;
  letter-spacing: 0;
}

.action-topline span:last-child, .result-topline span:last-child { opacity: .65; }

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  align-content: center;
  min-height: 280px;
  margin: 22px 0;
  padding: 32px 24px;
  border: 1px dashed rgb(255 255 255 / 68%);
  background: rgb(3 67 155 / 16%);
  cursor: pointer;
  text-align: center;
  transition: border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.drop-zone::before, .drop-zone::after { content: ""; position: absolute; width: 22px; height: 22px; border-color: white; opacity: .8; }
.drop-zone::before { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.drop-zone::after { right: -1px; bottom: -1px; border-right: 2px solid; border-bottom: 2px solid; }
.drop-zone:hover, .drop-zone:focus-within, .drop-zone.is-dragging { border-color: white; background: rgb(255 255 255 / 12%); transform: translateY(-3px); }
.drop-zone.is-busy { cursor: wait; opacity: .72; }
.drop-zone input { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); overflow: hidden; }
.upload-symbol { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 20px; border: 1px solid rgb(255 255 255 / 68%); }
.upload-symbol i, .upload-symbol i::after { display: block; width: 23px; height: 1px; background: white; content: ""; }
.upload-symbol i::after { transform: rotate(90deg); }
.drop-zone strong { color: white; font-size: 21px; }
.drop-zone > span { margin-top: 8px; color: rgb(255 255 255 / 76%); font-size: 14px; }
.drop-zone > span.drop-zone-hint { margin-top: 12px; color: rgb(255 255 255 / 78%); font-size: 11px; font-family: "Cascadia Code", Consolas, monospace; line-height: 1.45; }
.drop-zone > span.drop-zone-hint code { color: white; background: rgb(255 255 255 / 14%); padding: 1px 6px; border: 1px solid rgb(255 255 255 / 22%); }
.drop-zone em { max-width: 90%; margin-top: 22px; color: rgb(255 255 255 / 68%); font: 11px/1.45 "Cascadia Code", Consolas, monospace; font-style: normal; overflow-wrap: anywhere; }

.trust-list { margin: 18px 0 0; padding: 0; list-style: none; color: rgb(255 255 255 / 78%); font-size: 12px; line-height: 1.5; display: grid; gap: 6px; }
.trust-list li { display: flex; align-items: center; gap: 8px; }
.trust-list li span { display: inline-grid; place-items: center; width: 14px; height: 14px; border: 1px solid rgb(255 255 255 / 46%); font-size: 9px; flex-shrink: 0; }

.result { margin-top: 28px; padding: 30px clamp(24px, 4vw, 48px); border: 1px solid var(--console-border); background: var(--surface); box-shadow: var(--result-shadow); }
.result-topline { margin-bottom: 22px; color: var(--blue); }
.status-band { padding: 20px 22px; border-left: 4px solid var(--green); background: var(--green-surface); font-weight: 700; line-height: 1.5; }
.status-band.checking { border-color: var(--blue); background: var(--blue-surface); }
.status-band.offline, .status-band.caution { border-color: var(--amber); background: var(--amber-surface); }
.status-band.error { border-color: var(--red); background: var(--red-surface); }
.evidence { margin: 24px 0 0; border-top: 1px solid var(--line); }
.evidence > div { display: grid; grid-template-columns: minmax(132px, .32fr) 1fr; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: 14px; }
dd { margin: 0; overflow-wrap: anywhere; font: 13px/1.5 "Cascadia Code", Consolas, monospace; }

.footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 72px; padding: 22px 0 34px; border-top: 1px solid var(--line); color: var(--muted); font: 12px/1.5 "Cascadia Code", Consolas, monospace; }

@media (max-width: 760px) {
  .site-header, .footer, .inspection { width: min(100% - 24px, 1080px); }
  .site-header { min-height: 64px; padding-top: 6px; padding-bottom: 6px; }
  .organization span, .product { font-size: 12px; }
  .organization b, .product > span { font-size: 13px; }
  .organization small, .product small { display: none; }
  .verification-console { grid-template-columns: 1fr; min-height: 0; }
  .console-brief { padding: 30px 24px 64px; }
  .console-brief h1 { font-size: clamp(28px, 8vw, 38px); }
  .console-brief .lead { font-size: 14px; line-height: 1.65; margin-top: 16px; }
  .theme-toggle { left: 20px; bottom: 18px; width: 44px; height: 44px; }
  .theme-toggle .theme-icon { width: 18px; height: 18px; }
  .console-action { padding: 22px; }
  .drop-zone { min-height: 220px; margin: 18px 0; padding: 24px 18px; }
  .drop-zone strong { font-size: 18px; }
  .upload-symbol { width: 56px; height: 56px; margin-bottom: 14px; }
  .trust-list { font-size: 11px; gap: 5px; margin-top: 14px; }
  .result { margin-top: 18px; padding: 22px 22px; }
  .result-topline { font-size: 10px; margin-bottom: 16px; }
  .status-band { padding: 16px 18px; font-size: 14px; }
  .evidence { margin-top: 18px; }
  .evidence > div { grid-template-columns: 1fr; gap: 4px; padding: 12px 0; font-size: 12px; }
  dt { font-size: 12px; }
  dd { font-size: 12px; }
  .footer { margin-top: 40px; padding: 18px 0 24px; flex-direction: column; gap: 4px; font-size: 11px; }
}

@media (max-width: 380px) {
  .site-header, .footer, .inspection { width: calc(100% - 16px); }
  .console-brief { padding: 24px 18px 60px; }
  .console-brief h1 { font-size: 26px; }
  .console-action { padding: 18px; }
  .drop-zone { min-height: 200px; }
  .organization span, .product { font-size: 11px; }
  .organization b, .product > span { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) { .drop-zone { transition: none; } }
