/* ==========================================================================
   公考教练 · 设计系统
   ========================================================================== */

:root {
  --bg: #f5f4f0;
  --bg-soft: #efece5;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #191b1f;
  --ink-2: #444a52;
  --muted: #8a8f98;
  --line: #e6e2d9;
  --line-2: #d9d4c8;
  --primary: #0f5f54;
  --primary-600: #0b4b43;
  --primary-soft: #e4eeeb;
  --accent: #c2532a;
  --accent-soft: #fbeee7;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --ok: #0f7b52;
  --ok-soft: #e6f4ee;
  --warn: #a15c07;
  --warn-soft: #fcf3e2;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(25, 27, 31, 0.04), 0 6px 20px rgba(25, 27, 31, 0.045);
  --shadow-lg: 0 12px 40px rgba(25, 27, 31, 0.14);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', sans-serif;
  --serif: 'Songti SC', 'Source Han Serif SC', 'Noto Serif SC', 'SimSun', serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

p {
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: #cfe3de;
}

/* ------------------------------ 启动画面 ------------------------------ */

.boot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 14px;
  color: var(--muted);
}
.boot-mark {
  width: 54px;
  height: 54px;
  border-radius: 15px;
  background: var(--primary);
  color: #f5f4f0;
  display: grid;
  place-items: center;
  font-size: 26px;
  font-weight: 700;
}
.boot-text {
  font-size: 13px;
  letter-spacing: 0.08em;
}

/* ------------------------------ 布局 ------------------------------ */

.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--primary);
  color: #f7f6f2;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  flex: none;
}
.brand-name {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
  margin-top: -3px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}
.nav-item:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-600);
  font-weight: 600;
}
.nav-item.active svg {
  stroke: var(--primary-600);
}
.nav-item svg {
  width: 17px;
  height: 17px;
  stroke: var(--muted);
  stroke-width: 1.7;
  fill: none;
  flex: none;
}
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.nav-group {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.12em;
  padding: 14px 10px 5px;
}

.sidebar-foot {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 8px;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 9px;
  cursor: pointer;
}
.user-chip:hover {
  background: var(--surface-2);
}
.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-600);
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 13px;
  flex: none;
}
.user-meta {
  min-width: 0;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 10.5px;
  color: var(--muted);
}
.version-line {
  font-size: 10.5px;
  color: var(--muted);
  padding: 6px 8px 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
}

.balance-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-600);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 6px;
}
.balance-chip:hover {
  background: #d5e6e1;
}
.balance-chip .balance-hint {
  margin-left: auto;
  font-weight: 500;
  font-size: 11px;
  opacity: 0.7;
}

/* 错题本：标出用户选错的那个选项 */
.option.bad {
  border-color: rgba(200, 60, 60, 0.35);
  background: rgba(200, 60, 60, 0.06);
}
.option.bad .key {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.opt-flag {
  margin-left: auto;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(200, 60, 60, 0.12);
  color: var(--danger);
  font-weight: 600;
  flex: none;
}
.opt-flag.ok {
  background: rgba(20, 120, 90, 0.12);
  color: var(--ok);
}

/* ------------------------------ 原理课 ------------------------------ */

.lesson-body {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
}

.lesson-list {
  margin: 0;
  padding-left: 20px;
  line-height: 1.9;
  font-size: 14px;
}
.lesson-list li {
  margin-bottom: 2px;
}

.lesson-stem {
  font-size: 14.5px;
  line-height: 1.7;
  font-weight: 500;
}

.lesson-answer {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--primary-soft);
  border-radius: 8px;
  font-size: 14px;
}

