/* ═══════════════════════════════════════════════════════════════
   SDUT英语扶贫办 UI — Trae IDE Workbench Rebuild
   Token architecture sourced from TraeCode Design Library.
   Dark-first (default) + Light theme, brand accent themeable.
   ═══════════════════════════════════════════════════════════════ */

/* ==================== Theme Tokens ==================== */
:root,
html[data-theme="dark"] {
  /* surfaces */
  --bg: #1a1b1d;
  --surface-1: #222427;
  --surface-2: #2a2d31;
  --surface-3: #31353a;
  --overlay-1: rgba(224, 226, 242, 0.04);
  --overlay-2: rgba(224, 226, 242, 0.06);
  --overlay-3: rgba(224, 226, 242, 0.08);
  --overlay-4: rgba(224, 226, 242, 0.12);

  /* text */
  --text-1: #d1d3db;
  --text-2: #9599a6;
  --text-3: #666b75;
  --text-hover: #f5f9fe;
  --on-brand: #0c0c0d;

  /* borders */
  --border-1: rgba(224, 226, 242, 0.1);
  --border-2: rgba(224, 226, 242, 0.16);
  --border-3: rgba(224, 226, 242, 0.2);

  /* brand (JS overrides --accent) */
  --accent: #32f08c;
  --accent-hover: #0fdc78;
  --accent-soft: rgba(50, 240, 140, 0.12);
  --accent-soft-hover: rgba(50, 240, 140, 0.18);

  /* status */
  --danger: #f65a5a;
  --danger-soft: rgba(246, 70, 70, 0.14);
  --ok: #33c192;
  --ok-soft: rgba(0, 165, 110, 0.16);
  --warning: #d27e24;
  --warning-soft: rgba(210, 126, 36, 0.16);
  --info: #387bff;
  --info-soft: rgba(53, 121, 255, 0.18);

  /* selection markers */
  --marker: rgba(50, 240, 140, 0.2);
  --marker-strong: rgba(50, 240, 140, 0.34);

  /* radius — Trae geek hard edges */
  --radius: 6px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-full: 9999px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.25);
  --shadow-pop: 0 8px 32px rgba(0, 0, 0, 0.5);

  --font-sans: "SF Pro Text", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --editor-bg: #17181a;
  --editor-tint: #1c1d20;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f5f5f7;
  --surface-1: #ffffff;
  --surface-2: #f0f0f2;
  --surface-3: #e8e8eb;
  --overlay-1: rgba(0, 0, 0, 0.04);
  --overlay-2: rgba(0, 0, 0, 0.06);
  --overlay-3: rgba(0, 0, 0, 0.08);
  --overlay-4: rgba(0, 0, 0, 0.12);

  --text-1: #1a1b1d;
  --text-2: #6e7280;
  --text-3: #9599a6;
  --text-hover: #0c0c0d;
  --on-brand: #0c0c0d;

  --border-1: rgba(0, 0, 0, 0.08);
  --border-2: rgba(0, 0, 0, 0.12);
  --border-3: rgba(0, 0, 0, 0.16);

  --accent: #32f08c;
  --accent-hover: #0fdc78;
  --accent-soft: rgba(50, 240, 140, 0.12);
  --accent-soft-hover: rgba(50, 240, 140, 0.18);

  --danger: #e03333;
  --danger-soft: #fdecec;
  --ok: #1fa97d;
  --ok-soft: #e9f7f0;
  --warning: #b56a15;
  --warning-soft: #fdf3e4;
  --info: #2f6fe4;
  --info-soft: #e9f0fd;

  --marker: rgba(50, 240, 140, 0.22);
  --marker-strong: rgba(50, 240, 140, 0.36);

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 18px rgba(0, 0, 0, 0.05);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.14);

  --editor-bg: #fbfbfc;
  --editor-tint: #f5f5f7;
  color-scheme: light;
}

/* aliases kept for legacy component code */
:root {
  --ink: var(--text-1);
  --muted: var(--text-2);
  --faint: var(--text-3);
  --card: var(--surface-1);
  --surface-secondary: var(--surface-2);
  --surface-tertiary: var(--surface-3);
  --surface-hover: var(--overlay-2);
  --surface-active: var(--overlay-3);
  --text-onbrand: var(--on-brand);
  --border: var(--border-1);
  --border-strong: var(--border-2);
}

/* ==================== Base ==================== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; } /* 关闭触屏按压时的半透明高亮块 */

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--overlay-3);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--overlay-4); background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: var(--marker-strong); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==================== IDE Shell ==================== */
.ide-app {
  display: grid;
  grid-template-rows: 40px 1fr 24px;
  height: 100vh;
  overflow: hidden;
}

/* ---- Titlebar (40px) ---- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 10px 0 0;
  background: var(--surface-1);
  border-bottom: 1px solid var(--border-1);
  flex-shrink: 0;
  user-select: none;
}

/* App（WebView 壳）内隐藏顶部品牌栏，品牌感由启动图标承担 */
html.in-app .topbar { display: none; }
/* topbar 隐藏后同步收缩 grid 行，避免布局行数错位 */
html.in-app .ide-app { grid-template-rows: 1fr 24px; }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
  height: 100%;
  cursor: default;
}

.logo {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  position: relative;
  flex: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.logo::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%) rotate(-45deg);
  border: 1.5px solid var(--on-brand);
  border-radius: 2px;
}

.brand h1 { margin: 0; font-size: 12px; line-height: 1.2; font-weight: 600; color: var(--text-1); white-space: nowrap; }
.brand .sub { font-size: 11px; color: var(--text-2); font-weight: 400; margin-left: 4px; }
.tagline { display: none; }

/* mode switch — segmented */
.mode-nav {
  display: inline-flex;
  align-items: stretch;
  gap: 0;
  background: var(--overlay-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 2px;
  flex-shrink: 0;
}

.mode-btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
  padding: 0 12px;
  height: 24px;
  border-radius: 3px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
  white-space: nowrap;
}
.mode-btn:hover { color: var(--text-1); background: var(--overlay-2); }
.mode-btn.active {
  background: var(--surface-1);
  color: var(--text-1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  transition: background .12s ease, color .12s ease;
}
.icon-btn:hover { color: var(--text-1); background: var(--overlay-2); }
.icon-btn.active { color: var(--text-1); background: var(--overlay-3); }

/* theme picker — accent dots */
.theme-picker {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  background: var(--overlay-1);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
}
.theme-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform .12s ease, box-shadow .12s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
.theme-dot:hover { transform: scale(1.15); }
.theme-dot.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text-1); }

/* dark/light toggle */
.theme-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text-1);
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, box-shadow .12s;
}
.theme-mode-btn:hover { background: var(--accent-soft-hover); border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.tmb-svg { width: 14px; height: 14px; flex: none; color: var(--accent); }
.tmb-label { font-size: 11px; }

/* Dark/light icon swap */
html[data-theme="dark"] .tmb-svg-dark { display: block; }
html[data-theme="dark"] .tmb-svg-light { display: none; }
html[data-theme="light"] .tmb-svg-dark { display: none; }
html[data-theme="light"] .tmb-svg-light { display: block; }

.xp-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s ease;
}
.xp-chip:hover { background: var(--accent-soft-hover); }

.key-status { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.key-status.ok { color: var(--ok); }
.key-status.missing { color: var(--danger); }

/* ---- Activity Bar ---- */
.ide-body {
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.activity-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 44px;
  padding: 6px 0;
  background: var(--surface-1);
  border-right: 1px solid var(--border-1);
  flex-shrink: 0;
}

.activity-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.activity-btn svg { width: 16px; height: 16px; flex: none; }
.activity-btn:hover { color: var(--text-1); background: var(--overlay-2); }
.activity-btn:hover svg { color: var(--text-1); }
.activity-btn.is-active {
  background: var(--overlay-3);
  color: var(--text-1);
}
.activity-btn.is-active svg { color: var(--accent); }
.activity-btn.is-active::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--accent);
}

.activity-sep {
  width: 22px;
  height: 1px;
  margin: 4px 0;
  background: var(--border-2);
}

.activity-spacer { flex: 1; }

/* ---- Main views ---- */
.ide-main {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.view { display: none; height: 100%; }
.view.active { display: block; }

#view-learn { flex-direction: column; overflow: hidden; }
#view-learn.active { display: flex; }

#view-chat { overflow: hidden; }
#view-chat.active { display: flex; flex-direction: column; }

#view-guided { overflow: hidden; }

/* ---- Status bar (24px) ---- */
.statusbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  background: var(--surface-1);
  border-top: 1px solid var(--border-1);
  font-size: 11px;
  color: var(--text-2);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  user-select: none;
}
.statusbar .sb-brand {
  color: var(--text-3);
  font-weight: 500;
  flex-shrink: 0;
}
.statusbar .sb-brand b { color: var(--accent); font-weight: 600; }
#status-text { overflow: hidden; text-overflow: ellipsis; }

/* ==================== Generic Components ==================== */
.card {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border-1);
}
.card-head h2 { margin: 0; font-size: 12px; font-weight: 600; color: var(--text-1); }

.pill {
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  padding: 2px 9px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}
/* 已学完状态徽标 */
.pill.pill-done {
  color: var(--ok, #2e9e5b);
  background: rgba(46, 158, 91, 0.12);
  border-color: rgba(46, 158, 91, 0.35);
  font-weight: 600;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-1);
  background: var(--overlay-2);
  color: var(--text-1);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 28px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease, opacity .12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--overlay-3); border-color: var(--border-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-brand);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-brand); }

.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--overlay-2); }

.btn-sm { height: 24px; padding: 0 9px; font-size: 11px; }
.btn-lg {
  height: 44px;
  padding: 0 30px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-full);
  box-shadow: 0 8px 24px rgba(50, 240, 140, .28);
}
.btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-brand); }

.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 12px 0 6px;
}

.list-empty { color: var(--text-3); font-size: 12.5px; padding: 20px 4px; line-height: 1.7; }

.mini-tip { font-size: 12px; color: var(--text-3); margin-top: 8px; }
.mini { font-size: 12px; color: var(--text-2); margin: 6px 0 0; }

/* Skeleton */
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin: 8px 0;
}
.skeleton.w80 { height: 14px; width: 80%; }
.skeleton.w60 { height: 12px; width: 60%; }
.skeleton.w100 { height: 12px; width: 100%; }
.skeleton.w70 { height: 48px; width: 100%; border-radius: var(--radius-sm); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%) translateY(16px);
  background: var(--surface-2);
  color: var(--text-1);
  border: 1px solid var(--border-2);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 90;
  max-width: 80vw;
  pointer-events: none;
  box-shadow: var(--shadow-pop);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==================== Annotation Learning ==================== */
.learn-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-1);
  background: var(--surface-1);
  flex-shrink: 0;
}

.tool-group { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.tool-divider { width: 1px; height: 20px; background: var(--border-2); }
.tool-spacer { flex: 1; }

.tool-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  padding: 0 9px;
  height: 26px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .12s ease;
  white-space: nowrap;
}
.tool-btn:hover { color: var(--text-1); background: var(--overlay-2); }
.tool-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-brand); font-weight: 600; }

.swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  padding: 0;
  transition: transform .12s ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--text-1); }

.width-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  padding: 0 8px;
  height: 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.width-btn:hover { color: var(--text-1); background: var(--overlay-2); }
.width-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }

.learn-grid {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.col-left { flex: none; min-width: 0; overflow-y: auto; }
.col-center { flex: 1; display: flex; flex-direction: column; min-width: 200px; min-height: 0; }
.col-right { flex: none; min-width: 260px; display: flex; flex-direction: column; min-height: 0; }

/* 拖拽手柄 */
.col-resize {
  width: 6px; cursor: col-resize; flex: none;
  background: transparent; transition: background .2s;
  position: relative; z-index: 10;
}
.col-resize:hover, .col-resize.active { background: var(--accent); opacity: .4; }

.exercise-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-radius: 0;
  border: none;
  box-shadow: none;
}
.exercise-card .card-head { flex-shrink: 0; }

.hint { margin: 0; padding: 10px 18px 0; font-size: 12px; color: var(--text-2); }
.hint em { font-style: normal; color: var(--accent); font-weight: 600; }

.text-region {
  position: relative;
  flex: 1;
  margin: 12px 14px 14px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  background: var(--editor-bg);
  font-size: 18px;
  line-height: 2;
  letter-spacing: 0.01em;
  text-align: left;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  min-height: 0;
}

#selection-canvas {
  position: absolute;
  inset: 0;
  z-index: 5;
  cursor: crosshair;
  touch-action: none;
}

.word { position: relative; border-radius: var(--radius-sm); transition: background-color .12s ease, opacity .2s ease; cursor: pointer; }
.word:hover { background: var(--accent-soft); }
.word.preview { background: var(--marker); }
/* 新讲解句开始时闪烁提醒（3 次后由 JS 移除类，恢复普通高亮） */
@keyframes sentFlash {
  0%, 100% { background-color: var(--marker); box-shadow: 0 0 0 1px var(--accent); }
  50% { background-color: var(--accent); box-shadow: 0 0 10px 1px var(--accent); }
}
.word.preview.sent-flash { animation: sentFlash .45s ease-in-out 3; }
.word.selected { background: var(--marker-strong); box-shadow: 0 0 0 1px var(--accent-soft); }
/* 拖选过程中的实时预览（松开后转为 selected 保持高亮） */
.word.sel-preview { background: var(--marker-strong); box-shadow: 0 0 0 1px var(--accent); }
/* 被变暗的句子中，学生圈选出的词仍保持高亮清晰可见 */
.word.selected.dim, .word.dim.selected { opacity: 1; }
/* AI 讲解句高亮时，其余单词略微变暗 */
.word.dim { opacity: .28; }
.word.dim:hover { opacity: 1; }
/* 新讲解句开始时闪烁提醒（3 次后由 JS 移除类，恢复普通高亮；颜色随主题色，默认绿） */
@keyframes sentFlash {
  0%, 100% { background-color: transparent; box-shadow: none; }
  50% { background-color: var(--accent); box-shadow: 0 0 12px 2px var(--accent); }
}
.word.sent-flash { animation: sentFlash .45s ease-in-out 3; }

/* ---- Word Lookup Popup ---- */
.word-lookup {
  position: fixed;
  z-index: 100;
  min-width: 240px;
  max-width: 340px;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  padding: 12px 14px;
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-1);
  animation: wl-fade-in .15s ease-out;
}
@keyframes wl-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wl-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-1);
  padding-bottom: 8px;
}
.wl-word {
  font-size: 18px;
  font-weight: 600;
  color: var(--accent);
}
.wl-phonetic {
  font-size: 13px;
  color: var(--text-2);
  font-family: var(--font-mono);
  flex: 1;
}
.wl-speak-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.wl-speak-btn:hover {
  background: var(--accent-soft-hover);
  transform: scale(1.08);
}
.wl-speak-btn:active {
  transform: scale(0.95);
}
.wl-body { }
.wl-loading {
  color: var(--text-3);
  font-size: 12px;
  padding: 4px 0;
}
.wl-def {
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--text-1);
}
.wl-explain {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
  line-height: 1.6;
}
.wl-section {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-top: 8px;
  margin-bottom: 4px;
}
.wl-example {
  margin-bottom: 4px;
  padding-left: 8px;
  border-left: 2px solid var(--accent-soft);
}
.wl-ex-en { font-size: 13px; color: var(--text-1); }
.wl-ex-zh { font-size: 12px; color: var(--text-3); }
.wl-empty { color: var(--text-3); font-size: 12px; }
.wl-error { color: var(--danger); font-size: 12px; }

/* 聊天中可点击查词的英文单词（与普通文字一致，hover 高亮，点击弹卡片） */
.speak-word {
  cursor: pointer;
  border-radius: 3px;
  transition: background 0.15s;
}
.speak-word:hover {
  background: rgba(79, 70, 229, 0.12);
}

