/* 听写闯关网站 - 复刻英语世界设计
 * 深色模式主色板
 */
:root {
  --bg: #0B1220;
  --bg-2: #0A0F1E;
  --panel: #111827;
  --panel-2: #1E293B;
  --panel-3: #232936;
  --border: #2F3442;
  --divider: #2A2F3C;
  --title: #F3F5FF;
  --text: #D9DEEF;
  --muted: #A4ABBF;
  --muted-2: #7C8093;
  --primary: #7C3AED;
  --primary-2: #A855F7;
  --primary-soft: rgba(124, 58, 237, 0.18);
  --accent-blue: #4CB3F7;
  --gold: #FCD34D;
  --green: #22C55E;
  --red: #EF4444;
  --orange: #FB923C;
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow: hidden;
}
button {
  background: none; border: none; color: inherit; cursor: pointer; font-family: inherit;
}
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }

/* ========== 应用框架 ========== */
.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  height: 100vh;
  transition: grid-template-columns 0.25s ease;
}
/* 全屏学习模式：隐藏左侧栏，学习区铺满 90% */
.app.fullscreen {
  grid-template-columns: 1fr;
}
.app.fullscreen .sidebar {
  display: none;
}
/* 全屏时顶部栏：容纳「听音选词」工具行（左）+ 退出全屏按钮（右），同排 */
.app.fullscreen .top-bar {
  height: auto;
  min-height: 52px;
  padding: 6px 14px;
  justify-content: space-between;
  border-bottom: none;
  gap: 10px;
}
.app.fullscreen .top-bar .crumb { display: none; }
.app.fullscreen .top-bar .spacer { display: none; }
.app.fullscreen #backBtn { display: none !important; }
/* 工具行置顶到顶部栏后：取消原宽度/外边距，靠左排列 */
.app.fullscreen .top-bar .read-toolrow { width: auto; flex: 1; margin: 0; }
.app.fullscreen .top-bar .quiz-toolrow { justify-content: flex-start; }
.app.fullscreen .content {
  padding: 8px 5% 24px;
}
/* 全屏时隐藏学习进度条，内容上移 */
.app.fullscreen .lesson-progress { display: none; }
/* 全屏时放大内部学习内容宽度 */
.app.fullscreen .quiz-q { font-size: 42px; }
.app.fullscreen .read-wrap { max-width: none; }
.app.fullscreen .quiz-analysis { max-width: none; }
.app.fullscreen .quiz-translate { max-width: none; font-size: 36px; }
.app.fullscreen .quiz-text-input { max-width: none; }
.app.fullscreen .read-item { padding: 14px 20px; }

/* ===== 全屏时槽位与单词放大 1/3（×1.33），整体居中突出主要内容 ===== */
.app.fullscreen .quiz {
  gap: 40px;
  padding: 24px 0;
}
.app.fullscreen .sort-slots,
.app.fullscreen .word-pool,
.app.fullscreen .dict-slots {
  gap: 16px;
  max-width: none;
}
.app.fullscreen .sort-slot {
  min-width: 120px;
  min-height: 64px;
  font-size: 29px;
  padding: 8px 20px;
  border-bottom-width: 4px;
}
.app.fullscreen .pool-word {
  padding: 16px 30px;
  border-width: 3px;
  border-radius: 16px;
  font-size: 27px;
}
.app.fullscreen .dict-slot {
  min-width: 94px;
  min-height: 64px;
  font-size: 29px;
  padding: 8px 20px;
}
.app.fullscreen .dict-input {
  min-height: 64px;
  font-size: 29px;
  padding: 8px 12px;
  border-bottom-width: 4px;
}
.app.fullscreen .dict-input.slot-near {
  font-size: 58px;
  min-height: 128px;
  padding: 16px 24px;
  border-bottom-width: 8px;
}
.app.fullscreen .again-btn {
  padding: 13px 34px;
  font-size: 18px;
  gap: 10px;
}
.app.fullscreen .sort-feedback {
  font-size: 21px;
  padding: 14px 26px;
}
.app.fullscreen .mode-switch button {
  padding: 9px 24px;
  font-size: 17px;
}