.pitfall {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.pit-wrong,
.pit-right {
  padding: 9px 12px;
  font-size: 13.5px;
  line-height: 1.7;
}
.pit-wrong {
  background: rgba(200, 60, 60, 0.05);
}
.pit-right {
  background: rgba(20, 120, 90, 0.05);
  border-top: 1px dashed var(--line);
}
.pit-wrong b,
.pit-right b {
  display: block;
  margin-bottom: 3px;
  font-size: 12.5px;
}
.pit-wrong b {
  color: var(--danger);
}
.pit-right b {
  color: var(--ok);
}

.memory-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0f5f54, #17786a);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
.memory-tag {
  flex: none;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-weight: 500;
}

.variant {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.variant .option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: #fff;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
}

.essay-material {
  padding: 14px 16px;
  border-radius: 10px;
  background: #f7f6f2;
  border: 1px solid var(--line);
  font-size: 13.5px;
  line-height: 1.85;
  white-space: pre-wrap;
}

/* 三关诊断 */
.gate-dots {
  display: flex;
  gap: 6px;
}
.gate-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line-2);
}
.gate-dots .dot.on {
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.gate-dots .dot.done {
  background: var(--ok);
}

.ask-question {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.7;
  padding: 12px 14px;
  background: var(--primary-soft);
  border-radius: 10px;
}

.flawed-box {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fbf7ec;
  border: 1px dashed #e0cfa8;
  font-size: 13.5px;
  line-height: 1.8;
}
.flawed-tag {
  font-size: 11.5px;
  color: #a07a20;
  font-weight: 600;
  margin-bottom: 4px;
}

/* 导航分组 */
.nav-group {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.08em;
  padding: 7px 10px 2px;
  font-weight: 600;
}
.nav-group:first-child {
  padding-top: 2px;
}
.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  padding: 8px 10px 3px;
}
.nav-group-toggle:hover {
  color: var(--primary-600);
}
.nav-caret {
  font-size: 10px;
  opacity: 0.8;
}

/* 首页 */
.home-pet {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f5f54, #17786a);
  color: #fff;
}
.home-pet .persona-avatar {
  background: rgba(255, 255, 255, 0.18);
}
.home-pet-name {
  font-size: 12px;
  opacity: 0.75;
  margin-bottom: 4px;
}
.home-pet-line {
  font-size: 15px;
  line-height: 1.7;
  font-weight: 600;
}

.next-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.next-tag {
  font-size: 18px;
  font-weight: 700;
  margin: 3px 0;
  color: var(--primary-600);
}

/* 休息横幅 */
.rest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #f4f1ea;
  border: 1px solid #e6dfd0;
  font-size: 13px;
  color: #7a6a45;
}
.rest-banner button {
  border: 1px solid #d8cbaa;
  background: #fff;
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  color: #7a6a45;
}

/* 入门引导（未完成诊断时的整页） */
.onboard {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 80px;
}
.onboard-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.onboard-foot {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

/* 入门诊断闸门：主界面虚化 + 弹窗 */
.blurred {
  filter: blur(6px) saturate(0.9);
  pointer-events: none;
  user-select: none;
}
.gate-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(28, 32, 30, 0.28);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
  overflow: auto;
}
.gate-modal {
  width: min(880px, 96vw);
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 16px;
  padding: 22px 24px 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}
.gate-modal .page-head {
  margin-top: 0;
}
.gate-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 1px dashed var(--line);
  padding-top: 12px;
  margin-top: 8px;
}

.blur-skeleton {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sk-card {
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line);
}
.sk-hero {
  height: 96px;
  background: linear-gradient(135deg, #0f5f54, #17786a);
  opacity: 0.85;
}
.sk-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.sk-lg {
  height: 240px;
}
.sk-wide {
  height: 120px;
}

/* 题目中的图片 */
.q-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 8px 0;
  border-radius: 6px;
  background: #fff;
}

/* 表单校验：出错字段闪一下红框 */
.field-error .input,
.field-error input,
.field-error .captcha {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(214, 69, 56, 0.14);
  animation: field-shake 0.32s ease;
}
@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* 引导句：先给方向，再给答案 */
.guide-line {
  align-self: flex-start;
  max-width: 92%;
  padding: 7px 12px 7px 10px;
  margin-bottom: 2px;
  border-left: 3px solid var(--primary);
  background: linear-gradient(90deg, rgba(23, 120, 106, 0.07), transparent);
  border-radius: 0 8px 8px 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--primary-600);
}
.guide-line::before {
  content: '↳ ';
  opacity: 0.6;
}

