:root {
  --bg: #0b1120;
  --surface: #111827;
  --surface-2: #1e293b;
  --border: #273449;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #f7c600;
  --accent-hover: #ffd426;
  --accent-ink: #0f172a;
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.12);
  --danger: #f87171;
  --danger-bg: rgba(248, 113, 113, 0.12);
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at top center, #172554 0%, var(--bg) 52%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hero {
  padding: 36px 20px 22px;
  text-align: center;
}

.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(247, 198, 0, 0.12);
  border: 1px solid rgba(247, 198, 0, 0.3);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero h1 {
  margin: 14px 0 8px;
  font-size: clamp(22px, 4.6vw, 32px);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.container {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.card {
  background: rgba(17, 24, 39, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 4px;
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 20px;
}

.tab {
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s, color 0.18s;
}

.tab.active {
  background: var(--accent);
  color: var(--accent-ink);
}

.tab:not(.active):hover {
  color: var(--text);
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  gap: 10px;
}

.code-input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.code-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(247, 198, 0, 0.2);
}

.btn {
  height: 46px;
  padding: 0 22px;
  border-radius: 10px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s, background-color 0.18s, opacity 0.18s;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.helper {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 16px;
  border-radius: 12px;
  border: 1.5px dashed #3b4b66;
  background: rgba(30, 41, 59, 0.45);
  cursor: pointer;
  transition: border-color 0.18s, background-color 0.18s;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(247, 198, 0, 0.06);
}

.dropzone-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 600;
}

.dropzone-sub {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

.preview-wrap {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.preview-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex: none;
  background: #020617;
}

.preview-meta {
  flex: 1;
  min-width: 0;
}

.ocr-status {
  font-size: 13px;
  color: var(--text);
  line-height: 1.45;
}

.progress-track {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: #0f172a;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.2s ease;
}

.ocr-confirm {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.candidates {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.cand-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  cursor: pointer;
}

.cand-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.alert {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.alert-error {
  background: var(--danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
}

/* 校验结果卡片 */
.result-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  margin-bottom: 18px;
}

.result-header.ok {
  background: var(--success-bg);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.result-header.fail {
  background: var(--danger-bg);
  border: 1px solid rgba(248, 113, 113, 0.35);
}

.status-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  flex: none;
}

.result-header.ok .status-icon {
  background: var(--success);
  color: #052e16;
}

.result-header.fail .status-icon {
  background: var(--danger);
  color: #450a0a;
}

.result-title {
  font-size: 17px;
  font-weight: 700;
}

.result-sub {
  margin-top: 3px;
  font-size: 13px;
  color: var(--text-muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.stat-box {
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
}

.stat-value {
  margin-top: 5px;
  font-size: 14px;
  font-weight: 700;
  word-break: break-all;
}

.data-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.data-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0;
}

.data-item {
  padding: 12px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid var(--border);
}

.data-item.full {
  grid-column: 1 / -1;
}

.data-item dt {
  font-size: 12px;
  color: var(--text-muted);
}

.data-item dd {
  margin: 4px 0 0;
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
}

.footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 600px) {
  .hero {
    padding: 24px 16px 14px;
  }
  .card {
    padding: 16px;
  }
  .input-row {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .data-list {
    grid-template-columns: 1fr;
  }
}
