/* 100LS 复读机 · 暗色专业语言学习风 */
:root {
  --bg: #0f1115;
  --bg-soft: #1a1d24;
  --bg-soft-2: #232730;
  --border: #2d3139;
  --border-soft: #3a3f4a;
  --text: #e4e6eb;
  --text-dim: #9ca3af;
  --text-faint: #6b7280;
  --accent: #4ade80;
  --accent-soft: rgba(74, 222, 128, 0.15);
  --highlight: #fbbf24;
  --highlight-soft: rgba(251, 191, 36, 0.18);
  --danger: #f87171;
  --radius: 10px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  overflow: hidden;
}

body {
  display: flex;
  flex-direction: column;
}

/* ===== 顶部工具栏 ===== */
.topbar {
  flex: 0 0 auto;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-mark {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 1px;
  color: var(--text);
}

.brand-mark-accent {
  color: var(--accent);
}

.brand-sub {
  color: var(--text-dim);
  font-size: 12px;
}

.import-group {
  display: flex;
  gap: 8px;
}

.import-btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}

.import-btn:hover {
  background: rgba(74, 222, 128, 0.25);
  border-color: var(--accent);
}

.import-btn.alt {
  background: var(--bg-soft-2);
  color: var(--text);
  border-color: var(--border-soft);
}

.import-btn.alt:hover {
  background: var(--border);
}

.import-btn.ghost {
  background: transparent;
  color: var(--text-dim);
  border-color: transparent;
}

.import-btn.ghost:hover {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.08);
}

/* ===== 空状态 ===== */
.empty-hint {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

/* hidden 属性在 CSS display:flex 下需要显式覆盖 */
[hidden] {
  display: none !important;
}

.empty-card {
  max-width: 560px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
}

.empty-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 28px;
}

.empty-steps {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 24px;
  text-align: left;
}

.empty-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.step-no {
  flex: 0 0 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: var(--bg);
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
}

.empty-tip {
  font-size: 12px;
  color: var(--text-faint);
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

/* ===== 主区域：上视频 + 下三栏 ===== */
.main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 上部：播放区（整宽居中） */
.video-section {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  background: #000;
  border-bottom: 1px solid var(--border);
}

.player-wrap {
  position: relative;
  background: #000;
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
}

#media-player {
  width: 100%;
  max-height: 44vh;
  display: block;
  background: #000;
}

audio#media-player {
  max-height: 54px;
}

/* 下部三栏 */
.study-row {
  flex: 1 1 auto;
  display: flex;
  min-height: 0;
}

/* 左下：字幕 + 控制 */
.study-left {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.media-name {
  margin-top: 8px;
  align-self: flex-start;
  background: rgba(0, 0, 0, 0.7);
  color: var(--text-dim);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 字幕显示板 */
.subtitle-board {
  flex: 1 1 auto;
  min-height: 120px;
  padding: 20px 32px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  overflow-y: auto;
}

.sub-line {
  line-height: 1.5;
  transition: all .2s ease;
}

.sub-en {
  font-size: 24px;
  font-weight: 500;
  color: var(--highlight);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.3px;
}

.sub-en:empty::before,
.sub-zh:empty::before {
  content: " ";
}

.sub-zh {
  font-size: 18px;
  color: var(--text);
  font-weight: 400;
}

/* 控制条：紧凑图标式 */
.control-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  flex-wrap: nowrap;
  overflow-x: auto;
}

.ctrl-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 46px;
  padding: 4px 6px;
  background: transparent;
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}

.ctrl-ico { font-size: 15px; line-height: 1.2; }
.ctrl-lbl { font-size: 10.5px; color: var(--text-dim); line-height: 1.2; white-space: nowrap; }

.ctrl-btn:hover:not(:disabled) {
  background: var(--bg-soft-2);
}
.ctrl-btn:hover:not(:disabled) .ctrl-lbl { color: var(--text); }

.ctrl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ctrl-btn.primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
  min-width: 56px;
  padding: 8px 10px;
  border-radius: 999px;
  flex-direction: row;
  gap: 4px;
}
.ctrl-btn.primary .ctrl-lbl { color: var(--bg); font-size: 12px; font-weight: 600; }