/* 思考过程 */
.think {
  margin-bottom: 6px;
  border-left: 2px solid var(--line-2);
  padding-left: 10px;
}
.think summary {
  cursor: pointer;
  font-size: 11.5px;
  color: var(--muted);
  list-style: none;
  user-select: none;
}
.think summary::-webkit-details-marker {
  display: none;
}
.think summary::before {
  content: '▸ ';
}
.think[open] summary::before {
  content: '▾ ';
}
.think-body {
  font-size: 12px;
  line-height: 1.85;
  color: var(--muted);
  white-space: pre-wrap;
  margin-top: 4px;
  max-height: 240px;
  overflow-y: auto;
}

/* 刷题 + AI 侧栏 */
.practice-split {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.practice-main {
  flex: 1;
  min-width: 0;
}
.practice-ai {
  width: 380px;
  flex: none;
  position: sticky;
  top: 16px;
}
.qchat {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  max-height: 720px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.qchat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.qchat-name {
  font-size: 13px;
  font-weight: 650;
}
.qchat-sub {
  font-size: 11px;
  color: var(--muted);
}
.qchat-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.qchat-hint {
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted);
  background: var(--surface-2);
  border-radius: 10px;
  padding: 10px 12px;
}
.qchat-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.qchat-quick .chip {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink-2);
}
.qchat-quick .chip:hover {
  border-color: var(--primary);
  color: var(--primary-600);
}
.qchat-foot {
  display: flex;
  gap: 6px;
  align-items: flex-end;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
}
.qchat-foot .textarea {
  flex: 1;
  min-height: 38px;
  max-height: 90px;
  font-size: 13px;
}
.qchat-foot .mic-btn {
  width: 36px;
  height: 38px;
}

.ai-float {
  position: fixed;
  right: 24px;
  bottom: 96px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 95, 84, 0.28);
  font-family: inherit;
}
.ai-float:hover {
  background: var(--primary-600);
}

body.hide-assistant .chat-fab {
  display: none;
}

@media (max-width: 1180px) {
  .practice-split {
    flex-direction: column;
  }
  .practice-ai {
    width: 100%;
    position: static;
  }
  .qchat {
    height: 60vh;
  }
}

/* 语音 */
.mic-btn {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: 0.15s;
}
.mic-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary-600);
}
.mic-btn.rec {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  animation: mic-pulse 1s ease-in-out infinite;
}
.mic-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(214, 69, 56, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(214, 69, 56, 0); }
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: 0.15s;
}
.speak-btn:hover {
  border-color: var(--primary);
  color: var(--primary-600);
}
.speak-btn.on {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-600);
}

/* 题目反馈 */
.report-box {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}
.report-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.report-link:hover {
  color: var(--danger);
  text-decoration: underline;
}
.report-done {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--ok);
}

/* 知识地图 */
.map-bar {
  height: 10px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.map-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #17786a, #4fb3a0);
  transition: width 0.4s ease;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.map-node {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: 0.15s;
  position: relative;
}
.map-node:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.map-node.fog {
  background: #fafafa;
  color: var(--muted);
  border-style: dashed;
}
.map-node.learned {
  background: #eef7f4;
  border-color: #cfe6df;
}
.map-node.can_use {
  background: var(--primary-soft);
  border-color: #b6d8cf;
}
.map-node.solid {
  background: linear-gradient(135deg, #0f5f54, #17786a);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
}
.map-node.next {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 120, 106, 0.12);
}

.map-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
  background: #d8dcda;
}
.map-dot.learned {
  background: #9ecdc2;
}
.map-dot.can_use {
  background: #4fb3a0;
}
.map-dot.solid {
  background: var(--ok);
}
.map-node.solid .map-dot {
  background: #fff;
}

