:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #0f172a;
  background: #f5f7f7;
  font-synthesis: none;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --teal-light: #f0fdfa;
  --border: #e2e8f0;
  --muted: #64748b;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(13, 148, 136, .13), transparent 34%), linear-gradient(180deg, #f8fffd 0%, #f5f7f7 100%);
}
.page { width: min(100%, 1024px); min-height: 100vh; margin: 0 auto; padding: 32px 28px 44px; display: flex; flex-direction: column; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 16px; color: white; background: var(--teal); font-size: 23px; font-weight: 800; box-shadow: 0 10px 24px rgba(15, 118, 110, .18); }
.brand h1 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.02em; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.offline-badge { min-height: 28px; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px; border: 1px solid #99f6e4; border-radius: 999px; padding: 4px 10px; background: rgba(255,255,255,.78); color: var(--teal-dark); font-size: 12px; font-weight: 650; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.offline-badge.ready .status-dot { background: #10b981; }

.search-panel { border: 1px solid rgba(255,255,255,.86); border-radius: 26px; padding: 24px; background: rgba(255,255,255,.89); box-shadow: 0 20px 65px rgba(15,23,42,.08); backdrop-filter: blur(14px); }
.search-panel > label { display: block; margin: 0 0 9px; color: #334155; font-size: 14px; font-weight: 700; }
.search-row { display: flex; gap: 8px; }
.search-input-wrap { position: relative; flex: 1; min-width: 0; }
.search-symbol { position: absolute; left: 13px; top: 50%; transform: translateY(-54%); color: #94a3b8; font-size: 27px; pointer-events: none; }
#question-search { width: 100%; height: 48px; border: 1px solid var(--border); border-radius: 12px; padding: 0 13px 0 42px; outline: none; background: rgba(248,250,252,.88); color: #0f172a; font-size: 16px; transition: border-color .18s, box-shadow .18s; }
#question-search:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(13,148,136,.12); }
.button { height: 48px; border-radius: 12px; border: 1px solid transparent; padding: 0 18px; cursor: pointer; font-weight: 700; transition: background .18s, border-color .18s, transform .08s; }
.button:active, .filter:active { transform: scale(.98); }
.button-primary { background: var(--teal); color: white; }
.button-primary:hover { background: var(--teal-dark); }
.button-secondary { border-color: var(--border); background: white; color: #334155; }
.button-secondary:hover { border-color: #99f6e4; background: var(--teal-light); }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.filter-label { margin-right: 3px; color: #475569; font-size: 12px; font-weight: 700; }
.filter { height: 32px; border: 1px solid var(--border); border-radius: 999px; padding: 0 16px; background: white; color: #475569; cursor: pointer; font-size: 13px; font-weight: 650; transition: .18s; }
.filter:hover { border-color: #5eead4; background: var(--teal-light); color: var(--teal-dark); }
.filter.active { border-color: var(--teal); background: var(--teal); color: white; }
.question-count { margin-left: auto; color: #94a3b8; font-size: 12px; font-variant-numeric: tabular-nums; }
.status-message { display: flex; align-items: center; gap: 7px; margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.status-message span { color: var(--teal); font-weight: 900; }

.content-grid { display: grid; grid-template-columns: minmax(0,1fr) 270px; gap: 20px; flex: 1; margin-top: 20px; }
.results { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.empty-card { min-height: 256px; display: grid; place-content: center; justify-items: center; border: 1px dashed var(--border); border-radius: 18px; background: rgba(255,255,255,.56); text-align: center; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; margin-bottom: 14px; border-radius: 18px; background: #ccfbf1; color: var(--teal); font-size: 36px; }
.empty-card strong { color: #334155; }
.empty-card p { margin: 6px 18px 0; color: var(--muted); font-size: 14px; }

.result-card { overflow: hidden; border: 1px solid #ccfbf1; border-radius: 18px; background: white; box-shadow: 0 14px 45px rgba(15,118,110,.09); }
.result-header { padding: 20px 22px 17px; border-bottom: 1px solid #f1f5f9; }
.result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.badge { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 3px 9px; background: var(--teal); color: white; font-size: 12px; font-weight: 700; }
.badge.subtle { background: #f1f5f9; color: #334155; }
.score { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 650; }
.result-question { margin: 0; font-size: 20px; line-height: 1.5; }
.question-number { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.result-body { padding: 18px 22px 22px; }
.answer-box { border-radius: 16px; padding: 16px; background: var(--teal); color: white; }
.answer-box small { display: block; color: #ccfbf1; font-weight: 650; }
.answer-box strong { display: block; margin-top: 4px; font-size: 23px; line-height: 1.35; }
.options { display: grid; gap: 9px; margin-top: 18px; }
.option { display: flex; align-items: flex-start; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; background: rgba(248,250,252,.65); line-height: 1.55; }
.option.correct { border-color: #5eead4; background: var(--teal-light); color: #134e4a; }
.option-label { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: white; color: #475569; font-size: 13px; font-weight: 800; }
.option.correct .option-label { background: var(--teal); color: white; }
.analysis { margin-top: 18px; border: 1px solid var(--border); border-radius: 12px; padding: 12px 15px; background: rgba(248,250,252,.76); }
.analysis summary { cursor: pointer; color: #334155; font-weight: 700; }
.analysis p { margin: 12px 0 0; white-space: pre-wrap; color: #475569; font-size: 14px; line-height: 1.7; }
.candidate { width: 100%; border: 1px solid var(--border); border-radius: 12px; padding: 13px 15px; background: rgba(255,255,255,.78); color: #0f172a; text-align: left; cursor: pointer; transition: .18s; }
.candidate:hover { border-color: #5eead4; background: white; }
.candidate small { display: block; color: var(--muted); font-weight: 650; }
.candidate span { display: -webkit-box; overflow: hidden; margin-top: 5px; font-size: 14px; line-height: 1.6; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.sidebar { display: flex; flex-direction: column; gap: 16px; }
.history-card { border: 1px solid var(--border); border-radius: 16px; padding: 18px; background: rgba(255,255,255,.73); }
.history-heading h2 { margin: 0; font-size: 14px; }
.history-heading p { margin: 4px 0 12px; color: var(--muted); font-size: 12px; }
.history-list { display: grid; gap: 3px; }
.history-item { width: 100%; overflow: hidden; border: 0; border-radius: 8px; padding: 8px; background: transparent; color: #475569; text-align: left; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; font-size: 12px; }
.history-item:hover { background: #f1f5f9; }
.muted { color: #94a3b8; font-size: 12px; }
.clear-history { width: 100%; margin-top: 8px; border: 0; border-radius: 8px; padding: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.clear-history:hover { background: #f1f5f9; }
.shortcut-tip { border: 1px solid #ccfbf1; border-radius: 13px; padding: 15px; background: rgba(240,253,250,.82); color: #134e4a; font-size: 12px; line-height: 1.6; }
.shortcut-tip p { margin: 5px 0 0; }
.shortcut-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; border-radius: 11px; padding: 11px 12px; background: var(--teal); color: white; text-decoration: none; box-shadow: 0 8px 18px rgba(15,118,110,.17); transition: background .18s, transform .08s; }
.shortcut-link:hover { background: var(--teal-dark); }
.shortcut-link:active { transform: scale(.985); }
.shortcut-link b, .shortcut-link small { display: block; }
.shortcut-link b { font-size: 12px; }
.shortcut-link small { margin-top: 2px; color: #ccfbf1; font-size: 10px; }
.shortcut-arrow { flex: 0 0 auto; font-size: 20px; }
.site-footer { margin-top: 32px; border-top: 1px solid rgba(203,213,225,.8); padding-top: 18px; color: var(--muted); text-align: center; font-size: 12px; line-height: 1.8; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--teal); }

@media (max-width: 760px) {
  .page { padding: 20px 16px 32px; }
  .brand h1 { font-size: 20px; }
  .brand-icon { width: 42px; height: 42px; }
  .search-panel { padding: 17px; border-radius: 22px; }
  .search-row { flex-wrap: wrap; }
  .search-input-wrap { flex-basis: 100%; }
  .button { flex: 1; }
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { order: 2; }
  .result-header, .result-body { padding-left: 17px; padding-right: 17px; }
  .result-question { font-size: 17px; }
  .answer-box strong { font-size: 20px; }
}

@media (max-width: 430px) {
  .offline-badge { padding: 4px 8px; }
  .offline-badge span:last-child { display: none; }
  .question-count { width: 100%; margin: 2px 0 0 43px; }
}