.ctrl-btn.primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

.ctrl-btn.rec { color: var(--danger); }
.ctrl-btn.rec .ctrl-lbl { color: var(--danger); }

.ctrl-btn.rec:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.15);
}

.ctrl-btn.saved {
  background: var(--highlight-soft);
  border-color: rgba(251, 191, 36, 0.5);
}
.ctrl-btn.saved .ctrl-ico,
.ctrl-btn.saved .ctrl-lbl { color: var(--highlight); }

.ctrl-btn.rec.recording {
  background: var(--danger);
  color: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}

.ctrl-btn.cut {
  background: var(--highlight-soft);
  color: var(--highlight);
  border-color: rgba(251, 191, 36, 0.45);
  font-weight: 600;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.ctrl-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 10.5px;
  cursor: pointer;
  user-select: none;
  min-width: 36px;
}

.ctrl-toggle input {
  accent-color: var(--accent);
}

.ctrl-toggle:has(input:checked) {
  color: var(--accent);
  border-color: rgba(74, 222, 128, 0.4);
  background: var(--accent-soft);
}

.ctrl-toggle.mini {
  flex-direction: row;
  gap: 4px;
  padding: 3px 6px;
}
.ctrl-toggle.mini input {
  width: 30px;
  padding: 2px 4px;
  background: var(--bg-soft-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  text-align: center;
  outline: none;
}

.ctrl-divider {
  width: 1px;
  height: 24px;
  background: var(--border-soft);
  margin: 0 2px;
  flex-shrink: 0;
}

/* 播放设置按钮（⚙ 图标钮） */
.ctrl-btn.more {
  min-width: 40px;
  font-size: 19px;
  line-height: 1;
}

/* 播放设置弹层 */
.set-card .sheet-body {
  padding: 4px 22px 22px;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border-soft);
}
.set-row:last-child { border-bottom: none; }
.set-label {
  font-size: 14px;
  color: var(--text);
}

/* 录音历史 */
.rec-history {
  flex: 1 1 auto;
  padding: 12px 20px;
  background: var(--bg);
  overflow-y: auto;
  min-height: 0;
}

.rec-history-title {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.rec-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rec-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 12px;
}

.rec-item-no {
  color: var(--text-faint);
  width: 28px;
  flex: 0 0 auto;
}

.rec-item-text {
  flex: 1 1 auto;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-item-play {
  background: transparent;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
}

/* 句子列表（左栏主区域） */
.sentence-pane-inline {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-soft);
}

/* 中下：短语讲解面板 */
.phrase-pane {
  flex: 0 0 300px;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border-left: 1px solid var(--border);
}

.phrase-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.phrase-head-title {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.fav-save-btn {
  flex: 0 0 auto;
  padding: 5px 10px;
  background: var(--highlight-soft);
  color: var(--highlight);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}

.fav-save-btn:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.3);
}

.fav-save-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fav-save-btn.saved {
  background: var(--highlight);
  color: var(--bg);
}

.phrase-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px;
}

.phrase-empty {
  padding: 24px 12px;
  color: var(--text-faint);
  font-size: 12px;
  text-align: center;
  line-height: 1.6;
}

.phrase-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}

.phrase-item-en {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  font-family: Georgia, serif;
  margin-bottom: 4px;
}

.phrase-item-zh {
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.55;
}

/* 中文隐藏模式 */
body.hide-zh .sub-zh,
body.hide-zh .item-zh {
  display: none;
}

/* 语速选择器 */
.speed-select {
  padding: 3px 5px;
  background: var(--bg-soft-2);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  outline: none;
}

.speed-select:hover {
  border-color: var(--text-dim);
}

