/* 色值取自 legit_rn/apps/app/global.css @theme（改动两边同步）。 */
@font-face {
  font-family: 'Cormorant SC';
  src: url('/assets/cormorant-sc-600.woff2') format('woff2');
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-201D, U+2026;
}

:root {
  --canvas: #100E0C;
  --surface: #211C17;
  --surface-warm: #2C251B;
  --surface-subtle: #191612;
  --text-primary: #F5F1E8;
  --text-secondary: #B8AEA0;
  --text-muted: #988E80;
  --accent: #DCC5A0;
  --accent-soft: #33291B;
  --success: #78AC82;
  --danger: #D87970;
  --border: #413426;
  --radius-card: 16px;
  --radius-lg: 20px;
  --display: 'Cormorant SC', 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--text-primary);
  font: 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* 顶栏 */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px;
  padding-top: max(14px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--text-primary); text-decoration: none;
  font: 600 22px/1 var(--display); letter-spacing: .04em;
}
.lang select {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23B8AEA0' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat;
  background-position: right 12px center;
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 32px 8px 14px;
  font: inherit; font-size: 14px;
  max-width: 48vw;
}
[dir='rtl'] .lang select { background-position: left 12px center; padding: 8px 14px 8px 32px; }
.lang select:focus-visible, .btn:focus-visible, .photo-main:focus-visible, .photo-grid button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px 20px 40px; }

/* 状态页 */
.state { text-align: center; padding: 72px 8px; max-width: 520px; margin: 0 auto; }
.state h1 { font-size: 22px; margin: 16px 0 8px; }
.muted { color: var(--text-secondary); }
.spinner {
  width: 32px; height: 32px; margin: 0 auto 16px;
  border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.badge-invalid {
  width: 56px; height: 56px; margin: 0 auto; border-radius: 50%;
  display: grid; place-items: center;
  background: #3A211C; color: var(--danger); font: 700 28px/1 var(--sans);
}

.btn {
  display: inline-block; margin-top: 12px;
  background: var(--accent); color: var(--canvas);
  border: 0; border-radius: 14px; padding: 10px 22px;
  font: 600 15px/1.2 var(--sans); cursor: pointer;
}

/* 证书 */
.cert { display: grid; gap: 24px; }
.cert-info { order: -1; } /* 手机：先结论和信息，再照片 */

.hero {
  text-align: center;
  padding: 28px 20px 24px;
  background: linear-gradient(180deg, var(--surface-warm), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.seal { display: block; margin: 0 auto 12px; }
.eyebrow {
  margin: 0; color: var(--accent);
  font: 600 18px/1.2 var(--display); letter-spacing: .08em;
}
.outcome {
  margin: 6px 0 4px;
  color: var(--success);
  font: 600 44px/1.1 var(--display); letter-spacing: .04em;
}
.cert-no { margin: 0; color: var(--text-secondary); font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }

.trust {
  margin: 16px 0;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: 12px;
  color: var(--accent);
  font-size: 14px;
  text-align: center;
}

.details {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.details > div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 14px 16px;
}
.details > div + div { border-top: 1px solid var(--border); }
.details dt { color: var(--text-muted); flex-shrink: 0; }
.details dd { margin: 0; text-align: end; font-weight: 600; overflow-wrap: anywhere; }
#f-no { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 400; }

.statement { margin-top: 20px; }
.statement h2 {
  margin: 0 0 6px; color: var(--text-secondary);
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
}
.statement p { margin: 0; color: var(--text-secondary); font-size: 14px; }

/* 照片 */
.cert-photos { display: grid; gap: 10px; align-content: start; }
.photo-main, .photo-grid button {
  display: block; width: 100%; padding: 0; border: 1px solid var(--border);
  background: var(--surface-subtle); border-radius: var(--radius-card);
  overflow: hidden; cursor: zoom-in;
}
.photo-main { aspect-ratio: 1 / 1; }
.photo-main img, .photo-grid img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-main img { object-fit: contain; } /* 主图不裁切 */
.photo-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.photo-grid button { aspect-ratio: 1 / 1; border-radius: 12px; }
.photo-grid button[aria-current='true'] { border-color: var(--accent); }

dialog {
  padding: 0; border: 0; background: transparent; max-width: 96vw; max-height: 96vh;
}
dialog::backdrop { background: rgba(0, 0, 0, .88); }
dialog img { display: block; max-width: 96vw; max-height: 84vh; border-radius: 12px; }
dialog form { text-align: center; }

.footer {
  display: flex; justify-content: center; gap: 16px;
  padding: 20px; padding-bottom: max(20px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px;
}
.footer a { color: var(--text-secondary); }

/* PC：左照片、右信息 */
@media (min-width: 900px) {
  main { padding-top: 40px; }
  .cert { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .cert-info { order: 0; }
  .cert-photos { position: sticky; top: 24px; }
  .photo-grid { grid-template-columns: repeat(5, 1fr); }
  .outcome { font-size: 52px; }
}

