/* ============================================================
 * E234 ELearn 风格样式（阶段 2 生产环境）
 * ------------------------------------------------------------
 * 主色调：紫色 #6366f1（参考 elearn.elsetech.app）
 * 与 assets/css/style.css（珊瑚橙 --coral-*）并存，无变量冲突
 *
 * 使用规则：
 *   · ELearn 风格新页面（list/wordset/learn/notebook/profile）
 *     只引 elearn.css，不引 style.css
 *   · dictation / review 等未迁移页面继续用 style.css
 *   · 公共 header（includes/header.php）强依赖 elearn.css
 * ============================================================ */

:root {
  /* 主色 */
  --primary: #6366f1;
  --primary-strong: #4f46e5;
  --primary-press: #4338ca;
  --primary-soft: #eef1ff;
  --primary-soft-2: #e3e8ff;
  --primary-ring: rgba(99, 102, 241, .28);

  /* 渐变 */
  --gradient: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  --gradient-soft: linear-gradient(135deg, #eef2ff 0%, #f5f0ff 100%);

  /* 辅助色 */
  --violet: #7c3aed;
  --amber: #f59e0b;
  --green: #16a34a;
  --blue: #2563eb;
  --red: #ef4444;

  /* 背景 & 文字 */
  --bg: #f4f5fb;
  --bg-tint: radial-gradient(1200px 600px at 50% -200px, #eaecfb 0%, rgba(244, 245, 251, 0) 70%);
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --text: #1a1d29;
  --text-2: #525a6b;
  --text-3: #8b93a4;
  --text-4: #b3bac7;
  --border: #eceef3;
  --border-strong: #e0e3ec;

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(20, 24, 40, .04);
  --shadow-sm: 0 1px 3px rgba(20, 24, 40, .05), 0 1px 2px rgba(20, 24, 40, .03);
  --shadow-md: 0 6px 16px -8px rgba(20, 24, 40, .16), 0 2px 6px -2px rgba(20, 24, 40, .06);
  --shadow-lg: 0 18px 40px -16px rgba(28, 27, 84, .28), 0 4px 12px -6px rgba(20, 24, 40, .08);
  --shadow-primary: 0 10px 24px -10px rgba(99, 102, 241, .6);

  /* 字体 */
  --ipa-font: "Charis SIL", "Doulos SIL", "Gentium Plus", "Lucida Sans Unicode", system-ui, sans-serif;

  /* 布局 */
  --header-h: 62px;
  --maxw: 1080px;
  --header-bg: rgba(255, 255, 255, .82);
  --nav-bg: rgba(255, 255, 255, .92);
  --brand: #312e81;

  color-scheme: light;
}

/* 深色模式（预留） */
:root[data-theme="dark"] {
  --primary: #818cf8;
  --primary-strong: #a5b4fc;
  --primary-soft: #20233a;
  --primary-soft-2: #2a2e4a;
  --gradient: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  --gradient-soft: linear-gradient(135deg, #20233a 0%, #2a2340 100%);
  --bg: #0e0f14;
  --bg-tint: radial-gradient(1200px 600px at 50% -200px, #1b1d31 0%, rgba(14, 15, 20, 0) 70%);
  --surface: #181a21;
  --surface-2: #1f222b;
  --text: #e6e8ee;
  --text-2: #a8b0be;
  --text-3: #79818f;
  --text-4: #565d6b;
  --border: #272a33;
  --border-strong: #363b47;
  --header-bg: rgba(18, 20, 26, .8);
  --nav-bg: rgba(18, 20, 26, .9);
  --brand: #c7d2fe;
  color-scheme: dark;
}

/* ---------- 基础重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--primary-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
button:disabled { opacity: .5; cursor: not-allowed !important; }
input, textarea, select { font-family: inherit; }
::selection { background: var(--primary-soft-2); }
h1, h2, h3, h4, p { margin: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s ease, box-shadow .16s ease, background .16s ease,
    border-color .16s ease, color .16s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 1px; }
.btn--primary { background: var(--gradient); color: #fff; box-shadow: var(--shadow-primary); }
.btn--primary:hover { filter: brightness(1.05); }
.btn--outline { background: var(--surface); color: var(--primary-strong); border-color: var(--border-strong); }
.btn--outline:hover { border-color: var(--primary); background: var(--primary-soft); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--lg { padding: 15px 26px; font-size: 16px; border-radius: var(--r-lg); }
.btn--sm { padding: 7px 13px; font-size: 13px; border-radius: var(--r-sm); }
.btn--block { width: 100%; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

/* ---------- 分段控件 ---------- */
.segmented {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.segmented__btn {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.segmented__btn:hover { color: var(--text); }
.segmented__btn.is-active {
  background: var(--surface);
  color: var(--primary-strong);
  box-shadow: var(--shadow-xs);
}

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 650;
  border-radius: var(--r-pill);
  padding: 3px 9px;
  line-height: 1.4;
}
.badge--scene {
  color: var(--violet);
  background: #f3effe;
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 10px;
}
.badge--pos {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 700;
}

/* 键位提示 */
.kbd {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  line-height: 1.5;
}

.muted { color: var(--text-3); }
/* 注意：不加 !important，否则会挡住 Tailwind responsive 变体（如 lg:flex / md:block），
   而项目 pages/notebook/index.php 等页面严重依赖 <div class="hidden lg:flex"> 这种写法。
   需要强制隐藏时请用 [hidden] 属性或加更具体的选择器。 */
.hidden { display: none; }
/* ⚠️ 严禁给上面那条 .hidden 加 !important 或 .hidden.hidden 提高优先级 —— 那样会挡住
   Tailwind 的 .lg:flex / .md:block（这些优先级只有 10），导致 profile 侧栏、notebook
   桌面三栏之类"移动隐藏、桌面显示"的元素永远消失。
   ------------------------------------------------------------
   如果某个具体元素（例如 .form-field 因为定义了 display:flex）导致 .hidden 失效，
   请像下面这样做外科手术级特化，只针对那一类元素：*/
.form-field.hidden { display: none; }  /* 修 login_modal.php 里"确认密码"字段隐藏失效 */

/* ============================================================
 * 页面骨架
 * ============================================================ */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-image: var(--bg-tint);
  background-repeat: no-repeat;
}

/* 顶部栏 */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.app-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.01em;
  color: var(--brand);
}
.brand:hover { text-decoration: none; opacity: .85; }
.brand__logo {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--gradient);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
}

/* 顶部导航 */
.nav { display: flex; gap: 4px; }
.nav__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: var(--r-md);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: background .15s ease, color .15s ease;
}
.nav__link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav__link.is-active { color: var(--primary-strong); background: var(--primary-soft); }
.nav__link svg { width: 18px; height: 18px; }

.app-header__right { display: flex; align-items: center; gap: 6px; }
.icon-btn-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.icon-btn-header:hover { color: var(--text); background: var(--surface-2); }
.icon-btn-header svg { width: 19px; height: 19px; }

/* 主内容区 */
.app-main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px 20px 48px;
}