/* 字幕偏移调节 */
.offset-btn {
  padding: 5px 8px !important;
  font-size: 11px !important;
  background: var(--bg-soft-2);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
}
.offset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.offset-display {
  display: inline-block;
  min-width: 36px;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.offset-reset {
  padding: 5px 6px !important;
  font-size: 12px !important;
  color: var(--warn);
}

/* 顶部收藏夹按钮 */
.import-btn.fav {
  background: var(--highlight-soft);
  color: var(--highlight);
  border-color: rgba(251, 191, 36, 0.4);
}

.import-btn.fav:hover {
  background: rgba(251, 191, 36, 0.28);
  border-color: var(--highlight);
}

/* ===== 收藏夹弹窗 ===== */
.fav-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.fav-card {
  width: 100%;
  max-width: 720px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}

.fav-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
}

.fav-count {
  color: var(--highlight);
  margin-left: 4px;
}

.fav-head-actions {
  display: flex;
  gap: 8px;
}

.fav-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 12px 18px;
}

.fav-empty {
  padding: 40px 12px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.8;
}

.fav-item {
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.fav-item-en {
  font-size: 14px;
  color: var(--highlight);
  font-family: Georgia, serif;
  line-height: 1.5;
  margin-bottom: 4px;
}

.fav-item-zh {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 6px;
}

.fav-item-phrases {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.fav-chip {
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 10px;
  font-size: 11.5px;
}

.fav-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-faint);
}

.fav-item-jump,
.fav-item-del {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 4px;
}

.fav-item-jump { color: var(--accent); }
.fav-item-jump:hover { background: var(--accent-soft); }
.fav-item-del { color: var(--text-faint); }
.fav-item-del:hover { color: var(--danger); background: rgba(248,113,113,0.1); }

/* ===== 学习库 Tab ===== */
.fav-tabs {
  display: flex;
  gap: 6px;
}

.fav-tab {
  padding: 6px 12px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
}

.fav-tab:hover { color: var(--text); }

.fav-tab.active {
  background: var(--highlight-soft);
  color: var(--highlight);
  border-color: rgba(251, 191, 36, 0.4);
}

.fav-tab .fav-count {
  font-size: 11px;
  margin-left: 2px;
}

/* ===== 可点击单词 ===== */
.word {
  cursor: pointer;
  border-radius: 3px;
  padding: 0 1px;
  transition: background .12s ease, color .12s ease;
  text-decoration: underline dotted rgba(74, 222, 128, 0.35);
  text-underline-offset: 3px;
}

.word:hover {
  background: rgba(74, 222, 128, 0.22);
  color: var(--accent);
}

/* ===== 底部弹出卡片（词典 / AI 讲解，参考每日英语听力取词样式） ===== */
.sheet-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 110;
}

.sheet-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 60vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-bottom: none;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  animation: sheet-up .22s ease;
}

@keyframes sheet-up {
  from { transform: translateY(40px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-grab {
  flex: 0 0 auto;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-soft);
  margin: 8px auto 0;
}

.sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
}

.sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
}
.sheet-close:hover { color: var(--text); }

/* 词典卡片头部 */
.dict-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.dict-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dict-head-actions .ctrl-btn {
  flex-direction: row;
  min-width: 0;
  padding: 5px 10px;
  background: var(--bg-soft-2);
  border-color: var(--border-soft);
  font-size: 12.5px;
}
.dict-head-actions .ctrl-btn.cut {
  background: var(--highlight-soft);
  border-color: rgba(251, 191, 36, 0.45);
}

.dict-word {
  font-size: 22px;
  font-weight: 700;
  color: var(--highlight);
  font-family: Georgia, serif;
}

.dict-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px 18px;
}

.dict-loading {
  padding: 30px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

.dict-error {
  padding: 20px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.8;
}

.dict-phon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 16px;
}