/* ========== 左侧导航栏 ========== */
.sidebar {
  background: linear-gradient(180deg, #0f1424 0%, #0a0f1e 100%);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 16px 12px 12px;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px 16px;
}
.brand .logo {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  /* 拱形半圆 SVG 自带彩虹渐变，不再叠加紫色块背景 */
}
.brand .name { font-weight: 700; color: var(--title); }
.brand .sub { font-size: 11px; color: var(--muted); }

.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}
.nav-item:hover { background: var(--panel); }
.nav-item.active {
  background: var(--primary-soft);
  color: var(--title);
  font-weight: 600;
}
.nav-item.active svg { color: var(--primary-2); }
.nav-item svg { width: 18px; height: 18px; color: var(--muted); }

/* 桌面安装按钮（高亮渐变，引导用户添加桌面快捷方式） */
.install-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; margin-bottom: 6px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  color: #fff; cursor: pointer; text-align: left; width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.35);
  transition: all 0.15s;
}
.install-item:hover:not(:disabled) { filter: brightness(1.15); transform: translateY(-1px); box-shadow: 0 0 18px rgba(124, 58, 237, 0.5); }
.install-item:active:not(:disabled) { transform: translateY(0); }
.install-item:disabled { opacity: 0.65; cursor: default; }
.install-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.install-item.install-installed {
  background: var(--panel); color: var(--green); box-shadow: none; font-weight: 500;
}

.sidebar-footer {
  margin-top: 12px;         /* 从底部贴底改为固定在品牌区下方 */
  margin-bottom: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px;
}
.user-info { flex: 1; }
.user-name { font-size: 13px; color: var(--title); font-weight: 600; }
.user-tag {
  display: inline-block; font-size: 10px;
  background: var(--gold); color: #4a3800;
  padding: 1px 6px; border-radius: 6px; margin-top: 2px;
  font-weight: 700;
}
.user-action {
  flex: 0 0 auto;
  font-size: 12px; font-weight: 600; font-family: inherit;
  color: #fff; background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer;
  box-shadow: 0 4px 10px -4px rgba(124,58,237,0.55);
  transition: transform .08s ease, opacity .15s ease;
}
.user-action:active { transform: translateY(1px); }
.user-action.ghost {
  background: transparent; color: var(--muted);
  border: 1.5px solid var(--border); box-shadow: none; font-weight: 500;
  padding: 5px 9px;
}
.user-action.ghost:hover { color: var(--title); border-color: var(--primary-2); }

/* ========== 主区域 ========== */
.main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.top-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  height: 56px;
  flex-shrink: 0;
}
.top-bar .crumb {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 14px;
}
.top-bar .crumb .sep { color: var(--muted-2); }
.top-bar .crumb .now { color: var(--title); font-weight: 600; }
.top-bar .spacer { flex: 1; }
.top-bar-actions {
  display: flex; align-items: center; gap: 4px;
}
.icon-btn {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: all 0.15s;
}
.icon-btn:hover { background: var(--panel); color: var(--title); }
.icon-btn svg { width: 18px; height: 18px; }

.content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 40px;
}
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ========== 视图：书库 ========== */
.title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.title-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 3px solid #FCD34D;
  border-radius: 10px;
  padding: 8px 14px;
  width: 560px;
  max-width: 100%;
  transition: border-color 0.15s;
}
.title-search:focus-within { border-color: var(--gold); box-shadow: 0 0 8px rgba(252, 211, 77, 0.35); }
.title-search svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.title-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  flex: 1;
  font-size: 14px;
  min-width: 0;
}
.title-search input::placeholder { color: var(--muted-2); }