/* 单词查询弹窗 */
.word-popup {
  position: fixed;
  z-index: 1000;
  max-width: 320px;
  min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-1);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: auto;
}
.word-popup.show { opacity: 1; transform: translateY(0); }
.wp-loading, .wp-err { color: var(--text-3); font-size: 12px; }
.wp-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.wp-word { font-size: 17px; font-weight: 700; font-family: var(--font-mono); }
.wp-phonetic { color: var(--accent); font-size: 13px; }
.wp-type { font-size: 11px; color: var(--text-3); border: 1px solid var(--border-2); border-radius: 4px; padding: 0 5px; }
.wp-def { margin: 4px 0 6px; font-weight: 600; }
.wp-exp { color: var(--text-2); font-size: 12.5px; margin-bottom: 6px; }
.wp-gram { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.wp-gram-tag { font-size: 11px; background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 1px 6px; }
.wp-exs { border-top: 1px solid var(--border-1); padding-top: 6px; margin-top: 2px; }
.wp-ex { margin: 4px 0; }
.wp-en { display: block; color: var(--text-1); }
.wp-zh { display: block; color: var(--text-3); font-size: 12px; }

/* Text note sticky */
.text-note {
  position: absolute;
  z-index: 7;
  min-width: 130px;
  max-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 13px;
  line-height: 1.5;
  box-shadow: var(--shadow-pop);
  cursor: move;
  color: var(--text-1);
}
.text-note .note-body {
  outline: none;
  min-height: 22px;
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 16px;
  color: var(--text-1);
}
.text-note .note-body:focus { cursor: text; }
.note-del {
  position: absolute;
  top: 2px;
  right: 3px;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  border-radius: 50%;
}
.note-del:hover { background: var(--overlay-3); color: var(--danger); }

/* Sidebar */
.side-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  border: none;
  border-left: 1px solid var(--border-1);
  box-shadow: none;
  background: var(--surface-1);
}

.side-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-1);
  background: var(--surface-1);
  padding: 0 4px;
  flex-shrink: 0;
}
.side-tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 2px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.side-tab span { background: var(--surface-2); border-radius: var(--radius-full); padding: 1px 6px; font-size: 10px; }
.side-tab:hover { color: var(--text-1); }
.side-tab.active { color: var(--text-1); border-bottom-color: var(--accent); }
.side-tab.active span { background: var(--accent-soft); color: var(--accent); }

.side-panel { display: none; padding: 12px; overflow-y: auto; flex: 1; min-height: 0; }
.side-panel.active { display: block; }

/* 内置聊天 */
.chat-card { flex: 1; display: flex; flex-direction: column; border-radius: 0; border: none; border-left: 1px solid var(--border); box-shadow: none; min-height: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.chat-placeholder { color: var(--faint); font-size: 13px; text-align: center; padding: 40px 20px; }
.chat-msg { font-size: 13.5px; line-height: 1.6; padding: 8px 12px; border-radius: 10px; max-width: 90%; }
.chat-msg.user { align-self: flex-end; background: var(--accent-soft); color: var(--text-1); }
.chat-msg.assistant { align-self: flex-start; background: var(--overlay-1); color: var(--text-1); }
.chat-input-row { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--border); }
.chat-input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; outline: none; resize: none; background: var(--bg); color: var(--text-1); font-family: inherit; min-height: 36px; max-height: 100px; }
.chat-input:focus { border-color: var(--accent); }

.ann-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  margin-bottom: 6px;
  background: var(--surface-2);
}
.ann-swatch { width: 14px; height: 14px; border-radius: var(--radius-sm); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.18); }
.ann-info { flex: 1; min-width: 0; }
.ann-tool { font-size: 11px; color: var(--text-3); }
.ann-words {
  font-size: 12px;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Result cards */
.result-card {
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  padding: 14px;
  animation: fadeIn 0.25s ease;
  background: var(--surface-2);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.result-head { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.sel-chip {
  font-weight: 700;
  font-size: 14px;
  background: var(--marker-strong);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  word-break: break-all;
  color: var(--text-1);
}
.type-badge { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: var(--radius-full); white-space: nowrap; margin-top: 4px; }
.type-word { color: #fff; background: #387bff; }
.type-phrase { color: #fff; background: #33c192; }
.type-sentence { color: #fff; background: #d27e24; }
.type-grammar { color: #fff; background: #b655fc; }

.phonetic { font-size: 13px; color: var(--text-2); font-style: italic; margin: 2px 0 6px; }
.definition { font-size: 15px; font-weight: 700; margin: 4px 0 8px; }

.explanation {
  font-size: 13px;
  color: var(--text-1);
  background: var(--surface-1);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  white-space: pre-wrap;
}

.grammar-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.grammar-chip {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-full);
  padding: 2px 8px;
}

.example { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface-1); }
.example .en { font-size: 13px; font-weight: 600; color: var(--text-1); }
.example .zh { font-size: 12px; color: var(--text-2); }

.result-footer { margin-top: 10px; font-size: 11px; color: var(--text-3); display: flex; justify-content: space-between; }

.result-error { border: 1px solid var(--danger-soft); background: var(--danger-soft); border-radius: var(--radius); padding: 14px; }
.result-error h4 { margin: 0 0 6px; color: var(--danger); font-size: 13px; }
.result-error p { margin: 0 0 10px; font-size: 12px; color: var(--danger); white-space: pre-wrap; }

.loading-head { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }

.analyze-point { padding: 6px 8px; border-left: 3px solid var(--border-2); margin: 6px 0; background: var(--surface-1); border-radius: var(--radius-sm); }
.analyze-point .ap-words { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
.analyze-point .ap-interp { font-size: 12px; color: var(--text-2); }
.ap-note {
  display: inline-block;
  margin-left: 6px;
  font-weight: 400;
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-full);
  padding: 1px 7px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.explain-item { margin: 6px 0; padding: 8px 10px; border: 1px solid var(--border-1); border-left: 3px solid var(--danger); border-radius: var(--radius-sm); background: var(--surface-2); }
.explain-item .ex-words { font-size: 12.5px; font-weight: 700; margin-bottom: 4px; color: var(--text-1); }
.explain-item .ex-body { font-size: 12px; color: var(--text-2); white-space: pre-wrap; }

.mem-preview { margin: 6px 0; padding: 8px 10px; border: 1px solid var(--border-1); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--surface-2); }
.mem-preview .mem-term { font-size: 13.5px; font-weight: 800; color: var(--accent); }
.mem-preview .mem-meaning { font-size: 12px; margin-top: 2px; color: var(--text-1); }
.mem-preview .mem-example { font-size: 12px; color: var(--text-2); margin-top: 4px; font-style: italic; }

.memory-card {
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 6px 0;
  background: var(--surface-2);
}
.memory-card .mem-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.memory-card .mem-term { font-size: 14px; font-weight: 800; color: var(--accent); word-break: break-all; }
.memory-card .mem-meaning { font-size: 13px; margin-top: 4px; color: var(--text-1); }
.memory-card .mem-example { font-size: 12px; color: var(--text-2); margin-top: 4px; font-style: italic; }
.memory-card .mem-hint { font-size: 12px; color: var(--warning); background: var(--warning-soft); border-radius: var(--radius-sm); padding: 6px 8px; margin-top: 6px; }

.q-list { margin: 6px 0; padding-left: 20px; font-size: 13px; color: var(--text-1); }
.q-list li { margin: 4px 0; }

/* Annotation popover */
.ann-popover {
  margin-top: 10px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-2);
  box-shadow: var(--shadow-pop);
}
.ann-popover .ann-pop-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ann-popover .ann-pop-head .mini { color: var(--text-3); font-size: 11px; }
.ann-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.ann-preset {
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  color: var(--text-1);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}
.ann-preset.active {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.ann-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  min-height: 44px;
  background: var(--surface-1);
  color: var(--text-1);
}
.ann-input:focus { outline: 2px solid var(--accent-soft); outline-offset: 1px; border-color: var(--accent); }
.ann-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 10px; }

/* ==================== AI Chat ==================== */
.chat-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border-1);
  background: var(--surface-1);
  flex-shrink: 0;
}
.chat-head h2 { margin: 0; font-size: 12px; font-weight: 600; color: var(--text-1); }
.chat-head-actions { display: flex; align-items: center; gap: 8px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-empty { text-align: center; color: var(--text-3); padding: 60px 10px; }
.chat-empty p { margin: 0 0 8px; font-size: 14px; color: var(--text-2); }
.chat-empty .sub { font-size: 12px; }

.msg { display: flex; }
.msg-user { justify-content: flex-end; }
.msg-ai { justify-content: flex-start; }

.bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
}
.msg-user .bubble { background: var(--accent); color: var(--on-brand); border-bottom-right-radius: var(--radius-sm); }
.msg-ai .bubble { background: var(--surface-1); border: 1px solid var(--border-1); border-bottom-left-radius: var(--radius-sm); box-shadow: var(--shadow); }

.bubble-content p { margin: 0.4em 0; }
.bubble-content p:first-child { margin-top: 0; }
.bubble-content p:last-child { margin-bottom: 0; }
.bubble-content h3 { margin: 0.6em 0 0.3em; font-size: 14px; }
.bubble-content pre { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; overflow-x: auto; font-size: 12px; }
.bubble-content code { background: var(--surface-2); border-radius: var(--radius-sm); padding: 1px 5px; font-size: 12px; font-family: var(--font-mono); }
.bubble-content ul { margin: 0.4em 0; padding-left: 20px; }

.msg-refs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.msg-ref {
  font-size: 10px;
  background: var(--marker);
  color: var(--text-1);
  border-radius: var(--radius-sm);
  padding: 1px 7px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-user .msg-ref { background: rgba(12, 12, 13, 0.16); color: var(--on-brand); }

.msg-error .bubble { background: var(--danger-soft); border-color: var(--danger-soft); color: var(--danger); }

/* Composer */
.chat-composer { border-top: 1px solid var(--border-1); background: var(--surface-1); padding: 10px 14px 12px; flex-shrink: 0; }

.ref-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-full);
  padding: 2px 6px 2px 8px;
  max-width: 240px;
}
.ref-chip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-chip-del {
  border: none;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 50%;
}
.ref-chip-del:hover { background: var(--accent-soft-hover); }

.composer-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }

.fmt-group { display: flex; gap: 2px; }
.fmt-btn {
  width: 28px;
  height: 26px;
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-1);
  font-weight: 600;
  font-size: 12px;
}
.fmt-btn:hover { border-color: var(--accent); color: var(--accent); }

.voice-lang {
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 11px;
  background: var(--surface-2);
  color: var(--text-1);
}

.composer-input-wrap { display: flex; gap: 10px; align-items: flex-end; }
.composer-input {
  flex: 1;
  min-height: 42px;
  max-height: 160px;
  overflow-y: auto;
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  line-height: 1.55;
  outline: none;
  background: var(--surface-2);
  cursor: text;
  color: var(--text-1);
}
.composer-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.composer-input:empty::before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; }
.composer-input b, .composer-input i, .composer-input u { font: inherit; }

.send-btn { height: 42px; padding: 0 18px; font-size: 13px; flex: none; }

.composer-hint { min-height: 18px; font-size: 12px; color: var(--accent); margin-top: 6px; }

/* Ref picker */
.ref-picker-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.ref-pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  color: var(--text-1);
  transition: border-color .12s;
}
.ref-pick-item:hover { border-color: var(--accent); }
.ref-pick-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================== Tutor Messages ==================== */
.tut-msg { display: flex; flex-direction: column; max-width: 86%; }
.tut-msg.student { align-self: flex-end; align-items: flex-end; }
.tut-msg.tutor { align-self: flex-start; align-items: flex-start; }
.tut-msg-label { font-size: 10px; color: var(--text-3); margin-bottom: 3px; padding: 0 4px; }
/* 闲聊消息：AI 老师人设互动，独立气泡、轻量样式（区别于教学消息） */
.tut-msg.tut-msg-banter { max-width: 78%; }
.tut-msg-banter .tut-msg-body {
  font-style: italic;
  color: var(--text-2);
  background: var(--surface-3, var(--surface-2));
  border-style: dashed;
  border-color: var(--border-2);
  opacity: .92;
}
.tut-msg-banter .banter-tag {
  font-style: normal;
  font-weight: 600;
  font-size: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 1px 6px;
  margin-right: 4px;
  vertical-align: 1px;
}
/* 表情包消息：AI 老师主动发的 emoji 表情，大号居中展示 */
.tut-msg.tut-msg-sticker { max-width: 55%; }
.tut-msg-sticker .tut-msg-body {
  font-size: 34px;
  line-height: 1.3;
  text-align: center;
  padding: 6px 16px;
  background: var(--surface-3, var(--surface-2));
  border-style: dashed;
  border-color: var(--border-2);
}
.tut-msg-body {
  font-size: 13px;
  line-height: 1.6;
  padding: 9px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  color: var(--text-1);
}
.tut-msg.student .tut-msg-body { background: var(--accent); border-color: var(--accent); color: var(--on-brand); border-top-right-radius: var(--radius-sm); }
.tut-msg.tutor .tut-msg-body { background: var(--surface-2); border-color: var(--border-1); border-top-left-radius: var(--radius-sm); }
.tut-msg-body p { margin: 6px 0 0; }
.tut-msg-body p:first-child { margin-top: 0; }
.tut-msg-body ul,.tut-msg-body ol { margin: 6px 0; padding-left: 20px; }
.tut-msg-body li { margin: 3px 0; line-height: 1.7; }
.tut-msg-body li::marker { color: var(--accent); }
.tut-msg-body h3 { font-size: 14px; font-weight: 700; margin: 12px 0 4px; color: var(--text-1); }
.tut-msg-body h4 { font-size: 13px; font-weight: 700; margin: 9px 0 3px; color: var(--text-1); }
.tut-msg-body blockquote { margin: 8px 0; padding: 6px 12px; border-left: 3px solid var(--accent); background: var(--surface-1); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-2); font-size: 12.5px; }
.tut-msg-body strong { color: var(--text-1); }
.tut-msg-body pre { margin: 8px 0; padding: 8px 10px; background: var(--surface-1); border: 1px solid var(--border-1); border-radius: var(--radius-sm); overflow-x: auto; font-size: 12px; font-family: var(--font-mono); }
.tut-msg-body .speak-word { color: inherit; }
.tut-msg-body code { background: var(--surface-1); border: 1px solid var(--border-1); border-radius: var(--radius-sm); padding: 1px 5px; font-size: 12px; font-family: var(--font-mono); }
.tut-msg-body em { color: var(--accent); }
.tut-msg-body a { color: var(--accent); }
.thought-msg .tut-msg-body { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); font-size: 12px; padding: 6px 10px; border-radius: var(--radius); }
.tut-input-row { display: flex; gap: 10px; padding: 12px 16px; }
.tut-input {
  flex: 1;
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13px;
  outline: none;
  background: var(--surface-2);
  color: var(--text-1);
  transition: border-color .12s;
}
.tut-input::placeholder { color: var(--text-3); }
.tut-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tut-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 4px 0; }
.tut-ok-badge { font-size: 12px; font-weight: 600; color: var(--ok); background: var(--ok-soft); border: 1px solid var(--ok-soft); border-radius: var(--radius-full); padding: 6px 12px; }
.tut-rec { background: var(--surface-2); border: 1px solid var(--border-1); border-radius: var(--radius); padding: 12px 16px; font-size: 13px; color: var(--text-1); line-height: 1.7; }

/* ==================== AI Thinking Loading — centered premium ring ==================== */
.ai-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 0;
}
.ai-loading-ring {
  position: relative;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-loading-ring::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--border-1);
}
.ai-loading-ring::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: ai-spin 0.8s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}
.ai-loading-glow {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, var(--accent-soft) 25%, transparent 60%);
  opacity: 0.5;
  animation: ai-glow 2.2s ease-in-out infinite;
}
@keyframes ai-glow {
  0%, 100% { opacity: 0.3; transform: scale(0.95); }
  50% { opacity: 0.7; transform: scale(1.08); }
}
.ai-loading-inner {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-soft-hover), 0 0 24px var(--accent-soft);
  animation: ai-dot 1.6s ease-in-out infinite;
}
@keyframes ai-dot {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.4); opacity: 1; }
}
.ai-loading-text {
  margin-top: 22px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  letter-spacing: 0.05em;
  display: flex;
  gap: 0;
}
.ai-loading-text span {
  display: inline-block;
  animation: ai-text-wave 1.8s ease-in-out infinite;
}
.ai-loading-text span:nth-child(1) { animation-delay: 0s; }
.ai-loading-text span:nth-child(2) { animation-delay: 0.1s; }
.ai-loading-text span:nth-child(3) { animation-delay: 0.2s; }
.ai-loading-text span:nth-child(4) { animation-delay: 0.3s; }
.ai-loading-text span:nth-child(5) { animation-delay: 0.4s; }
.ai-loading-text span:nth-child(6) { animation-delay: 0.5s; }
.ai-loading-text span:nth-child(7) { animation-delay: 0.6s; }
.ai-loading-text span:nth-child(8) { animation-delay: 0.7s; }
@keyframes ai-text-wave {
  0%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
  60% { opacity: 0.35; transform: translateY(0); }
}
@keyframes ai-spin {
  to { transform: rotate(360deg); }
}