.map-next-flag {
  margin-left: auto;
  font-style: normal;
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
}

.receipt-chip {
  display: inline-block;
  margin: 4px 0 2px 2px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(20, 120, 90, 0.1);
  color: var(--ok);
  font-size: 11.5px;
  font-weight: 600;
}

/* 灵宠 */
.chat-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 6px 0 2px 2px;
}
.chat-actions .chip {
  white-space: nowrap;
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary-600);
  cursor: pointer;
  font-family: inherit;
}
.chat-actions .chip:hover {
  background: var(--primary-soft);
}
.fab-emoji {
  font-size: 15px;
  line-height: 1;
}
.persona-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #0f5f54, #17786a);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  flex: none;
}
.persona-avatar.sm {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  font-size: 12.5px;
}
.persona-picker {
  padding: 8px 10px 4px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  max-height: 260px;
  overflow: auto;
}
.persona-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--text);
}
.persona-item:hover {
  background: #fff;
  border-color: var(--line-2);
}
.persona-item.on {
  background: #fff;
  border-color: var(--primary);
}
.persona-item b {
  display: block;
  font-size: 13px;
}
.persona-item em {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
}

/* 充值面额选择 */
.tier-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.tier {
  flex: 1;
  min-width: 78px;
  padding: 12px 6px;
  border: 1.5px solid var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  font-family: inherit;
  color: var(--text);
  transition: 0.15s;
}
.tier b {
  font-size: 21px;
  font-weight: 700;
}
.tier span {
  font-size: 11.5px;
  color: var(--muted);
}
.tier:hover {
  border-color: var(--primary-400, #7fb3a8);
}
.tier.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.tier.active b,
.tier.active span {
  color: var(--primary-600);
}

.main {
  min-width: 0;
  padding: 26px 34px 80px;
}
.container {
  max-width: 1120px;
  margin: 0 auto;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-sub {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ------------------------------ 卡片 ------------------------------ */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card-flat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 14.5px;
  font-weight: 650;
}
.card-desc {
  font-size: 12.5px;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 16px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* 常用分栏（移动端自动折行） */
.split {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
}
.split-even {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
}
.split-score {
  display: grid;
  gap: 16px;
  grid-template-columns: auto minmax(0, 1fr);
}
.split-exam {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 216px;
}

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 38px;
  padding: 0 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.13s ease;
  white-space: nowrap;
  user-select: none;
}
.btn:hover {
  border-color: var(--primary);
  color: var(--primary-600);
}
.btn:active {
  transform: translateY(0.5px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
  color: #fff;
}
.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--ink-2);
}
.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--ink);
}
.btn-danger {
  color: var(--danger);
  border-color: #f1c6c2;
}
.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 12.5px;
  border-radius: 7px;
}
.btn-lg {
  height: 46px;
  padding: 0 22px;
  font-size: 15px;
  border-radius: 11px;
}
.btn-block {
  width: 100%;
}
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------ 表单 ------------------------------ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
}
.hint {
  font-size: 11.5px;
  color: var(--muted);
}
.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 9px 11px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.13s ease, box-shadow 0.13s ease;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 95, 84, 0.1);
}
.textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.8;
}
.input-lg {
  height: 44px;
  font-size: 15px;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px;
}
.row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.row > * {
  min-width: 0;
}
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.switch input {
  appearance: none;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--line-2);
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease;
  margin: 0;
  flex: none;
}
.switch input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.switch input:checked {
  background: var(--primary);
}
.switch input:checked::after {
  transform: translateX(16px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}
.chip:hover {
  border-color: var(--primary);
  color: var(--primary-600);
}
.chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.chip-count {
  opacity: 0.6;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ 标签 / 徽章 ------------------------------ */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 550;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag-green {
  background: var(--ok-soft);
  color: var(--ok);
  border-color: #c9e6d8;
}
.tag-red {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f2cdc9;
}
.tag-amber {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: #efdcbd;
}
.tag-blue {
  background: #eaf1f8;
  color: #1d5a8a;
  border-color: #cfe0ef;
}
.tag-plain {
  background: transparent;
}

/* ------------------------------ 数据 ------------------------------ */

.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.stat-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  margin-top: 2px;
}
.stat-value small {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
  letter-spacing: 0;
}
.stat-foot {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.progress {
  height: 7px;
  border-radius: 4px;
  background: var(--bg-soft);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--primary);
  transition: width 0.4s ease;
}
.progress.thin {
  height: 4px;
}
.progress.ok > span {
  background: var(--ok);
}
.progress.warn > span {
  background: var(--warn);
}
.progress.danger > span {
  background: var(--danger);
}

.bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 54px;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 12.5px;
}
.bar-row .name {
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-row .val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  font-weight: 600;
}
.bar-track {
  height: 8px;
  border-radius: 5px;
  background: var(--bg-soft);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 5px;
  background: var(--primary);
  transition: width 0.5s ease;
}