.section-title {
  font-size: 22px; color: var(--title); font-weight: 700;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.section-title .badge {
  font-size: 12px; font-weight: 500;
  background: var(--panel-2); color: var(--muted);
  padding: 2px 10px; border-radius: 999px;
}

/* 上传课程按钮（书库标题行） */
.upload-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px;
  background: var(--primary); color: #fff;
  border: none; cursor: pointer;
  font-size: 14px; font-weight: 600;
  transition: filter 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.upload-btn:hover { filter: brightness(1.08); }
.upload-btn:active { transform: scale(0.97); }
.upload-btn svg { width: 16px; height: 16px; }

/* 标题行右侧组合（上传按钮 + 搜索框） */
.title-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* UGC 角标（用户上传课程） */
.ugc-badge {
  position: absolute; top: 8px; left: 8px;
  background: var(--gold, #F59E0B); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  z-index: 2;
}

.cat-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 24px;
}
.cat-chip {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.cat-chip:hover { border-color: var(--primary); color: var(--text); }
.cat-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* 子类目筛选行（一级分类下的子类目，一行集中显示） */
.subcat-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: -12px 0 20px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.subcat-chip {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.subcat-chip:hover { border-color: var(--primary); color: var(--text); }
.subcat-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}
.cat-group-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 18px 0 2px;
  padding-top: 14px;
  border-top: 1px solid var(--divider);
  font-size: 15px;
  font-weight: 600;
  color: var(--title);
}
.cat-group-title:first-child { margin-top: 0; border-top: none; padding-top: 0; }
.cat-group-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.cat-sub-title {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0 2px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-2);
}
.book-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.book-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
/* 会员锁定书籍：封面暗化 + 右上角锁标 */
.book-card.locked { position: relative; }
.book-card.locked .cover { filter: grayscale(0.6) brightness(0.75); }
.book-card.locked:hover { border-color: var(--border); transform: none; box-shadow: none; cursor: not-allowed; }
.lock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 8px;
  padding: 3px 6px;
  z-index: 2;
}
.book-card .cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--panel-2);
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--muted);
}
.book-card .info { padding: 12px; }
.book-card .name {
  font-size: 14px; color: var(--title); font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-card .cat {
  font-size: 11px; color: var(--muted-2);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ========== 视图：课程详情 ========== */
.detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.detail-grid::before {
  content: "";
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, var(--primary-soft), transparent 70%);
  pointer-events: none;
}
.detail-cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  object-fit: cover;
  background: var(--panel-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--muted);
}
.detail-info h1 {
  font-size: 28px; color: var(--title); font-weight: 700;
  margin-bottom: 12px;
}
.detail-desc {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.detail-actions {
  display: flex; align-items: center; gap: 16px;
  margin-top: 16px;
}
.progress-info { flex: 1; }
.progress-info .num { font-size: 13px; color: var(--muted); }
.progress-bar {
  height: 6px; background: var(--panel-2);
  border-radius: 3px; margin-top: 8px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-2) 100%);
  border-radius: 3px;
  transition: width 0.3s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-2) 100%);
  color: #fff;
  padding: 12px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
  transition: transform 0.15s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary svg { width: 16px; height: 16px; }

/* 课程列表 */
.tabs {
  display: flex; gap: 8px;
  margin-bottom: 16px;
}
.tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.tab:not(.active):hover { background: var(--panel); color: var(--text); }
.tab .dot { width: 8px; height: 8px; border-radius: 50%; }
.tab.all .dot { background: var(--primary); }
.tab.pending .dot { background: var(--orange); }
.tab.done .dot { background: var(--green); }

.course-list {
  display: flex; flex-direction: column; gap: 10px;
}
.course-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  display: flex; align-items: center; gap: 16px;
  transition: all 0.15s;
}
.course-item:hover { border-color: var(--primary); }
.course-item .num {
  width: 36px; height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}