/* ==================== Plan Loading — premium stage-based progress ==================== */
.plan-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 20px 36px;
  gap: 0;
}

.plan-loading-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.plan-loading-spinner {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.plan-loading-spinner::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--border-1);
}
.plan-loading-spinner::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  animation: plan-spin 0.7s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
}
@keyframes plan-spin {
  to { transform: rotate(360deg); }
}
.plan-loading-glow {
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft) 0%, var(--accent-soft) 20%, transparent 55%);
  opacity: 0.45;
  animation: plan-glow 2s ease-in-out infinite;
}
@keyframes plan-glow {
  0%, 100% { opacity: 0.25; transform: scale(0.92); }
  50% { opacity: 0.6; transform: scale(1.06); }
}
.plan-loading-dot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-soft-hover), 0 0 20px var(--accent-soft);
  z-index: 1;
  animation: plan-dot 1.4s ease-in-out infinite;
}
@keyframes plan-dot {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
}

.plan-loading-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}

.plan-stages {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  max-width: 300px;
}

.plan-stage {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: background .3s, opacity .3s;
  opacity: 0.35;
}
.plan-stage.active {
  opacity: 1;
  background: var(--accent-soft);
}
.plan-stage.done {
  opacity: 0.7;
}

.plan-stage-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all .35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* pending state */
.plan-stage .plan-stage-icon {
  border: 1.5px solid var(--border-2);
  background: transparent;
  color: transparent;
}

/* active state — pulsing ring */
.plan-stage.active .plan-stage-icon {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 12px var(--accent-soft-hover);
  animation: stage-pulse 1.4s ease-in-out infinite;
}
@keyframes stage-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--accent-soft); }
  50% { box-shadow: 0 0 0 8px var(--accent-soft), 0 0 16px var(--accent-soft-hover); }
}

/* done state — checkmark */
.plan-stage.done .plan-stage-icon {
  border-color: var(--ok);
  background: var(--ok);
  box-shadow: none;
  animation: none;
  color: #fff;
}

.plan-stage-label {
  font-size: 13px;
  color: var(--text-2);
  transition: color .3s;
}
.plan-stage.active .plan-stage-label {
  color: var(--text-1);
  font-weight: 500;
}
.plan-stage.done .plan-stage-label {
  color: var(--text-2);
}

.plan-loading-status {
  margin-top: 20px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.03em;
  animation: plan-status-fade 1.8s ease-in-out infinite;
}
@keyframes plan-status-fade {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}

/* Q&A separator (自由提问分隔线) */
.qa-separator {
  display: flex; align-items: center; gap: 10px;
  margin: 16px 0 8px; padding: 0 4px;
  color: var(--text-3); font-size: 11px;
}
.qa-separator::before, .qa-separator::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border-1);
}
.qa-msg { opacity: 0.85; }
.qa-msg .tut-msg-body { font-size: 13px; }

/* Start screen */
.start-screen {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center; gap: 26px;
  height: 100%; min-height: 320px;
}
.start-hero {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.start-icon {
  width: 76px; height: 76px;
  display: flex; align-items: center; justify-content: center;
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-soft-hover));
  border: 1px solid rgba(50, 240, 140, .28);
  border-radius: 22px;
  box-shadow: 0 0 0 8px var(--accent-soft), 0 14px 36px rgba(0, 0, 0, .16);
}
.start-title {
  font-size: 22px; font-weight: 800; letter-spacing: -.02em;
  color: var(--text-1); margin: 4px 0 0;
}
.start-desc {
  color: var(--text-2); font-size: 13.5px; line-height: 1.7;
  max-width: 380px; margin: 0;
}
.start-config {
  width: 100%; max-width: 400px; text-align: left;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
}
.start-config-hd {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  letter-spacing: .08em; margin-bottom: 10px;
}
.start-config-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.start-cfg-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
}
.start-cfg-label { font-size: 11px; color: var(--text-3); }
.start-cfg-value { font-size: 13px; font-weight: 600; color: var(--text-1); line-height: 1.35; }

/* Exam & mode picker (个人中心复用) */
.exam-pick-cards { display: flex; flex-direction: column; gap: 6px; }
.exam-pick-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 12px; border-radius: var(--radius);
  background: var(--surface-1); border: 1px solid var(--border-2);
  color: var(--text-1); cursor: pointer; text-align: left;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.exam-pick-card:hover { border-color: var(--accent); }
.exam-pick-card.active { border-color: var(--accent); background: var(--overlay-2); box-shadow: 0 0 0 1px var(--accent); }
.exam-pick-label { font-size: 14px; font-weight: 700; }
.exam-pick-sub { font-size: 12px; color: var(--text-2); }
.exam-pick-card.active .exam-pick-sub { color: var(--text-1); }

/* Exercises */
.exercise-block { margin: 8px 0; background: var(--surface-1); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 14px 16px; }
.ex-q { margin-bottom: 12px; } .ex-q:last-child { margin-bottom: 0; }
.ex-q-text { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.ex-opts { display: flex; flex-direction: column; gap: 5px; padding-left: 4px; }
.ex-opt { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-1); cursor: pointer; padding: 5px 8px; border-radius: var(--radius-sm); transition: background .12s; }
.ex-opt:hover { background: var(--overlay-2); } .ex-opt input { margin: 0; accent-color: var(--accent); }
.ex-input { width: 100%; border: 1px solid var(--border-1); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; outline: none; resize: vertical; background: var(--surface-2); color: var(--text-1); }
.ex-input:focus { border-color: var(--accent); }
.ex-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.ex-result { font-size: 13px; font-weight: 600; } .ex-result.ex-ok { color: var(--ok); } .ex-result.ex-partial { color: var(--warning); }
.ex-feedback { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-1); }
.ex-fb-hint { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.ex-fb-content { font-size: 13px; color: var(--text-1); line-height: 1.7; }
.ex-fb-content p { margin: 6px 0; }

/* ASK block */
.ask-block { margin: 8px 0; background: var(--surface-1); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 14px 16px; }
.ask-q { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 10px; }
.ask-opts { display: flex; flex-direction: column; gap: 5px; padding-left: 4px; }
.ask-opt { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-1); cursor: pointer; padding: 7px 10px; border-radius: var(--radius-sm); transition: background .12s; }
.ask-opt:hover { background: var(--overlay-2); }
.ask-opt input { margin: 0; accent-color: var(--accent); }
.ask-input { width: 100%; border: 1px solid var(--border-1); border-radius: var(--radius-sm); padding: 8px 10px; font-size: 12px; outline: none; resize: vertical; background: var(--surface-2); color: var(--text-1); font-family: inherit; }
.ask-input:focus { border-color: var(--accent); }
.ask-actions { margin-top: 10px; display: flex; gap: 8px; }
.ask-opts-inline { display: flex; gap: 6px; margin-top: 6px; }
.ask-quick { white-space: nowrap; }
.ask-done { opacity: .6; pointer-events: none; }
.ask-chosen { background: var(--accent-soft); border-color: var(--accent); border-radius: 8px; }

/* ==================== Modals ==================== */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(10, 11, 12, 0.6);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }

.modal {
  width: 100%;
  max-width: 460px;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pop);
  padding: 20px;
  max-height: 86vh;
  overflow-y: auto;
}
.modal h3 { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--text-1); }
.modal-tip { margin: 0 0 16px; font-size: 12px; color: var(--text-2); line-height: 1.6; }
.modal label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-1); }
.modal input[type="password"] {
  width: 100%;
  padding: 9px 11px;
  font-size: 13px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface-2);
  color: var(--text-1);
  transition: border-color .12s, box-shadow .12s;
}
.modal input[type="password"]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.modal input[type="password"]::placeholder { color: var(--text-3); }
.modal-hint { margin-top: 8px; font-size: 12px; min-height: 18px; color: var(--text-2); }
.modal-hint.ok { color: var(--ok); }
.modal-hint.error { color: var(--danger, #ef4444); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }

/* ==================== Guided Learning — IDE Three-Column ==================== */
#guided-root { height: 100%; overflow: hidden; }
.g3-wrap {
  display: flex;
  gap: 0;
  align-items: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.g3-col {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 180px;
  max-width: 45vw;
  overflow: hidden;
}
.g3-col.g3-left { width: 220px; flex: none; background: var(--surface-1); }
.g3-col.g3-main { flex: 1; min-width: 320px; max-width: none; background: var(--bg); }
.g3-col.g3-right { width: 380px; flex: none; background: var(--surface-1); border-left: 1px solid var(--border-1); }

.g3-resizer {
  width: 6px;
  cursor: col-resize;
  position: relative;
  z-index: 10;
  flex: none;
  background: transparent;
  transition: background .12s ease;
}
.g3-resizer:hover,
.g3-resizer.dragging { background: var(--accent-soft); }
.g3-resizer::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--border-2);
  transition: background .12s ease;
}
.g3-resizer:hover::after,
.g3-resizer.dragging::after { background: var(--accent); }

.g3-left { display: flex; flex-direction: column; }
.g3-right { display: flex; flex-direction: column; }
.g3-main { display: flex; flex-direction: column; min-width: 0; }

.g3-card {
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  margin: 10px 12px;
}
.g3-card-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-1);
  color: var(--text-2);
  background: var(--surface-1);
  flex: none;
  letter-spacing: 0.02em;
}
.g3-logo {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  padding: 14px 16px 10px;
  letter-spacing: -.01em;
  flex: none;
}
.g3-progress-card { text-align: center; padding: 12px 12px 10px; flex: none; }
.g3-stat-row { font-size: 24px; font-weight: 700; color: var(--text-1); }
.g3-stat-row .g3-stat-div { color: var(--border-3); margin: 0 2px; font-weight: 400; }
.g3-stat-label { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 4px; }
.g3-xp { font-size: 10px; color: var(--text-3); margin-top: 4px; }
.g3-bar { height: 4px; background: var(--surface-3); margin: 8px 0 0; border-radius: var(--radius-full); overflow: hidden; }
.g3-bar-fill { height: 100%; background: var(--accent); border-radius: var(--radius-full); transition: width .4s; }
.g3-steps-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.g3-steps-card .g3-card-hd { border: none; padding-bottom: 4px; background: transparent; }
.g3-steps { list-style: none; margin: 0; padding: 0 14px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.g3-step { display: flex; align-items: center; gap: 7px; font-size: 11.5px; padding: 5px 0; color: var(--text-3); transition: color .12s; }
.g3-step.done { color: var(--ok); }
.g3-step.active { color: var(--accent); font-weight: 600; }
.g3-step-mark { flex: none; width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; }
.g3-mark-pending .g3-step-mark::after { content: ""; display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--border-2); }
.g3-mark-active .g3-step-mark::after { content: ""; display: block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-soft-hover); }
.g3-mark-done .g3-step-mark::after { content: "\2713"; display: block; color: var(--ok); font-size: 12px; font-weight: 700; line-height: 1; }
.g3-step-clickable { cursor: pointer; }
.g3-step-clickable:hover { color: var(--text-1); }
.g3-step.muted { color: var(--text-3); }
.g3-step-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g3-step-relearn {
  flex: none;
  font-size: 10px;
  color: var(--text-3);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 1px 7px;
  opacity: 0;
  transition: opacity .12s, color .12s, border-color .12s;
  cursor: pointer;
}
.g3-step:hover .g3-step-relearn,
.g3-step-relearn:focus-visible { opacity: 1; }
.g3-step-relearn:hover { color: var(--accent); border-color: var(--border-2); background: var(--overlay-2); }
.g3-step.active .g3-step-relearn { color: var(--accent); }
.g3-badge {
  font-size: 10px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-1);
  margin-left: auto;
}
.g3-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 12px; }
.g3-tag {
  font-size: 10px;
  color: var(--text-2);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}
.g3-chip {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius-full);
  padding: 2px 8px;
}
/* 词汇银行词条：可点击朗读 */
.g3-chip-word {
  cursor: pointer;
  transition: all .15s;
}
.g3-chip-word:hover {
  color: var(--on-brand);
  background: var(--accent);
  border-color: var(--accent);
}
.g3-passage-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* 引用条 */
.gd-ref-bar {
  padding: 4px 8px;
  background: var(--surface-2);
  border-top: 1px solid var(--border-1);
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.gd-ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 8px;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-1);
}
.gd-ref-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 300px;
}
.gd-ref-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  color: var(--text-2, #999);
  padding: 0;
}
.gd-ref-close:hover { color: var(--danger, #ef4444); }

/* 引导学习 - 文章容器 */
.g3-passage-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.g3-passage {
  padding: 16px 18px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-1);
  background: var(--editor-bg);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  -webkit-user-select: none;
  user-select: none; /* 圈选改自定义拖选，禁用原生文字选择避免双重选中 */
  cursor: pointer;
  height: 100%;
  box-sizing: border-box;
}
.g3-chat-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  margin: 0;
  border: none;
  border-radius: 0;
}
.g3-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  overflow-y: auto;
  background: var(--bg);
  border-top: 1px solid var(--border-1);
  border-bottom: 1px solid var(--border-1);
  min-height: 0;
}
.g3-input-row { display: flex; gap: 8px; padding: 10px 12px; flex: none; background: var(--surface-1); }
.g3-input {
  flex: 1;
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  padding: 8px 11px;
  font-size: 13px;
  outline: none;
  background: var(--surface-2);
  color: var(--text-1);
}
.g3-input::placeholder { color: var(--text-3); }
.g3-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.g3-done-actions { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 0; }
.tut-stall { font-size: 11px; color: var(--warning); background: var(--warning-soft); border: 1px solid var(--warning-soft); border-radius: var(--radius-full); padding: 4px 10px; }

/* 移动端引导学习专用控件：桌面端一律隐藏 */
.g3-ai-fab, .g3-chat-collapse, .gd-fs-btn, .g3-plan-mb-hd { display: none; }
/* 移动端计划弹窗的内容包裹层：桌面端不参与布局 */
.g3-plan-body { display: contents; }
.g3-backdrop { position: fixed; inset: 0; z-index: 78; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s ease; }

/* ==================== Responsive ==================== */
@media (max-width: 1020px) {
  .learn-grid { grid-template-columns: 1fr; }
  .col-side { display: none; }
  #view-guided { overflow-y: auto; } /* 窄屏纵向堆叠后聊天区排在最下方，允许滚动到达，避免被裁剪在视口外 */
  #guided-root { height: auto; overflow: visible; }
  .g3-wrap { flex-direction: column; height: auto; min-height: 0; overflow: visible; }
  .g3-col { width: 100% !important; max-width: none; min-width: auto; }
  .g3-col.g3-main { min-height: 420px; }
  .g3-resizer { display: none; }
  .g3-chat-card { height: 520px; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 8px 0 0; gap: 8px; }
  .brand { padding: 0 8px; }
  .brand .sub { display: none; }
  .mode-btn { padding: 0 8px; }
  .theme-picker { display: none; }
  .topbar-right { gap: 5px; }
  .xp-chip { padding: 0 8px; }
  .key-status { display: none; }
  .activity-bar { width: 38px; }
  .learn-toolbar { padding: 8px; }
  .hint { padding: 10px 12px 0; }
  .text-region { margin: 10px 8px 12px; font-size: 17px; padding: 18px 16px 20px; }
}

/* ==================== Auth / User Chip ==================== */
.user-chip-slot { display: inline-flex; align-items: center; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-1);
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.user-chip:hover { background: var(--surface-3); border-color: var(--accent); }

.user-chip .avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c5cff);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.user-chip .username { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.user-chip-login {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .12s;
}
.user-chip-login:hover { opacity: .85; }

/* ==================== Auth Modal ==================== */
.auth-modal { max-width: 400px; }
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-1);
}
.auth-tab {
  flex: 1;
  padding: 10px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.auth-tab.active {
  color: var(--text-1);
  border-bottom-color: var(--accent);
}
.auth-tab:hover:not(.active) { color: var(--text-2); }

.auth-form { display: flex; flex-direction: column; gap: 12px; }
.auth-form label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-1); }
.auth-form input {
  width: 100%;
  padding: 9px 11px;
  font-size: 13px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface-2);
  color: var(--text-1);
  transition: border-color .12s, box-shadow .12s;
}
.auth-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-form .auth-hint { font-size: 12px; min-height: 18px; color: var(--text-2); margin-top: -4px; }
.auth-form .auth-hint.error { color: var(--danger); }
.auth-form .auth-hint.success { color: var(--ok); }