.spark {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 76px;
}
.spark-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 3px;
  align-items: center;
  height: 100%;
}
.spark-bar {
  width: 100%;
  max-width: 26px;
  border-radius: 3px 3px 0 0;
  background: var(--primary-soft);
  min-height: 3px;
  position: relative;
  transition: height 0.4s ease;
}
.spark-bar.b {
  background: var(--primary);
}
.spark-bar.zero {
  background: var(--line);
}
.spark-day {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

/* ------------------------------ 题目 ------------------------------ */

.q-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.q-stem {
  font-size: 15.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  margin-bottom: 16px;
}
.material {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--line-2);
  border-radius: 8px;
  padding: 13px 15px;
  font-size: 13.5px;
  line-height: 1.85;
  white-space: pre-wrap;
  color: var(--ink-2);
  margin-bottom: 16px;
  max-height: 340px;
  overflow-y: auto;
  font-family: var(--serif);
}

.option {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  margin-bottom: 9px;
  cursor: pointer;
  transition: all 0.12s ease;
  background: var(--surface);
}
.option:hover {
  border-color: var(--primary);
  background: #fbfcfb;
}
.option .key {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-2);
  flex: none;
  margin-top: 1px;
  background: var(--surface-2);
}
.option .txt {
  flex: 1;
  line-height: 1.7;
  font-size: 14px;
}
.option.sel {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.option.sel .key {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.option.ok {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.option.ok .key {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}
.option.bad {
  border-color: var(--danger);
  background: var(--danger-soft);
}
.option.bad .key {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.option.disabled {
  cursor: default;
}
.option.disabled:hover {
  background: inherit;
}

.explain {
  margin-top: 16px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 15px 16px;
}
.explain-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 650;
  font-size: 13px;
}
.explain-body {
  font-size: 13.5px;
  line-height: 1.9;
  white-space: pre-wrap;
  color: var(--ink-2);
}

.qnav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.qdot {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  color: var(--ink-2);
}
.qdot.ok {
  background: var(--ok-soft);
  border-color: #bfe0d0;
  color: var(--ok);
  font-weight: 600;
}
.qdot.bad {
  background: var(--danger-soft);
  border-color: #f0c9c5;
  color: var(--danger);
  font-weight: 600;
}
.qdot.cur {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.qdot.done {
  background: var(--surface-2);
}

.timer {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.timer.warn {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: #efdcbd;
}
.timer.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f2cdc9;
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.62;
  }
}

/* ------------------------------ 列表 ------------------------------ */

.list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.list-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color 0.13s ease, box-shadow 0.13s ease;
}
.list-item:hover {
  border-color: var(--line-2);
  box-shadow: var(--shadow);
}
.list-main {
  flex: 1;
  min-width: 0;
}
.list-title {
  font-size: 13.8px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.list-sub {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
  overflow-x: auto;
}
.tab {
  padding: 9px 13px;
  font-size: 13.5px;
  color: var(--muted);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  font-weight: 550;
}
.tab:hover {
  color: var(--ink);
}
.tab.on {
  color: var(--primary-600);
  border-bottom-color: var(--primary);
  font-weight: 650;
}

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--muted);
}
.empty-mark {
  font-size: 30px;
  margin-bottom: 10px;
  opacity: 0.5;
}
.empty-title {
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 600;
  margin-bottom: 4px;
}
.empty-desc {
  font-size: 12.5px;
  max-width: 380px;
  margin: 0 auto 16px;
  line-height: 1.7;
}

/* ------------------------------ 弹层 ------------------------------ */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 26, 30, 0.42);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
  animation: fade 0.15s ease;
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  animation: pop 0.18s ease;
}
.modal-lg {
  max-width: 860px;
}
@keyframes pop {
  from {
    transform: translateY(8px) scale(0.99);
    opacity: 0;
  }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
}
.modal-title {
  font-size: 16.5px;
  font-weight: 700;
}