.course-item .info { flex: 1; min-width: 0; }
.course-item .title { font-size: 15px; color: var(--title); font-weight: 600; }
.course-item .desc {
  font-size: 12px; color: var(--muted);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-item .start {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.course-item .start:hover { background: var(--primary); color: #fff; }

/* ========== 视图：学习页面 ========== */
.lesson {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.lesson .top-bar { padding: 0 24px; }
.lesson .content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0 32px;
}
.lesson-progress {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 0;
  flex-shrink: 0;
}
.lesson-progress .label { font-size: 13px; color: var(--muted); }
.lesson-progress .bar {
  flex: 1; height: 4px; background: var(--border);
  border-radius: 2px; overflow: hidden;
}
.lesson-progress .fill {
  height: 100%; background: var(--primary);
  border-radius: 2px; transition: width 0.3s;
}
.lesson-progress .time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

.quiz {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  padding: 24px 0;
}
.quiz .mode-switch {
  display: flex; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}
.quiz .mode-switch button {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
}
.quiz .mode-switch button.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.quiz-q {
  font-size: 36px;
  font-weight: 700;
  color: var(--title);
  text-align: center;
  letter-spacing: 0.5px;
  line-height: 1.5;
}
.quiz-q .slot {
  display: inline-block;
  min-width: 120px;
  border-bottom: 3px solid var(--primary);
  margin: 0 6px;
  padding: 0 8px;
  color: var(--primary-2);
  font-style: italic;
}
.quiz-q .slot.filled { color: var(--title); font-style: normal; }
.quiz-q .slot.correct { color: var(--green); border-color: var(--green); }
.quiz-q .slot.wrong { color: var(--red); border-color: var(--red); }

.quiz-options {
  display: flex; gap: 16px; flex-wrap: wrap;
  justify-content: center;
  max-width: 800px;
}
.quiz-options .opt {
  padding: 12px 24px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  color: var(--text);
  min-width: 120px;
  cursor: pointer;
  transition: all 0.15s;
}
.quiz-options .opt:hover { border-color: var(--primary); }
.quiz-options .opt.correct { background: var(--green); border-color: var(--green); color: #fff; }
.quiz-options .opt.wrong { background: var(--red); border-color: var(--red); color: #fff; }
.quiz-options .opt.disabled { opacity: 0.5; cursor: not-allowed; }

.quiz-translate {
  /* 字体与「再次朗读」按钮保持一致（尺寸翻倍） */
  font-size: 30px;
  letter-spacing: 0.2em;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  max-width: 800px;
  padding: 14px 24px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* ========== 听音排列模式 ========== */
.sort-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  max-width: 90vw;
}
.sort-slot {
  min-width: 90px;
  min-height: 48px;
  border-bottom: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--title);
  padding: 6px 14px;
  cursor: pointer;
  border-radius: 0 0 6px 6px;
  transition: all 0.2s;
  background: transparent;
}
.sort-slot:hover { background: var(--panel); }
.sort-slot.correct { border-color: var(--green); color: var(--green); }
.sort-slot.wrong { border-color: var(--red); color: var(--red); }

.word-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 900px;
}
.pool-word {
  padding: 12px 22px;
  background: var(--panel);
  border: 2px solid var(--primary);
  border-radius: 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--title);
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.pool-word:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.pool-word.used {
  opacity: 0.3;
  border-color: var(--border);
  color: var(--muted);
  pointer-events: none;
}
.pool-word.done { border-color: var(--green); }

.sort-feedback {
  font-size: 17px;
  text-align: center;
  padding: 12px 20px;
  border-radius: 10px;
  max-width: 90vw;
}
.sort-feedback.correct { color: var(--green); background: rgba(34, 197, 94, 0.1); }
.sort-feedback.wrong { color: var(--red); background: rgba(239, 68, 68, 0.1); }
/* 语音整句：单词全对但顺序有误的提醒 */
.order-warn { color: var(--amber, #F59E0B); font-size: 14px; font-weight: 600; margin-top: 6px; }
/* 答错反馈：完整句子 + 音标（字号翻倍展示，便于看清算对错） */
.fail-full { font-size: 36px; font-weight: 600; color: var(--title); margin-bottom: 6px; }
.fail-ipa { font-size: 32px; color: var(--primary-2); font-family: var(--font-mono, Consolas, monospace); margin-bottom: 6px; }
.fail-tip { font-size: 13px; color: var(--muted); }

.sort-next-hint { margin-top: 4px; }

/* 再次朗读按钮 */
.again-row {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}
.again-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 26px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.15s;
}
.again-btn:hover {
  border-color: var(--primary);
  color: var(--title);
  background: var(--panel-2);
}
.again-btn svg { width: 18px; height: 18px; }
/* 0.5 倍速按钮：主色边框常显强调，与再次朗读同排 */
.speed-btn { border-color: var(--primary); color: var(--primary-2); }
.speed-btn:hover { border-color: var(--primary-2); color: var(--title); }

/* ========== 听写填空：槽位直接输入 ========== */
.dict-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  max-width: 90vw;
}
.dict-slot {
  min-width: 70px;
  min-height: 48px;
  border-bottom: 3px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--title);
  padding: 6px 14px;
  background: var(--panel);
  border-radius: 8px 8px 0 0;
  border-bottom: 3px solid var(--green);
}
.dict-input {
  min-height: 48px;
  border: none;
  border-bottom: 3px solid var(--primary);
  background: transparent;
  color: var(--title);
  caret-color: var(--primary);
  font-size: 22px;
  font-weight: 600;
  text-align: center;
  padding: 6px 8px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  -webkit-tap-highlight-color: transparent;
  border-radius: 8px 8px 0 0;
  transition: border-color 0.15s, background 0.15s;
}
.dict-input::placeholder { color: var(--muted-2); }
/* 听写槽位：聚焦时把浏览器默认 focus ring 彻底压掉，避免空格切槽时冒出白框
   （视觉上由 .slot-near 的字号放大来指示当前选中槽，不需要 focus 轮廓） */
.dict-input:focus,
.dict-input:focus-visible,
.dict-input:focus-within {
  outline: none !important;
  outline-offset: 0;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  background: transparent;
}
.dict-input:focus { border-bottom-color: var(--primary-2); }
/* 压掉 Chrome/Edge 自动填充的白底（浏览器记住输入过的单词，focus 时把槽位刷白） */
.dict-input:-webkit-autofill,
.dict-input:-webkit-autofill:hover,
.dict-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--title);
  -webkit-box-shadow: 0 0 0 1000px transparent inset;
  transition: background-color 9999s ease-out;
}
.dict-input.correct { border-bottom-color: var(--green); color: var(--green); }
.dict-input.wrong { border-bottom-color: var(--red); color: var(--red); }
/* 答错重填：正确槽位锁定保留（标绿且不被浏览器置灰） */
.dict-input:disabled { opacity: 1; }
.dict-input.correct:disabled { border-bottom-color: var(--green); color: var(--green); background: transparent; }
/* 光标所在槽及前后槽放大一倍（不用 transition 避免动画锁定 computed style） */
.dict-input.slot-near {
  font-size: 44px;        /* 22px × 2 */
  min-height: 96px;       /* 48px × 2 */
  padding: 12px 16px;
  border-bottom-width: 6px;
  border-radius: 16px 16px 0 0;
  z-index: 2;
  position: relative;
  outline: none;
  box-shadow: none;
}