.auth-submit {
  width: 100%;
  padding: 10px;
  margin-top: 4px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .12s, transform .06s;
}
.auth-submit:hover { opacity: .9; }
.auth-submit:active { transform: scale(0.98); }
.auth-submit:disabled { opacity: .5; cursor: not-allowed; }

/* ==================== Passage Panel ==================== */
/* ==================== 题库页 ==================== */
.passage-panel {
  width: 100%;
  height: 100%;
}
.tb {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2px 22px 22px;
}
.tb-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 2px 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tb-empty { padding: 44px 0; text-align: center; color: var(--text-3); font-size: 13px; }
.tb-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.tb-card:hover {
  border-color: var(--accent);
  background: var(--overlay-2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
}
.tb-card-main { flex: 1; min-width: 0; }
.tb-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
}
.tb-card-preview {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-card-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.tb-tags { display: flex; gap: 6px; }
.tb-tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 500; }
.tb-tag-grade { background: var(--accent-soft); color: var(--accent); }
.tb-tag-diff { background: var(--surface-3); color: var(--text-2); }
.tb-go { font-size: 12px; color: var(--accent); opacity: 0; transition: opacity .12s; }
.tb-card:hover .tb-go { opacity: 1; }
.tb-badge { font-size: 10px; padding: 1px 7px; border-radius: 999px; font-weight: 600; flex: none; }
.tb-badge-preset { background: var(--surface-3); color: var(--text-2); }
.tb-badge-user { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 720px) {
  .tb-card { flex-direction: column; align-items: flex-start; }
  .tb-card-side { align-items: flex-start; flex-direction: row; width: 100%; justify-content: space-between; }
  .tb-go { opacity: 1; }
}
/* ==================== 上传文章弹窗（我的资料库） ==================== */
.upload-modal { max-width: 560px; }
.up-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
}
.up-tab {
  flex: 1;
  padding: 8px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  background: transparent;
  border: none;
  border-radius: calc(var(--radius) - 3px);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.up-tab:hover { color: var(--text-1); }
.up-tab.active {
  color: var(--text-1);
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--border-2);
}
.up-pane { display: flex; flex-direction: column; }
.up-pane[hidden] { display: none; }
.up-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--text-1);
}
.up-pane > .up-label ~ .up-label { margin-top: 14px; }
.up-text {
  width: 100%;
  min-height: 140px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .12s, box-shadow .12s;
}
.up-text:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.up-text::placeholder { color: var(--text-3); }
.up-photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.up-file-btn { cursor: pointer; }
.up-img-preview {
  margin-top: 10px;
  max-height: 200px;
  overflow: hidden;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.up-img-preview img { max-width: 100%; max-height: 200px; object-fit: contain; display: block; margin: 0 auto; }
.up-ocr-status {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}
.up-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.up-input {
  width: 100%;
  min-width: 0;
  padding: 9px 11px;
  font-size: 12.5px;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .12s, box-shadow .12s;
}
.up-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.up-input::placeholder { color: var(--text-3); }

/* ==================== User Menu Dropdown ==================== */
.user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--surface-1);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 6px;
  z-index: 100;
}
.user-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-1);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .12s;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
}
.user-menu-item:hover { background: var(--surface-3); }
.user-menu-item.danger { color: var(--danger); }
.user-menu-divider { height: 1px; background: var(--border-1); margin: 4px 0; }

/* ==================== 新导航：图标 + 文字 ==================== */
.activity-bar { width: 68px; }
.activity-btn {
  width: 60px;
  height: 50px;
  flex-direction: column;
  gap: 3px;
  padding: 6px 2px;
}
.activity-btn svg { margin: 0; }
.nav-text {
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-3);
  white-space: nowrap;
  transition: color .12s;
}
.activity-btn:hover .nav-text,
.activity-btn.is-active .nav-text { color: var(--accent); }
.activity-btn.is-active::before { left: -4px; }

/* ==================== 页面头部（我的题目 / 个人中心） ==================== */
.page-head { padding: 18px 22px 2px; }
.page-head h2 { margin: 0; font-size: 18px; font-weight: 700; color: var(--text-1); }
.page-tip { margin: 6px 0 0; font-size: 12px; color: var(--text-2); }

/* ==================== 个人中心 ==================== */
.profile-root,
.mypassages-root {
  height: 100%;
  overflow-y: auto;
}

.pf-wrap {
  height: 100%;
  overflow-y: auto;
  padding: 6px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 用户名片 */
.pf-user {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--surface-1), var(--surface-2));
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}
.pf-user::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 120px at 88% 0%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.pf-user-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}
.pf-avatar {
  width: 58px; height: 58px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  color: var(--accent);
  font-size: 24px; font-weight: 800;
  box-shadow: 0 0 0 6px var(--accent-soft);
}
.pf-user-main { flex: 1; min-width: 0; }
.pf-name { font-size: 17px; font-weight: 700; color: var(--text-1); }
.pf-bio { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.pf-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--border-1);
  padding-top: 16px;
}
.pf-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.pf-stat b { font-size: 17px; font-weight: 700; color: var(--text-1); font-variant-numeric: tabular-nums; }
.pf-stat span { font-size: 11px; color: var(--text-3); }
.pf-actions { position: relative; z-index: 1; flex: none; }

/* 卡片网格 */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.pf-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  transition: border-color .12s, box-shadow .12s;
}
.pf-card:hover { border-color: var(--border-2); }
.pf-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.pf-card-sub { margin-left: auto; font-size: 11px; color: var(--text-3); flex: none; }
.pf-icon {
  flex: none;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
}
.pf-icon svg { display: block; }
.pf-card-head h3 { margin: 0; font-size: 14px; font-weight: 700; color: var(--text-1); }
.pf-span-2 { grid-column: span 2; }
.pf-exam-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pf-sub {
  margin: 12px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.pf-sub:first-of-type { margin-top: 0; }
.pf-hint { margin: 12px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.pf-tip { margin: 0 0 10px; font-size: 12px; color: var(--text-3); line-height: 1.6; }

@media (max-width: 820px) {
  .pf-user-top { flex-wrap: wrap; }
  .pf-user-top .pf-actions { margin-left: auto; }
}
@media (max-width: 700px) {
  .pf-grid { grid-template-columns: 1fr; }
  .pf-span-2 { grid-column: span 1; }
}

/* 签到 / 外观 功能卡（内容居中） */
.checkin-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  width: 100%;
}
.checkin-box .pf-tip { margin: 0; }
.checkin-info { font-size: 12px; color: var(--text-2); }
.pf-theme-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.pf-theme-box .theme-picker { padding: 8px 12px; }
.theme-mode-row { margin-top: 12px; }

#api-key-input {
  width: 100%;
  padding: 9px 11px;
  font-size: 13px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface-2);
  color: var(--text-1);
  transition: border-color .12s, box-shadow .12s;
}
#api-key-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
#api-key-input::placeholder { color: var(--text-3); }
.api-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.api-key-row .key-status { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.key-status.warn { color: var(--warning); }

/* ==================== 我的学习 ==================== */
.mp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  padding: 6px 22px 24px;
}
.mp-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-md);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.mp-card:hover { border-color: var(--border-2); box-shadow: 0 6px 20px rgba(0, 0, 0, .10); transform: translateY(-1px); }
.mp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.mp-headline { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.mp-grade {
  align-self: flex-start;
  font-size: 10px; font-weight: 600; letter-spacing: .03em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px; padding: 2px 9px;
}
.mp-title { font-size: 14.5px; font-weight: 700; color: var(--text-1); line-height: 1.45; }
.mp-status {
  flex: none;
  font-size: 11px; font-weight: 600;
  border-radius: 999px; padding: 4px 11px;
  white-space: nowrap;
}
.mp-status.mp-done { color: var(--ok); background: var(--ok-soft); border: 1px solid rgba(0, 165, 110, .3); }
.mp-status.mp-ing { color: var(--info); background: var(--info-soft); border: 1px solid transparent; }
.mp-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.mp-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transition: width .3s ease;
}
.mp-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.mp-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--border-1);
}
.mp-actions-left { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mp-del { color: var(--danger); }
.mp-loading { padding: 22px; font-size: 12px; color: var(--text-3); }

/* 互动记录弹窗 */
.logs-modal { max-width: 560px; }
.logs-list { display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; padding: 2px; }

/* 学习总结笔记弹窗 */
.notes-modal { max-width: 640px; }
.notes-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 2px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--text-1);
}
.notes-body h2, .notes-body h3 {
  margin: 12px 0 6px;
  font-weight: 600;
  color: var(--text-1);
}
.notes-body h2 { font-size: 15px; padding-bottom: 4px; border-bottom: 1px solid var(--border-1); }
.notes-body h3 { font-size: 13px; }
.notes-body p { margin: 6px 0; }
.notes-body ul, .notes-body ol { margin: 6px 0; padding-left: 20px; }
.notes-body li { margin: 3px 0; }
.notes-body strong { color: var(--accent); }
.notes-body code {
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: 4px;
  padding: 0 4px;
  font-size: 12px;
}
.notes-body blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--text-2);
}
.notes-body hr { border: none; border-top: 1px solid var(--border-1); margin: 10px 0; }
.tut-sub { margin-top: 6px; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.logs-item {
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  background: var(--surface-2);
}
.logs-item.logs-user { border-left: 3px solid var(--accent); }
.logs-item.logs-ai { border-left: 3px solid var(--text-3); }
.logs-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.logs-role { font-size: 11px; font-weight: 600; color: var(--accent); }
.logs-item.logs-ai .logs-role { color: var(--text-2); }
.logs-step {
  font-size: 10px; color: var(--text-3);
  background: var(--accent-soft);
  border-radius: 999px; padding: 1px 8px;
  max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.logs-time { margin-left: auto; font-size: 10px; color: var(--text-3); flex: none; }
.logs-body {
  font-size: 12.5px; line-height: 1.65; color: var(--text-1);
  white-space: pre-wrap; word-break: break-word;
  max-height: 130px; overflow-y: auto;
}
.empty-card {
  margin: 14px 22px;
  padding: 30px 22px;
  align-items: center;
  text-align: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-2);
}

/* ==================== 引导学习开始页提示 ==================== */
.start-hint { margin: 8px 0 0; font-size: 11px; color: var(--text-3); }
.start-gen-hint {
  margin: 10px 0 0;
  padding: 7px 10px;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(50, 240, 140, .24);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}
.start-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==================== 按题型学习章节卡 ==================== */
.start-sections {
  width: 100%;
  max-width: 420px;
  text-align: left;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
}
.start-sections-hd {
  font-size: 11px; font-weight: 700; color: var(--text-3);
  letter-spacing: .08em;
}
.start-sections-sub {
  margin: 6px 0 10px;
  font-size: 12px; color: var(--text-2); line-height: 1.5;
}
.start-sec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}
.start-sec-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
}
.start-sec-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.start-sec-card.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.start-sec-icon { font-size: 20px; line-height: 1; }
.start-sec-name { font-size: 12.5px; font-weight: 700; }
.start-sec-desc { font-size: 10px; color: var(--text-3); text-align: center; line-height: 1.35; }
.start-sec-card.active .start-sec-desc { color: var(--text-2); }

/* ==================== AI 一键生成文章弹窗 ==================== */
.agen-modal { max-width: 720px; }
.agen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.agen-head h3 { margin: 0; }
.agen-close {
  flex: 0 0 auto;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  font-size: 16px; line-height: 1;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.agen-close:hover { background: var(--surface-3); color: var(--text-1); border-color: var(--border-2); }
.agen-field { margin-bottom: 14px; }
.agen-field > label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 6px; color: var(--text-1); }
.agen-exam {
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.agen-topics { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.agen-topic {
  padding: 5px 13px;
  font-size: 12px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.agen-topic:hover { border-color: var(--accent); color: var(--text-1); }
.agen-topic.active { background: var(--accent); border-color: var(--accent); color: var(--on-brand); font-weight: 600; }
.agen-input {
  width: 100%;
  padding: 9px 11px;
  font-size: 13px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--surface-2);
  color: var(--text-1);
  box-sizing: border-box;
  transition: border-color .12s, box-shadow .12s;
}
.agen-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.agen-input::placeholder { color: var(--text-3); }
.agen-gen { width: 100%; margin-top: 4px; }
.agen-error { margin: 10px 0 0; font-size: 12.5px; color: var(--danger, #ef4444); line-height: 1.6; }

/* 关键：hidden 属性必须生效，否则转圈区会一直显示（.agen-loading 的 display:flex 会覆盖 UA 的 [hidden] 样式） */
.agen-loading[hidden], .agen-result[hidden], .agen-error[hidden], .agen-config[hidden] { display: none !important; }

/* 加载卡片：只在生成期间出现 */
.agen-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 46px 24px;
  background: var(--surface-2);
  border: 1px dashed var(--border-2);
  border-radius: var(--radius-md);
  animation: agen-fadein .25s ease;
}
@keyframes agen-fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.agen-spinner {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 3px solid var(--border-2);
  border-top-color: var(--accent);
  animation: agen-spin .8s linear infinite;
  margin-bottom: 8px;
}
@keyframes agen-spin { to { transform: rotate(360deg); } }
.agen-loading-title { font-size: 14px; font-weight: 700; color: var(--text-1); margin: 0; }
.agen-loading-sub { font-size: 12.5px; color: var(--text-2); margin: 0; }
.agen-loading-hint { font-size: 11.5px; color: var(--text-3); margin: 4px 0 0; }
/* 结果区顶部操作栏（生成后无需滑到底即可操作） */
.agen-result-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 12px;
}

.agen-result-title { font-size: 16px; font-weight: 700; color: var(--text-1); margin-bottom: 10px; }
.agen-passage {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius);
  padding: 14px 16px;
  max-height: 260px;
  overflow-y: auto;
  margin-bottom: 14px;
  white-space: normal;
}
.agen-section { margin-bottom: 14px; }
.agen-section h4 {
  font-size: 12px; font-weight: 700;
  color: var(--text-3);
  letter-spacing: .06em;
  margin: 0 0 8px;
  display: flex; align-items: center; gap: 8px;
}
.agen-section-tag { font-size: 11px; font-weight: 400; color: var(--text-3); letter-spacing: 0; }
.agen-vocab { display: flex; flex-direction: column; gap: 6px; }
.agen-vocab-item {
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px;
}
.agen-vocab-word {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--accent);
  cursor: pointer;
  border-bottom: 1px dashed var(--accent);
}
.agen-vocab-word:hover { color: var(--accent-hover); }
.agen-vocab-ph { font-size: 12px; color: var(--text-3); font-family: var(--font-mono); }
.agen-vocab-meaning { font-size: 12.5px; color: var(--text-1); }
.agen-vocab-context {
  width: 100%;
  font-size: 12px;
  color: var(--text-2);
  font-style: italic;
  line-height: 1.6;
  margin-top: 2px;
}
.agen-points { margin: 0; padding-left: 18px; }
.agen-points li { font-size: 12.5px; color: var(--text-1); line-height: 1.8; margin-bottom: 4px; }
.agen-q { font-size: 13.5px; font-weight: 600; color: var(--text-1); line-height: 1.7; margin: 0 0 8px; }
.agen-opts { display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px; }
.agen-opt {
  display: flex; gap: 8px; align-items: flex-start;
  font-size: 13px; color: var(--text-1);
  line-height: 1.6;
  padding: 6px 9px;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
}
.agen-opt-key { font-weight: 700; color: var(--accent); flex: 0 0 auto; }
.agen-answer { font-size: 13px; margin-top: 8px; }
.agen-answer summary { cursor: pointer; color: var(--accent); font-size: 12.5px; font-weight: 600; }
.agen-answer-text { margin: 8px 0 4px; color: var(--ok); }
.agen-answer-exp { margin: 0; color: var(--text-2); line-height: 1.7; }


/* ==================== 一键确认/准备好了按钮（精美样式） ==================== */
.ask-opts-inline .ask-quick {
  border-radius: 999px;
  padding: 8px 20px;
  min-height: 34px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text-1);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
  transition: all .16s ease;
}
.ask-opts-inline .ask-quick:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  /* 不移位（transform 会让按钮离开鼠标导致边缘点击落空/抖动），仅颜色+阴影反馈 */
  box-shadow: 0 3px 8px rgba(0,0,0,.1);
}
.ask-opts-inline .ask-quick:active { transform: translateY(0); box-shadow: none; }
.ask-opts-inline .ask-quick.ask-chosen,
.ask-opts-inline .ask-quick.ask-chosen:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-brand);
  font-weight: 600;
  transform: none;
}

