/* 楂樿€冭嫳璇惉鍔涜缁冪郴缁?v2 路 璁捐浠ょ墝涓庣Щ鍔ㄤ紭鍏堟牱寮忥紙闆朵緷璧栥€佹棤鏋勫缓锛?*/
:root {
  --accent: #4361ee;
  --accent-strong: #2f4bd8;
  --accent-soft: #eef1ff;
  --correct: #22c55e;
  --correct-soft: #dcfce7;
  --wrong: #ef4444;
  --wrong-soft: #fee2e2;
  --female: #e91e63;
  --male: #2196f3;
  --warn: #f59e0b;
  --warn-soft: #fef3c7;
  --text: #1f2937;
  --muted: #6b7280;
  --faint: #94a3b8;
  --line: #e5e7eb;
  --bg: #f5f7fb;
  --card: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --shadow: 0 2px 10px rgba(31, 41, 55, 0.05), 0 12px 32px rgba(67, 97, 238, 0.08);
  --shadow-soft: 0 1px 3px rgba(31, 41, 55, 0.06);
  --font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
code { background: #f1f5f9; border-radius: 5px; padding: 1px 5px; font-size: 0.9em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.view:focus, .feedback-slot:focus { outline: none; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 200; background: var(--accent);
  color: #fff; padding: 8px 14px; border-radius: 0 0 10px 10px;
}
.skip-link:focus { top: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.text-ok { color: var(--correct); font-weight: 700; }
.text-bad { color: var(--wrong); font-weight: 700; }

/* ---------- 甯冨眬楠ㄦ灦 ---------- */
.app-shell { 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; gap: 8px;
  padding: 9px 14px; background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: 8px; color: inherit; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #7c3aed); font-size: 17px;
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.3);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15px; letter-spacing: 0.2px; }
.brand-text small { color: var(--muted); font-size: 10.5px; }
.brand-text strong, .brand-text small { white-space: nowrap; }
.status { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px;
  border-radius: 999px; background: #f1f5f9; color: var(--muted);
  font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.status-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.75; }
.status-pill[data-state="ok"] { background: var(--correct-soft); color: #15803d; }
.status-pill[data-state="warn"] { background: var(--warn-soft); color: #b45309; }
.notice {
  margin: 0; padding: 8px 14px; font-size: 12px; line-height: 1.55;
  background: var(--warn-soft); color: #92400e; border-bottom: 1px solid #fcd34d;
}
.view { flex: 1; }
.view-pad { width: 100%; max-width: 1040px; margin: 0 auto; padding: 14px 14px 24px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: rgba(255, 255, 255, 0.97); border-top: 1px solid var(--line);
  padding: 5px 2px calc(5px + env(safe-area-inset-bottom));
  backdrop-filter: blur(10px);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  color: var(--muted); font-size: 10px; font-weight: 600; padding: 4px 0;
}
.tabbar .tab-emoji { font-size: 18px; line-height: 1.15; filter: grayscale(0.45); }
.tabbar a.is-active { color: var(--accent); }
.tabbar a.is-active .tab-emoji { filter: none; }
body { padding-bottom: 0; }
.app-shell { padding-bottom: 64px; }
.page-footer { margin: 26px 0 8px; text-align: center; line-height: 1.6; }

/* ---------- 閫氱敤缁勪欢 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; box-shadow: var(--shadow-soft);
}
.card + .card { margin-top: 12px; }
.card-title { font-size: 16px; margin-bottom: 10px; }
.card-head-inline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.section { margin-top: 20px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head h2 { font-size: 17px; }
.section-head p { margin-top: 2px; }
.view-head { margin-bottom: 14px; }
.view-head h1 { font-size: 22px; line-height: 1.3; margin: 6px 0; }
.back-link { display: inline-block; color: var(--muted); font-size: 12.5px; padding: 2px 0; }
.back-link:hover { color: var(--accent); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 999px; padding: 9px 16px;
  background: #eef2f7; color: var(--text); font-size: 14px; font-weight: 600;
  line-height: 1.2; text-decoration: none; transition: transform 0.12s, box-shadow 0.15s, background 0.15s;
}
.btn:hover { filter: brightness(1.03); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; transform: none; }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 16px rgba(67, 97, 238, 0.24); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ai { background: linear-gradient(135deg, var(--accent), #7c3aed); color: #fff; }
.btn-danger { background: var(--wrong); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }
.link-btn {
  background: none; border: 0; padding: 3px 0; color: var(--accent);
  font-size: 12.5px; font-weight: 600; text-decoration: none;
}
.link-btn:hover { text-decoration: underline; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px;
  border-radius: 999px; background: #f1f5f9; color: #475569;
  font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); color: var(--accent-strong); }
.chip-soft { background: #eef1ff; color: #4338ca; }
.chip-ghost { background: #fff; border: 1px solid var(--line); color: var(--muted); }
.chip-filter { cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--muted); padding: 6px 12px; }
.chip-filter:hover { border-color: var(--accent); color: var(--accent); }
.chip-filter.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.progress { height: 6px; background: #eef2f7; border-radius: 999px; overflow: hidden; }
.progress-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width 0.35s ease; }
.level-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #f8fafc; color: var(--lv-color, var(--muted)); font-size: 10.5px; font-weight: 700; }
.icon-text { display: inline-flex; align-items: center; gap: 5px; }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0; font-size: 13.5px; line-height: 1.65; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
.spinner {
  display: inline-block; width: 17px; height: 17px; flex: none;
  border: 2px solid #dbe3ff; border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-block { display: flex; align-items: center; gap: 8px; padding: 18px 2px; color: var(--muted); font-size: 13px; }
.boot-skeleton { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 16px; text-align: center; }
.empty-state {
  background: #fff; border: 1px dashed #cbd5e1; border-radius: var(--radius);
  padding: 30px 16px; text-align: center;
}
.empty-emoji { font-size: 40px; line-height: 1.2; }
.empty-state h3 { font-size: 16px; margin: 8px 0 4px; }
.empty-state p { font-size: 13px; line-height: 1.65; }
.empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.error-block { background: #fff7f7; border: 1px solid #fecaca; border-radius: var(--radius); padding: 18px; }
.error-block h3 { font-size: 15px; color: #b91c1c; margin-bottom: 4px; }
.error-block p { font-size: 13px; line-height: 1.65; }
.banner { margin: 8px 0; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; line-height: 1.55; }
.banner-warn { background: var(--warn-soft); color: #92400e; border: 1px solid #fcd34d; }
.toast-stack {
  position: fixed; left: 50%; bottom: 78px; z-index: 120;
  width: min(92vw, 420px); transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  padding: 10px 14px; border-radius: 12px; background: #1f2937; color: #fff;
  font-size: 13px; line-height: 1.5; box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
  animation: toast-in 0.22s ease-out;
}
.toast-error { background: #b91c1c; }
.toast-success { background: #15803d; }
.toast-warn { background: #b45309; }

/* ---------- 棣栭〉 ---------- */
.hero {
  border: 0; border-radius: var(--radius-lg); padding: 20px 18px;
  background: radial-gradient(120% 140% at 0% 0%, #6d8bfa 0%, #4361ee 45%, #5b21b6 100%);
  color: #fff; box-shadow: 0 14px 34px rgba(67, 97, 238, 0.3);
}
.hero-kicker { font-size: 12px; opacity: 0.85; }
.hero h1 { font-size: 25px; line-height: 1.28; margin: 8px 0 10px; }
.hero-sub { font-size: 13.5px; line-height: 1.65; opacity: 0.92; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 9px; margin: 16px 0 18px; }
.hero .btn-primary { background: #fff; color: var(--accent-strong); box-shadow: 0 6px 16px rgba(15, 23, 42, 0.18); }
.hero .btn-ghost { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; border-top: 1px solid rgba(255, 255, 255, 0.22); padding-top: 14px; }
.hero-stats div { display: flex; flex-direction: column; gap: 1px; }
.hero-stats b { font-size: 19px; }
.hero-stats span { font-size: 10.5px; opacity: 0.8; }
.guide h2 { font-size: 17px; margin-bottom: 4px; }
.guide-steps { list-style: none; padding: 0; margin: 6px 0 8px; }
.guide-steps li { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.guide-steps li:last-child { border-bottom: 0; }
.step-no {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft);
  color: var(--accent-strong); display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.guide-steps b { font-size: 14px; }
.guide-steps p { font-size: 12.5px; color: var(--muted); line-height: 1.6; margin: 2px 0 4px; }
.task-grid { display: flex; flex-direction: column; gap: 9px; }
.task-card {
  display: flex; align-items: center; gap: 11px; padding: 13px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  color: inherit; box-shadow: var(--shadow-soft); transition: border-color 0.15s, transform 0.15s;
}
.task-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.task-icon { font-size: 21px; flex: none; }
.task-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.task-main b { font-size: 14px; }
.task-main span { font-size: 12px; color: var(--muted); line-height: 1.5; }
.task-cta { flex: none; font-size: 12px; font-weight: 700; color: var(--accent); }
.skill-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.skill-card {
  display: flex; align-items: center; gap: 11px; padding: 11px 12px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  color: inherit; box-shadow: var(--shadow-soft); transition: border-color 0.15s, transform 0.15s;
}
.skill-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.skill-emoji {
  flex: none; width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); font-size: 19px;
}
.skill-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.skill-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.skill-name { font-size: 13.5px; font-weight: 700; }
.skill-meta { font-size: 11px; color: var(--muted); }
.skill-arrow { flex: none; color: var(--faint); font-size: 20px; }
.quick-grid { display: grid; grid-template-columns: 1fr; gap: 9px; }
.quick-card {
  display: flex; flex-direction: column; gap: 3px; padding: 15px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  color: inherit; box-shadow: var(--shadow-soft);
}
.quick-card:hover { border-color: var(--accent); }
.quick-emoji { font-size: 23px; }
.quick-card b { font-size: 14px; }
.quick-card span { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ---------- 绛旈鍗?/ 鎾斁鍣?---------- */
.qcard { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 13px; box-shadow: var(--shadow); }
.qcard-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.qcard-tags { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }
.qcard-index { flex: none; font-size: 11.5px; color: var(--faint); font-weight: 700; }
.player { background: #f8faff; border: 1px solid #e3e9ff; border-radius: 13px; padding: 9px; }
.player-row { display: flex; align-items: center; gap: 7px; }
.player-toggle {
  flex: 1; border: 0; border-radius: 10px; padding: 9px 13px; color: #fff;
  background: linear-gradient(135deg, var(--accent), #5b7cfa); font-size: 13.5px;
  font-weight: 700; display: flex; align-items: center; gap: 7px;
}
.player-stop { flex: none; width: 36px; height: 36px; padding: 0; font-size: 14px; }
.player-info { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 68px; }
.speaker-pill {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: #eef2f7; color: var(--muted); white-space: nowrap;
}
.speaker-pill.is-female { background: #fce7f3; color: var(--female); }
.speaker-pill.is-male { background: #e3f2fd; color: var(--male); }
.player-line { font-size: 10px; color: var(--muted); }
.player-bar { margin-top: 8px; height: 5px; border-radius: 999px; background: #e5eaf5; overflow: hidden; }
.player-bar span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #7c3aed); transition: width 0.3s ease;
}
.player-mode { margin-top: 5px; min-height: 14px; }
.stem { font-size: 16.5px; line-height: 1.55; margin: 15px 0 11px; }
.options { display: flex; flex-direction: column; gap: 7px; }
.option {
  display: flex; align-items: flex-start; gap: 9px; width: 100%;
  padding: 10px 11px; text-align: left; background: #fff;
  border: 1.5px solid var(--line); border-radius: 11px;
  color: var(--text); font-size: 13.5px; line-height: 1.5; transition: border-color 0.14s, background 0.14s;
}
.option:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.option:disabled { opacity: 1; cursor: default; }
.option-key {
  flex: none; width: 23px; height: 23px; border-radius: 50%;
  background: #f1f5f9; color: var(--muted); display: grid; place-items: center;
  font-size: 11.5px; font-weight: 800;
}
.option-text { flex: 1; }
.option.is-correct { border-color: var(--correct); background: #f0fdf4; }
.option.is-correct .option-key { background: var(--correct); color: #fff; }
.option.is-wrong { border-color: var(--wrong); background: #fef2f2; }
.option.is-wrong .option-key { background: var(--wrong); color: #fff; }
.hint-row { margin-top: 9px; }
.hint-box {
  margin-top: 7px; padding: 9px 11px; background: #fffbeb; color: #92400e;
  border: 1px dashed #fcd34d; border-radius: 10px; font-size: 12.5px; line-height: 1.6;
}
.feedback-slot { margin-top: 11px; }
.feedback { padding: 11px 12px; border-radius: 13px; border: 1px solid var(--line); }
.feedback.is-correct { background: #f0fdf4; border-color: #bbf7d0; }
.feedback.is-wrong { background: #fef2f2; border-color: #fecaca; }
.feedback-title { font-size: 14.5px; font-weight: 800; margin-bottom: 3px; }
.feedback-answer { font-size: 13px; line-height: 1.6; margin: 2px 0; }
.feedback-chosen { color: var(--muted); }
.feedback-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.mastery-change { font-weight: 800; }
.mastery-change.is-up { color: var(--correct); }
.mastery-change.is-down { color: var(--wrong); }
.feedback-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.transcript { margin-top: 13px; border-top: 1px dashed var(--line); padding-top: 11px; }
.transcript-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.transcript-head h3 { font-size: 13.5px; }
.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.line {
  display: flex; gap: 8px; padding: 7px 9px; border-radius: 10px; background: #f8fafc;
  border-left: 3px solid transparent; transition: background 0.25s, box-shadow 0.25s;
}
.line.is-female { border-left-color: var(--female); }
.line.is-male { border-left-color: var(--male); }
.line.is-active { background: #eef2ff; box-shadow: inset 0 0 0 1px #c7d2fe; }
.line-avatar { flex: none; font-size: 15px; line-height: 1.4; }
.line-body { flex: 1; min-width: 0; }
.line-speaker { font-size: 10px; font-weight: 800; color: var(--muted); letter-spacing: 0.3px; }
.line-text { margin: 1px 0 0; font-size: 13px; line-height: 1.55; }
.explain-slot { margin-top: 11px; }
.explain-card { border: 1px solid #dbe3ff; background: linear-gradient(180deg, #f8faff, #fff); border-radius: 13px; padding: 11px 12px; }
.explain-card.is-rule { border-color: #fde68a; background: #fffdf5; }
.explain-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; font-weight: 800; margin-bottom: 5px; }
.explain-text { font-size: 13px; line-height: 1.7; margin: 0 0 7px; }
.explain-row { font-size: 12.5px; line-height: 1.65; margin: 4px 0; }
.explain-row b { color: var(--accent-strong); margin-right: 4px; }
.explain-tip { background: var(--accent-soft); color: var(--accent-strong); padding: 6px 8px; border-radius: 8px; font-size: 12px; margin: 7px 0 0; }
.explain-note { font-size: 11px; color: var(--muted); margin: 7px 0 0; line-height: 1.55; }
.explain-loading { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }

/* ---------- 浼氳瘽 / 缁撶畻 ---------- */
.session-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.session-title h2 { font-size: 18px; line-height: 1.35; }
.session-title p { margin-top: 2px; }
.session-progress { display: flex; gap: 4px; margin-top: 10px; }
.session-progress .seg { flex: 1; height: 5px; border-radius: 999px; background: #e5e7eb; }
.session-progress .seg.is-done { background: var(--accent); }
.session-progress .seg.is-current { background: #7c3aed; }
.session-count { margin: 6px 0 11px; }
.session-result { text-align: center; padding: 22px 15px; }
.result-emoji { font-size: 42px; line-height: 1.2; }
.session-result h2 { font-size: 19px; margin: 6px 0; }
.result-score { font-size: 14.5px; }
.result-score b { font-size: 21px; color: var(--accent); }
.result-score-lg { font-size: 16px; }
.result-pass { margin: 9px auto 0; padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 700; max-width: 460px; }
.result-pass.is-pass { background: var(--correct-soft); color: #15803d; }
.result-pass.is-fail { background: var(--wrong-soft); color: #b91c1c; }
.result-skill-list { text-align: left; margin-top: 16px; }
.result-skill-list h3 { font-size: 14px; margin-bottom: 5px; }
.result-skill-list ul { list-style: none; padding: 0; margin: 0; }
.result-skill-list li { display: flex; align-items: flex-start; gap: 7px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.result-skill-list li:last-child { border-bottom: 0; }
.q-skill { flex: none; min-width: 62px; font-weight: 700; color: var(--accent-strong); font-size: 11.5px; }
.q-stem { flex: 1; color: var(--muted); line-height: 1.5; }
.wrong-mini { text-align: left; margin-top: 14px; background: #fff7ed; border-radius: 11px; padding: 10px 12px; }
.wrong-mini h3 { font-size: 13px; margin-bottom: 4px; }
.wrong-mini ul { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.6; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.practice-meta { margin: 0 0 9px; }

/* ---------- 瀛︽儏鎶ュ憡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 13px 0; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 11px 12px; display: flex; flex-direction: column; }
.stat-card b { font-size: 21px; color: var(--accent-strong); }
.stat-card span { font-size: 11px; color: var(--muted); }
.radar-card { text-align: center; }
.radar-slot { display: flex; justify-content: center; }
.radar-canvas { display: block; width: 100%; max-width: 380px; height: auto; }
.radar-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 6px 0; }
.legend-item { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.legend-item i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-testing { font-weight: 700; }
.error-bars { display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.error-bar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; margin-bottom: 4px; }
.error-bar-row .progress { height: 7px; }
.error-bar-row .muted { margin-top: 3px; }
.trap-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 11px; }
.ai-report-source { font-size: 11.5px; color: var(--accent-strong); margin-bottom: 5px; }
.ai-summary { font-size: 13px; line-height: 1.7; }
.ai-two-col { display: grid; grid-template-columns: 1fr; gap: 9px; margin: 11px 0; }
.ai-block { background: #f8fafc; border-radius: 11px; padding: 10px; }
.ai-block h4 { font-size: 12.5px; margin-bottom: 4px; }
.ai-block ul { margin: 0; padding-left: 17px; font-size: 12.5px; line-height: 1.65; }
.ai-block.is-good { background: #f0fdf4; }
.ai-block.is-bad { background: #fff7ed; }
.plan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.plan-list li { display: flex; gap: 8px; }
.plan-day { flex: none; height: fit-content; background: var(--accent-soft); color: var(--accent-strong); font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 7px; margin-top: 1px; }
.plan-list p { font-size: 12px; color: var(--muted); line-height: 1.55; margin: 1px 0 0; }
.ai-encourage { margin-top: 9px; padding: 8px 10px; border-radius: 9px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12.5px; font-weight: 600; }
.wrong-list { display: flex; flex-direction: column; gap: 7px; }
.wrong-item { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; background: #f8fafc; border-radius: 11px; }
.wrong-item-main { flex: 1; min-width: 0; }
.wrong-stem { font-size: 12px; color: #334155; line-height: 1.55; margin-top: 4px; }
.review-list { display: flex; flex-direction: column; gap: 6px; }
.review-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; background: #f8fafc; border-radius: 9px; font-size: 12.5px; }
.review-box { flex: none; background: var(--accent-soft); color: var(--accent-strong); font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.review-main { flex: 1; font-weight: 600; }
.diagnose-history { list-style: none; padding: 0; margin: 0; }
.diagnose-history li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.diagnose-history li:last-child { border-bottom: 0; }

/* ---------- 璇婃柇 / 澶嶆祴 ---------- */
.diagnose-intro { margin-bottom: 14px; }
.diagnose-weak { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 9px 10px; background: #f8fafc; border-radius: 10px; margin-bottom: 12px; }

/* ---------- AI 鏁欑粌 ---------- */
.coach-card { padding: 13px; }
.coach-status { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 10px; background: #f8fafc; font-size: 12px; margin-bottom: 9px; }
.coach-status.is-ok { background: #f0fdf4; color: #15803d; }
.coach-status.is-warn { background: var(--warn-soft); color: #92400e; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.coach-status .status-dot { background: currentColor; }
.chat-list { max-height: 46vh; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding: 4px 2px; scroll-behavior: smooth; }
.bubble-row { display: flex; align-items: flex-start; gap: 7px; margin: 4px 0; }
.bubble-row.is-user { flex-direction: row-reverse; }
.bubble-avatar { flex: none; width: 27px; height: 27px; border-radius: 50%; background: var(--accent-soft); display: grid; place-items: center; font-size: 14px; }
.bubble { max-width: 84%; background: #f1f5f9; border-radius: 4px 13px 13px 13px; padding: 8px 11px; font-size: 13px; line-height: 1.6; }
.bubble-row.is-user .bubble { background: var(--accent); color: #fff; border-radius: 13px 4px 13px 13px; }
.bubble-text { white-space: pre-wrap; word-break: break-word; }
.bubble-note { font-size: 11px; opacity: 0.8; margin-top: 5px; border-top: 1px dashed rgba(100, 116, 139, 0.35); padding-top: 4px; }
.bubble-time { font-size: 9.5px; opacity: 0.55; margin-top: 3px; }
.bubble.is-pending { padding: 11px 14px; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; animation: blink 1.2s infinite; }
.typing-dots i:nth-child(2) { animation-delay: 0.2s; }
.typing-dots i:nth-child(3) { animation-delay: 0.4s; }
.quick-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0; }
.chat-form { display: flex; align-items: flex-end; gap: 7px; }
.chat-form textarea {
  flex: 1; min-height: 44px; max-height: 120px; resize: vertical;
  border: 1.5px solid var(--line); border-radius: 11px; padding: 9px 11px;
  font-size: 13.5px; line-height: 1.5; background: #fff; color: var(--text);
}
.chat-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.14); }
.chat-form .btn { flex: none; }
.chat-system-note { text-align: center; font-size: 11.5px; color: var(--muted); margin: 6px 0; }

/* ---------- 璁剧疆 ---------- */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 11px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.setting-row:last-of-type { border-bottom: 0; }
.setting-label { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.setting-label b { font-size: 13.5px; }
.segmented { display: inline-flex; gap: 2px; background: #f1f5f9; border-radius: 10px; padding: 3px; flex: none; }
.segment { border: 0; background: transparent; color: var(--muted); padding: 6px 9px; border-radius: 8px; font-size: 12px; font-weight: 700; }
.segment.is-active { background: #fff; color: var(--accent); box-shadow: var(--shadow-soft); }
.switch { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px 4px 4px; flex: none; }
.switch-thumb { width: 20px; height: 20px; border-radius: 50%; background: #cbd5e1; transition: background 0.18s; }
.switch-text { font-size: 11px; font-weight: 700; color: var(--muted); }
.switch.is-on { border-color: var(--accent); background: var(--accent-soft); }
.switch.is-on .switch-thumb { background: var(--accent); }
.switch.is-on .switch-text { color: var(--accent-strong); }
.status-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.status-row:last-child { border-bottom: 0; }
.status-label { min-width: 88px; font-size: 12.5px; font-weight: 700; }
.status-detail { flex: 1; }
.status-row .status-dot.is-ok { background: var(--correct); }
.status-row .status-dot.is-warn { background: var(--warn); }

/* ---------- 鍝嶅簲寮?---------- */
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; row-gap: 5px; padding-top: 8px; padding-bottom: 8px; }
  .brand { flex: 1 1 auto; }
  .status { flex: 1 1 100%; justify-content: flex-start; }
}
@media (min-width: 640px) {
  .view-pad { padding: 20px 20px 28px; }
  .hero { padding: 26px 24px; }
  .hero h1 { font-size: 30px; }
  .hero-sub { font-size: 14.5px; }
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .ai-two-col { grid-template-columns: 1fr 1fr; }
  .bubble { max-width: 72%; }
  .chat-list { max-height: 52vh; }
  .qcard { padding: 17px; }
  .stem { font-size: 17.5px; }
  .player-line { font-size: 10.5px; }
  .toast-stack { bottom: 84px; }
}
@media (min-width: 900px) {
  .skill-grid { grid-template-columns: repeat(3, 1fr); }
  .topbar { padding: 11px 24px; }
  .brand-mark { width: 38px; height: 38px; font-size: 19px; }
  .brand-text strong { font-size: 16px; }
  .status-pill { font-size: 11px; }
  .tabbar a { font-size: 11px; }
  .tabbar .tab-emoji { font-size: 19px; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes blink { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ---- 移动端兜底：防止任何内容把视口撑宽（Lead 修复 2026-11-22） ---- */
html, body { overflow-x: hidden; max-width: 100%; }
img, canvas, pre, code { max-width: 100%; }


/* ---- 浏览器音色设置（Lead 追加 2026-11-22） ---- */
.row-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.select { max-width: 60vw; padding: 7px 9px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: inherit; font-size: 12px; }
.notice-inline { margin: 9px 0; padding: 9px 11px; border-radius: 10px; background: var(--warn-soft); color: #92400e; font-size: 12.5px; line-height: 1.65; }
.setting-label b { white-space: nowrap; }