/* ========== 语音输入整句（借助输入法语音转文字）========== */
.dict-voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  width: 100%;
  max-width: 900px;
}
.dict-voice-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--title);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.dict-voice-btn:hover { background: var(--panel-3); }
.dict-voice-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--title);
  font-size: 16px;
  outline: none;
}
.dict-voice-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.dict-voice-input::placeholder { color: var(--muted-2); font-size: 13px; }

/* ========== 整篇阅读模式 ========== */
/* 内容置顶，最大化利用空间 */
.quiz.read-mode {
  justify-content: flex-start;
  align-items: stretch;
  padding-top: 8px;
  overflow: hidden;
}
.quiz.read-mode .mode-switch { align-self: center; }
.read-wrap {
  width: 100%;
  max-width: none;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
  padding: 4px 2px 16px;
  flex: 1;
}
.read-wrap::-webkit-scrollbar { width: 6px; }
.read-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
/* 整篇阅读顶部工具行：模式切换（左）+ 句数/朗读全文（右），不占内容空间 */
.read-toolrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
  margin-bottom: 14px;
}
/* 听音选词/听写填空工具行：三个按钮紧凑居中（0.5倍速与再次朗读向中间靠拢） */
.quiz-toolrow { justify-content: center; }
.read-head {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 18px;
  white-space: nowrap;
}
.read-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  padding: 9px 20px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  transition: opacity 0.15s;
}
.read-btn:hover { opacity: 0.9; }
.read-btn svg { width: 18px; height: 18px; }
.read-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 12px;
}
.read-item .read-en {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.read-item .read-idx {
  color: var(--primary-2);
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  min-width: 40px;
  padding-top: 6px;
}
/* 折叠开关按钮：跟随句子末尾，不另起一行 */
.read-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--muted);
  background: var(--panel-2);
  margin-left: 10px;
  vertical-align: middle;
  transition: all 0.2s;
}
.read-toggle:hover { color: var(--title); background: var(--panel-3); }
.read-toggle svg { width: 18px; height: 18px; transition: transform 0.25s; }
.read-toggle.open svg { transform: rotate(180deg); }
/* 详情默认折叠 */
.read-detail {
  display: none;
  margin-top: 10px;
}
.read-detail.open {
  display: block;
  animation: readFadeIn 0.25s ease-out;
}
@keyframes readFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.read-item .read-eng {
  font-size: 32px;
  font-weight: 600;
  color: var(--title);
  cursor: pointer;
  line-height: 1.5;
  flex: 1;
  min-width: 0;
}
.read-item .read-eng > * { pointer-events: auto; }
.read-item .read-eng:hover { color: var(--primary-2); }
.read-item .read-zh {
  font-size: 28px;
  color: var(--text);
  margin-top: 8px;
}
.read-item .read-ipa {
  font-size: 25px;
  color: var(--ipa, #88889a);
  margin-top: 8px;
}
.read-item .read-ana {
  font-size: 25px;
  color: var(--muted);
  margin-top: 10px;
  padding: 10px 16px;
  background: var(--bg);
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
}

.quiz-text-input {
  width: 100%;
  max-width: 700px;
  padding: 16px 24px;
  background: var(--panel);
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 18px;
  color: var(--title);
  outline: none;
  text-align: center;
}
.quiz-text-input:focus { border-color: var(--primary); }
.quiz-text-input.correct { border-color: var(--green); background: rgba(34, 197, 94, 0.1); }
.quiz-text-input.wrong { border-color: var(--red); background: rgba(239, 68, 68, 0.1); }

.quiz-feedback {
  font-size: 14px;
  text-align: center;
  min-height: 22px;
}
.quiz-feedback.correct { color: var(--green); }
.quiz-feedback.wrong { color: var(--red); }

.quiz-analysis {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--muted);
  max-width: 700px;
  display: none;
}
.quiz-analysis.show { display: block; }