/* 一键"我准备好了，开始吧" */
.gd-ready { display: flex; justify-content: flex-start; }
.gd-ready .btn {
  border-radius: 999px;
  padding: 8px 24px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 3px 10px var(--accent-soft);
}
.gd-ready .btn:hover { transform: translateY(-1px); }

/* ==================== 首页 ==================== */
.hm-wrap { padding: 6px 22px 24px; }
.hm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  align-items: stretch;
}
.hm-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  transition: border-color .12s, box-shadow .12s, transform .12s;
}

/* 未登录引导横幅 */
.hm-login-banner {
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface-1) 70%);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.hm-login-banner-icon {
  flex: none;
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  color: var(--accent);
  background: var(--surface-1);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}
.hm-login-banner-main { flex: 1; min-width: 0; }
.hm-login-banner-title { font-size: 15px; font-weight: 700; color: var(--text-1); }
.hm-login-banner-desc { margin-top: 4px; font-size: 12px; color: var(--text-2); line-height: 1.6; }
.hm-card:hover { border-color: var(--border-2); box-shadow: 0 6px 20px rgba(0, 0, 0, .10); transform: translateY(-1px); }
.hm-span-2 { grid-column: span 2; }
.hm-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.hm-greet { font-size: 17px; font-weight: 700; color: var(--text-1); line-height: 1.4; }
.hm-date { margin-top: 4px; font-size: 12px; color: var(--text-2); }
.hm-ring {
  flex: none;
  width: 74px; height: 74px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--pct, 50%), var(--surface-3) 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.hm-ring::before {
  content: "";
  position: absolute; inset: 7px;
  border-radius: 50%;
  background: var(--surface-1);
}
.hm-ring-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.hm-ring-inner b { font-size: 15px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.hm-ring-inner span { font-size: 10px; color: var(--text-3); }
.hm-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0 0;
}
.hm-stat {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
}
.hm-stat b { font-size: 16px; font-weight: 700; color: var(--text-1); font-variant-numeric: tabular-nums; }
.hm-stat span { font-size: 11px; color: var(--text-3); }
.hm-events { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.hm-chip {
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 10px;
}
.hm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.hm-recent { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-1); }
.hm-recent-hd { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.hm-recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  margin-bottom: 6px;
}
.hm-recent-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-recent-title {
  font-size: 12.5px; font-weight: 600; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hm-recent-meta { font-size: 11px; color: var(--text-3); }
.hm-recent-go { flex: none; }
.hm-card-hd { font-size: 14px; font-weight: 700; color: var(--text-1); }
/* 移动端首页功能导航（桌面端隐藏；底部导航仅保留核心项，其余从此进入） */
.hm-nav-quick { display: none; }
.hm-nav-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.hm-nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.hm-nav-item svg { flex: none; color: var(--accent); }
.hm-nav-item:active { background: var(--surface-3); }
.hm-nav-item:hover { border-color: var(--accent); }
.hm-tip { margin: 8px 0 10px; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.hm-input {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  resize: vertical;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.hm-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.hm-input::placeholder { color: var(--text-3); }
.hm-input + .btn, .hm-form .btn { margin-top: 8px; }
.hm-form { display: flex; flex-direction: column; gap: 8px; }
.hm-input-name { flex: none; width: 160px; }
.hm-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 220px; overflow-y: auto; }
.hm-empty { margin: 4px 0; font-size: 12px; color: var(--text-3); text-align: center; padding: 12px 0; }
.hm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-2);
}
.hm-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hm-item-top { display: flex; align-items: center; gap: 8px; }
.hm-item-name { font-size: 12px; font-weight: 600; color: var(--accent); }
.hm-item-text { font-size: 12.5px; color: var(--text-1); line-height: 1.6; word-break: break-word; }
.hm-item-time { margin-left: auto; font-size: 10px; color: var(--text-3); flex: none; }
.hm-item-del {
  flex: none;
  font-size: 14px;
  line-height: 1;
  color: var(--text-3);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}
.hm-item-del:hover { color: var(--danger); background: var(--overlay-2); }

/* ==================== 首页 · 考试冲刺计划 ==================== */
.hm-exam-card { padding: 18px 20px 16px; }
/* 头部：标题左 · 操作按钮右 */
.hm-exam-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hm-exam-top .hm-card-hd { margin: 0; }
.hm-exam-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.hm-exam-actions .btn { white-space: nowrap; }
/* 类别选择行：考试 pills 左 · 日期输入右（日期弱化为幽灵输入） */
.hm-exam-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--border-1); }
.hm-exam-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.hm-exam-pick {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
  transition: color .12s, background .12s, border-color .12s;
}
.hm-exam-pick:hover { color: var(--accent); border-color: var(--accent); }
.hm-exam-pick.active {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.hm-exam-date { font-size: 12px; color: var(--text-3); }
.hm-exam-date .hm-input {
  width: auto; padding: 4px 8px; font-size: 12px;
  background: transparent; border-color: transparent; color: var(--text-2);
}
.hm-exam-date .hm-input:hover { border-color: var(--border-2); }
/* 倒计时焦点区：小标签 + 大数字 + 单位 基线对齐 */
.hm-countdown { display: flex; align-items: baseline; gap: 10px; margin-top: 16px; }
.hm-count-label { font-size: 13px; color: var(--text-2); }
.hm-count-value { display: inline-flex; align-items: baseline; gap: 5px; }
.hm-count-num {
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2, var(--accent)));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hm-count-unit { font-size: 13px; font-weight: 600; color: var(--text-3); }
.hm-exam-meta { margin-top: 8px; font-size: 12px; color: var(--text-3); }
/* 阶段条 */
.hm-phase { margin-top: 16px; }
.hm-phase-bar { display: flex; height: 36px; border-radius: 10px; overflow: hidden; gap: 3px; }
.hm-phase-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 52px;
  background: var(--surface-3, var(--surface-2));
  border: 1px solid var(--border-1);
  border-radius: 8px;
  color: var(--text-3);
  transition: background .2s, color .2s, border-color .2s;
}
.hm-phase-seg span { font-size: 11px; font-weight: 700; }
.hm-phase-seg em { font-size: 9.5px; font-style: normal; opacity: .85; }
.hm-phase-seg.cur {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2, var(--accent)));
  border-color: transparent;
  box-shadow: 0 4px 14px var(--accent-soft);
}
.hm-phase-seg.done {
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 12%, transparent);
  border-color: color-mix(in srgb, var(--ok) 35%, transparent);
}
/* 阶段说明与总进度并排一行，收拢信息层级 */
.hm-phase-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.hm-phase-focus { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--text-2); }
/* 计划总进度（内联迷你条） */
.hm-plan-progress { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.hm-plan-progress-bar {
  width: 84px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-3, var(--surface-2));
  overflow: hidden;
}
.hm-plan-progress-bar > em {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2, var(--accent)));
  transition: width .3s ease;
}
.hm-plan-progress b { color: var(--accent); }

