:root {
  --bg: #08111f;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: rgba(15, 23, 42, 0.1);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 24px 80px rgba(2, 8, 23, 0.28);
  --radius: 28px;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 15% 0%, rgba(59, 130, 246, .42), transparent 32rem),
    radial-gradient(circle at 88% 12%, rgba(20, 184, 166, .28), transparent 28rem),
    linear-gradient(160deg, #07111f 0%, #0f172a 46%, #1e293b 100%);
  overflow-x: hidden;
}
.bg-orb { position: fixed; border-radius: 999px; filter: blur(20px); opacity: .62; pointer-events: none; }
.orb-a { width: 15rem; height: 15rem; left: -5rem; top: 18rem; background: #38bdf8; }
.orb-b { width: 13rem; height: 13rem; right: -4rem; bottom: 7rem; background: #22c55e; }
.app-shell { width: min(980px, 100%); margin: 0 auto; padding: 18px 14px 48px; }
.hero {
  padding: 28px 22px 24px;
  color: #fff;
  border-radius: 0 0 34px 34px;
}
.brand-row { display: flex; align-items: center; gap: 16px; }
.brand-mark {
  width: 58px; height: 58px; display: grid; place-items: center;
  border-radius: 20px; background: linear-gradient(135deg, #60a5fa, #34d399);
  color: #fff; font-weight: 900; font-size: 28px; box-shadow: 0 18px 50px rgba(59, 130, 246, .42);
}
.eyebrow { margin: 0 0 8px; letter-spacing: .14em; font-size: 11px; font-weight: 800; color: rgba(226, 232, 240, .74); }
h1 { margin: 0; font-size: clamp(36px, 9vw, 64px); line-height: .98; letter-spacing: -0.06em; }
h1 span { color: #93c5fd; }
.hero-copy { margin: 18px 0 0; color: rgba(226, 232, 240, .88); line-height: 1.75; font-size: 15px; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.stats-grid div { padding: 14px 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 20px; background: rgba(255,255,255,.08); backdrop-filter: blur(16px); }
.stats-grid strong { display:block; font-size: 20px; }
.stats-grid span { display:block; margin-top: 4px; color: rgba(226,232,240,.72); font-size: 12px; }
.panel, .results { margin-top: 14px; border: 1px solid rgba(255,255,255,.55); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.panel { padding: 18px; }
.section-title { display:flex; justify-content:space-between; align-items:flex-start; gap: 12px; margin-bottom: 16px; }
.section-title .eyebrow { color: #2563eb; }
h2 { margin: 0; font-size: 20px; letter-spacing: -0.03em; }
.status-pill { white-space: nowrap; border-radius: 999px; padding: 8px 11px; background: #e0f2fe; color: #0369a1; font-size: 12px; font-weight: 800; }
.status-pill.ready { background: #dcfce7; color: #15803d; }
.status-pill.error { background: #fee2e2; color: #b91c1c; }
.drop-zone { display:grid; place-items:center; text-align:center; min-height: 190px; padding: 24px 18px; border: 1.5px dashed rgba(37,99,235,.42); border-radius: 26px; background: linear-gradient(180deg, rgba(239,246,255,.86), rgba(255,255,255,.76)); cursor:pointer; transition: transform .2s ease, border .2s ease; }
.drop-zone:hover { transform: translateY(-1px); border-color: rgba(37,99,235,.8); }
.drop-zone input { display:none; }
.camera-icon { width:64px;height:64px;display:grid;place-items:center;border-radius:22px;background:#dbeafe;font-size:30px;margin-bottom:12px; }
.drop-zone strong { font-size:18px; }
.drop-zone span { margin-top:8px; color:var(--muted); font-size:13px; line-height:1.5; }
.preview-wrap { margin-top: 14px; overflow:hidden; border-radius: 24px; background:#0f172a; position:relative; }
.preview-wrap img { display:block; width:100%; max-height: 420px; object-fit:contain; }
.preview-wrap .ghost-btn { position:absolute; right:10px; top:10px; background:rgba(255,255,255,.9); }
.actions-row { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.actions-row.compact { grid-template-columns: 1fr auto; }
button { border:0; font: inherit; cursor:pointer; }
.primary-btn, .secondary-btn, .ghost-btn { min-height: 48px; border-radius: 18px; padding: 11px 14px; font-weight: 850; }
.primary-btn { color:#fff; background: linear-gradient(135deg, var(--primary), #06b6d4); box-shadow: 0 14px 30px rgba(37, 99, 235, .28); }
.primary-btn:disabled { cursor:not-allowed; opacity:.48; box-shadow:none; }
.primary-btn small { display:block; font-size:11px; opacity:.82; font-weight:600; margin-top:2px; }
.secondary-btn { color:#0f172a; background:#e0f2fe; }
.ghost-btn { color:#334155; background:#f1f5f9; }
.progress-card { margin-top:14px; padding:14px; border-radius:20px; background:#f8fafc; border:1px solid var(--line); }
.progress-top { display:flex; justify-content:space-between; font-size:13px; color:#475569; margin-bottom:10px; }
.progress-bar { height:10px; border-radius:999px; background:#e2e8f0; overflow:hidden; }
.progress-bar i { display:block; width:0%; height:100%; border-radius:inherit; background:linear-gradient(90deg,#2563eb,#14b8a6); transition: width .2s ease; }
textarea { width:100%; resize:vertical; min-height: 132px; padding:16px; border-radius: 22px; border:1px solid var(--line); outline:none; font: inherit; line-height:1.65; background: rgba(255,255,255,.76); }
textarea:focus { border-color: rgba(37,99,235,.62); box-shadow:0 0 0 4px rgba(37,99,235,.12); }
.results { padding: 0; overflow:hidden; }
.empty-state { padding: 44px 24px; text-align:center; color:#fff; background: linear-gradient(145deg, rgba(15,23,42,.88), rgba(30,41,59,.84)); }
.empty-state div { font-size: 40px; }
.empty-state p { margin:10px auto 0; max-width: 420px; color:rgba(226,232,240,.74); line-height:1.7; }
.result-card { padding: 18px; background: var(--panel-strong); border-top: 1px solid var(--line); }
.result-card.best { border-top: 0; background: linear-gradient(180deg, #ffffff, #eff6ff); }
.result-head { display:flex; align-items:flex-start; justify-content:space-between; gap: 12px; }
.badges { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:10px; }
.badge { display:inline-flex; align-items:center; gap:5px; padding:6px 9px; border-radius:999px; font-size:12px; font-weight:850; background:#e2e8f0; color:#334155; }
.badge.primary { background:#dbeafe; color:#1d4ed8; }
.badge.success { background:#dcfce7; color:#15803d; }
.badge.warn { background:#fef3c7; color:#b45309; }
.question { margin: 8px 0 12px; font-size: 17px; line-height: 1.65; font-weight: 850; letter-spacing:-.02em; }
.answer-box { display:flex; align-items:center; gap:12px; padding:14px; border-radius:20px; background:#0f172a; color:#fff; margin: 12px 0; }
.answer-label { color:#93c5fd; font-size:12px; font-weight:800; }
.answer-value { font-size:26px; font-weight:950; letter-spacing:.08em; }
.options { display:grid; gap:9px; margin-top: 12px; }
.option { padding:12px 13px; border-radius:16px; background:#f8fafc; border:1px solid var(--line); line-height:1.55; }
.option.correct { background:#dcfce7; border-color: rgba(22,163,74,.36); }
.option b { margin-right:8px; }
.thumb-list { display:flex; gap:8px; overflow-x:auto; padding: 4px 0 2px; margin-top: 12px; }
.thumb-list img { height: 92px; border-radius:14px; border:1px solid var(--line); background:#f8fafc; }
.match-note { color:var(--muted); font-size:12px; line-height:1.5; margin-top: 10px; }
@media (min-width: 760px) {
  .app-shell { padding-top: 28px; }
  .hero { border-radius: 34px; }
  .panel { padding: 24px; }
  .capture-panel, .search-panel { display:block; }
  .question { font-size:20px; }
}
@media (max-width: 430px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .hero { padding-left: 12px; padding-right: 12px; }
  .brand-mark { width:52px; height:52px; border-radius:18px; }
  .stats-grid { gap: 7px; }
  .stats-grid div { padding: 11px 8px; }
  .actions-row { grid-template-columns: 1fr; }
}

.actions-row.single { grid-template-columns: 1fr; }