/* 底部工具栏（现在只有设置按钮） */
.lesson-toolbar {
  display: flex; align-items: center; gap: 4px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin: 0 auto 24px;
  max-width: 600px;
  justify-content: center;
  flex-shrink: 0;
}
.lesson-toolbar button {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted);
  transition: all 0.15s;
}
.lesson-toolbar button:hover { background: var(--panel-2); color: var(--title); }
.lesson-toolbar .settings-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.lesson-toolbar .settings-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========== 加载/空状态 ========== */
.loading {
  display: flex; align-items: center; justify-content: center;
  flex: 1; color: var(--muted);
  font-size: 14px;
}
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  flex: 1; color: var(--muted);
  padding: 60px 20px;
  text-align: center;
}
.empty svg { width: 48px; height: 48px; opacity: 0.5; margin-bottom: 12px; }

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== 进度完成提示 ========== */
.complete-toast {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 1px solid var(--primary);
  border-radius: 12px;
  padding: 24px 32px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  animation: pop 0.3s ease-out;
}
@keyframes pop {
  from { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.complete-toast h2 { color: var(--primary-2); font-size: 20px; margin-bottom: 8px; }
.complete-toast p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.complete-toast button {
  margin: 4px;
  padding: 8px 18px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}
.complete-toast button.secondary { background: var(--panel-2); color: var(--text); }

/* 烟花粒子 */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 9999;
  animation: confettiFly 1.4s ease-out forwards;
}
@keyframes confettiFly {
  0% { transform: translate(0, 0) rotate(0deg) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.4); opacity: 0; }
}

/* 语音服务异常提示 */
.tts-hint {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 2px solid var(--orange);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--title);
  box-shadow: var(--shadow-lg);
  animation: pop 0.3s ease-out;
}
.tts-hint button {
  background: var(--primary);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.tts-hint button:last-child { background: var(--panel-2); color: var(--text); }

/* ===== 设置页（全屏覆盖）===== */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-2);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  color: var(--text);
  overflow: hidden;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}
.settings-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.15s;
}
.settings-back:hover { background: var(--panel-3); color: var(--title); }
.settings-back svg { width: 18px; height: 18px; }
.settings-header h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--title);
  margin: 0;
}
.settings-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all 0.15s;
}
.settings-close:hover { background: var(--panel-3); color: var(--title); }
.settings-close svg { width: 18px; height: 18px; }

.settings-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px 60px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.settings-body::-webkit-scrollbar { width: 6px; }
.settings-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.settings-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  margin-bottom: 14px;
  overflow: hidden;
}
/* 可折叠板块头 */
.settings-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.settings-section-head:hover { background: var(--panel-2); }
.section-icon { font-size: 17px; }
.section-head-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--title);
}
.section-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: transform 0.2s;
}
.section-arrow svg { width: 18px; height: 18px; }
.section-arrow.open { transform: rotate(180deg); }
/* 板块内容（折叠时隐藏） */
.settings-section-inner { padding: 8px 4px; }
.settings-section.collapsed .settings-section-inner { display: none; }
.settings-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--title);
  padding: 10px 16px 6px;
  margin: 0;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
  min-height: 56px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row.sub-row { padding-top: 8px; padding-bottom: 8px; }
.settings-row.primary-row {
  background: var(--panel-2);
  border-radius: 10px;
  margin: 4px 8px 0;
  border: 1px solid var(--primary);
}
.settings-row-icon {
  font-size: 20px;
  margin-right: 4px;
}
.settings-row-text {
  flex: 1;
  min-width: 0;
}
.settings-row-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--title);
  margin-bottom: 2px;
}
.settings-row-desc {
  font-size: 12px;
  color: var(--muted);
}