/* ==================== 首页 · 今日学习任务 ==================== */
.hm-today-card { padding: 20px; }
.hm-today-sub { font-size: 11px; font-weight: 500; color: var(--text-3); margin-left: 6px; }
.hm-today-progress { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.hm-today-progress-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-3, var(--surface-2)); overflow: hidden; }
.hm-today-progress-bar > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2, var(--accent))); transition: width .3s ease; }
.hm-today-progress span { font-size: 12px; color: var(--text-2); white-space: nowrap; }
.hm-today-progress b { color: var(--accent); }
.hm-task-list { margin-top: 8px; display: flex; flex-direction: column; gap: 7px; }
.hm-task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .12s, background .12s, transform .12s;
}
.hm-task-item:hover { border-color: var(--accent); background: var(--surface-1); transform: translateY(-1px); }
.hm-task-check { flex: none; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.hm-task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-task-title { font-size: 12.5px; font-weight: 600; color: var(--text-1); line-height: 1.5; }
.hm-task-meta { font-size: 11px; color: var(--text-3); }
.hm-task-ok {
  flex: none;
  width: 18px; height: 18px;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  background: var(--ok);
  border-radius: 50%;
}
.hm-task-item.done .hm-task-title { text-decoration: line-through; color: var(--text-3); }
.hm-task-item.done .hm-task-ok { display: inline-flex; }
.hm-task-item.done { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.hm-today-done {
  margin-top: 10px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ok);
  background: color-mix(in srgb, var(--ok) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent);
  border-radius: var(--radius-sm);
  padding: 8px;
}

/* 个人中心：AI 老师人设 + 称呼设置 */
.teacher-pick-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.nick-row { display: flex; gap: 12px; flex-wrap: wrap; }
.nick-field {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.nick-label { font-size: 11.5px; color: var(--text-2); }
.nick-field input {
  font-family: inherit;
  font-size: 13px;
  color: var(--text-1);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.nick-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.nick-field input::placeholder { color: var(--text-3); }

@media (max-width: 820px) {
  .hm-span-2 { grid-column: span 1; }
  .hm-stats { grid-template-columns: repeat(2, 1fr); }
  .teacher-pick-cards { grid-template-columns: 1fr 1fr; }
}

/* ==================== 文章题库 · 真题与素材库 ==================== */
.qb { padding: 16px 18px; }
.qb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.qb-title { display: flex; align-items: baseline; gap: 10px; }
.qb-title h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text-1); }
.qb-stats { font-size: 12px; color: var(--text-3); }
.qb-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.qb-filter {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  padding: 4px 11px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.qb-filter:hover { color: var(--text-1); border-color: var(--accent); }
.qb-filter.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.qb-list { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.qb-bank {
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
  transition: border-color .12s;
}
.qb-bank:hover { border-color: var(--accent); }
.qb-bank-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--text-1);
}
.qb-year {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 3px 9px;
}
.qb-bank-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-bank-meta { flex: none; font-size: 11.5px; color: var(--text-3); }
.qb-caret { flex: none; font-size: 11px; color: var(--text-3); transition: transform .15s; }
.qb-bank-body { padding: 0 12px 12px; border-top: 1px dashed var(--border-1); }
.qb-bank-desc { padding: 10px 0 6px; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.qb-sections { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 0; }
.qb-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  background: var(--surface-3, var(--surface-2));
  border: 1px solid var(--border-1);
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}
.qb-tag-topic { color: var(--accent); background: var(--accent-soft); border-color: transparent; }
.qb-sub { font-size: 12px; font-weight: 700; color: var(--text-2); margin: 8px 0 6px; }
.qb-mats { display: flex; flex-direction: column; gap: 6px; }
.qb-mat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.qb-mat:hover { border-color: var(--accent); transform: translateY(-1px); }
.qb-mat-title { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-tags-mini { display: flex; gap: 4px; flex-wrap: wrap; }
.qb-tags-mini i { font-style: normal; font-size: 10.5px; color: var(--text-3); background: var(--surface-2); border-radius: 999px; padding: 1px 7px; }
.qb-qs { display: flex; flex-direction: column; gap: 6px; }
.qb-q {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.qb-q:hover { border-color: var(--accent); transform: translateY(-1px); }
.qb-q-no {
  flex: none;
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}
.qb-q-stem { flex: 1; min-width: 0; font-size: 12.5px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qb-q-tags { flex: none; display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 45%; }
.qb-q-go { flex: none; font-size: 12px; color: var(--accent); opacity: 0; transition: opacity .12s; }
.qb-q:hover .qb-q-go { opacity: 1; }

/* ==================== 题库学习（题目练习 / 单词与知识） ==================== */
.qbt-tabs { display: flex; gap: 6px; }
.qbt-tab {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 6px 16px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.qbt-tab:hover { color: var(--text-1); border-color: var(--accent); }
.qbt-tab.is-active { color: var(--accent); background: var(--accent-soft); border-color: var(--accent); }
.qbt-body { margin-top: 12px; }

/* 筛选栏 */
.qbt-filters { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--border-1); border-radius: var(--radius-sm); background: var(--surface-2); }
.qbt-fgroup { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qbt-flabel { flex: none; font-size: 12px; font-weight: 700; color: var(--text-3); width: 34px; }
.qbt-fbtns { display: flex; gap: 6px; flex-wrap: wrap; }
.qbt-fbtn {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.qbt-fbtn:hover { color: var(--text-1); border-color: var(--accent); }
.qbt-fbtn.is-active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

/* 题目列表 */
.qbt-qs { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.qbt-q {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.qbt-q:hover { border-color: var(--accent); transform: translateY(-1px); }
.qbt-q-no {
  flex: none;
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}
.qbt-q-stem { flex: 1; min-width: 0; font-size: 13px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qbt-q-tags { flex: none; display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 42%; }
.qbt-q-go { flex: none; font-size: 12px; color: var(--accent); opacity: 0; transition: opacity .12s; }
.qbt-q:hover .qbt-q-go { opacity: 1; }

/* 答题面板 */
.qbt-panel { display: flex; flex-direction: column; gap: 14px; }
.qbt-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.qbt-panel-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.qbt-panel-count { font-size: 12px; color: var(--text-3); margin-left: 6px; }
.qbt-panel-context .qbt-ctx-line { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.qbt-stem { font-size: 14.5px; line-height: 1.85; color: var(--text-1); padding: 12px 14px; border: 1px solid var(--border-1); border-radius: var(--radius-sm); background: var(--surface-2); white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; text-align: justify; }
.qbt-opts { display: flex; flex-direction: column; gap: 8px; }
.qbt-opt {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-1);
  transition: border-color .12s, background .12s, transform .12s;
}
.qbt-opt:hover { border-color: var(--accent); }
.qbt-opt.is-picked { border-color: var(--accent); background: var(--accent-soft); }
.qbt-opt.is-correct { border-color: #22c55e; background: rgba(34, 197, 94, .12); }
.qbt-opt.is-wrong { border-color: #ef4444; background: rgba(239, 68, 68, .1); }
.qbt-opt:disabled { cursor: default; opacity: .85; }
.qbt-opt-letter {
  flex: none;
  width: 22px; height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-3, var(--surface-1));
  border-radius: 50%;
}
.qbt-opt-text {
  flex: 1;
  min-width: 0;
  text-align: left;
  word-break: break-word;
  overflow-wrap: anywhere;
  white-space: normal;
}
.qbt-submit { align-self: flex-start; }
.qbt-result { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-1); background: var(--surface-2); }
.qbt-result[hidden] { display: none; }
.qbt-result-mark { font-size: 14px; font-weight: 700; }
.qbt-result-mark.ok { color: #22c55e; }
.qbt-result-mark.bad { color: #ef4444; }
.qbt-result-ans { font-size: 13px; font-weight: 600; color: var(--text-1); }
.qbt-result-exp { font-size: 13px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; }
.qbt-ctx { font-size: 12px; color: var(--text-3); }
.qbt-ctx summary { cursor: pointer; font-weight: 600; }
.qbt-ctx-text { margin-top: 6px; font-size: 12.5px; line-height: 1.7; color: var(--text-2); white-space: pre-wrap; background: var(--surface-1); padding: 10px; border-radius: var(--radius-sm); max-height: 240px; overflow: auto; }
.qbt-panel-nav { display: flex; align-items: center; gap: 10px; }

/* 题目练习双模式切换 */
.qbt-mode { display: flex; gap: 6px; margin-bottom: 10px; }
.qbt-mode-btn {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  padding: 5px 16px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.qbt-mode-btn:hover { color: var(--text-1); border-color: var(--accent); }
.qbt-mode-btn.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }
.qbt-mode-body { margin-top: 2px; }

/* 整套卷：卷列表网格 */
.qbt-sets { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.qbt-set {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.qbt-set:hover { border-color: var(--accent); transform: translateY(-1px); }
.qbt-set-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qbt-set-year { font-size: 20px; font-weight: 800; color: var(--accent); }
.qbt-set-title { font-size: 13.5px; font-weight: 700; color: var(--text-1); line-height: 1.5; }
.qbt-set-meta { font-size: 12px; color: var(--text-3); }
.qbt-set-go { font-size: 12px; color: var(--accent); opacity: 0; transition: opacity .12s; }
.qbt-set:hover .qbt-set-go { opacity: 1; }

/* 整套卷：扫描版卷面（连续作答 + 贴合原卷排版） */
.qbt-paper-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.qbt-paper-tip { font-size: 12px; color: var(--text-3); }

/* 卷首（模拟原卷抬头） */
.qbt-paper-mast {
  text-align: center;
  padding: 14px 16px 10px;
  border-top: 3px double var(--text-1);
  border-bottom: 1px solid var(--text-1);
  margin-bottom: 10px;
}
.qbt-paper-mast-year { font-size: 30px; font-weight: 800; line-height: 1.15; letter-spacing: 1px; color: var(--text-1); }
.qbt-paper-mast-exam { font-size: 16px; font-weight: 800; letter-spacing: 2px; color: var(--text-1); margin-top: 2px; }
.qbt-paper-mast-sub { font-size: 12.5px; color: var(--text-3); margin-top: 4px; }

/* 作答进度（吸顶） */
.qbt-paper-progress {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-1) 86%, transparent);
  backdrop-filter: blur(6px);
}
.qbt-pp-text { flex: none; font-size: 12px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.qbt-pp-bar { flex: 1; height: 6px; border-radius: 3px; background: var(--border-1); overflow: hidden; }
.qbt-pp-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .3s; }

/* 区块标题（仿原卷 Section 标题） */
.qbt-sec { margin-top: 18px; }
.qbt-sec-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  padding: 5px 0 5px 10px;
  border-left: 4px solid var(--accent);
  border-bottom: 1px solid var(--border-1);
}
.qbt-sec-en { font-size: 15px; font-weight: 800; color: var(--text-1); letter-spacing: .5px; }

/* 文章块（仿原卷正文） */
.qbt-art { margin-top: 12px; }
.qbt-art-head { font-size: 13px; font-weight: 800; color: var(--accent); margin-bottom: 6px; }
.qbt-art-text {
  font-family: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', serif;
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.qbt-blank {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  border-radius: 2px;
  padding: 0 4px;
  font-weight: 700;
  background: var(--accent-soft);
  letter-spacing: .5px;
}
.qbt-blank sup { font-size: 10px; font-weight: 800; color: var(--accent); margin-right: 1px; }

/* 题目区 */
.qbt-qs { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.qbt-card.is-done { border-color: var(--accent); }
.qbt-card.is-next { animation: qbtNext .9s ease; }
@keyframes qbtNext {
  0%, 60% { box-shadow: 0 0 0 3px var(--accent-soft); }
  100% { box-shadow: none; }
}

/* 紧凑选项行（完形 / 听力，贴合原卷选项表） */
.qbt-card-compact { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 9px 12px; }
.qbt-qrow-top { display: flex; align-items: baseline; gap: 8px; width: 100%; }
.qbt-qrow-top .qbt-q-no { font-size: 15px; font-weight: 800; color: var(--accent); }
.qbt-qrow-stem { font-size: 13px; line-height: 1.6; color: var(--text-2); }
.qbt-opts-inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; flex: 1; min-width: 240px; }
.qbt-opts-inline .qbt-opt { gap: 4px; padding: 6px 8px; font-size: 12.5px; }
.qbt-card-compact .qbt-submit { padding: 5px 14px; flex: none; }

/* 开放式作答（翻译 / 写作） */
.qbt-open { display: flex; flex-direction: column; gap: 8px; }
.qbt-open-area {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.85;
  text-align: justify;
  color: var(--text-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: var(--surface-1);
  font-family: inherit;
}
.qbt-open-area-lg { min-height: 240px; font-size: 14px; }
.qbt-open-area:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.qbt-open .qbt-submit { align-self: flex-start; }

/* 题卡（整套卷内联作答） */
.qbt-card { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-1); background: var(--surface-2); }
.qbt-card-head { display: flex; align-items: center; gap: 6px; }
.qbt-card .qbt-submit { align-self: flex-start; }

/* 素材卡片 */
.qbt-mat-grid { margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.qbt-sub { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-top: 4px; }
.qbt-mat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.qbt-mat-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.qbt-mat-name { font-size: 14px; font-weight: 700; color: var(--text-1); }
.qbt-mat-meta { font-size: 12px; color: var(--text-3); }
.qbt-mat-tags { display: flex; gap: 5px; flex-wrap: wrap; }
.qbt-mat-go { align-self: flex-end; font-size: 12.5px; color: var(--accent); }

/* 词卡学习：纵向铺满整个界面 */
.qbt-vocab { display: flex; flex-direction: column; height: 100%; min-height: 0; }
/* 顶部一行：返回 · 需学/已学 · 上一个单词学习内容 */
.qbt-topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 2px 0;
}
.qbt-exit-back {
  flex: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-1);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.qbt-exit-back:hover { background: var(--surface-3); transform: scale(1.05); }
.qbt-exit-back:active { transform: scale(0.94); }
.qbt-progress { flex: none; display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.qbt-pr-seg { display: flex; align-items: center; gap: 3px; }
.qbt-pr-seg i { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.qbt-pr-seg b { color: var(--text-1); font-weight: 700; font-variant-numeric: tabular-nums; }
.qbt-pr-seg b.is-dim { opacity: .45; font-weight: 500; }
.qbt-pr-dot { color: var(--text-3); }
.qbt-prev-info {
  flex: 1;
  min-width: 0;
  text-align: right;
  font-size: 12px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.qbt-prev-info b { color: var(--text-2); font-weight: 600; }
/* 中部舞台：单词在剩余空间居中（与顶栏自然拉开大间距），答题区贴近底部 */
.qbt-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.qbt-word-wrap {
  flex: 1.25;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 0;
  cursor: pointer;
  user-select: none;
}
.qbt-word {
  font-size: clamp(34px, 7vw, 46px);
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: .5px;
  text-align: center;
  word-break: break-word;
}
@keyframes qbtPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
.qbt-pop { animation: qbtPop .35s ease; }
.qbt-phon { font-size: 14px; color: var(--text-3); font-family: "Segoe UI", "Microsoft YaHei", sans-serif; }

/* ===== 背诵全屏沉浸：隐藏顶栏、状态栏与底部导航栏 ===== */
body.vocab-fullscreen .topbar,
body.vocab-fullscreen .statusbar,
body.vocab-fullscreen .activity-bar { display: none !important; }
body.vocab-fullscreen .ide-app { grid-template-rows: 1fr; }
/* 全屏下让背诵页纵向撑满整个视口（含移动端，覆盖 .view height:auto 的响应式规则） */
body.vocab-fullscreen .ide-main,
body.vocab-fullscreen .view,
body.vocab-fullscreen .tb-vocab-block,
body.vocab-fullscreen .qbt-vocab { height: 100%; min-height: 0; overflow: hidden; }
body.vocab-fullscreen .mypassages-root { height: 100%; min-height: 0; overflow: hidden; }
body.vocab-fullscreen .passage-panel .tb { padding: 0 18px; }
/* ==== 词汇背诵 · 四选一速测 ==== */
/* 选项区占比小于单词区：卡片高度约为原版的 0.8（1 ÷ 1.25） */
.qbt-quiz-area { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
/* 倒计时条：无灰底轨道，只剩渐变条本身，走完即消失 */
.qbt-quiz-timer { height: 5px; border-radius: 99px; overflow: hidden; }
.qbt-quiz-timer i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent));
  transform-origin: left center; border-radius: 99px;
}
.qbt-quiz-timer.is-low i { background: linear-gradient(90deg, #ff8a5c, #ff6b6b); }
/* 2×2 卡片式选项（随剩余空间拉伸，两行等高）
   注意：卡片需显式 height:100%，否则全局 .btn 的固定 height 会让 stretch 失效，
   行被拉高而卡片缩在行顶，行间出现大空隙 */
.qbt-quiz-options { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(67px, 1fr)); gap: 12px; align-items: stretch; }
.qbt-quiz-options .qbt-opt {
  height: 100%;
  min-height: 67px;
  justify-content: flex-start;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  border-radius: 16px;
  border: 1px solid var(--border-1);
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  color: var(--text-1);
  cursor: pointer;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .07);
  transition: border-color .15s, background .15s, color .15s, transform .12s, box-shadow .15s;
}
.qbt-quiz-options .qbt-opt:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .14);
}
.qbt-opt:active:not(:disabled) { transform: scale(.985); }
.qbt-opt.opt-right { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.qbt-opt.opt-wrong { border-color: rgba(255, 107, 107, .65); background: rgba(255, 107, 107, .1); color: #ff8a8a; text-decoration: line-through; }
.qbt-opt:disabled { opacity: .88; cursor: default; }
.qbt-quiz-verdict { text-align: center; font-size: 14px; font-weight: 700; padding: 4px 8px; animation: qbtPopIn .25s ease; }
.v-good { color: var(--accent); }
.v-warn { color: #ffb84d; }
.v-bad { color: #ff7a7a; }
@keyframes qbtPopIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
/* ===== 答对庆祝粒子层 ===== */
.fx-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 999; }
/* ===== 底部操作条：提示 / 会了（贴页面最底部，只留一点底边距） ===== */
.qbt-quiz-actions {
  flex: none;
  display: flex;
  gap: 12px;
  padding: 16px 4px calc(10px + env(safe-area-inset-bottom, 0px));
}
.qbt-act {
  flex: 1;
  height: 50px;
  border: none;
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--text-1);
  font-size: 15.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .15s ease, opacity .15s ease;
}
.qbt-act:hover:not(:disabled) { transform: translateY(-1px); }
.qbt-act:active:not(:disabled) { transform: scale(.96); }
.qbt-act:disabled { opacity: .4; cursor: default; }
.qbt-act svg { flex: none; }
/* AI 生成中：灯泡图标隐藏，换成经典等待转圈；生成完自动恢复灯泡 */
.qbt-act-tip.is-loading svg { display: none; }
.qbt-act-tip.is-loading::before {
  content: '';
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid var(--border-1); border-top-color: var(--accent);
  animation: qbtTipSpin .8s linear infinite;
}
.qbt-act-tip.pulse { animation: qbtTipPulse 1.2s ease infinite; }
@keyframes qbtTipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(50, 240, 140, .45); }
  50% { box-shadow: 0 0 0 9px rgba(50, 240, 140, 0); }
}
.qbt-act-pass {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: 0 8px 22px rgba(50, 240, 140, .25);
}
.qbt-act-pass:hover:not(:disabled) { box-shadow: 0 10px 26px rgba(50, 240, 140, .35); }
@keyframes qbtTipSpin { to { transform: rotate(360deg); } }
/* ===== 学习方法展示区：无边框卡片，柔和渐变底色 ===== */
.qbt-tips-area {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 30vh;
  overflow-y: auto;
  text-align: left;
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  background:
    linear-gradient(140deg, var(--accent-soft), transparent 55%),
    var(--surface-2);
  animation: qbtPopIn .22s ease;
}
.tip-item { display: flex; align-items: flex-start; gap: 7px; animation: qbtPopIn .25s ease; }
.tip-label { flex: none; color: var(--accent); font-size: 12.5px; font-weight: 700; line-height: 1.6; }
.tip-text { flex: 1; font-size: 13px; line-height: 1.6; color: var(--text-2); overflow-wrap: anywhere; }
/* 等待 AI 的加载占位 */
.tip-loading { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); animation: qbtPopIn .22s ease; }
.tip-loading-ring {
  flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border-1); border-top-color: var(--accent);
  animation: qbtTipSpin .8s linear infinite;
}
/* ===== 单词详情弹层：提示看完后弹出（全部速记 + 会了 / 随堂测试） ===== */
.wd-modal {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 14, 20, .55);
  backdrop-filter: blur(6px);
  animation: wdFadeIn .2s ease;
}
@keyframes wdFadeIn { from { opacity: 0; } to { opacity: 1; } }
.wd-panel {
  width: min(560px, 100%);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--surface-1);
  border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(14px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .28);
  overflow: hidden;
  animation: wdSlideUp .28s cubic-bezier(.2, .8, .3, 1);
}
@keyframes wdSlideUp { from { transform: translateY(48px); opacity: .4; } to { transform: none; opacity: 1; } }
.wd-head { flex: none; text-align: left; padding-bottom: 12px; border-bottom: 1px dashed var(--border-1); }
.wd-word-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wd-word { font-size: 26px; font-weight: 800; color: var(--text-1); letter-spacing: .5px; }
.wd-phon { font-size: 13.5px; color: var(--text-3); }
.wd-meaning { margin-top: 5px; font-size: 14px; color: var(--text-2); overflow-wrap: anywhere; }
.wd-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.wd-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 2px 6px; text-align: left; }
/* display:flex 会盖过 hidden 属性的默认隐藏，这里显式恢复 */
.wd-modal [hidden] { display: none !important; }
.wd-entry {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: 12px;
  background: linear-gradient(140deg, var(--accent-soft), transparent 60%), var(--surface-2);
  animation: qbtPopIn .25s ease;
}
.wd-label { flex: none; color: var(--accent); font-size: 12.5px; font-weight: 700; line-height: 1.6; }
.wd-text { flex: 1; font-size: 13.5px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
/* —— 随堂测试区 —— */
.wd-quiz { border-top: 1px dashed var(--border-1); margin-top: 8px; padding: 12px 2px 4px; text-align: left; animation: qbtPopIn .25s ease; }
.wdq-title { font-size: 13px; font-weight: 800; color: var(--accent); margin-bottom: 8px; }
.wdq-loading { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); padding: 4px 0 8px; }
.wdq-error { font-size: 13px; color: #ff8a8a; padding: 4px 0 8px; }
.wdq-sentence { font-size: 14.5px; line-height: 1.7; font-weight: 600; color: var(--text-1); overflow-wrap: anywhere; }
.wdq-translation { font-size: 13px; line-height: 1.6; color: var(--text-3); margin-top: 6px; overflow-wrap: anywhere; }
.wdq-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.wdq-opt {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-height: 46px; padding: 10px 12px;
  border: 1.5px solid var(--border-1); border-radius: 12px;
  background: var(--surface-2); color: var(--text-1);
  font-size: 13.5px; font-weight: 600; text-align: center; cursor: pointer;
  white-space: normal; word-break: break-word; overflow-wrap: anywhere;
  transition: border-color .15s, background .15s, color .15s, transform .12s;
}
.wdq-opt-word { display: block; }
/* 卡片内的单词提示（音标+词性+意思）：提交后展示 */
.wdq-opt-gloss {
  display: block; width: 100%; padding-top: 6px;
  border-top: 1px dashed var(--border-1);
  font-size: 12px; font-weight: 400; line-height: 1.55; text-align: left;
  color: var(--text-2); animation: qbtPopIn .22s ease;
}
/* 选择阶段：仅选中高亮（可改选），不是最终答案 */
.wdq-opt.is-picked { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.wdq-opt:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.wdq-opt:disabled { cursor: default; opacity: .75; }
/* 提交后锁定态：不再有作答 hover 反馈 */
.wdq-opts.is-done .wdq-opt { cursor: default; opacity: .85; }
.wdq-opts.is-done .wdq-opt:hover { border-color: var(--border-1); color: var(--text-1); transform: none; }
.wdq-opts.is-done .wdq-opt.is-picked:hover { border-color: var(--border-1); color: var(--text-1); background: var(--surface-2); }
.wdq-opts.is-done .wdq-opt.is-right:hover { border-color: var(--accent); color: var(--accent); }
.wdq-opts.is-done .wdq-opt.is-wrong:hover { border-color: rgba(255, 107, 107, .65); color: #ff8a8a; }
.wdq-opt.is-right { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); opacity: 1; font-weight: 700; }
.wdq-opt.is-wrong { border-color: rgba(255, 107, 107, .65); background: rgba(255, 107, 107, .1); color: #ff8a8a; opacity: 1; }
.wdq-opt.is-wrong .wdq-opt-word { text-decoration: line-through; }
.wdq-opt.is-right .wdq-opt-gloss, .wdq-opt.is-wrong .wdq-opt-gloss { color: var(--text-2); }
.wdq-feedback { margin-top: 12px; font-size: 13px; line-height: 1.6; border-radius: 12px; padding: 10px 12px; overflow-wrap: anywhere; }
.wdq-feedback.is-ok { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.wdq-feedback.is-no { background: rgba(255, 107, 107, .1); color: #ff8a8a; }
/* —— 弹层底部按钮：随堂测试（次） + 会了（主） —— */
.wd-actions { flex: none; display: flex; gap: 10px; padding-top: 12px; }
.wd-btn {
  flex: 1; height: 48px; padding: 0 8px; border: none; border-radius: 14px;
  font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .12s ease, opacity .15s ease, box-shadow .15s ease;
}
.wd-btn:active:not(:disabled) { transform: scale(.97); }
.wd-btn:disabled { opacity: .55; cursor: default; }
.wd-btn-quiz { background: var(--surface-2); color: var(--text-1); border: 1px solid var(--border-1); }
.wd-btn-know {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: 0 8px 22px rgba(50, 240, 140, .25);
}
.qbt-quiz-summary { display: flex; flex-direction: column; gap: 14px; padding: 18px 6px; text-align: center; animation: qbtPopIn .35s ease; }
/* 专门总结页：隐藏学习界面元素（单词卡/提示区/底部按钮/答题区原有子元素），总结内容独占舞台 */
.qbt-summary-mode .qbt-word-wrap,
.qbt-summary-mode .qbt-tips-area,
.qbt-summary-mode .qbt-quiz-actions { display: none !important; }
.qbt-summary-mode .qbt-quiz-area > :not(.qbt-quiz-summary) { display: none !important; }
.qbt-summary-mode .qbt-quiz-area { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.qbt-summary-mode .qbt-progress { opacity: .4; } /* 顶栏进度淡化，焦点让给总结 */
.qs-title { font-size: 20px; font-weight: 800; color: var(--text-1); }
.qs-title-today { font-size: 22px; background: linear-gradient(90deg, var(--accent), #4dc3ff); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.qs-emoji { font-size: 42px; line-height: 1; animation: qbtPopIn .45s ease; }
.qs-sub { font-size: 13px; color: var(--text-2); margin-top: -8px; }
.qs-sub b { color: var(--accent); }
.qs-total-line { font-size: 12.5px; color: var(--text-3); }
.qs-total-line b { color: var(--accent); font-size: 16px; }
.qs-confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; }
/* 双卡片：新学计划 / 复习计划 分开展示 */
.qs-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left; }
@media (max-width: 360px) { .qs-cards { grid-template-columns: 1fr; } }
.qs-card { background: var(--surface-1); border: 1px solid var(--border-1); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 9px; }
.qs-card-head { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-1); }
.qs-card-ico { font-size: 15px; }
.qs-hit { margin-left: auto; font-size: 11px; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 2px 8px; font-weight: 700; white-space: nowrap; }
.qs-progress { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.qs-progress i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #4dc3ff); }
.qs-progress-num { font-size: 12px; color: var(--text-2); }
.qs-progress-num b { color: var(--accent); font-size: 19px; font-weight: 800; }
.qs-round-line { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.qs-kv { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--text-2); }
.qs-kv b { color: var(--text-1); font-weight: 700; font-size: 15px; }
.qs-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.qs-chip { font-size: 12.5px; padding: 4px 11px; border-radius: 999px; border: 1px solid var(--border-1); color: var(--text-2); }
.qs-fast { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); font-weight: 700; }
.qs-master { color: var(--accent); border-color: var(--accent-soft); }
.qs-slow { color: #ffb84d; }
.qs-bad { color: #ff7a7a; }
.qs-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.qs-srs-note { font-size: 12px; color: var(--text-3); }

/* 词汇学习闭环：今日概览（目标进度 / 复习 / 错词本入口） */
.vw-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 4px 0 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: linear-gradient(150deg, var(--accent-soft), var(--surface-2));
}
.vw-ov-main { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 6px; }
.vw-ov-goal { font-size: 13.5px; font-weight: 700; color: var(--text-1); }
.vw-ov-goal b { font-size: 18px; color: var(--accent); }
.vw-ov-bar { height: 7px; border-radius: 999px; background: var(--border-1); overflow: hidden; }
.vw-ov-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), #7ee0b0); transition: width .4s ease; }
.vw-ov-sub { font-size: 12px; color: var(--text-3); }
.vw-ov-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.vw-ov-btns .btn { font-size: 13px; padding: 8px 14px; border-radius: 999px; }
.vw-ov-btns .btn:disabled { opacity: .5; cursor: not-allowed; }

/* 记忆曲线分布图：各复习档在学词数柱状图 */
.vw-curve {
  margin: 0 0 10px;
  padding: 12px 16px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-1);
  background: var(--surface-2);
}
.vw-curve-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.vw-curve-title { font-size: 13.5px; font-weight: 700; color: var(--text-1); }
.vw-curve-title::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.vw-curve-sum { font-size: 12px; color: var(--text-3); }
.vw-curve-sum b { color: var(--accent); }
.vw-curve-bars { display: flex; align-items: flex-end; gap: 6px; }
.vw-curve-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; }
.vw-curve-n { font-size: 11px; font-weight: 700; color: var(--accent); line-height: 1; min-height: 12px; }
.vw-curve-col i {
  display: block; width: 100%; max-width: 34px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, var(--accent), #7ee0b0);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  transition: height .4s ease;
}
.vw-curve-d { font-size: 10.5px; color: var(--text-3); white-space: nowrap; }

/* 背词答题区：8 阶记忆链（答对点亮升阶，答错回退） */
.qbt-memwrap { display: block; margin-top: 6px; }
.qbt-membar { display: inline-flex; align-items: flex-end; gap: 3px; padding: 0; }
.qbt-mem-cell {
  display: inline-block; width: 16px; height: var(--h, 13px);
  border-radius: 3px;
  background: var(--border-1);
  opacity: .55;
  transition: background .25s ease, opacity .25s ease, transform .25s ease;
}
.qbt-mem-cell.on { background: linear-gradient(180deg, var(--accent), #7ee0b0); opacity: 1; }
.qbt-mem-cell.cur { transform: scale(1.18); animation: qbtMemPulse 1s ease infinite; }
@keyframes qbtMemPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(50, 240, 140, .45); } 50% { box-shadow: 0 0 0 4px rgba(50, 240, 140, 0); } }
.qbt-membar.mb-warn .qbt-mem-cell.on { background: linear-gradient(180deg, #ffb84d, #ffd58a); }
.qbt-membar.mb-warn .qbt-mem-cell.cur { animation-name: qbtMemPulseW; }
@keyframes qbtMemPulseW { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 184, 77, .45); } 50% { box-shadow: 0 0 0 4px rgba(255, 184, 77, 0); } }
.qbt-mem-label { display: block; font-size: 12px; color: var(--text-3); margin-top: 4px; font-weight: 600; }

/* 词书卡片内的学习进度（已学 / 掌握 / 错词） */
.qbt-mat-prog { font-size: 12px; color: var(--accent); font-weight: 600; }
.qbt-mat-prog-empty { color: var(--text-3); font-weight: 400; }

/* 错词本弹层 */
.vw-mask {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: qbtPopIn .2s ease;
}
.vw-modal {
  width: min(520px, 100%);
  max-height: 78vh;
  display: flex; flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
  overflow: hidden;
}
.vw-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--border-1); }
.vw-modal-title { font-size: 15px; font-weight: 700; color: var(--text-1); }
.vw-modal-close {
  width: 28px; height: 28px; border-radius: 50%;
  border: none; background: var(--surface-2);
  color: var(--text-2); font-size: 16px; line-height: 1;
  cursor: pointer;
}
.vw-modal-close:hover { color: var(--text-1); background: var(--border-1); }
.vw-modal-body { flex: 1; overflow: auto; padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.vw-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border-1); border-radius: 10px; background: var(--surface-2); }
.vw-item-word { font-size: 14.5px; font-weight: 700; color: var(--text-1); }
.vw-item-meaning { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.vw-item-meta { font-size: 11.5px; color: #ff7a7a; }
.vw-modal-foot { padding: 12px 16px; border-top: 1px solid var(--border-1); display: flex; justify-content: flex-end; }

/* 个人中心：每日背词目标 */
.dg-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dg-opt {
  padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border-1); background: var(--surface-2);
  color: var(--text-2); font-size: 13px; cursor: pointer;
  transition: border-color .12s, background .12s, color .12s;
}
.dg-opt:hover { border-color: var(--accent); }
.dg-opt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 700; }

/* 素材阅读 */
.qbt-reader { display: flex; flex-direction: column; gap: 12px; }
.qbt-reader-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qbt-reader-title { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 700; color: var(--text-1); }
.qbt-reader-body {
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  text-align: justify;
  font-family: Georgia, 'Times New Roman', 'Songti SC', 'SimSun', serif;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: 62vh;
  overflow: auto;
}

/* ==================== 移动端适配 ==================== */
/* 平板 / 窄屏：隐藏拖拽手柄等桌面交互残留 */
@media (max-width: 900px) {
  .col-resize, .g3-resizer { display: none; }
}

/* 手机：应用外壳改为「顶栏 + 内容 + 底部导航」 */
@media (max-width: 768px) {
  /* 高度使用动态视口单位，避免手机浏览器地址栏收起/弹出导致底部内容被裁 */
  .ide-app { height: 100vh; height: 100dvh; grid-template-rows: 40px 1fr; }
  /* App 内 topbar 已隐藏：仅剩内容 + 底部导航两块 */
  html.in-app .ide-app { grid-template-rows: 1fr; }
  /* 移动端隐藏桌面式状态栏，让底部导航真正贴底（含安全区） */
  .statusbar { display: none; }

  /* 左侧导航 → 底部导航 */
  .ide-body { flex-direction: column; }
  .activity-bar {
    order: 2;
    flex-direction: row;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    height: auto;
    min-height: 52px;
    padding: 3px 2px calc(3px + env(safe-area-inset-bottom, 0px));
    border-right: none;
    border-top: 1px solid var(--border-1);
    gap: 2px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
  }
  .activity-btn {
    flex: 1 1 0;
    width: auto;
    min-width: 46px;
    max-width: 96px;
    height: 46px;
    flex-direction: column;
    gap: 2px;
    padding: 3px 0;
  }
  .activity-btn svg { width: 18px; height: 18px; margin: 0; }
  .activity-btn.is-active::before { display: none; }
  .activity-sep, .activity-spacer { display: none; }
  /* 移动端底部导航只保留核心入口，其余从首页「功能导航」进入 */
  .activity-btn:not(.mobile-primary) { display: none; }

  .ide-main { order: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
  /* 底部导航在所有视图（含个人中心）固定保留：主区始终可收缩滚动，导航不被内容推走 */
  .ide-main { flex: 1 1 auto; min-height: 0; }
  /* 移动端隐藏原生滚动条槽位：滚动条占位约 9px，会让内容相对整个屏幕偏左约 4.5px。
     触摸滚动不受影响，组件边框即可相对整个视口真正居中 */
  .ide-main { scrollbar-width: none; }
  .ide-main::-webkit-scrollbar { width: 0; height: 0; }
  .ide-main .view, .ide-main .view * { scrollbar-width: none; }
  .ide-main .view *::-webkit-scrollbar { width: 0; height: 0; }
  .view { height: auto; min-height: 100%; }

  /* 原本固定高度 / 内部滚动的容器改为自然流式，跟随页面整体滚动 */
  .profile-root, .mypassages-root, .pf-wrap,
  #guided-root, .home-root { height: auto; overflow: visible; }
  #view-guided { overflow-y: visible; }

  /* 网格卡片：允许收缩到容器宽度，杜绝横向溢出 */
  .hm-grid, .mp-grid { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
  .qbt-sets { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); }
  .hm-span-2 { grid-column: span 1; }

  /* 页面内边距收紧 */
  .hm-wrap, .pf-wrap, .qb { padding-left: 14px; padding-right: 14px; }
  .page-head { padding: 16px 14px 2px; }
  .hm-card, .pf-card { padding: 16px; }
  .mp-grid { padding: 6px 14px 24px; }
  .qb { padding: 14px; }

  /* 移动端首页展示「功能导航」入口 */
  .hm-nav-quick { display: block; }

  /* 引导学习移动端：只保留「文章 + AI 对话」，其余按需弹出 */
  .g3-col.g3-main { min-height: 0; }
  .g3-logo { display: none; }

  /* 标题栏：「步骤 X/Y」状态徽章 = 唯一计划入口，小巧胶囊居中；文本靠左、全屏按钮靠右 */
  .g3-card-hd { position: relative; }
  #gd-badge {
    position: absolute; left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    margin-left: 0;
    cursor: pointer; user-select: none; -webkit-tap-highlight-color: transparent;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11px; white-space: nowrap;
  }
  #gd-badge:active { filter: brightness(1.15); }

  /* 左栏 → 点「步骤 X/Y」弹出居中卡片式弹窗（固定头部 + 内容区滚动），平时隐藏 */
  #g3-left { display: none; }
  .g3-wrap.plan-open #g3-left {
    display: flex; flex-direction: column; gap: 0;
    position: fixed; z-index: 80;
    left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(92vw, 400px) !important;
    max-height: min(74vh, 600px);
    overflow: hidden;
    padding: 14px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    border: 1px solid var(--border-1); border-radius: 16px;
    background: var(--surface-1);
    box-shadow: 0 24px 64px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.25);
  }
  /* 弹窗头部：标题 + 圆形关闭钮（CSS 画叉，无文字溢出） */
  .g3-plan-mb-hd {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 10px; margin-bottom: 12px;
    border-bottom: 1px solid var(--border-1);
    flex: none;
  }
  .g3-plan-mb-title {
    font-size: 15px; font-weight: 700; letter-spacing: .02em;
    color: var(--text-1);
  }
  .g3-plan-close {
    position: relative; flex: none;
    width: 30px; height: 30px;
    border: 1px solid var(--border-2); border-radius: 50%;
    background: var(--surface-2); cursor: pointer;
    transition: background .15s ease;
  }
  .g3-plan-close::before, .g3-plan-close::after {
    content: ''; position: absolute; left: 50%; top: 50%;
    width: 12px; height: 2px; border-radius: 1px;
    background: var(--text-2);
  }
  .g3-plan-close::before { transform: translate(-50%, -50%) rotate(45deg); }
  .g3-plan-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
  .g3-plan-close:active { background: var(--surface-3, var(--border-1)); }
  /* 弹窗内容区：可滚动，头部保持固定 */
  .g3-wrap.plan-open .g3-plan-body {
    display: flex; flex-direction: column; gap: 10px;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    min-height: 0; flex: 1;
  }
  /* 弹窗内隐藏词汇银行 */
  .g3-wrap.plan-open #gd-vcard { display: none !important; }
  /* 弹窗内卡片：去边框、以面层次代替描边，观感更柔和 */
  .g3-wrap.plan-open .g3-plan-body > .g3-card { background: var(--surface-2); border-color: transparent; margin: 0; }
  /* 弹窗内进度卡与步骤列表的精修：字号加大、统一由内容区滚动 */
  .g3-wrap.plan-open #gd-progress-card { border-radius: 12px; padding: 16px 16px 14px; text-align: left; }
  .g3-wrap.plan-open .g3-stat-row { font-size: 20px; display: flex; align-items: baseline; gap: 2px; }
  .g3-wrap.plan-open .g3-stat-row .g3-stat-label { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 6px; }
  .g3-wrap.plan-open .g3-steps-card { border-radius: 12px; padding-bottom: 4px; }
  .g3-wrap.plan-open .g3-card-hd { padding: 14px 16px 8px; font-size: 13px; }
  .g3-wrap.plan-open .g3-steps { overflow-y: visible; flex: none; padding: 0 16px 10px; }
  .g3-wrap.plan-open .g3-step { font-size: 13px; padding: 7px 0; line-height: 1.5; }
  .g3-wrap.plan-open .g3-step-mark { width: 18px; height: 18px; }
  .g3-wrap.plan-open .g3-backdrop, .g3-wrap.chat-open .g3-backdrop { opacity: 1; pointer-events: auto; }

  /* 右栏（AI 对话）→ 横屏：右侧抽屉（贴到屏幕底，不露缝）；竖屏在下方媒体查询覆盖为底部弹出 */
  #g3-right {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: min(85vw, 380px) !important;
    z-index: 80;
    padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px));
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    border-left: 1px solid var(--border-1);
    background: var(--surface-1);
    box-shadow: 0 0 28px rgba(0,0,0,.4);
    transform: translateX(105%); transition: transform .26s ease;
  }
  .g3-wrap.chat-open #g3-right { transform: translateX(0); }
  #g3-right .g3-chat-card { height: 100%; min-height: 0; }

  /* AI 对话悬浮开关：右下角（底部导航上方） */
  .g3-ai-fab {
    display: inline-flex; align-items: center; gap: 6px;
    position: fixed; z-index: 55;
    right: 12px; bottom: calc(var(--nav-h, 56px) + 12px);
    padding: 8px 13px; border-radius: 999px;
    border: 1px solid var(--accent);
    background: var(--accent); color: var(--on-brand);
    font-size: 13px; font-weight: 600;
    box-shadow: 0 4px 14px rgba(0,0,0,.28); cursor: pointer;
  }
  .g3-wrap.chat-open .g3-ai-fab { display: none; }

  /* 文章一键全屏按钮：仅移动端显示（靠右侧组自动收拢于标题栏末端） */
  .gd-fs-btn { display: inline-flex; }

  /* 全屏阅读：文章卡铺满屏幕、字号放大，横竖屏均可（进入时自动尝试锁定横屏） */
  .g3-passage-card:fullscreen {
    background: var(--surface-1);
    padding: calc(12px + env(safe-area-inset-top, 0px)) 18px calc(12px + env(safe-area-inset-bottom, 0px));
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: 0;
  }
  .g3-passage-card:fullscreen .g3-passage-wrap { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .g3-passage-card:fullscreen .g3-passage { max-width: 860px; margin: 0 auto; font-size: 1.2em; line-height: 1.9; }

  /* 竖屏：AI 对话从底部弹出固定高度面板（不全屏覆盖），贴到屏幕底不露缝，收起时完全滑出 */
  @media (orientation: portrait) {
    #g3-right {
      top: auto;
      left: 0; bottom: 0;
      width: auto !important;
      height: min(58vh, 460px);
      padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
      border-left: none; border-top: 1px solid var(--border-1);
      box-shadow: 0 -8px 28px rgba(0,0,0,.35);
      transform: translateY(105%);
    }
    .g3-wrap.chat-open #g3-right { transform: translateY(0); }
  }

  /* 对话抽屉顶部收起按钮（▾），展开时可见 */
  .g3-chat-collapse {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; padding: 0; margin-right: 4px;
    border: none; border-radius: 50%;
    background: var(--surface-2); color: var(--text-2);
    font-size: 13px; line-height: 1; cursor: pointer;
  }
  .g3-chat-collapse::before { content: '▾'; }

  /* 引导学习开始界面：手机端一屏化（压缩留白、精简层级、列表限高内滚） */
  .start-screen { padding: 16px 14px calc(18px + env(safe-area-inset-bottom, 0px)); gap: 12px; }
  .start-hero::before { display: none; }
  .start-icon { width: 40px; height: 40px; border-radius: 12px; }
  .start-icon svg { width: 20px; height: 20px; }
  .start-title { font-size: 17px; margin-top: 0; }
  .start-desc { font-size: 11.5px; margin: 2px 0 0; }
  /* 题型标签：均匀换行、不再散乱居中 */
  .start-sec-line { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
  .start-sec-tag {
    padding: 3.5px 11px; font-size: 11px;
    border: 1px solid var(--border-1); border-radius: 999px; background: var(--surface-2);
  }
  .start-pick { padding: 12px 13px; }
  .start-pick-hd { margin-bottom: 0; }
  .start-sections-hd { font-size: 12.5px; }
  .start-sections-sub { display: none; } /* 细节说明移除，保持一屏 */
  .start-gen-hint { display: none; }     /* 当前文章提示交给精选卡片高亮呈现 */
  .start-pick-list {
    max-height: min(32vh, 240px); overflow-y: auto; -webkit-overflow-scrolling: touch;
    display: flex; flex-direction: column; gap: 8px; margin-top: 10px;
  }
  .start-pick-card { padding: 9px 11px; }
  .start-pick-title { font-size: 12.5px; }
  .start-actions { gap: 8px; margin-top: 4px; }
  .start-actions .btn-lg { flex: 1; padding: 10px 12px; font-size: 13.5px; border-radius: 11px; }
  .start-hint { margin: 2px 0 0; font-size: 10.5px; }

  /* 模态框：手机端贴底弹出，避免小屏输入被遮挡 */
  .modal-mask { padding: 12px; align-items: flex-end; }
  .modal { max-height: 88vh; }
  .upload-modal { max-height: 88vh; }
  .up-fields { grid-template-columns: 1fr 1fr; }
  .up-fields .up-input:first-child { grid-column: 1 / -1; }

  /* 个人中心用户横幅紧凑换行 */
  .pf-user { padding: 16px; gap: 12px; }
  .hm-exam-row { align-items: center; }
  .hm-phase-foot { gap: 8px; }
  .hm-login-banner { flex-wrap: wrap; gap: 12px; }
  .hm-login-banner .btn { flex: 1 1 100%; }

  /* 词卡学习中大标题缩小 */
  .qbt-card-word { font-size: 26px; }
}

/* 小屏手机（≤480px）进一步压缩 */
@media (max-width: 480px) {
  .topbar { padding: 0 6px 0 0; gap: 6px; }
  .brand { padding: 0 8px; }
  .brand h1 { font-size: 11px; }
  .brand .sub { display: none; }
  .mode-btn { padding: 0 7px; font-size: 10.5px; }
  .theme-mode-btn { padding: 0 8px; }
  .activity-btn { min-width: 42px; }
  .activity-btn .nav-text { font-size: 9.5px; }

  /* 小屏手机：功能导航改为两列，避免按钮过窄 */
  .hm-nav-grid { grid-template-columns: repeat(2, 1fr); }

  .pf-user-top .pf-actions { flex-basis: 100%; margin-left: 0; }
  .pf-user-top .pf-actions .btn { width: 100%; }
  .pf-exam-grid { grid-template-columns: 1fr; }

  .hm-count-num { font-size: 36px; }
  .hm-phase-seg span { display: none; }
  .hm-phase-seg em { font-size: 10px; }
  .qbt-paper-mast-year { font-size: 24px; }
  .qbt-opt { padding: 9px 10px; }
  .toast { max-width: 92vw; }
  .g3-passage { font-size: 15px; padding: 12px 14px; }
  .g3-input-row { padding: 8px; }
  .start-config { padding: 12px; }
  .start-config-grid { grid-template-columns: 1fr; }
}

/* ==================== 引导学习：未选文章空状态 ==================== */
.gd-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  height: 100%;
  min-height: 280px;
  padding: 32px 20px;
}
.gd-empty-icon {
  font-size: 38px;
  line-height: 1;
  width: 72px; height: 72px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: 20px;
}
.gd-empty-title { font-size: 16px; font-weight: 700; color: var(--text-1); }
.gd-empty-sub { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin: 0; }