.dict-flag {
  flex: 0 0 42px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.dict-ipa {
  color: var(--accent);
  font-family: "Lucida Sans Unicode", "Arial Unicode MS", Consolas, monospace;
  font-size: 17px;
  min-width: 110px;
}

.dict-speak {
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
}

.dict-speak:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.dict-ipa-empty {
  color: var(--text-faint);
  font-size: 12px;
}

.dict-section-title {
  margin: 14px 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.dict-zh {
  font-size: 16px;
  color: var(--text);
  line-height: 1.6;
}

.dict-def {
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--border-soft);
  margin-bottom: 6px;
  font-size: 13.5px;
  color: var(--text);
  line-height: 1.55;
}

.dict-pos {
  display: inline-block;
  font-size: 11px;
  color: var(--highlight);
  background: var(--highlight-soft);
  border-radius: 3px;
  padding: 1px 6px;
  margin-right: 8px;
  font-style: normal;
}

/* 中文释义词性标签用绿色区分 */
.dict-def-zh .dict-pos {
  color: var(--accent);
  background: var(--accent-soft);
}

/* 学习徽章 */
.dict-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 4px;
}

.dict-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.3px;
}

.dict-badge.oxford {
  color: #111827;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.dict-badge.collins {
  color: var(--highlight);
  background: var(--highlight-soft);
  border: 1px solid rgba(251, 191, 36, 0.4);
  letter-spacing: 1px;
}

.dict-badge.exam {
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(74, 222, 128, 0.35);
}

.dict-badge.mini {
  font-size: 10px;
  padding: 1px 6px;
}

/* 屈折形式提示 */
.dict-lemma-note {
  margin-bottom: 10px;
  padding: 6px 10px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--text);
}

.dict-lemma-note b {
  color: var(--accent);
}

/* 数据来源脚注 */
.dict-source {
  margin-top: 14px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-soft);
  font-size: 10.5px;
  color: var(--text-faint);
}

.dict-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
}

.dict-tip {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* ===== 生词本条目 ===== */
.word-item {
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--highlight);
  border-radius: var(--radius-sm);
}

.word-item-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.word-item-word {
  font-size: 15px;
  font-weight: 700;
  color: var(--highlight);
  font-family: Georgia, serif;
}

.word-item-ipa {
  font-size: 12px;
  color: var(--accent);
  font-family: Consolas, monospace;
}

.word-item-ipa .flag-mini {
  color: var(--text-faint);
  margin-right: 2px;
}

.word-item-zh {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.5;
}

.word-item-context {
  font-size: 11.5px;
  color: var(--text-faint);
  font-style: italic;
  line-height: 1.5;
  margin-bottom: 4px;
}

.word-item-actions {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.word-item-speak {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
}

.word-item-speak:hover { color: var(--accent); background: var(--accent-soft); }
.word-item-del {
  background: transparent;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  font-size: 11.5px;
  padding: 2px 6px;
  border-radius: 4px;
}
.word-item-del:hover { color: var(--danger); background: rgba(248,113,113,0.1); }

.sentence-head {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.sentence-count {
  color: var(--accent);
  font-weight: 700;
}

.sentence-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px;
}

.sentence-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background .15s ease;
  border: 1px solid transparent;
  margin-bottom: 2px;
}

.sentence-item:hover {
  background: var(--bg-soft-2);
}

.sentence-item.active {
  background: var(--highlight-soft);
  border-color: rgba(251, 191, 36, 0.4);
  padding: 16px 12px;
  margin-bottom: 6px;
}

.sentence-item.active .item-en {
  color: var(--highlight);
  font-size: 18px;
  font-weight: 500;
}

.sentence-item.active .item-zh {
  font-size: 14px;
  color: var(--text);
}

.sentence-item.active .item-no {
  color: var(--highlight);
  font-size: 12px;
}

.item-en {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 4px;
  font-family: Georgia, serif;
}

.item-zh {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}

.item-no {
  font-size: 10px;
  color: var(--text-faint);
  margin-right: 6px;
}

/* 底部状态条 */
.statusbar {
  flex: 0 0 auto;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px;
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 11px;
}

.status-sep {
  color: var(--border-soft);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-soft);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
}

