﻿/* ============================================================
   决简 DecisionMate · Mobile-first UI v2
   设计参考：移动端底部 Tab 导航 / 大触控目标 / 卡片化 / Material & iOS 规范
   ============================================================ */

:root {
  --bg: #f4f5fa;
  --card: #ffffff;
  --line: #e7e8f0;
  --text: #16192b;
  --muted: #6b7280;
  --primary: #4f46e5;
  --primary-strong: #4338ca;
  --primary-soft: #eef2ff;
  --grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  --green: #059669;
  --green-soft: #d1fae5;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --amber: #b45309;
  --amber-soft: #fef3c7;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(22,25,43,.05), 0 4px 14px rgba(22,25,43,.05);
  --shadow-md: 0 4px 10px rgba(22,25,43,.06), 0 12px 32px rgba(22,25,43,.08);
  --tabbar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(231,232,240,.8);
}
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 11px;
  background: var(--grad);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
  box-shadow: 0 4px 10px rgba(99,102,241,.35);
}
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: -.2px; }
.brand-name small { color: var(--muted); font-weight: 500; font-size: 11px; margin-left: 3px; }

.nav-desktop { display: none; gap: 6px; }
.nav-btn {
  border: 0; background: transparent; color: var(--muted);
  font-size: 14px; padding: 8px 14px; border-radius: 12px;
  cursor: pointer; font-weight: 600; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px;
  transition: background .15s ease, color .15s ease, transform .1s ease;
}
.nav-btn:active { transform: scale(.96); }
.nav-btn:hover { background: #f0f1f7; color: var(--text); }
.nav-btn.active { background: var(--primary-soft); color: var(--primary); }

/* ---------- 主内容 ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 40px);
}
.view { animation: fade .28s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 通用卡片/按钮 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
}
.card h1 { font-size: 22px; font-weight: 800; margin-bottom: 14px; letter-spacing: -.3px; }

.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px;
  transition: transform .1s ease, background .15s ease, box-shadow .15s ease, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--grad); color: #fff; box-shadow: 0 6px 16px rgba(99,102,241,.35); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { background: #f6f7fb; }
.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 16px; min-height: 52px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.page-head { padding: 6px 4px 14px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }
.page-head .muted { margin-top: 2px; font-size: 13.5px; }

.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- 首页 Hero ---------- */
.hero {
  text-align: center;
  padding: 26px 18px 24px;
  border-radius: 24px;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(139,92,246,.14) 0%, transparent 50%),
    radial-gradient(120% 120% at 0% 100%, rgba(99,102,241,.12) 0%, transparent 50%),
    #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.hero-kicker {
  display: inline-block;
  font-size: 12px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 12px; border-radius: 99px;
  margin-bottom: 10px;
  letter-spacing: 1px;
}
.hero h1 { font-size: 31px; font-weight: 800; letter-spacing: -.8px; line-height: 1.25; text-wrap: balance; }
.hero-sub { color: var(--muted); margin: 12px auto 20px; max-width: 420px; font-size: 15px; }
.hero-actions { display: flex; flex-direction: column; gap: 10px; max-width: 320px; margin: 0 auto; }
.ai-status { margin-top: 16px; font-size: 13px; color: var(--amber); }

/* ---------- 模型卡片 ---------- */
.models-preview h2, .history h2 { font-size: 16px; margin: 22px 4px 12px; font-weight: 800; }
.model-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.model-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease;
}
.model-card:active { transform: scale(.97); }
.model-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.mc-icon {
  width: 42px; height: 42px; border-radius: 13px;
  background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; margin-bottom: 10px;
}
.mc-name { font-weight: 800; font-size: 14.5px; margin-bottom: 3px; }
.mc-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.models-note { color: var(--muted); font-size: 12.5px; margin: 12px 4px 0; }