/* ==================== 引导学习：选择学习文章 ==================== */
.start-pick {
  width: 100%;
  max-width: 420px;
  text-align: left;
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
}
.start-pick-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.start-pick-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.start-pick-loading { font-size: 12px; color: var(--text-3); padding: 8px 0; }
.start-pick-empty {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
  padding: 10px 2px 2px;
}
.start-pick-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s, transform .12s;
}
.start-pick-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.start-pick-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.start-pick-grade {
  font-size: 10px; font-weight: 600; letter-spacing: .03em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px; padding: 2px 9px;
}
.start-pick-diff { font-size: 10px; color: var(--text-3); }
.start-pick-title { font-size: 13.5px; font-weight: 700; color: var(--text-1); line-height: 1.4; }
.start-pick-q {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 引导学习 - 开始界面（渲染在中栏，由 .g3-passage 统一滚动，避免嵌套滚动/滚轮穿透异常） */
.start-screen {
  height: auto;
  justify-content: flex-start;
  white-space: normal;
  cursor: default;
  padding-top: 26px;
  padding-bottom: 34px;
}
.start-hero { width: 100%; max-width: 560px; text-align: center; }
.start-pick { max-width: 560px; }
/* 按题型学习：精简为一行内联标签 */
.start-sec-line {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.start-sec-tag {
  font-size: 11.5px;
  line-height: 1;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-full);
  padding: 5px 11px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.start-sec-tag:hover { color: var(--accent); border-color: var(--accent); }
.start-sec-tag.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
/* 「个人中心」配置入口（内联链接） */
.start-link {
  display: inline;
  font-size: inherit;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.start-link:hover { color: var(--accent-hover); }
/* 未选文章点击「开始学习」时的选文区提示动画 */
.start-pick-nudge {
  animation: startNudge .6s ease 2;
}
@keyframes startNudge {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 0 5px rgba(239, 68, 68, .22); }
}

/* 引导学习开始界面 · 高级化排版（左栏隐藏后中栏全宽居中） */
.start-hero { position: relative; }
.start-hero::before {
  content: "";
  position: absolute;
  top: -90px;
  left: 50%;
  transform: translateX(-50%);
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  opacity: .55;
  pointer-events: none;
  z-index: -1;
}
.start-icon {
  width: 84px; height: 84px;
  border-radius: 24px;
  box-shadow: 0 0 0 10px var(--accent-soft), 0 18px 44px rgba(0, 0, 0, .18);
}
.start-title { font-size: 26px; margin-top: 2px; }
.start-desc { max-width: 460px; font-size: 13.5px; }
/* 按题型标签：更轻的高级感 */
.start-sec-line { margin-top: 12px; }
.start-sec-tag { background: transparent; border-color: transparent; color: var(--text-2); }
.start-sec-tag:hover { background: var(--surface-2); border-color: var(--border-1); color: var(--accent); }
.start-sec-tag.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
/* 选文卡片：留白 + 投影层次 */
.start-pick-card {
  padding: 14px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}
.start-pick-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .10);
}
.start-pick-title { font-size: 14px; }
.start-pick-q { font-size: 12px; }
.start-pick-hd { margin-bottom: 2px; }
/* 主操作按钮更突出 */
.start-actions { gap: 14px; margin-top: 12px; }
.start-actions .btn-lg { padding: 11px 34px; font-size: 14.5px; border-radius: var(--radius-md); }