/* 响应式：窄屏时三栏堆叠 */
@media (max-width: 960px) {
  .study-row {
    flex-direction: column;
    overflow-y: auto;
  }
  .study-left {
    flex: 0 0 auto;
  }
  .phrase-pane,
  .sentence-pane-inline {
    flex: 0 0 auto;
    border-left: none;
    border-top: 1px solid var(--border);
    max-height: 48vh;
  }
  #media-player {
    max-height: 30vh;
  }
  /* 进度条与文件名压窄：把空间让给句子列表 */
  .custom-bar {
    padding: 4px 8px;
    gap: 8px;
    margin-top: 4px;
    border-radius: 8px;
  }
  .cb-track { height: 14px; }
  .media-name {
    margin-top: 4px;
    font-size: 11px;
    padding: 3px 8px;
  }
  .sub-en {
    font-size: 18px;
  }
  .sub-zh {
    font-size: 15px;
  }
}

/* ============ AI 讲解 ============ */
.import-btn.ai {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border-color: rgba(139, 92, 246, 0.45);
}

.import-btn.ai:hover {
  background: rgba(139, 92, 246, 0.3);
}

.ai-section {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-explain-btn {
  width: 100%;
  padding: 8px 10px;
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all .15s ease;
}

.ai-explain-btn:hover:not(:disabled) {
  background: rgba(139, 92, 246, 0.3);
}

.ai-explain-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ai-sheet .sheet-body {
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
}

.ai-sheet .ai-h {
  color: #a78bfa;
  font-weight: 700;
  font-size: 12.5px;
  margin: 8px 0 4px;
}

.ai-sheet .ai-h:first-child { margin-top: 0; }

.ai-sheet .ai-ul {
  margin: 0 0 6px;
  padding-left: 18px;
}

.ai-sheet .ai-ul li { margin-bottom: 3px; }

.ai-result .ai-p { margin: 0 0 6px; }

.ai-result strong { color: var(--highlight); }

.ai-result code {
  background: var(--bg-soft-2);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 11.5px;
}

.ai-loading {
  color: var(--text-faint);
  text-align: center;
  padding: 12px 0;
}

.ai-error {
  color: var(--danger);
  line-height: 1.6;
}

.ai-cached-note {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  color: var(--text-faint);
  font-size: 11px;
}

.ai-link-btn {
  margin-top: 6px;
  padding: 3px 10px;
  background: transparent;
  border: 1px solid rgba(139, 92, 246, 0.45);
  color: #a78bfa;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
}

.ai-link-btn:hover { background: rgba(139, 92, 246, 0.15); }

/* AI 设置弹窗 */
.ai-card { max-width: 520px; }

.ai-form {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-dim);
}

.ai-label input,
.ai-label select {
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

.ai-label input:focus,
.ai-label select:focus {
  border-color: #a78bfa;
}

.ai-help {
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.7;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius-sm);
}

.ai-help a { color: #a78bfa; }

.ai-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ai-test-result {
  font-size: 12.5px;
  min-height: 18px;
  color: var(--text-dim);
}

.ai-note {
  font-size: 11px;
  color: var(--text-faint);
  line-height: 1.6;
}

/* ===== 跟读模式步骤提示条 ===== */
.shadow-hint {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(139, 92, 246, 0.18), rgba(74, 222, 128, 0.12));
  border-bottom: 1px solid rgba(139, 92, 246, 0.35);
  animation: shadow-hint-in .2s ease;
}

@keyframes shadow-hint-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.shadow-step {
  font-size: 14px;
  font-weight: 600;
  color: #a78bfa;
  white-space: nowrap;
}