/* 底部 tab bar（移动端） */
.bottom-nav { display: none; }

@media (max-width: 720px) {
  :root { --header-h: 56px; }
  .app-header__inner { padding: 0 16px; }
  .nav { display: none; }
  .app-main { padding: 20px 16px calc(78px + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid var(--border);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    border-radius: var(--r-md);
    transition: color .15s ease;
    text-decoration: none;
  }
  .bottom-nav__item:hover { text-decoration: none; }
  .bottom-nav__item.is-active { color: var(--primary-strong); }
  .bottom-nav__item svg { width: 23px; height: 23px; }
}

/* ============================================================
 * 首页
 * ============================================================ */
.home { max-width: 560px; margin: 0 auto; }
.home__greeting {
  font-size: 30px;
  font-weight: 780;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}
.home__sub { color: var(--text-3); font-size: 15px; margin-top: 6px; }

/* 学习卡片（首页的紫色渐变卡片） */
.study-card {
  margin-top: 26px;
  border-radius: var(--r-xl);
  padding: 22px;
  background: var(--gradient);
  box-shadow: var(--shadow-lg);
  color: #fff;
}
.study-card__label { font-size: 13px; font-weight: 600; opacity: .85; }
.mode-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 12px 0 14px;
}
.mode-btn {
  border: 1.5px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .92);
  border-radius: var(--r-md);
  height: 44px;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.mode-btn:hover { background: rgba(255, 255, 255, .2); }