/* ==================== 我的资料库 ==================== */
.mylib-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.mylib-head .page-tip { flex-basis: 100%; margin-top: 0; }
.mylib-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: 999px;
  padding: 2px 10px;
  vertical-align: middle;
  margin-left: 6px;
}
.mylib-card { min-width: 0; }
.mylib-preview {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═══════════════ 需求5：首页全新视觉（未登录 Hero + 仪表盘新增区块） ═══════════════ */

/* —— 未登录：全屏登录引导 Hero —— */
.hm-hero {
  position: relative;
  overflow: hidden;
  max-width: 720px;
  margin: 26px auto 0;
  padding: 54px 48px 42px;
  text-align: center;
  border: 1px solid var(--border-1);
  border-radius: 18px;
  background:
    radial-gradient(120% 140% at 50% -20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 55%),
    var(--surface-1);
  box-shadow: var(--shadow);
  animation: heroIn .5s ease both;
}
@keyframes heroIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.hm-hero-glow {
  position: absolute;
  top: -150px; left: 50%;
  transform: translateX(-50%);
  width: 540px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 65%);
  filter: blur(10px);
  pointer-events: none;
}
.hm-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
.hm-hero-title {
  margin: 18px 0 0;
  font-size: 34px;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: .01em;
  color: var(--text-1);
}
.hm-hero-title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #4cc3ff));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--accent);
}
.hm-hero-sub {
  margin: 14px auto 0;
  max-width: 480px;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.hm-hero-cta { margin-top: 26px; display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hm-hero-stats {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.hm-hero-stat {
  flex: 1;
  max-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 18px;
}
.hm-hero-stat + .hm-hero-stat { border-left: 1px solid var(--border-1); }
.hm-hero-stat b {
  font-size: 24px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.hm-hero-stat span { font-size: 11.5px; color: var(--text-3); }
.hm-hero-lock {
  margin-top: 26px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--overlay-1);
  border: 1px dashed var(--border-2);
  font-size: 12px;
  color: var(--text-2);
}
.hm-hero-lock svg { flex: none; color: var(--accent); }

/* —— 已登录：欢迎横幅（问候 + 每日金句 + 等级环） —— */
.hm-hero2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  background:
    radial-gradient(90% 160% at 100% 0%, color-mix(in srgb, var(--accent) 9%, transparent), transparent 60%),
    var(--surface-1);
}
.hm-hero2-main { flex: 1; min-width: 0; }
.hm-hero2-side { flex: none; display: flex; align-items: center; gap: 14px; }
.hm-quote {
  margin: 12px 0 0;
  font-size: 13px;
  font-style: italic;
  line-height: 1.7;
  color: var(--text-2);
}

/* —— 粘性三卡：签到 / 每日一词 / 学习日历 —— */
.hm-sticky-card { position: relative; overflow: hidden; }
.hm-sticky-card::before {
  content: "";
  position: absolute;
  top: 0; left: 22px;
  width: 28px; height: 3px;
  border-radius: 0 0 4px 4px;
  background: var(--accent);
}
.hm-checkin {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.hm-checkin-info { flex: 1; min-width: 120px; font-size: 11.5px; line-height: 1.55; color: var(--text-3); }

.hm-word { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.hm-word-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hm-word-w { font-size: 23px; font-weight: 800; letter-spacing: .01em; color: var(--text-1); }
.hm-word-ipa { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); }
.hm-word-pos {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 1px 8px;
  border-radius: 999px;
}
.hm-word-cn { font-size: 13px; font-weight: 600; color: var(--text-1); }
.hm-word-eg {
  font-size: 12px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-3);
  padding-left: 10px;
  border-left: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.hm-word #hm-word-go { align-self: flex-start; margin-top: 2px; }

.hm-cal {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 12px;
}
.hm-cal-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 0 7px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid transparent;
  transition: background .15s, border-color .15s;
}
.hm-cal-day .hm-cal-num { font-size: 14px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; }
.hm-cal-day .hm-cal-label { font-size: 10px; color: var(--text-3); }
.hm-cal-day.on {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}
.hm-cal-day.on .hm-cal-num { color: var(--accent); }
.hm-cal-day.today { border-color: var(--accent); }
.hm-cal-day.today .hm-cal-label { color: var(--accent); font-weight: 700; }

/* —— 引导学习开始界面：文章来源双卡片（AI 生成 + 素材库导入） —— */
.start-source-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.start-source-card {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.start-source-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .10);
}
.start-source-icon {
  flex: none;
  width: 42px; height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}
.start-source-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.start-source-title { font-size: 14px; font-weight: 700; color: var(--text-1); }
.start-source-desc { font-size: 11.5px; line-height: 1.55; color: var(--text-3); }
.start-source-go { flex: none; font-size: 18px; line-height: 1; color: var(--text-3); transition: color .15s, transform .15s; }
.start-source-card:hover .start-source-go { color: var(--accent); transform: translateX(2px); }

/* —— 需求2：首次登录强制设置目标考试弹窗（不可关闭） —— */
.exam-setup-mask {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(4px);
}
.exam-setup-mask.show { display: flex; }
.exam-setup-box {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 34px 34px 26px;
  border-radius: 18px;
  border: 1px solid var(--border-1);
  background: var(--surface-1);
  box-shadow: var(--shadow-pop);
  text-align: center;
  animation: examPop .28s ease both;
}
@keyframes examPop { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.exam-setup-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}
.exam-setup-title { margin: 14px 0 0; font-size: 22px; font-weight: 800; color: var(--text-1); }
.exam-setup-sub { margin: 8px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--text-2); }
.exam-setup-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.exam-setup-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--border-1);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.exam-setup-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.exam-setup-card.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.exam-setup-short {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}
.exam-setup-label { font-size: 13px; font-weight: 700; color: var(--text-1); }
.exam-setup-sub2 { font-size: 11px; line-height: 1.5; color: var(--text-3); }
.exam-setup-confirm {
  width: 100%;
  margin-top: 20px;
  padding: 13px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-brand);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}
.exam-setup-confirm:hover:not(:disabled) { background: var(--accent-hover); }
.exam-setup-confirm:disabled { background: var(--surface-3); color: var(--text-3); cursor: not-allowed; }
.exam-setup-lock { margin-top: 12px; font-size: 11.5px; color: var(--text-3); }

/* —— 移动端适配 —— */
@media (max-width: 768px) {
  .hm-hero { margin-top: 14px; padding: 38px 20px 30px; border-radius: 14px; }
  .hm-hero-title { font-size: 25px; }
  .hm-hero-sub { font-size: 12.5px; }
  .hm-hero-cta { flex-direction: column; align-items: center; }
  .hm-hero-cta .btn { width: 100%; max-width: 320px; }
  .hm-hero-stats { margin-top: 26px; }
  .hm-hero-stat { padding: 4px 10px; }
  .hm-hero-stat b { font-size: 19px; }
  .hm-hero-lock { padding: 7px 12px; font-size: 11px; line-height: 1.5; }

  .hm-hero2 { flex-direction: column; align-items: stretch; padding: 18px; }
  .hm-hero2-side { justify-content: space-between; }
  .hm-quote { font-size: 12.5px; }

  .hm-cal-day { padding: 7px 0 5px; border-radius: 8px; }
  .hm-cal-day .hm-cal-num { font-size: 12.5px; }
  .hm-word-w { font-size: 21px; }

  .start-source-cards { grid-template-columns: 1fr; }
  .start-source-card { padding: 14px; }

  .exam-setup-box { padding: 26px 18px 20px; }
  .exam-setup-grid { grid-template-columns: 1fr; gap: 8px; }
  .exam-setup-card { flex-direction: row; align-items: center; }
  .exam-setup-sub2 { display: none; }
}