.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
}
.toast {
  background: #22262b;
  color: #fff;
  padding: 10px 15px;
  border-radius: 9px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.2s ease;
  max-width: 360px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.toast.err {
  background: #8f1d14;
}
.toast.ok {
  background: #0b5c40;
}
@keyframes slideIn {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

/* ------------------------------ 登录 ------------------------------ */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}
.auth-side {
  background: var(--primary);
  color: #eaf1ef;
  padding: 52px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-side::after {
  content: '';
  position: absolute;
  right: -120px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.auth-side::before {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -60px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.auth-brand .brand-mark {
  background: rgba(255, 255, 255, 0.14);
}
.auth-slogan {
  font-size: 30px;
  line-height: 1.55;
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 460px;
  font-family: var(--serif);
}
.auth-slogan em {
  font-style: normal;
  color: #f0c9a8;
}
.auth-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 13.5px;
  color: rgba(234, 241, 239, 0.82);
  max-width: 400px;
}
.auth-point {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.auth-point b {
  color: #fff;
  font-weight: 600;
}
.auth-main {
  display: grid;
  place-items: start center;
  padding: 28px 24px;
  overflow-y: auto;
}
.auth-box {
  width: 100%;
  max-width: 400px;
  margin: auto 0;
}
/* 注册表单字段多，压缩行距，争取一屏放下 */
.auth-box .field {
  margin-bottom: 10px;
}
.auth-box .input-lg {
  height: 42px;
}
.auth-box .auth-title {
  font-size: 21px;
  margin-bottom: 2px;
}
.auth-box .auth-sub {
  margin-bottom: 14px;
}
.auth-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}
.auth-sub {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 26px;
}
/* 校验提示贴在出错字段下面，不用滚回顶部找 */
.field-msg {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--danger);
  display: flex;
  align-items: center;
  gap: 5px;
}
.field-msg::before {
  content: '!';
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  flex: none;
}
.auth-switch {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 18px;
}
.auth-switch button {
  border: none;
  background: none;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  padding: 0 2px;
}
.auth-note {
  margin-top: 22px;
  padding: 11px 13px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11.8px;
  color: var(--muted);
  line-height: 1.7;
}

/* ------------------------------ 其他 ------------------------------ */

.divider {
  height: 1px;
  background: var(--line);
  margin: 18px 0;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.mono {
  font-family: var(--mono);
}
.nowrap {
  white-space: nowrap;
}
.right {
  margin-left: auto;
}
.flex {
  display: flex;
  align-items: center;
  gap: 8px;
}
.flex-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wrap {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.mt-1 {
  margin-top: 6px;
}
.mt-2 {
  margin-top: 12px;
}
.mt-3 {
  margin-top: 18px;
}
.mt-4 {
  margin-top: 26px;
}
.mb-2 {
  margin-bottom: 12px;
}
.hidden {
  display: none !important;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-block {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 13px;
}

.skeleton {
  background: linear-gradient(90deg, #eeece7 25%, #f6f4f0 37%, #eeece7 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--ink-2);
}

.alert {
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 12.8px;
  line-height: 1.7;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
}
.alert-warn {
  background: var(--warn-soft);
  border-color: #efdcbd;
  color: #7a4506;
}
.alert-danger {
  background: var(--danger-soft);
  border-color: #f2cdc9;
  color: #8f1d14;
}
.alert-ok {
  background: var(--ok-soft);
  border-color: #c9e6d8;
  color: #0b5c40;
}

.kv {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 6px 12px;
  font-size: 13px;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  word-break: break-all;
}

.score-ring {
  width: 96px;
  height: 96px;
  flex: none;
}

.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  flex: none;
}
.dot.green {
  background: var(--ok);
}
.dot.red {
  background: var(--danger);
}
.dot.amber {
  background: var(--warn);
}

.seg {
  display: inline-flex;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  overflow: hidden;
  background: var(--surface);
}
.seg button {
  border: none;
  background: none;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink-2);
  border-right: 1px solid var(--line);
}
.seg button:last-child {
  border-right: none;
}
.seg button.on {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.markdown {
  font-size: 13.6px;
  line-height: 1.9;
  white-space: pre-wrap;
  color: var(--ink-2);
}

/* ------------------------------ 图形验证码 ------------------------------ */

.captcha {
  display: flex;
  align-items: center;
  gap: 8px;
}
.captcha-img {
  width: 136px;
  height: 48px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
  flex: none;
  user-select: none;
}
.captcha-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ------------------------------ 随身教练 ------------------------------ */

.chat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  height: 46px;
  padding: 0 18px;
  border-radius: 24px;
  border: none;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(15, 95, 84, 0.28);
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 80;
}
.chat-fab:hover {
  background: var(--primary-600);
  transform: translateY(-1px);
}

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 384px;
  height: min(620px, calc(100vh - 44px));
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 90;
  overflow: hidden;
  animation: pop 0.18s ease;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px 11px 14px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.chat-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.chat-msg.user {
  align-items: flex-end;
}
.chat-msg .bubble {
  max-width: 87%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.78;
  white-space: pre-wrap;
  background: var(--surface-2);
  border: 1px solid var(--line);
  word-break: break-word;
}
.chat-msg.user .bubble {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.chat-msg .bubble.err {
  background: var(--danger-soft);
  border-color: #f2cdc9;
  color: var(--danger);
}
.chat-sugs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.chat-input {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.rest-link {
  align-self: flex-start;
  border: none;
  background: none;
  padding: 0 2px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.rest-link:hover {
  color: var(--primary-600);
  text-decoration: underline;
}
.rest-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.rest-pick .chip {
  border: 1px solid var(--line-2);
  background: #fff;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
}
.rest-pick .chip:hover {
  border-color: var(--primary);
  color: var(--primary-600);
}
.chat-input .textarea {
  min-height: 40px;
  max-height: 120px;
  flex: 1;
  font-size: 13px;
}
.chat-input .btn {
  height: 40px;
  width: 44px;
  padding: 0;
}

@media (max-width: 860px) {
  .chat-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 80vh;
    border-radius: 16px 16px 0 0;
  }
  .chat-fab {
    right: 14px;
    bottom: 14px;
    height: 44px;
    padding: 0 15px;
  }
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 1080px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    gap: 6px;
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar {
    display: none;
  }
  .split,
  .split-even,
  .split-score,
  .split-exam {
    grid-template-columns: 1fr;
  }
  .brand {
    padding: 0 8px 0 2px;
  }
  .brand-sub,
  .brand-name,
  .nav-group,
  .sidebar-foot,
  .nav-badge {
    display: none;
  }
  .nav {
    flex-direction: row;
    overflow: visible;
    gap: 4px;
  }
  .nav-item {
    padding: 7px 10px;
    width: auto;
    white-space: nowrap;
    font-size: 13px;
  }
  .main {
    padding: 18px 16px 70px;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .auth {
    grid-template-columns: 1fr;
  }
  .auth-side {
    display: none;
  }
  .page-title {
    font-size: 20px;
  }
  .toasts {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast {
    max-width: none;
  }
}