.mode-btn:active { transform: translateY(1px); }
.mode-btn.is-active { background: #fff; color: var(--primary-strong); border-color: #fff; }
.mode-desc { font-size: 13px; opacity: .9; min-height: 19px; margin-bottom: 16px; }
.study-start {
  width: 100%;
  padding: 15px 0;
  border: none;
  border-radius: var(--r-lg);
  background: #fff;
  color: var(--primary-strong);
  font-size: 16px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .1s ease, box-shadow .15s ease;
}
.study-start:hover { box-shadow: 0 8px 20px -8px rgba(0, 0, 0, .3); }
.study-start:active { transform: translateY(1px); }

/* 统计卡 */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.stat-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .13s ease, box-shadow .16s ease, border-color .16s ease;
  color: var(--text);
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  text-decoration: none;
  color: var(--text);
}
.stat-card__num {
  font-size: 30px;
  font-weight: 760;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--primary-strong);
}
.stat-card__num--green { color: var(--green); }
.stat-card__num--amber { color: var(--amber); }
.stat-card__label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-3);
  margin-top: 5px;
  font-weight: 500;
}

/* ============================================================
 * 学习练习页
 * ============================================================ */
.practice-progress { margin-bottom: 22px; }
.practice-progress__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}
.practice-progress__text { font-size: 13px; color: var(--text-3); font-weight: 500; }
.progress-track {
  height: 6px;
  background: var(--border);
  border-radius: var(--r-pill);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient);
  border-radius: var(--r-pill);
  transition: width .35s ease;
}

/* 单词卡片主容器 */
.word-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 28px 30px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* 卡片头部：单词 + IPA + 音频 + 星标 */
.wc-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.wc-head-left {
  display: flex;
  align-items: baseline;
  gap: 18px;
  flex-wrap: wrap;
}
.wc-word {
  font-size: 40px;
  font-weight: 760;
  letter-spacing: -.02em;
  line-height: 1.05;
}
.wc-ipa-row { display: flex; gap: 16px; flex-wrap: wrap; }
.wc-ipa-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.wc-ipa-label {
  font-size: 10.5px;
  color: #fff;
  background: var(--text-4);
  border-radius: 4px;
  padding: 1px 5px;
  font-weight: 700;
}
.wc-ipa {
  font-size: 16px;
  color: var(--text-2);
  font-family: var(--ipa-font);
}

/* 小图标按钮（发音喇叭） */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 15px;
  padding: 0;
  transition: background .14s ease, border-color .14s ease;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--primary-soft); border-color: var(--primary-soft-2); color: var(--primary-strong); }
.icon-btn.is-playing { background: var(--primary-soft-2); color: var(--primary-strong); }

/* 星标（生词本） */
.star-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
  padding: 0 2px;
  transition: transform .12s ease;
  color: var(--text-4);
  position: relative;
}
.star-btn:hover { transform: scale(1.12); color: var(--amber); }
.star-btn.is-active { color: var(--amber); }
.star-btn__tooltip {
  position: absolute;
  top: 50%;
  right: calc(100% + 8px);
  transform: translateY(-50%);
  background: var(--text);
  color: #fff;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.star-btn:hover .star-btn__tooltip { opacity: 1; }

/* 显示释义（正面按钮） */
.reveal-wrap {
  display: flex;
  justify-content: center;
  padding: 40px 0;
}
.reveal-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 26px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: transform .1s ease, box-shadow .15s ease;
}
.reveal-btn:hover { filter: brightness(1.05); }
.reveal-btn:active { transform: translateY(1px); }