/* ---------- 历史 ---------- */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: flex; align-items: center; gap: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 15px 16px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .15s ease;
}
.history-item:active { transform: scale(.98); }
.history-item:hover { box-shadow: var(--shadow-md); }
.hi-icon {
  flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
}
.hi-main { flex: 1; min-width: 0; }
.hi-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-del {
  flex: none; border: 0; background: transparent; color: #b6bcc9;
  width: 40px; height: 40px; border-radius: 12px;
  font-size: 17px; cursor: pointer;
}
.hi-del:hover { color: var(--red); background: var(--red-soft); }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 30px 0; background: var(--card); border: 1px dashed var(--line); border-radius: 18px; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 7px; color: #374151; }
input, textarea, select {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  font-size: 15px; font-family: inherit; color: var(--text); background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
  -webkit-appearance: none; appearance: none;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79,70,229,.12);
}
textarea { resize: vertical; line-height: 1.55; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}
.key-row { display: flex; gap: 8px; }
.key-row input { flex: 1; min-width: 0; }
.key-row .btn { flex: none; }

/* 提交按钮：移动端悬浮在底部（拇指友好） */
.btn-cta {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  z-index: 20;
  margin-top: 6px;
  box-shadow: 0 10px 24px rgba(99,102,241,.4);
}

