/* ============================================================
   蓝白设计系统（风格参考 mbti.yahui.co：浅色卡片 / 大圆角 / 柔和阴影 / 平滑动效）
   ============================================================ */
:root {
  --brand-50: #eff6ff;
  --brand-100: #dbeafe;
  --brand-200: #bfdbfe;
  --brand-300: #93c5fd;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-700: #1d4ed8;

  --surface: #f6f9fc;
  --card: #ffffff;
  --text-1: #0f172a;
  --text-2: #5f6b7a;
  --text-3: #94a3b8;
  --border: #e8eef5;

  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 6px rgba(16, 24, 40, .06);
  --shadow-md: 0 10px 24px -8px rgba(16, 24, 40, .12);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);

  --radius-sm: .6rem;
  --radius-md: .85rem;
  --radius-lg: 1.1rem;
  --radius-xl: 1.4rem;

  --ease: cubic-bezier(.4, 0, .2, 1);

  /* 重主题 Bootstrap 主色（蓝色 #2563eb） */
  --bs-primary: #2563eb;
  --bs-primary-rgb: 37, 99, 235;
  --bs-primary-text-emphasis: #1d4ed8;
  --bs-primary-bg-subtle: #dbeafe;
  --bs-primary-border-subtle: #bfdbfe;
  --bs-link-color: #2563eb;
  --bs-link-color-rgb: 37, 99, 235;
  --bs-link-hover-color: #1d4ed8;
  --bs-link-hover-color-rgb: 29, 78, 216;
  --bs-body-color: #0f172a;
  --bs-body-bg: #f6f9fc;
  --bs-border-color: #e8eef5;
}

/* ===== 基础 ===== */
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
  margin: 0;
  padding: 0;
}
body {
  margin: 0;
  padding: 0;
  background: var(--surface);
  color: var(--text-1);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    "WenQuanYi Micro Hei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { text-decoration: none; }
h1, h2, h3, h4, h5, h6 { color: var(--text-1); letter-spacing: -.01em; }
.text-muted { color: var(--text-3) !important; }
.footer { margin-top: 3rem; }

/* ===== 导航栏（毛玻璃白色 + 蓝色点缀） ===== */
.app-navbar {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
.app-navbar .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-600);
  font-weight: 800;
  letter-spacing: -.01em;
}
.app-navbar .navbar-brand .brand-logo { height: 40px; width: auto; display: block; }
.app-navbar .nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--text-2);
  font-weight: 600;
  font-size: 20px;
  padding: 6px 12px;
  border-radius: 999px;
  transition: color .18s var(--ease), background .18s var(--ease), text-shadow .18s var(--ease);
}
.app-navbar .nav-link:hover { color: var(--brand-600); background: var(--brand-50); }
.app-navbar .nav-link .nav-icon { flex: none; width: 16px; height: 16px; }
.app-nav-menu { gap: .25rem; }
@media (min-width: 992px) {
  .app-nav-menu { gap: 1.5rem; }
}

/* ===== 首页 Hero ===== */
.hero {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 40%, #60a5fa 100%);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-xl);
}
.hero h1 { color: #fff; }
.hero p { color: rgba(255, 255, 255, .9); }

/* ===== 卡片通用 ===== */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  background: var(--card);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.card-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0 !important; }