.shadow-keys {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shadow-keys kbd {
  display: inline-block;
  padding: 1px 7px;
  background: var(--bg-soft-2);
  border: 1px solid var(--border-soft);
  border-bottom-width: 2px;
  border-radius: 4px;
  font-family: Consolas, Monaco, monospace;
  font-size: 11px;
  color: var(--text);
  margin: 0 2px;
}

.shadow-exit {
  flex: 0 0 auto;
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.shadow-exit:hover { color: var(--danger); background: rgba(248,113,113,0.1); }

/* 跟读模式下录音按钮强化 */
.ctrl-btn.rec.shadow-active {
  background: rgba(248, 113, 113, 0.2);
  border-color: rgba(248, 113, 113, 0.6);
  animation: pulse 1.2s ease-in-out infinite;
}

/* ===== 复习卡片弹窗 ===== */
.review-card {
  max-width: 480px;
  width: 100%;
}

.review-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  min-height: 260px;
}

.review-card-inner {
  position: relative;
  width: 100%;
  min-height: 220px;
  perspective: 1200px;
  cursor: pointer;
  user-select: none;
}

.review-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 24px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  backface-visibility: hidden;
  transition: transform .35s ease, opacity .25s ease;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.review-front {
  transform: rotateY(0deg);
  opacity: 1;
}

.review-back {
  transform: rotateY(180deg);
  opacity: 0;
  background: var(--bg-soft-2);
}

.review-card-inner.flipped .review-front {
  transform: rotateY(-180deg);
  opacity: 0;
}

.review-card-inner.flipped .review-back {
  transform: rotateY(0deg);
  opacity: 1;
}

.review-face .review-word {
  font-size: 32px;
  font-weight: 700;
  color: var(--highlight);
  font-family: Georgia, serif;
  text-align: center;
  line-height: 1.2;
}

.review-face .review-ipa {
  font-size: 14px;
  color: var(--accent);
  font-family: Consolas, monospace;
}

.review-face .review-zh {
  font-size: 15px;
  color: var(--text);
  text-align: center;
  line-height: 1.6;
}

.review-face .review-context {
  font-size: 12px;
  color: var(--text-faint);
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}

.review-face .review-speak-btns {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.review-face .review-jump-btn {
  margin-top: 6px;
  padding: 5px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.4);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
}
.review-face .review-jump-btn:hover { background: rgba(74, 222, 128, 0.28); }

.review-foot {
  flex: 0 0 auto;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.review-flip {
  width: 100%;
  padding: 10px;
  background: var(--bg-soft-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.review-flip:hover { border-color: var(--accent); color: var(--accent); }

.review-rate-group {
  display: flex;
  gap: 8px;
}

.review-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .15s ease;
}

.rate-forgot {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.4);
}
.rate-forgot:hover { background: rgba(248, 113, 113, 0.25); }

.rate-vague {
  background: rgba(251, 191, 36, 0.12);
  color: var(--highlight);
  border-color: rgba(251, 191, 36, 0.4);
}
.rate-vague:hover { background: rgba(251, 191, 36, 0.25); }

.rate-known {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(74, 222, 128, 0.4);
}
.rate-known:hover { background: rgba(74, 222, 128, 0.28); }

/* 复习 Tab 汇总页 */
.review-summary {
  padding: 24px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  line-height: 1.8;
}

.review-summary strong {
  color: var(--highlight);
  font-size: 16px;
}

.review-start-btn {
  display: block;
  margin: 20px auto 30px;
  padding: 10px 28px;
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.review-start-btn:hover { filter: brightness(1.1); }
.review-start-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== 复习最小化悬浮球 ===== */
.review-fab {
  position: fixed;
  right: 18px;
  bottom: 42px;
  z-index: 105;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45);
  animation: fab-in .2s ease;
}

@keyframes fab-in {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.review-fab:hover { filter: brightness(1.1); }
.review-fab span { font-weight: 400; opacity: 0.9; }

/* ===== 单词背面：英美音分行 ===== */
.review-accent-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 340px;
}

.review-accent-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.review-accent-flag {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  min-width: 38px;
}

.review-accent-row .review-ipa {
  flex: 1 1 auto;
  text-align: left;
  font-size: 13.5px;
  min-width: 0;
}

.review-ipa-empty { color: var(--text-faint); font-size: 12px !important; }

.review-accent-speak {
  flex: 0 0 auto;
  padding: 4px 10px;
  background: var(--bg-soft-2);
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.review-accent-speak:hover { background: var(--accent-soft); }

/* ===== 复习完成面板 ===== */
.review-done {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px;
  animation: fab-in .25s ease;
}

.review-done-emoji { font-size: 44px; }

.review-done-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--highlight);
}

.review-done-stats {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 6px;
  padding: 16px 20px;
  background: var(--bg-soft-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-dim);
  min-width: 260px;
}

.done-stat { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.cnt-known { color: var(--accent); }
.cnt-vague { color: var(--highlight); }
.cnt-forgot { color: var(--danger); }

.review-done-group {
  display: flex;
  gap: 10px;
  width: 100%;
}

/* ===== 跟读功能组（录音/回放/原音，仅跟读模式显示） ===== */
.shadow-ctrl-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: shadow-hint-in .2s ease;
}

/* ===== 学习统计 ===== */
.stat-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}