/* 背面三栏 */
.wc-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 26px;
  align-items: start;
}
.wc-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.wc-col-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--border);
}
@media (max-width: 720px) {
  .wc-cols { grid-template-columns: 1fr; gap: 20px; }
}

/* 释义项 */
.def-item { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.def-en { font-size: 14px; color: var(--text); line-height: 1.55; }
.def-zh { font-size: 13px; color: var(--text-3); }

/* 记忆魔法（点释义时展开的黄卡） */
.mnemonic-box {
  margin-top: 6px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #fff8e1 0%, #ffefd5 100%);
  border: 1px solid #ffe08a;
  border-radius: var(--r-md);
  font-size: 12.5px;
  color: #7c4a03;
  line-height: 1.55;
  animation: fade-slide-in .25s ease;
}
.mnemonic-box__title {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  color: #b26b00;
  font-size: 11.5px;
  margin-bottom: 4px;
}
[data-theme="dark"] .mnemonic-box {
  background: rgba(120, 80, 20, .3);
  border-color: rgba(255, 200, 100, .3);
  color: #ffd58a;
}
[data-theme="dark"] .mnemonic-box__title { color: #ffc266; }

/* 词根词缀 */
.root-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.root-title { font-size: 11px; font-weight: 700; color: var(--text-3); }
.root-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  line-height: 1.45;
}
.root-token { font-weight: 700; color: var(--primary-strong); }
.root-meaning { color: var(--text-2); }
.root-note { color: var(--text-3); }

/* 词组项 */
.phrase-item { display: flex; flex-direction: column; gap: 3px; }
.phrase-en { font-size: 14px; font-weight: 650; color: var(--text); }
.phrase-zh { font-size: 13px; color: var(--text-2); }
.phrase-scene {
  align-self: flex-start;
  font-size: 10px;
  color: var(--violet);
  font-weight: 650;
  background: #f3effe;
  border-radius: 5px;
  padding: 1px 7px;
}

/* 例句项 */
.ex-item { display: flex; flex-direction: column; gap: 2px; }
.ex-en { font-size: 14px; color: var(--text); line-height: 1.55; }
.ex-zh { font-size: 13px; color: var(--text-3); }

/* 可点击/可悬停朗读的词 */
.speakable {
  cursor: pointer;
  border-radius: 3px;
  padding: 0 1px;
  transition: color .12s ease, background .12s ease;
}
.speakable:hover {
  color: var(--primary-strong);
  background: var(--primary-soft);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.speakable.is-speaking {
  color: var(--primary-strong);
  background: var(--primary-soft-2);
}

.empty-dash { color: var(--text-4); font-size: 14px; }

/* 底部评分栏 */
.rating-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.rating-label-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.rating-label { font-size: 14px; color: var(--text-2); font-weight: 550; }

/* 帮助按钮（问号） */
.help-btn {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color .14s ease, border-color .14s ease, background .14s ease;
}
.help-btn:hover,
.help-btn[aria-expanded="true"] {
  color: var(--primary-strong);
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* 5 级评分说明弹层 */
.rating-help {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  z-index: 60;
  width: min(340px, 80vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  text-align: left;
  animation: pop-in .16s ease;
}
.rating-help__title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 6px;
}
.rating-help__item {
  display: flex;
  gap: 9px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.rating-help__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.rating-help__name { font-size: 13.5px; font-weight: 650; color: var(--text); }
.rating-help__desc { font-size: 12.5px; color: var(--text-2); line-height: 1.55; margin-top: 2px; }
.rating-help__note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}

/* 5 个评分按钮 */
.rating-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.rating-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1.5px solid;
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 650;
  background: var(--surface);
  transition: all .14s ease;
}
.rating-btn:hover { transform: translateY(-1px); }
.rating-num { font-size: 11px; opacity: .55; font-weight: 700; }

/* 5 种评分颜色 */
.rating-btn[data-rating="1"] { border-color: #ef4444; color: #ef4444; }
.rating-btn[data-rating="1"]:hover { background: #fef2f2; }
.rating-btn[data-rating="2"] { border-color: #f97316; color: #f97316; }
.rating-btn[data-rating="2"]:hover { background: #fff7ed; }
.rating-btn[data-rating="3"] { border-color: #16a34a; color: #16a34a; }
.rating-btn[data-rating="3"]:hover { background: #f0fdf4; }
.rating-btn[data-rating="4"] { border-color: #2563eb; color: #2563eb; }
.rating-btn[data-rating="4"]:hover { background: #eff6ff; }
.rating-btn[data-rating="5"] { border-color: #7c3aed; color: #7c3aed; }
.rating-btn[data-rating="5"]:hover { background: #f5f3ff; }

@media (max-width: 720px) {
  .word-card { padding: 22px 18px; border-radius: var(--r-lg); }
  .wc-word { font-size: 32px; }
  .rating-bar { flex-direction: column; align-items: stretch; gap: 12px; }
  .rating-label-wrap { justify-content: center; }
  .rating-btns { display: grid; grid-template-columns: 1fr 1fr; }
  .rating-btn { justify-content: center; }
}

/* 顶部返回条 */
.top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.top-row__back {
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: background .14s ease;
}
.top-row__back:hover { background: var(--surface-2); }
.top-row__prog { font-size: 13px; color: var(--text-3); font-weight: 600; }

/* 完成态 */
.done-card { text-align: center; padding: 24px; }
.done-icon {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  background: var(--gradient-soft);
  border-radius: 50%;
}
.done-title { font-size: 23px; font-weight: 750; }
.done-desc { color: var(--text-3); font-size: 15px; margin-top: 8px; }

/* ============================================================
 * 生词本 & 词库列表
 * ============================================================ */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-title { font-size: 24px; font-weight: 760; letter-spacing: -.02em; }
.page-count { color: var(--text-3); font-size: 14px; font-weight: 500; }

.wb-list { display: flex; flex-direction: column; }
.wb-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--border);
}
.wb-row:last-child { border-bottom: none; }
.wb-word { font-weight: 650; font-size: 16px; }
.wb-ipa {
  font-size: 13px;
  color: var(--text-3);
  font-family: var(--ipa-font);
  margin: 0 10px;
}
.wb-def { font-size: 13px; color: var(--text-2); }

.remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 550;
  transition: color .14s ease;
}
.remove-btn:hover { color: var(--red); }

.badge--learning {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 650;
}
.badge--mastered {
  color: var(--green);
  background: #f0fdf4;
  border-radius: 5px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 650;
}

.empty-state { text-align: center; padding: 56px 0; color: var(--text-2); }
.empty-state__icon { font-size: 44px; margin-bottom: 14px; }

/* ============================================================
 * 设置 / 关于
 * ============================================================ */
.settings, .about { max-width: 680px; margin: 0 auto; }
.settings-section, .about-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.settings-section__title, .about-section__title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 16px;
}
.settings-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  gap: 12px;
}
.settings-field__label { font-size: 14px; color: var(--text); }
.settings-field__value { font-size: 14px; color: var(--text-3); }

.shortcut-list { display: flex; flex-direction: column; gap: 10px; }
.shortcut-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}
.shortcut-row:last-child { border-bottom: none; }
.shortcut-row__desc { color: var(--text-2); }
.shortcut-row__keys { display: inline-flex; gap: 4px; }

.about-p {
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 12px;
}
.about-p:last-child { margin-bottom: 0; }
.about-p b { color: var(--text); font-weight: 650; }
.about-p--muted { font-size: 13.5px; color: var(--text-3); }

/* ============================================================
 * 动画
 * ============================================================ */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-slide-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
@keyframes card-flip-in {
  from { opacity: 0; transform: rotateY(-8deg) scale(.96); }
  to { opacity: 1; transform: none; }
}
.fade-in { animation: fade-in .2s ease; }
.card-flip-in { animation: card-flip-in .3s ease; }

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 550;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  animation: pop-in .2s ease;
}

/* ============================================================
 * 生产环境补充组件（阶段 2 新增）
 * ============================================================ */

/* ---------- 品牌名文字渐变（顶部 E234 logo）---------- */
.brand__title {
  background: linear-gradient(270deg, #6366f1 0%, #7c3aed 25%, #6366f1 50%, #7c3aed 75%, #6366f1 100%);
  background-clip: text;
  -webkit-background-clip: text;
  background-size: 200% 100%;
  -webkit-text-fill-color: transparent;
  animation: masked-animation 5s linear infinite;
}
@keyframes masked-animation {
  0% { background-position-x: 0%; }
  100% { background-position-x: -200%; }
}

/* ---------- 页脚 ---------- */
.page-footer {
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 40px;
}
.page-footer a { color: var(--text-3); }
.page-footer a:hover { color: var(--primary-strong); }

@media (max-width: 720px) {
  .page-footer { margin-bottom: 60px; } /* 给 bottom-nav 让位 */
}

/* ---------- 模态框（登录 / 通用弹窗）---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade-in .18s ease;
}
.modal-backdrop.hidden { display: none; }
.modal-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px 26px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: pop-in .22s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.modal-title {
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.01em;
  color: var(--text);
}
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--surface-2);
  color: var(--text-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .14s ease, color .14s ease;
}
.modal-close:hover { background: var(--border); color: var(--text); }

/* ---------- 表单 ---------- */
.form-stack { display: flex; flex-direction: column; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}
.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  transition: border-color .14s ease, box-shadow .14s ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.form-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
  margin-top: 14px;
}
.form-hint a { color: var(--primary-strong); font-weight: 600; }

/* ---------- Toast 容器 ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-container .toast {
  position: static;
  transform: none;
  pointer-events: auto;
}
.toast--success { background: var(--green); }
.toast--error   { background: var(--red); }
.toast--warning { background: var(--amber); color: #1a1a1a; }

/* ---------- 头像 / 登录按钮（#user-area）---------- */
.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
  border: 2px solid transparent;
}
.user-avatar:hover { transform: scale(1.06); box-shadow: var(--shadow-primary); }
.user-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

.login-btn {
  padding: 8px 16px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
}
.login-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-primary); }

/* ---------- 移动端抽屉菜单 ---------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(0, 0, 0, .5);
  display: none;
}
.drawer-backdrop.is-open { display: block; animation: fade-in .18s ease; }
.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  max-width: 82vw;
  background: var(--surface);
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  animation: slide-left .2s ease;
}
@keyframes slide-left {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.drawer-close {
  width: 34px; height: 34px;
  border-radius: 50%; border: none;
  background: var(--surface-2); color: var(--text-2);
  cursor: pointer;
  margin-bottom: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.drawer-nav__link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 14.5px;
  font-weight: 600;
  transition: background .14s ease, color .14s ease;
  text-decoration: none;
}
.drawer-nav__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.drawer-nav__link.is-active { background: var(--primary-soft); color: var(--primary-strong); }
.drawer-nav__link svg { width: 20px; height: 20px; flex-shrink: 0; }

/* 汉堡按钮（移动端顶部）*/
.hamburger-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.hamburger-btn:hover { background: var(--surface-2); color: var(--text); }
.hamburger-btn svg { width: 22px; height: 22px; }
@media (max-width: 720px) {
  .hamburger-btn { display: inline-flex; }
}

/* ---------- 通用工具类 ---------- */
.container-narrow { max-width: 720px; margin: 0 auto; }
.text-center { text-align: center; }
.mt-6 { margin-top: 24px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