/* 可点击卡片的悬浮上浮 */
.wordbook-card { cursor: pointer; }
.wordbook-card:hover,
a .card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.wordbook-cover {
  height: 110px; display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; color: #fff; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: linear-gradient(135deg, var(--brand-500), var(--brand-400));
}
.wordbook-cover.alt-1 { background: linear-gradient(135deg, #60a5fa, #93c5fd); }
.wordbook-cover.alt-2 { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.wordbook-cover.alt-3 { background: linear-gradient(135deg, #2563eb, #60a5fa); }
.wordbook-cover.alt-4 { background: linear-gradient(135deg, #38bdf8, #60a5fa); }

/* 词库分组标题 */
.wb-group-icon { font-size: 1.5rem; line-height: 1; margin-right: .4rem; }

/* 级别配色（封面 + 徽章） */
.wordbook-cover { font-weight: 700; letter-spacing: 3px; }
.wordbook-cover.lv-primary { background: linear-gradient(135deg, #10b981, #34d399); }
.wordbook-cover.lv-junior { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.wordbook-cover.lv-senior { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }
.wordbook-cover.lv-college { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.wordbook-cover.lv-abroad { background: linear-gradient(135deg, #06b6d4, #22d3ee); }
.wordbook-cover.lv-other { background: linear-gradient(135deg, #64748b, #94a3b8); }

.badge.lv-primary { background: #d1fae5; color: #065f46; }
.badge.lv-junior { background: #dbeafe; color: #1e40af; }
.badge.lv-senior { background: #ede9fe; color: #5b21b6; }
.badge.lv-college { background: #fef3c7; color: #92400e; }
.badge.lv-abroad { background: #cffafe; color: #155e75; }
.badge.lv-other { background: #e2e8f0; color: #475569; }

/* 关卡卡片 */
.level-card {
  min-height: 96px; cursor: pointer;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.level-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.level-done { opacity: 1; background: linear-gradient(180deg, #f0fdf4, #fff); }
.level-doing { border: 2px solid var(--brand-500); }

/* 文章封面 */
.article-cover {
  height: 140px; background: #e9eef5; overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.article-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease); }
a:hover .article-cover img { transform: scale(1.05); }
.article-cover-lg { height: 240px; }

/* ===== 按钮 ===== */
.btn { border-radius: var(--radius-sm); font-weight: 600; transition: all .18s var(--ease); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-lg { border-radius: var(--radius-md); padding: .7rem 1.6rem; }
.btn-primary { box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .5); }
.btn-primary:hover { box-shadow: 0 8px 20px -6px rgba(37, 99, 235, .55); }

.badge { font-weight: 600; border-radius: 999px; }

/* ===== 闯关页 ===== */
.study-topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-xs);
  border-radius: var(--radius-lg);
}
.speaker-btn {
  width: 96px; height: 96px; border-radius: 50%; font-size: 2.4rem;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
.speaker-btn:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }

/* 英式/美式发音切换按钮组 */
.speak-duo { display: inline-flex; gap: .5rem; justify-content: center; }
.speak-chip {
  border-radius: 999px;
  padding: .4rem 1rem;
  font-weight: 600;
  white-space: nowrap;
}
.speak-chip .flag { font-size: 1.05rem; }

/* 模式1：选项卡片 */
.option-card {
  border: 2px solid var(--border); border-radius: var(--radius-md); padding: 1.1rem;
  cursor: pointer; transition: all .15s var(--ease); background: #fff; text-align: center;
  box-shadow: var(--shadow-xs);
}
.option-card:hover { border-color: var(--brand-500); background: var(--brand-50); transform: translateY(-2px); }
.option-card .opt-word { font-size: 1.25rem; font-weight: 700; }
.option-card.correct { border-color: #16a34a; background: #dcfce7; }
.option-card.wrong { border-color: #dc2626; background: #fee2e2; }

/* 模式2：字母键盘 */
.word-input {
  font-size: 1.8rem; letter-spacing: .2em; text-align: center; font-weight: 700;
  border-radius: var(--radius-md);
}
.keyboard { max-width: 560px; margin: 0 auto; }
.key-btn {
  min-width: 44px; height: 48px; margin: 3px; font-weight: 600;
  border-radius: .6rem;
}
.key-btn.key-used { opacity: .35; pointer-events: none; }

/* 模式3：消消乐 */
.match-tip { max-width: 520px; margin-inline: auto; }
.match-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: .7rem;
  max-width: 900px;
  margin: 0 auto;
}
.match-tile {
  position: relative;
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .6rem .5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  user-select: none;
  text-align: center;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), opacity .3s var(--ease), border-color .15s var(--ease);
  box-shadow: var(--shadow-sm);
}
.match-tile.eng {
  background: linear-gradient(160deg, #eff6ff, #dbeafe);
  border: 2px solid #bfdbfe;
  color: #1d4ed8;
}
.match-tile.chi {
  background: linear-gradient(160deg, #fffbeb, #fef3c7);
  border: 2px solid #fde68a;
  color: #b45309;
}
.match-tile .mt-side {
  position: absolute;
  top: 4px; right: 7px;
  font-size: .6rem;
  font-weight: 800;
  letter-spacing: .04em;
  opacity: .45;
}
.match-tile .mt-text { line-height: 1.3; word-break: break-word; overflow-wrap: anywhere; }
.match-tile.eng .mt-text { font-size: .95rem; font-weight: 700; }
.match-tile.chi .mt-text { font-size: .78rem; font-weight: 600; }
.match-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.match-tile.selected {
  border-color: var(--brand-500);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .18);
}
.match-tile.matched { opacity: 0; transform: scale(.6); pointer-events: none; }
.match-tile.flash-wrong {
  border-color: #dc2626 !important;
  background: #fee2e2 !important;
  color: #b91c1c !important;
  animation: match-shake .4s var(--ease);
}
@keyframes match-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}

.match-timer {
  font-weight: 800;
  font-size: 1.05rem;
  padding: .28rem .85rem;
  border-radius: 999px;
  background: #ecfdf5;
  color: #059669;
  border: 1.5px solid #a7f3d0;
  font-variant-numeric: tabular-nums;
  min-width: 78px;
  text-align: center;
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.match-timer.danger {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
  animation: timer-pulse 1s infinite;
}
@keyframes timer-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.match-acc { background: #eef2ff; color: #4338ca; }

@media (max-width: 768px) {
  .match-grid { grid-template-columns: repeat(4, 1fr); gap: .55rem; }
}
@media (max-width: 480px) {
  .match-grid { grid-template-columns: repeat(3, 1fr); gap: .45rem; }
  .match-tile { min-height: 68px; }
}

/* 关卡页模式标签 */
.study-mode-tabs { gap: .5rem; }
.study-mode-tabs .nav-link {
  border-radius: 999px;
  padding: .5rem 1.1rem;
  font-weight: 600;
  color: var(--text-2);
  background: #fff;
  border: 1px solid var(--border);
  transition: all .18s var(--ease);
}
.study-mode-tabs .nav-link:hover { color: var(--brand-600); border-color: var(--brand-300); }
.study-mode-tabs .nav-link.active {
  color: #fff;
  background: var(--brand-600);
  border-color: var(--brand-600);
  box-shadow: var(--shadow-sm);
}
.study-mode-tabs .tab-hint { font-size: .72rem; font-weight: 500; opacity: .85; margin-left: .2rem; }

/* 结果页 */
.result-circle {
  width: 140px; height: 140px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: var(--shadow-lg);
}

/* 错题复习 闪卡 */
.flashcard {
  min-height: 220px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; background: #fff; box-shadow: var(--shadow-sm);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.flashcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.flashcard .fc-word { font-size: 2.2rem; font-weight: 700; }

/* 后台 */
.admin-sidebar .nav-link { color: #adb5bd; }
.admin-sidebar .nav-link:hover, .admin-sidebar .nav-link.active { color: #fff; background: rgba(255,255,255,.1); }

/* 错题复习：点击卡片翻面 */
.review-item .flashcard { min-height: 200px; display: flex; }
.review-item .fc-front, .review-item .fc-back {
  width: 100%; min-height: 200px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.review-item .fc-front .fc-word { font-size: 1.6rem; font-weight: 700; }
.review-item .fc-back { display: none; }
.review-item.show-back .fc-front { display: none; }
.review-item.show-back .fc-back { display: flex; }

/* 闯关页反馈 */
.study-feedback { border-radius: var(--radius-lg); }
.study-feedback.ok { background: #dcfce7; border: 2px solid #16a34a; }
.study-feedback.no { background: #fee2e2; border: 2px solid #dc2626; }

/* ===== 导航高亮 & 幽灵按钮 ===== */
.app-navbar .nav-link.active {
  color: var(--brand-600);
  background: var(--brand-50);
  font-weight: 600;
}
.btn-ghost { color: var(--text-2); border: 1px solid transparent; }
.btn-ghost:hover { color: var(--brand-600); background: var(--brand-50); }

/* ===== 首页：单屏 Hero + 可切换背景 ===== */
body.home { background: #fff; height: 100vh; height: 100svh; overflow: hidden; }
body.home .app-navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1030;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: none;
}
body.home .app-navbar .navbar-brand,
body.home .app-navbar .nav-link {
  color: rgba(255, 255, 255, .95);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
body.home .app-navbar .nav-link:hover,
body.home .app-navbar .nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, .15);
  text-shadow: 0 1px 3px rgba(0, 0, 0, .65);
}
body.home .app-navbar .btn-ghost { color: rgba(255, 255, 255, .92); }
body.home .app-navbar .btn-ghost:hover { color: #fff; background: rgba(255, 255, 255, .18); }
body.home .app-navbar .btn-outline-primary { color: #fff; border-color: rgba(255, 255, 255, .65); }
body.home .app-navbar .btn-outline-primary:hover { color: #fff; background: rgba(255, 255, 255, .18); border-color: #fff; }
body.home .app-navbar .navbar-toggler { border-color: rgba(255, 255, 255, .6); }
body.home .app-navbar .navbar-toggler-icon { filter: invert(1); }
body.home main.container { max-width: none; width: 100%; padding: 0 !important; margin: 0; }
body.home .footer { display: none; }

.home-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.home-bg, .home-bg-layer { position: absolute; inset: 0; }
.home-bg-layer {
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1);
  transition: opacity 1s var(--ease);
  will-change: opacity, transform;
}
.home-bg-layer.active { opacity: 1; animation: homeKenBurns 24s ease-in-out infinite alternate; }
@keyframes homeKenBurns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.12) translate(1.5%, -1.5%); }
}
.home-overlay {
  position: absolute; inset: 0;
  background: none;
}
.home-content {
  position: relative; z-index: 2; text-align: center; color: #fff;
  max-width: 700px; width: calc(100% - 2rem);
  padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .22);
}
.home-title {
  color: #fff;
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 3.5rem);
  letter-spacing: -.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, .35);
}
.home-subtitle { color: #fff; font-size: 1.15rem; margin: .8rem 0 1.8rem; text-shadow: 0 1px 8px rgba(0, 0, 0, .55); }
.home-actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }
.home-actions .btn-outline-light { border-width: 2px; }

.home-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 48px; height: 48px; border: none; border-radius: 50%;
  background: rgba(255, 255, 255, .16); color: #fff;
  font-size: 2rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.home-arrow:hover { background: rgba(255, 255, 255, .3); }
.home-arrow-prev { left: 18px; }
.home-arrow-next { right: 18px; }

.home-dots {
  position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; gap: 10px;
}
.home-dot {
  width: 10px; height: 10px; border-radius: 50%; border: none; padding: 0;
  background: rgba(255, 255, 255, .45); cursor: pointer;
  transition: all .25s var(--ease);
}
.home-dot.active { width: 26px; border-radius: 999px; background: #fff; }

@media (max-width: 768px) {
  .home-hero { min-height: 100svh; }
  .home-arrow { width: 40px; height: 40px; font-size: 1.6rem; }
  .home-arrow-prev { left: 10px; }
  .home-arrow-next { right: 10px; }
}

/* ===== 闪卡学习（背单词） ===== */
.learn-wrap { max-width: 1180px; }
.learn-card {
  min-height: 320px; cursor: pointer;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.learn-card .learn-front,
.learn-card .learn-back {
  width: 100%; min-height: 320px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.learn-card .learn-back { display: none; }
.learn-card.show-back .learn-front { display: none; }
.learn-card.show-back .learn-back { display: flex; }
.learn-card .fc-word { font-size: 2.4rem; font-weight: 800; }
.learn-card .learn-meaning { font-size: 1.6rem; font-weight: 600; line-height: 1.5; padding: 0 1.5rem; }
.learn-speaker { width: 72px; height: 72px; font-size: 1.8rem; margin-bottom: 1rem; }

/* ===== 游戏大厅 ===== */
.game-card { cursor: pointer; text-align: center; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.game-icon { font-size: 2.6rem; }

.option-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem;
  max-width: 640px; margin: 0 auto;
}
@media (max-width: 560px) { .option-grid { grid-template-columns: 1fr; } }

/* ===== 游戏结果 ===== */
.result-box {
  max-width: 360px; background: #fff;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: .6rem 1.2rem; text-align: left;
}
.result-row { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.result-row:last-child { border-bottom: none; }

/* ===== 背单词：10 词一组（学习卡片） ===== */
.learn-stage {
  display: flex; flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
@media (max-width: 991px) {
  .learn-stage { height: calc(100vh - 150px); height: calc(100dvh - 150px); flex: none; }
}

.word-detail-card { border-radius: var(--radius-lg); }
.word-detail-card .card-body { padding: 1.4rem 1.5rem 1.6rem; }

/* 学习卡片填满剩余高度，内部滚动，底部按钮固定 */
.word-detail-card.wc-fill { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.word-detail-card.wc-fill .card-body.wc-body {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
  padding: 1.25rem 1.5rem 1.4rem;
}

/* 复用卡片：头部固定，详情区滚动（例句/词组超出时在小框内加滑轮） */
.wc-card { display: flex; flex-direction: column; flex: 1 1 auto; height: 100%; min-height: 0; }
.wc-head { flex: none; }
.wc-details { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding-right: .35rem; }
.wc-details::-webkit-scrollbar { width: 6px; }
.wc-details::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.wc-details::-webkit-scrollbar-track { background: transparent; }

.wd-word { font-size: 2.4rem; font-weight: 800; line-height: 1.1; }

.detail-section { padding: .7rem 0; border-top: 1px solid var(--border); }
.detail-section:first-of-type { border-top: none; }
.detail-title { font-size: .8rem; font-weight: 700; color: var(--brand-600); letter-spacing: .04em; margin-bottom: .35rem; }
.detail-body { line-height: 1.6; }
.detail-body:empty { display: none; }

.def-item { margin-bottom: .3rem; }
.def-item:last-child { margin-bottom: 0; }
.badge-pos { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }

.syn-chip {
  display: inline-block; padding: .25rem .6rem; margin: 0 .35rem .35rem 0;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 999px;
  font-size: .85rem; font-weight: 600;
}

.phrase-item { padding: .25rem 0; }
.phrase-item strong { color: #1f2937; }

.example-item { margin-bottom: .6rem; }
.example-item:last-child { margin-bottom: 0; }
.example-item .text-muted { font-size: .85rem; }

.study-actions { flex-wrap: wrap; }

/* ===== 背单词：左右双列横版（桌面一屏，内滚动） ===== */
.learn-side { display: none; }

.side-panel {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.side-head {
  flex: none; padding: .7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: .92rem;
}
.side-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding: .5rem;
}
.side-list::-webkit-scrollbar { width: 6px; }
.side-list::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.side-list::-webkit-scrollbar-track { background: transparent; }
.side-item {
  display: flex; align-items: center; gap: .55rem;
  padding: .5rem .65rem; margin-bottom: .2rem;
  border-radius: var(--radius-md); cursor: pointer;
  transition: background .12s var(--ease), color .12s var(--ease);
}
.side-item:hover { background: var(--brand-50); }
.side-item.active { background: var(--brand-600); color: #fff; }
.side-item .si-index {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700;
  background: #f1f5f9; color: var(--text-2);
}
.side-item.active .si-index { background: rgba(255,255,255,.22); color: #fff; }
.side-item .si-word { flex: 1 1 auto; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .si-status { flex: none; font-size: .8rem; font-weight: 800; }
.si-ok { color: #16a34a; }
.si-no { color: #dc2626; }
.si-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; display: inline-block; }
.side-item.active .si-ok { color: #bbf7d0; }
.side-item.active .si-no { color: #fecaca; }
.side-item.active .si-dot { background: rgba(255,255,255,.55); }

/* 复习阶段：内容区独立滚动 */
.review-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.review-body::-webkit-scrollbar { width: 6px; }
.review-body::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.review-body::-webkit-scrollbar-track { background: transparent; }

@media (min-width: 992px) {
  body.learn-page { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
  body.learn-page .app-navbar { flex: none; position: static; }
  body.learn-page .footer { display: none; }
  body.learn-page > main.container {
    flex: 1 1 auto; min-height: 0; overflow: hidden;
    display: flex; flex-direction: column;
    padding-top: .75rem; padding-bottom: .75rem;
  }
  body.learn-page .learn-wrap {
    flex: 1 1 auto; min-height: 0;
    display: flex; flex-direction: column;
    width: 100%;
  }
  .learn-shell { flex: 1 1 auto; min-height: 0; display: flex; gap: 1rem; align-items: stretch; }
  .learn-main { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
  .learn-side { display: flex; flex: 0 0 280px; min-width: 0; min-height: 0; flex-direction: column; }
}

/* 复习阶段中文提示 */
.review-meaning { font-size: 1.5rem; font-weight: 700; color: #111827; }

/* 生词本卡片 */
.nb-word-card { cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.nb-word-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand-300); }
.nb-del { font-size: 1.15rem; line-height: 1; padding: 0 .3rem; text-decoration: none; }

/* 生词本 / 错题集 表格：释义两行截断，保持行高整齐 */
.cell-meaning {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-width: 640px;
}

/* ===== 成就徽章墙 ===== */
.ach-grid { display: flex; flex-wrap: wrap; gap: .9rem; }
.ach-item { width: 68px; text-align: center; flex: none; }
.ach-icon {
  width: 48px; height: 48px; margin: 0 auto .3rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease);
}
.ach-item:hover .ach-icon { transform: scale(1.08); }
.ach-icon.ach-locked {
  background: #eef2f6 !important;
  color: #c2ccd6 !important;
  filter: grayscale(1);
  box-shadow: none;
}
.ach-label {
  font-size: .72rem; color: var(--text-2); line-height: 1.2;
  max-width: 68px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== 小游戏：音标 / 按顺序点击字母拼写 / 居中倒计时 ===== */
.spell-phonetic {
  font-size: 1.2rem; font-weight: 600; color: var(--text-2);
  letter-spacing: .03em;
}
.spell-slots { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; }
.spell-slot {
  width: 34px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border-bottom: 3px solid var(--border);
  font-size: 1.3rem; font-weight: 700; color: var(--text-1);
  text-transform: lowercase;
}
.spell-slot.filled { border-bottom-color: var(--brand-500); }
.letter-bank { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.letter-tile {
  min-width: 46px; height: 48px; padding: 0 .55rem;
  font-size: 1.2rem; font-weight: 700;
  border: 2px solid var(--brand-200); border-radius: .6rem;
  background: #fff; color: var(--brand-700);
  cursor: pointer; box-shadow: var(--shadow-xs);
  transition: all .12s var(--ease);
}
.letter-tile:hover { border-color: var(--brand-500); background: var(--brand-50); transform: translateY(-2px); }
.letter-tile.used { opacity: .3; pointer-events: none; transform: none; }

.match-countdown {
  width: 96px; height: 96px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: #ecfdf5; color: #059669;
  border: 2px solid #a7f3d0;
  box-shadow: var(--shadow-sm);
  transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease);
}
.match-countdown.danger {
  background: #fef2f2; color: #dc2626; border-color: #fecaca;
  animation: timer-pulse 1s infinite;
}

@media (max-width: 480px) {
  .spell-slot { width: 26px; height: 38px; font-size: 1.15rem; }
  .letter-tile { min-width: 38px; height: 44px; font-size: 1.05rem; }
}

/* ===== 个人中心：等级 LV ===== */
.lv-badge {
  width: 74px; height: 74px; border-radius: 1rem;
  background: linear-gradient(135deg, #2563eb, #60a5fa);
  color: #fff; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.lv-caption { font-size: .68rem; font-weight: 800; letter-spacing: .12em; opacity: .85; }
.lv-number { font-size: 1.85rem; font-weight: 800; line-height: 1; }
.lv-progress { background: #e8eef5; border-radius: 999px; }

/* 个人中心：成就数徽章（金色） */
.ach-badge {
  width: 74px; height: 74px; border-radius: 1rem;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #fff; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}

/* 个人中心：VIP 徽章（黑金） + 到期标签 */
.vip-badge {
  width: 74px; height: 74px; border-radius: 1rem;
  background: linear-gradient(135deg, #1f2937, #0f172a);
  color: #fbbf24; text-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(251, 191, 36, .45);
}
.vip-icon { font-size: 1.45rem; line-height: 1; }
.vip-label { font-size: .72rem; font-weight: 800; letter-spacing: .14em; }
.vip-pill {
  display: inline-block;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #1f2937; font-weight: 800; font-size: .78rem;
  border-radius: 999px; padding: .18rem .7rem;
}

/* ===== 排行榜 ===== */
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem 1rem; border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }
.rank-no {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .85rem;
  background: var(--brand-50); color: var(--brand-600); flex-shrink: 0;
}
.rank-no.no-1 { background: #fbbf24; color: #78350f; }
.rank-no.no-2 { background: #cbd5e1; color: #334155; }
.rank-no.no-3 { background: #fdba74; color: #7c2d12; }
.rank-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-value { font-weight: 800; color: var(--brand-600); white-space: nowrap; }

/* 个人中心横板入口（生词本 / 错题集） */
.entry-card {
  display: flex; align-items: center; gap: .8rem;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: .85rem 1rem; color: var(--text-1);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
}
.entry-card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--brand-300); color: var(--text-1);
}
.entry-icon { font-size: 1.4rem; line-height: 1; }
.entry-text { flex: 1; font-weight: 600; }
.entry-arrow { font-size: 1.4rem; color: var(--text-3); line-height: 1; }