.stat-block-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.stat-row3 {
  display: flex;
  gap: 8px;
}

.stat-cell {
  flex: 1;
  text-align: center;
  padding: 10px 4px 8px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.stat-num.listen { color: var(--accent); }
.stat-num.speak { color: #a78bfa; }

.stat-cap {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 3px;
}

.stat-target-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.stat-target-label {
  flex: 0 0 92px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.stat-target-label.listen { color: var(--accent); }
.stat-target-label.speak { color: #a78bfa; }

.stat-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-soft-2);
  border-radius: 999px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: width .3s ease;
}
.stat-bar.speak .stat-bar-fill { background: #a78bfa; }

.stat-media-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-faint);
}

.stat-day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 2px 4px;
  font-size: 12px;
  color: var(--text-faint);
  border-top: 1px solid var(--border);
}

.stat-day-date {
  flex: 0 0 52px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}
.stat-day-row .listen { color: var(--accent); flex: 0 0 56px; }
.stat-day-row .speak { color: #a78bfa; flex: 0 0 56px; }

/* 连续开口天数 */
.streak-chip {
  float: right;
  font-size: 12px;
  font-weight: 600;
  color: #f97316;
  background: rgba(249, 115, 22, 0.12);
  padding: 3px 10px;
  border-radius: 999px;
}

.stat-empty {
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.7;
  padding: 4px 2px;
}

/* 口语进步对比行 */
.speak-cmp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.speak-cmp-no {
  flex: 0 0 34px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.speak-cmp-text {
  flex: 1 1 auto;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 40px;
}

.speak-cmp-meta {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.speak-cmp-btn {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
}

.speak-cmp-btn.primary {
  border-color: var(--accent);
  color: var(--accent);
}

.speak-cmp-btn:disabled {
  opacity: 0.4;
}

/* ===== 自制粉色进度条 ===== */
.custom-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-top: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
}

.cb-time {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: center;
}

.cb-track {
  position: relative;
  flex: 1;
  height: 20px;
  cursor: pointer;
  touch-action: none;
}

.cb-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 5px;
  transform: translateY(-50%);
  background: var(--bg-soft-2, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
}

.cb-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 5px;
  width: 0;
  transform: translateY(-50%);
  background: #ff6b9d;
  border-radius: 999px;
  pointer-events: none;
}

.cb-thumb {
  position: absolute;
  left: 0;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translate(-50%, -50%);
  background: #ff6b9d;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.18);
  pointer-events: none;
}

.cb-fs {
  flex: 0 0 auto;
  width: 30px;
  height: 26px;
  font-size: 14px;
  line-height: 1;
  color: var(--text-dim);
  background: var(--bg-soft-2, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--border-soft);
  border-radius: 6px;
}

.cb-fs:hover { color: var(--text); }

/* ===== AI 讲解 / 取词卡：桌面改为右侧抽屉，不遮挡句子 ===== */
@media (min-width: 900px) {
  #ai-result.sheet-modal,
  #dict-modal.sheet-modal {
    left: auto;
    top: 0;
    bottom: 0;
    right: 0;
    width: 400px;
    background: transparent;
    pointer-events: none;
    align-items: stretch;
  }
  #ai-result .sheet-card,
  #dict-modal .sheet-card {
    pointer-events: auto;
    width: 100%;
    max-width: none;
    max-height: none;
    height: 100%;
    border-radius: 14px 0 0 14px;
    border-right: none;
    animation: drawer-in .22s ease;
  }
  #dict-modal .dict-card { height: 100%; }
}