/* 开关（Toggle） */
.settings-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.settings-toggle input { opacity: 0; width: 0; height: 0; }
.settings-toggle label {
  position: absolute;
  inset: 0;
  background: var(--panel-3);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.settings-toggle label::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.settings-toggle input:checked + label { background: var(--green); }
.settings-toggle input:checked + label::before { transform: translateX(20px); }

/* 滑块（Slider） */
.settings-slider-wrap {
  flex: 1;
  min-width: 120px;
  max-width: 240px;
}
.settings-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: var(--panel-3);
  border-radius: 2px;
  outline: none;
}
.settings-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(124, 58, 237, 0.5);
}
.settings-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid #fff;
}
.settings-slider-value {
  font-size: 13px;
  color: var(--muted);
  min-width: 48px;
  text-align: right;
}

/* 音效按钮式选择 */
.sound-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.sound-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.sound-pill:hover { background: var(--panel-2); color: var(--text); }
.sound-pill.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* 试听按钮 */
.settings-buttons {
  display: flex;
  gap: 8px;
}
.btn-correct, .btn-wrong {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-correct {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
  border: 1px solid var(--green);
}
.btn-correct:hover { background: var(--green); color: #fff; }
.btn-wrong {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid var(--red);
}
.btn-wrong:hover { background: var(--red); color: #fff; }
.btn-combo {
  background: rgba(251, 146, 60, 0.15);
  color: var(--orange);
  border: 1px solid var(--orange);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-combo:hover { background: var(--orange); color: #fff; }

/* TTS 风格选项 */
.settings-tts-style, .settings-tts-rate {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.tts-style-pill, .tts-rate-pill {
  padding: 7px 16px;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.tts-style-pill:hover, .tts-rate-pill:hover { background: var(--panel-3); }
.tts-style-pill.active, .tts-rate-pill.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.settings-volume-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.settings-volume-wrap .settings-slider { width: 120px; }

/* 语音列表 */
.settings-voice-list {
  margin-top: 6px;
  padding: 0 16px;
}
.voice-group {
  margin-bottom: 18px;
}
.voice-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  padding: 8px 0;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.voice-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.voice-row:hover { border-color: var(--primary); }
.voice-row.active {
  background: var(--primary-soft);
  border-color: var(--primary);
}
.voice-row-name {
  flex: 1;
  font-size: 14px;
  color: var(--title);
  font-weight: 500;
}
.voice-row-gender {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.voice-row-gender.male {
  background: rgba(79, 158, 240, 0.2);
  color: #4F9EF0;
}
.voice-row-gender.female {
  background: rgba(236, 100, 167, 0.2);
  color: #EC64A7;
}
.voice-row-check {
  color: var(--green);
  font-weight: 600;
  font-size: 16px;
}
.voice-row-play {
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--panel-3);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.voice-row-play:hover { background: var(--primary); color: #fff; }

/* ========== 收藏功能 ========== */
/* 收藏按钮（工具行）：已收藏金色高亮 */
.fav-btn.faved { border-color: #F59E0B; color: #F59E0B; }
.fav-btn.faved svg { fill: #F59E0B; }
/* 收藏 toast（右下角浮现） */
.fav-toast {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 9999;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--title);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
/* 我的收藏页 */
.fav-page {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fav-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.fav-count { font-size: 16px; font-weight: 600; color: var(--title); }
.fav-warn { font-size: 13px; color: var(--red); }
.fav-tip { font-size: 13px; color: var(--muted); }
.fav-empty { padding: 60px 20px; }
.fav-day {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.fav-day-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
}
.fav-day-head:hover { background: var(--panel-2); }
.fav-arrow { color: var(--muted); font-size: 14px; width: 14px; flex-shrink: 0; }
.fav-date { font-size: 16px; font-weight: 600; color: var(--title); flex: 1; }
.fav-n { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.fav-review-btn, .fav-clear-btn {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--title);
  flex-shrink: 0;
}
.fav-review-btn:hover { border-color: var(--primary); color: var(--primary-2); }
.fav-clear-btn:hover { border-color: var(--red); color: var(--red); }
.fav-day-body { border-top: 1px solid var(--border); padding: 4px 12px; }
.fav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  border-bottom: 1px solid var(--border);
}
.fav-item:last-child { border-bottom: none; }
.fav-idx { color: var(--muted); font-size: 12px; width: 22px; flex-shrink: 0; text-align: center; }
.fav-text { flex: 1; min-width: 0; }
.fav-en { font-size: 15px; color: var(--title); font-weight: 600; cursor: pointer; }
.fav-en:hover { color: var(--primary-2); }
.fav-zh { font-size: 13px; color: var(--muted); margin-top: 2px; }
.fav-del {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}
.fav-del:hover { color: var(--red); background: rgba(239, 68, 68, 0.12); }
/* 收藏夹满 10 个时的学习锁定页 */
.fav-lock { padding: 60px 20px; }

/* ========== 点击查词（答错整句提示） ========== */
/* 可点击单词：虚线描边 + hover 高亮 */
.click-word {
  cursor: pointer;
  border-bottom: 2px dashed var(--primary);
  transition: color 0.15s, background 0.15s;
  border-radius: 4px;
}
.click-word:hover { color: var(--primary-2); background: rgba(124, 58, 237, 0.12); }
/* 整篇阅读：单词默认无下划线（不干扰阅读），hover 显示可点提示 */
.read-item .read-eng .read-click { border-bottom-color: transparent; }
.read-item .read-eng .read-click:hover { border-bottom-color: var(--primary); background: rgba(124, 58, 237, 0.12); }
/* 查词面板：居中弹窗（淡入 + 轻微放大动画） */
.dict-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dict-panel {
  width: 100%;
  max-width: 1120px; /* 宽度为原 560px 的两倍 */
  max-height: 80vh;  /* 仅作上限防溢出；高度随内容自适应 */
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 30px 36px 36px;
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.dict-overlay.open .dict-panel { transform: scale(1); opacity: 1; }
.dict-head { display: flex; align-items: center; gap: 16px; }
.dict-word { font-size: 60px; font-weight: 600; color: var(--title); flex: 1; text-transform: capitalize; }
.dict-speak, .dict-close {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--title);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.dict-speak:hover { border-color: var(--primary); color: var(--primary-2); }
.dict-speak svg { width: 30px; height: 30px; }
.dict-close:hover { border-color: var(--red); color: var(--red); }
.dict-ipa { display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.dict-ipa-chip {
  background: var(--panel-3);
  border: 1px solid var(--border);
  color: var(--primary-2);
  padding: 8px 22px;
  border-radius: 999px;
  font-size: 30px;
  font-family: var(--font-mono, Consolas, monospace);
}
.dict-body { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.dict-pos {
  align-self: flex-start;
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-2);
  font-size: 26px;
  font-weight: 600;
  padding: 6px 18px;
  border-radius: 8px;
}
.dict-mean { font-size: 34px; color: var(--title); line-height: 1.6; }
.dict-base { font-size: 26px; color: var(--muted); margin-bottom: 4px; }
.dict-zh { font-size: 30px; color: var(--title); }
.dict-phrase {
  font-size: 28px;
  color: var(--primary-2);
  background: var(--panel-2);
  border: 1px solid var(--border);
  padding: 14px 22px;
  border-radius: 8px;
}
.dict-miss { color: var(--muted); font-size: 28px; padding: 20px 0; }
.dict-example { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 20px; }
.dict-example-en { font-size: 30px; color: var(--title); font-weight: 600; }
.dict-example-zh { font-size: 26px; color: var(--muted); margin-top: 8px; }
/* 查询中 / 在线词典英文释义 */
.dict-loading { color: var(--muted); font-size: 28px; padding: 24px 0; text-align: center; }
.dict-online-def { font-size: 30px; color: var(--title); line-height: 1.6; margin-bottom: 8px; }
.dict-online-def::before { content: "• "; color: var(--primary-2); }
/* 在线词典：双语例句 + 网络释义 */
.dict-pair { margin-top: 16px; padding: 14px 22px; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; }
.dict-pair-en { font-size: 28px; color: var(--title); font-weight: 600; }
.dict-pair-zh { font-size: 26px; color: var(--muted); margin-top: 6px; }
.dict-web { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.dict-web-label { font-size: 24px; color: var(--muted); margin-bottom: 10px; }
.dict-web-item { font-size: 28px; color: var(--primary-2); line-height: 1.7; }
/* 设置页：字典源 radio 选择 */
.settings-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.settings-radio:hover { border-color: var(--primary); }
.settings-radio-dot { width: 12px; height: 12px; border-radius: 50%; background: transparent; }
.settings-radio-dot.on { background: var(--primary); }
.dict-source-row.selected .settings-row-title { color: var(--primary-2); }