/* ---------- 分析中 ---------- */
.analyzing {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.analyzing h1 { font-size: 20px; font-weight: 800; margin: 16px 0 4px; }
.analyzing-orb {
  width: 72px; height: 72px; margin: 0 auto;
  border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px rgba(99,102,241,.4);
  animation: orbPulse 1.6s ease-in-out infinite;
}
.orb-inner {
  width: 26px; height: 26px; border-radius: 50%;
  border: 3px solid #fff;
  border-top-color: transparent;
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orbPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.progress { height: 6px; background: #eef0f6; border-radius: 99px; overflow: hidden; margin: 18px 0 12px; }
.progress-bar { height: 100%; width: 0; background: var(--grad); border-radius: 99px; transition: width .5s ease; }
.progress-text { font-weight: 700; font-size: 15px; }
.progress-hint { color: var(--muted); font-size: 12.5px; margin: 6px 0 18px; }

/* ---------- 结果 ---------- */
.result-head h1 { font-size: 21px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 6px; }
.result-actions { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.result-actions .btn { min-height: 42px; padding: 9px 14px; font-size: 13.5px; border-radius: 12px; }
.result-actions .spacer { flex: 1; }
.r-meta { color: var(--muted); font-size: 12.5px; }

.r-body { display: flex; flex-direction: column; gap: 14px; }
.sec {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.sec h2 { font-size: 15.5px; font-weight: 800; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.verdict {
  border-radius: 20px;
  padding: 20px;
  font-size: 15px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border: 1px solid #e0e7ff;
}
.verdict .rec { font-size: 19px; font-weight: 800; color: var(--primary-strong); margin-bottom: 4px; letter-spacing: -.2px; }
.verdict .conf { font-size: 13px; color: var(--muted); margin-top: 6px; }
.verdict .reason { margin-top: 10px; }
.verdict .reason p { margin-top: 4px; font-size: 13.5px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 420px; }
th, td { padding: 10px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; background: #fafbff; }
td.num { text-align: center; white-space: nowrap; }
tr.best td { background: #f0fdf4; font-weight: 700; }
tr.best td:last-child { color: var(--green); }

.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.badge-weight { background: #f1f2f7; color: var(--muted); }
.badge-score { background: var(--primary-soft); color: var(--primary); }
.badge-total { background: var(--green-soft); color: var(--green); }

ul { padding-left: 20px; }
ul li { margin: 5px 0; }
.dim { margin-bottom: 14px; }
.dim h3 { font-size: 14px; font-weight: 800; margin-bottom: 4px; color: var(--primary-strong); }

#r-extra h2 { font-size: 15px; font-weight: 800; margin: 18px 0 8px; }
#r-extra h2:first-child { margin-top: 0; }
#r-extra p { font-size: 14px; }

/* ---------- 设置 ---------- */
.settings-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
#s-test-result { font-size: 13px; font-weight: 700; }

/* ---------- 底部 Tab 导航（移动端） ---------- */
.tabbar {
  display: flex;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  z-index: 40;
}
.tabbar .nav-btn {
  flex: 1;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  padding: 6px 0;
  border-radius: 14px;
  min-height: 0;
  color: #9aa0ae;
}
.tabbar .nav-btn svg { width: 24px; height: 24px; }
.tabbar .nav-btn.active { color: var(--primary); background: transparent; }
.tabbar .nav-btn.active span { font-weight: 800; }
.tabbar .nav-btn.nav-btn-primary svg {
  background: var(--grad); color: #fff;
  padding: 4px; border-radius: 50%;
  box-shadow: 0 6px 14px rgba(99,102,241,.4);
}

/* ---------- 页脚 / Toast ---------- */
.footer { text-align: center; color: #a6adba; font-size: 11.5px; padding: 14px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 14px); }
.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 18px);
  transform: translateX(-50%);
  background: rgba(22,25,43,.92);
  color: #fff; padding: 12px 20px; border-radius: 14px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.22);
  z-index: 99; white-space: nowrap; max-width: 86vw; overflow: hidden; text-overflow: ellipsis;
  animation: fade .2s ease;
}

/* ---------- 桌面端适配 ---------- */
@media (min-width: 768px) {
  .nav-desktop { display: flex; }
  .tabbar { display: none; }
  main { padding: 28px 24px 60px; }
  .footer { padding: 18px 16px 30px; }
  .hero-actions { flex-direction: row; }
  .hero-actions .btn-block { width: auto; }
  .model-cards { grid-template-columns: repeat(4, 1fr); }
  .btn-cta { position: static; box-shadow: var(--shadow-sm); }
  .toast { bottom: 28px; }
  .result-actions { position: static; }
}

/* ---------- 无障碍：减少动画 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* ---------- v0.3.0：模型图书馆 ---------- */
.model-card { text-align: left; font-family: inherit; color: inherit; cursor: pointer; }
.mc-more { margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--primary); }
.model-list-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.guide-card { background: linear-gradient(135deg, #eef2ff, #faf9ff); }
.guide-head h2 { font-size: 16px; font-weight: 800; }
.guide-head .muted { margin-top: 2px; }
.guide-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.guide-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; font-size: 14px; font-family: inherit; cursor: pointer; color: var(--text);
  transition: box-shadow .15s ease, transform .1s ease;
}
.guide-row:active { transform: scale(.98); }
.guide-row:hover { box-shadow: var(--shadow-sm); }
.guide-scene { font-weight: 600; }
.guide-arrow { color: var(--primary); font-weight: 700; white-space: nowrap; }

.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; padding: 4px 0;
  background: none; border: 0; color: var(--primary);
  font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.link-btn:active { opacity: .7; }

.model-detail { padding: 18px; }
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: 0; color: var(--muted);
  font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
  padding: 6px 0; margin-bottom: 8px;
}
.back-btn:active { opacity: .7; }
.md-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.md-icon { width: 52px; height: 52px; border-radius: 16px; font-size: 26px; margin: 0; flex: none; }
.md-title { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.md-tag { color: var(--muted); font-size: 13.5px; }
.md-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.md-sec h3 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.md-sec p { font-size: 14.5px; color: #374151; }
.md-sec ol { padding-left: 22px; }
.md-sec ol li { margin: 6px 0; font-size: 14.5px; color: #374151; }
.md-example { background: var(--primary-soft); border-radius: 12px; padding: 12px 14px; font-size: 14px !important; }
.md-cta { margin-top: 20px; }

/* ---------- v0.3.0：盲区追问 ---------- */
.blind-card h2 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.blind-card .muted { margin-bottom: 12px; font-size: 13.5px; }
.blind-result { margin-top: 12px; }
.br-h { font-size: 14px !important; font-weight: 800; margin: 14px 0 6px; color: var(--primary-strong); }
.blind-result .dim h4 { font-size: 14px; font-weight: 800; }
.blind-result .dim p { font-size: 14px; color: #374151; }

@media (min-width: 768px) {
  .model-list-grid { grid-template-columns: repeat(3, 1fr); }
}


/* ---------- v0.5.0：快速开始模板 ---------- */
.templates { margin-bottom: 14px; }
.tpl-label { font-size: 13px; font-weight: 700; color: var(--muted); margin: 0 4px 8px; }
.tpl-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 4px 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tpl-chips::-webkit-scrollbar { display: none; }
.tpl-chip {
  flex: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 99px;
  padding: 10px 16px; font-size: 13.5px; font-weight: 700; font-family: inherit; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .1s ease, border-color .15s ease;
}
.tpl-chip:active { transform: scale(.95); }
.tpl-chip:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- v0.5.0：决策统计与复盘 ---------- */
.stats-card {
  background: linear-gradient(135deg, #eef2ff, #faf9ff);
  border: 1px solid #e0e7ff; border-radius: 18px;
  padding: 14px 16px; margin-bottom: 12px;
}
.stats-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.stats-title { font-weight: 800; font-size: 15px; }
.stats-sub { font-size: 12px; color: var(--muted); }
.stats-bar { display: flex; gap: 8px; margin-top: 10px; }
.stat { flex: 1; text-align: center; background: #fff; border-radius: 12px; padding: 8px 4px; font-size: 13px; font-weight: 700; border: 1px solid var(--line); }
.stat-good { color: var(--green); }
.stat-ok { color: var(--amber); }
.stat-bad { color: var(--red); }

.hi-action {
  flex: none; width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: transparent; color: #9aa0ae; font-size: 16px; cursor: pointer;
}
.hi-action:hover { background: #f1f2f7; }
.hi-del:hover { background: var(--red-soft); color: var(--red); }
.hi-tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700; background: var(--green-soft); color: var(--green);
}
.hi-tag[data-bad] { background: var(--red-soft); color: var(--red); }

.review-panel {
  margin-top: 12px; padding: 14px; background: #fafbff; border: 1px solid var(--line);
  border-radius: 14px; width: 100%;
}
.review-label { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.review-pills { display: flex; gap: 8px; margin-bottom: 10px; }
.pill {
  flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 99px;
  padding: 9px 6px; font-size: 13px; font-weight: 700; font-family: inherit; color: var(--text); cursor: pointer;
}
.pill-active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.review-note { margin-bottom: 10px; }
.review-actions { display: flex; gap: 8px; }
.review-actions .btn { flex: 1; min-height: 42px; padding: 9px 12px; font-size: 14px; }


/* ---------- v0.6.0 ---------- */
.hero-subline { margin-top: 6px; color: var(--primary-strong); font-weight: 700; font-size: 15.5px; }
.hero-subline strong { font-weight: 800; }

/* 开始分析：移动端底部固定悬浮 */
.btn-cta {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px);
  width: min(calc(100% - 32px), 688px); z-index: 30;
}
#view-new { padding-bottom: 100px; }
@media (min-width: 768px) {
  .btn-cta { position: static; transform: none; width: 100%; }
  #view-new { padding-bottom: 0; }
}

/* 结果页：底部固定操作栏 */
.result-actions {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px);
  width: min(calc(100% - 24px), 688px);
  background: rgba(255,255,255,.94); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 16px;
  padding: 8px; margin: 0; box-shadow: var(--shadow-md); z-index: 30;
  display: flex; gap: 6px; flex-wrap: nowrap;
}
.result-actions .btn { flex: 1; min-height: 40px; padding: 8px 10px; font-size: 13px; }
#view-result { padding-bottom: 130px; }
@media (min-width: 768px) {
  .result-actions { position: static; transform: none; width: 100%; background: transparent; border: 0; box-shadow: none; padding: 0; margin-bottom: 14px; }
  .result-actions .btn { flex: none; }
  #view-result { padding-bottom: 0; }
}

/* 模型库折叠分组 */
.model-group { margin-bottom: 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--card); box-shadow: var(--shadow-sm); overflow: hidden; }
.model-group summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 800; font-size: 15px; user-select: none; }
.model-group summary::-webkit-details-marker { display: none; }
.model-group summary::after { content: "▾"; color: var(--muted); transition: transform .2s ease; }
.model-group[open] summary::after { transform: rotate(180deg); }
.mg-hint { font-size: 12px; font-weight: 500; color: var(--muted); }
.mg-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--muted); background: #f1f2f7; border-radius: 99px; padding: 2px 10px; }
.model-group .model-list-grid { padding: 4px 14px 16px; }

/* 置信度仪表 */
.conf-meter { height: 8px; border-radius: 99px; background: #e5e7f0; overflow: hidden; margin-top: 10px; }
.conf-fill { height: 100%; border-radius: 99px; background: var(--grad); transition: width .6s ease; }

/* 图表 */
.chart { margin-top: 14px; }
.chart-title { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.chart-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.chart-label { flex: none; width: 84px; font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart-track { flex: 1; height: 14px; background: #f1f2f7; border-radius: 99px; overflow: hidden; }
.chart-fill { height: 100%; border-radius: 99px; background: var(--primary); opacity: .85; }
.chart-fill.chart-best { background: var(--green); opacity: 1; }
.chart-val { flex: none; width: 36px; text-align: right; font-size: 12.5px; font-weight: 700; }

/* 追问 */
.ask-card h2 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.ask-card .muted { margin-bottom: 10px; }
.ask-row { display: flex; gap: 8px; }
.ask-row input { flex: 1; min-width: 0; }
.ask-row .btn { flex: none; }
.ask-item { border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-top: 10px; line-height: 1.65; }
.ask-q { background: var(--primary-soft); color: var(--primary-strong); font-weight: 600; }
.ask-a { background: #f7f8fc; border: 1px solid var(--line); color: var(--text); white-space: pre-wrap; }

/* 语音 */
.mic-btn { border: 0; background: var(--primary-soft); width: 30px; height: 30px; border-radius: 9px; font-size: 15px; cursor: pointer; margin-left: 6px; vertical-align: middle; }
.mic-btn:active { transform: scale(.92); }

/* 深色模式（跟随系统） */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1015; --card: #161922; --line: #262b36; --text: #e7e9f0; --muted: #9aa1b0;
    --primary-soft: #1d2440;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.35), 0 4px 14px rgba(0,0,0,.35);
    --shadow-md: 0 4px 10px rgba(0,0,0,.45), 0 12px 32px rgba(0,0,0,.5);
  }
  .topbar { background: rgba(22,25,34,.85); border-bottom-color: #262b36; }
  .tabbar { background: rgba(22,25,34,.92); border-top-color: #262b36; }
  .hero { background: radial-gradient(120% 120% at 100% 0%, rgba(99,102,241,.18) 0%, transparent 50%), radial-gradient(120% 120% at 0% 100%, rgba(139,92,246,.15) 0%, transparent 50%), var(--card); }
  .verdict { background: linear-gradient(135deg, #1d2440, #241f3d); border-color: #2a3150; }
  .chart-track, .progress, .conf-meter { background: #222735; }
  .ask-a { background: #1b1f2a; }
  .result-actions { background: rgba(22,25,34,.94); }
  .result-actions .btn-ghost { background: #1b1f2a; border-color: #2a2f3c; }
  input, textarea, select { background: #12151d; color: var(--text); border-color: #2a2f3c; }
  .mg-count, .badge-weight, .stat { background: #222735; }
}


/* ---------- v0.7.0 ---------- */
.hero-subline { margin-bottom: 14px; }
.hero-actions { margin-top: 6px; }

/* 键盘弹出时隐藏悬浮元素 */
body.keyboard-open .btn-cta,
body.keyboard-open .tabbar,
body.keyboard-open .result-actions { display: none !important; }

/* 全屏加载层 */
.analyzing {
  position: fixed; inset: 0; z-index: 60;
  margin: 0; border: 0; border-radius: 0;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
}
.analyzing[hidden] { display: none !important; }
.analyzing h1 { margin: 16px 0 4px; }
.analyzing .progress { width: min(320px, 80%); }
.analyzing .progress-hint { max-width: 320px; }
.analyzing .btn { margin-top: 8px; }

/* 结果页头部 */
.result-head-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.result-page-label { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: 1px; }

/* 首页小贴士 */
.tips-card { background: linear-gradient(135deg, #eef2ff, #faf9ff); }
.tips-card h2 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.tips-list { list-style: none; padding: 0; }
.tips-list li { position: relative; padding: 6px 0 6px 20px; font-size: 13.5px; color: #374151; }
.tips-list li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 800; }

/* 怎么选模型：紧凑网格 */
.guide-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.guide-chip {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; font-size: 13px; font-family: inherit; cursor: pointer; color: var(--text);
  text-align: left; transition: transform .1s ease, box-shadow .15s ease;
}
.guide-chip:active { transform: scale(.97); }
.guide-chip:hover { box-shadow: var(--shadow-sm); }
.guide-chip .guide-scene { font-weight: 700; }
.guide-chip .guide-arrow { font-size: 12px; color: var(--primary); font-weight: 700; }

/* 多模型选择 */
.multi-options { margin-top: 8px; background: #fafbff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.multi-label { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.multi-checks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.multi-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; cursor: pointer; }
.multi-check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* 多模型结果 */
.cmp-card { background: linear-gradient(135deg, #eef2ff, #faf9ff); }
.cmp-row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.cmp-name { font-weight: 800; font-size: 14px; }
.cmp-conf { font-size: 12px; color: var(--primary); font-weight: 700; }
.cmp-rec { font-size: 13.5px; color: #374151; }
.multi-sec > .sec { box-shadow: none; border: 1px dashed var(--line); margin-top: 10px; }

@media (prefers-color-scheme: dark) {
  .tips-card { background: linear-gradient(135deg, #1d2440, #241f3d); }
  .tips-list li { color: var(--text); }
  .cmp-card { background: linear-gradient(135deg, #1d2440, #241f3d); }
  .cmp-rec { color: var(--text); }
  .guide-chip, .multi-check { background: #1b1f2a; border-color: #2a2f3c; }
  .multi-options { background: #12151d; }
}


/* ---------- v0.7.1 细节打磨 ---------- */
/* 1) 副标题间距：上下留出呼吸感 */
.hero-subline { margin: 10px 0 20px; font-size: 15px; }
.hero-actions { margin-top: 2px; }

/* 2) 小贴士：强制单行，超长省略 */
.tips-list li { font-size: 13px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 5px 0 5px 18px; }

/* 3) 底部留白收紧（首页/模型页通用） */
main { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px); }
.footer { padding: 8px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 10px); font-size: 11px; color: #b3bac6; }
@media (min-width: 768px) {
  main { padding-bottom: 56px; }
  .footer { padding: 14px 16px 24px; }
}

/* 4) 结果/历史详情页排版统一（字号、间距、节奏） */
#view-result { padding-bottom: 116px; }
.r-body { gap: 12px; }
.sec { padding: 16px; margin-bottom: 0; }
.card { padding: 16px; margin-bottom: 12px; }
.result-head h1 { font-size: 20px; margin-bottom: 8px; }
.sec h2, #r-extra h2, .blind-card h2, .ask-card h2, .tips-card h2 { font-size: 15px; margin-bottom: 10px; }
.r-meta { font-size: 12.5px; }
.verdict { padding: 16px; }
.verdict .rec { font-size: 17px; }
.verdict .conf { font-size: 12.5px; }
.verdict .reason p { font-size: 13.5px; }
#r-extra p, #r-extra div, #r-assumptions div, #r-risks div { font-size: 14px; line-height: 1.6; }
#r-extra h2 { margin: 16px 0 8px; }
#r-extra h2:first-child { margin-top: 0; }
.card .muted, .blind-card .muted { font-size: 13px; }
.md-sec p, .md-sec ol li, .cmp-rec, .ask-item { font-size: 14px; }
.cmp-row { padding: 9px 0; }
table th, table td { padding: 9px 10px; font-size: 13px; }
.chart-row { margin-bottom: 7px; }
@media (min-width: 768px) {
  #view-result { padding-bottom: 40px; }
}

/* v0.7.2：手机端隐藏页脚，内容到底部导航精确 16px */
@media (max-width: 767px) {
  .footer { display: none; }
}