@keyframes drawer-in {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 手机上讲解/取词卡降低高度，少挡句子 */
@media (max-width: 899px) {
  #ai-result .sheet-card,
  #dict-modal .sheet-card { max-height: 45vh; }
}

/* ===== 语音识别生成字幕弹窗 ===== */
.whisper-card .sheet-body {
  padding: 18px 20px 22px;
  overflow-y: auto;
}

.ws-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.ws-desc {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.ws-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.ws-label {
  flex: 0 0 auto;
  font-size: 13px;
  color: var(--text-dim);
}

.ws-row select {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 10px;
  background: var(--bg-soft-2);
  color: var(--text);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.ws-progress {
  margin-bottom: 14px;
}

.ws-status {
  font-size: 12.5px;
  color: var(--accent);
  margin-bottom: 6px;
  word-break: break-all;
}

.ws-bar {
  height: 8px;
  background: var(--bg-soft-2);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.ws-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width .2s ease;
}

/* 不确定进度（解码/准备阶段）来回滑动 */
.ws-bar-fill.indeterminate {
  animation: ws-slide 1.2s ease-in-out infinite alternate;
}

@keyframes ws-slide {
  0% { width: 15%; }
  100% { width: 85%; }
}

.ws-pct {
  font-size: 11.5px;
  color: var(--text-faint);
  margin-top: 4px;
  text-align: right;
}

.ws-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ws-actions .import-btn {
  flex: 1 1 auto;
  justify-content: center;
  padding: 10px 16px;
  font-size: 14px;
}

.ws-note {
  margin-top: 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
  background: var(--bg-soft-2);
  border-radius: var(--radius-sm);
  word-break: break-all;
}

.ws-note.err {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.08);
}

/* ===== 手机端顶栏：品牌一行 + 按钮一行（横向排列，放不下可滑动） ===== */
@media (max-width: 899px) {
  .topbar {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 8px 10px;
  }
  .brand {
    justify-content: center;
    gap: 8px;
  }
  .brand-mark { font-size: 19px; }
  .brand-sub { font-size: 11px; white-space: nowrap; }
  .import-group {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 2px;
  }
  .import-group::-webkit-scrollbar { display: none; }
  .import-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 7px 11px;
    font-size: 12.5px;
  }

  /* 控制条吸底固定：滚动句子列表时控制条不动（类似音乐播放器） */
  .control-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding-bottom: calc(6px + env(safe-area-inset-bottom)); /* 适配全面屏底部手势条 */
    overflow-x: hidden; /* 严禁横向溢出：所有按钮必须收进屏幕内 */
    justify-content: space-between;
    padding-left: 4px;
    padding-right: 4px;
  }
  .ctrl-btn {
    min-width: 42px;
    padding: 4px 4px;
  }
  /* 跟读模式收纳：隐藏 跟读/收藏/讲解（跟读钮冗余，退出用提示条✕），录音组改纯图标 */
  .control-bar.in-shadow #shadow-mode-btn,
  .control-bar.in-shadow #save-fav-btn,
  .control-bar.in-shadow #ai-explain-btn {
    display: none;
  }
  .control-bar.in-shadow #shadow-ctrl-group .ctrl-lbl { display: none; }
  .control-bar.in-shadow #shadow-ctrl-group .ctrl-ico { font-size: 17px; }
  .control-bar.in-shadow #shadow-ctrl-group .ctrl-divider { display: none; }

  /* 学习库弹窗：tab 改 3 列网格两行排布，文字横排不竖排 */
  .fav-head {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
  }
  .fav-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }
  .fav-tab {
    white-space: nowrap;
    text-align: center;
    padding: 8px 4px;
    font-size: 12.5px;
  }
  .fav-head-actions {
    justify-content: flex-end;
  }
  /* 内容区底部预留控制条高度，避免最后一句被遮挡 */
  .main { padding-bottom: 72px; }
  .statusbar { display: none; } /* 状态栏与吸底控制条重叠，手机端隐藏 */
}
