:root {
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-soft: #f9f8f4;
  --ink: #1e293b;
  --ink-muted: #64748b;
  --border: #e5e3da;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --primary-soft: #eff6ff;
  --dialogue: #6d28d9;
  --dialogue-soft: #f5f3ff;
  --accent: #c2410c;
  --accent-soft: #fff7ed;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --c1: #b91c1c;
  --c1-bg: #fef2f2;
  --b2: #b45309;
  --b2-bg: #fffbeb;
  --b1: #0f766e;
  --b1-bg: #f0fdfa;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  --font-main: "Segoe UI", "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* 访问者默认隐藏管理员专属功能（无闪烁） */
body:not(.is-admin-mode) .admin-only {
  display: none !important;
}

.stat-admin-badge {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
  font-weight: 700;
}

.btn-logout {
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-logout:hover:not(:disabled) {
  background: #fef2f2;
  border-color: #f87171;
}

/* 管理员登录弹层 */
.admin-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
}

.admin-login-card {
  width: 100%;
  max-width: 390px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 28px 26px 24px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.28);
  text-align: center;
}

.admin-login-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.admin-login-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  color: #0f172a;
}

.admin-login-desc {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-muted);
}

.admin-password-input {
  width: 100%;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  margin-bottom: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-password-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.15);
}

.admin-login-error {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 13px;
  font-weight: 600;
}

.admin-login-submit {
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-size: 14px;
}

.admin-back-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-muted);
  text-decoration: none;
}

.admin-back-link:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* 顶部导航栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

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

.brand-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1d4ed8, #6d28d9);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.brand h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-muted);
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stat-chip {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--ink);
  white-space: nowrap;
}

.stat-mode {
  color: var(--ink-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 按钮与表单 */
.btn {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.15s ease;
  font-family: inherit;
}

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

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--ink);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-soft);
}

.select-compact, .select-full {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.select-full {
  width: 100%;
}

/* 任务日志横幅 */
.job-banner {
  background: #0f172a;
  color: #e2e8f0;
  padding: 12px 20px;
  border-bottom: 1px solid #334155;
}

.job-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.job-msg {
  color: #93c5fd;
}

.btn-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
}

.job-logs {
  margin: 8px 0 0;
  padding: 10px 12px;
  background: #1e293b;
  border-radius: 8px;
  max-height: 150px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  color: #cbd5e1;
  white-space: pre-wrap;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #475569;
  border-top-color: #60a5fa;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 三栏工作区 */
.workspace {
  display: grid;
  grid-template-columns: 295px minmax(0, 1fr) 415px;
  gap: 18px;
  padding: 18px 20px 32px;
  max-width: 1680px;
  margin: 0 auto;
  align-items: start;
}

/* 左侧节目列表 */
.sidebar {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}

.type-filter-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.type-pill {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 4px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s ease;
  white-space: nowrap;
}

.type-pill.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
}

.article-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow);
}

.article-item:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
}

.article-item.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.12);
}

.article-thumb-wrap {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #0f172a;
  aspect-ratio: 16 / 9;
  margin-bottom: 8px;
}

.article-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-duration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  background: rgba(15, 23, 42, 0.84);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

.thumb-cat {
  position: absolute;
  left: 6px;
  top: 6px;
  background: rgba(29, 78, 216, 0.92);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
}

.thumb-cat.is-dialogue {
  background: rgba(109, 40, 217, 0.92);
}

.article-item-title {
  margin: 0 0 6px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.42;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-item-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* 中间播放器与正文区 */
.content-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-muted);
}

.player-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.video-wrapper {
  position: relative;
  background: #020617;
  aspect-ratio: 16 / 9;
  width: 100%;
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

/* 纯音频对话封面舞台模式 */
.video-wrapper.is-audio {
  aspect-ratio: auto;
  min-height: 295px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #0b1120;
}

.video-wrapper.is-audio video {
  position: relative;
  z-index: 3;
  height: 54px;
  background: rgba(15, 23, 42, 0.96);
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}

.audio-cover-stage {
  position: relative;
  flex: 1;
  min-height: 240px;
  display: flex;
  align-items: center;
  padding: 22px 26px;
  overflow: hidden;
}

.audio-cover-backdrop {
  position: absolute;
  inset: -16px;
  width: calc(100% + 32px);
  height: calc(100% + 32px);
  object-fit: cover;
  filter: blur(22px) brightness(0.38);
  transform: scale(1.06);
  z-index: 1;
}

.audio-cover-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 22px;
  width: 100%;
}

.audio-cover-thumb {
  width: 220px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
}

.audio-cover-info {
  flex: 1;
  min-width: 0;
  color: #f8fafc;
}

.audio-cover-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #e9d5ff;
  background: rgba(109, 40, 217, 0.55);
  border: 1px solid rgba(192, 132, 252, 0.45);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.audio-cover-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  margin-bottom: 12px;
}

.audio-wave {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 22px;
}

.audio-wave span {
  display: block;
  width: 4px;
  height: 6px;
  border-radius: 2px;
  background: #60a5fa;
  transition: height 0.2s ease;
}

.audio-wave.playing span {
  animation: waveBounce 0.9s ease-in-out infinite;
}

.audio-wave.playing span:nth-child(2) { animation-delay: 0.15s; background: #a78bfa; }
.audio-wave.playing span:nth-child(3) { animation-delay: 0.3s; background: #38bdf8; }
.audio-wave.playing span:nth-child(4) { animation-delay: 0.45s; background: #a78bfa; }
.audio-wave.playing span:nth-child(5) { animation-delay: 0.6s; }

@keyframes waveBounce {
  0%, 100% { height: 6px; }
  50% { height: 22px; }
}

.player-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border-top: 1px solid var(--border);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.ctrl-label {
  font-size: 12px;
  color: var(--ink-muted);
  margin-right: 2px;
}

.ctrl-btn, .speed-btn, .size-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}

.ctrl-btn:hover, .speed-btn:hover, .size-btn:hover {
  border-color: #93c5fd;
  background: var(--primary-soft);
}

.speed-btn.active, .size-btn.active, .ctrl-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.ctrl-export {
  border-color: #93c5fd;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.ctrl-download {
  text-decoration: none;
  border-color: #86efac;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
}

.ctrl-pdf {
  text-decoration: none;
  border-color: #fdba74;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.ctrl-pdf:hover {
  background: #ffedd5;
  border-color: #f97316;
}

.btn-pdf-bundle {
  margin-top: 10px;
  width: 100%;
  justify-content: center;
  text-decoration: none;
  background: var(--accent-soft);
  border-color: #fdba74;
  color: var(--accent);
}

.btn-pdf-bundle:hover {
  background: #ffedd5;
  border-color: #f97316;
}

.shortcut-hint {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.article-header {
  margin-top: 14px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-cat {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-cat.is-dialogue {
  background: var(--dialogue-soft);
  color: var(--dialogue);
}

.meta-offline {
  background: var(--success-soft);
  color: var(--success);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.meta-link {
  color: var(--primary);
  text-decoration: none;
  margin-left: auto;
}

.meta-link:hover {
  text-decoration: underline;
}

.article-title {
  margin: 0 0 6px;
  font-size: 22px;
  line-height: 1.38;
  font-weight: 700;
  color: #0f172a;
}

.article-title-zh {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* 正文精读区 */
.reader-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 12px;
}

.reader-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.reader-tools-left, .reader-tools-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.article-body {
  padding: 22px 24px 26px;
  color: #1e293b;
}

.article-body.size-sm { font-size: 15px; line-height: 1.85; }
.article-body.size-md { font-size: 16.8px; line-height: 1.95; }
.article-body.size-lg { font-size: 19px; line-height: 2.05; }

.article-body p {
  margin: 0 0 16px;
}

.article-body p:last-child {
  margin-bottom: 0;
}

.speaker-tag {
  display: inline-block;
  font-weight: 700;
  color: var(--dialogue);
  background: var(--dialogue-soft);
  border: 1px solid #ddd6fe;
  border-radius: 5px;
  padding: 0 6px;
  margin-right: 6px;
  font-size: 0.9em;
}

.vocab-hl {
  background: linear-gradient(transparent 62%, rgba(251, 191, 36, 0.42) 62%);
  border-bottom: 1.5px solid #d97706;
  border-radius: 2px;
  padding: 0 2px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.vocab-hl:hover {
  background: rgba(251, 191, 36, 0.48);
}

.vocab-hl.is-mastered {
  background: linear-gradient(transparent 68%, rgba(34, 197, 94, 0.25) 68%);
  border-bottom-color: #16a34a;
}

/* 实时同步字幕条与单句循环 */
.ab-loop-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 3px 8px 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.ab-clear-btn {
  border: none;
  background: transparent;
  color: #92400e;
  cursor: pointer;
  font-weight: 700;
  padding: 0 2px;
}

.live-caption-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  background: linear-gradient(135deg, #0f172a 0%, #172554 100%);
  color: #f8fafc;
  border-top: 2px solid #3b82f6;
  box-shadow: inset 0 1px 0 rgba(147, 197, 253, 0.25);
}

.live-caption-bar.is-playing {
  border-top-color: #f59e0b;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}

.live-caption-time {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 700;
  color: #fef08a;
  background: rgba(245, 158, 11, 0.22);
  border: 1px solid rgba(251, 191, 36, 0.45);
  padding: 3px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.live-caption-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.live-caption-text {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.live-caption-text .vocab-hl {
  background: rgba(251, 191, 36, 0.24);
  color: #fde68a;
  border-bottom: 1.5px solid #fbbf24;
  padding: 0 3px;
}

.live-caption-text .speaker-tag {
  background: rgba(139, 92, 246, 0.35);
  border-color: rgba(196, 181, 253, 0.5);
  color: #ede9fe;
}

.live-caption-zh {
  font-size: 13px;
  line-height: 1.48;
  color: #bfdbfe;
}

.live-caption-zh:empty {
  display: none;
}

.btn-caption-loop {
  border: 1px solid #475569;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}

.btn-caption-loop:hover,
.btn-caption-loop.active {
  background: #d97706;
  border-color: #f59e0b;
  color: #fff;
}

/* 阅读模式切换与正文同步高亮 */
.mode-switch {
  display: inline-flex;
  background: #e2e8f0;
  padding: 2px;
  border-radius: 8px;
  gap: 2px;
}

.mode-btn {
  border: none;
  background: transparent;
  color: #475569;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.mode-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.sync-hint-bar {
  padding: 7px 16px;
  font-size: 12px;
  color: #475569;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* 段落分组与逐句双语同步卡片（正文同步模式） */
.para-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px dashed #e2e8f0;
}

.para-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.sync-sentence-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-left: 3.5px solid transparent;
  border-radius: 10px;
  background: transparent;
  transition: all 0.16s ease;
}

.sync-sentence-row.has-time {
  cursor: pointer;
}

.sync-sentence-row.has-time:hover {
  background: #f8fafc;
  border-color: #dbeafe;
  border-left-color: #93c5fd;
}

.sync-sentence-row.is-speaking {
  background: linear-gradient(90deg, #eff6ff 0%, #fefce8 100%);
  border-color: #93c5fd;
  border-left-color: #2563eb;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.14);
}

.sync-sentence-row.is-looping {
  background: #fffbeb;
  border-color: #fbbf24;
  border-left-color: #d97706;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.15);
}

.sent-content {
  min-width: 0;
}

.sent-en {
  color: #1e293b;
  line-height: 1.65;
}

.sync-sentence-row.is-speaking .sent-en {
  color: #0f172a;
  font-weight: 600;
}

.sent-zh {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}

.sync-sentence-row.is-speaking .sent-zh {
  color: #1e40af;
}

.sent-time-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 3px 6px;
  margin-top: 2px;
  cursor: pointer;
  user-select: none;
}

.sync-sentence-row.is-speaking .sent-time-pill {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.sync-sentence-row.is-looping .sent-time-pill {
  background: #d97706;
  color: #fff;
  border-color: #d97706;
}

/* 逐句听写字幕列表视图 */
.transcript-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transcript-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3.5px solid transparent;
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s ease;
}

.transcript-row:hover {
  border-color: #93c5fd;
  border-left-color: #93c5fd;
  background: #f8fafc;
}

.transcript-row.is-speaking {
  border-color: #93c5fd;
  border-left-color: var(--primary);
  background: linear-gradient(90deg, #eff6ff 0%, #fefce8 100%);
  box-shadow: 0 2px 10px rgba(29, 78, 216, 0.16);
}

.transcript-row.is-speaking .tr-text > div:first-child {
  color: #0f172a;
  font-weight: 600;
}

.transcript-row.is-looping {
  border-color: #f59e0b;
  border-left-color: #d97706;
  background: #fffbeb;
}

.tr-time {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 6px;
  padding: 3px 6px;
  text-align: center;
  margin-top: 2px;
}

.transcript-row.is-speaking .tr-time {
  background: var(--primary);
  color: #fff;
}

.tr-text {
  line-height: 1.65;
  color: #1e293b;
}

.tr-text-zh {
  margin-top: 3px;
  font-size: 13px;
  line-height: 1.5;
  color: #64748b;
}

.transcript-row.is-speaking .tr-text-zh {
  color: #1e40af;
}

.para-zh {
  margin-top: 5px;
  font-size: 14px;
  line-height: 1.65;
  color: #475569;
  padding-left: 10px;
  border-left: 2.5px solid #cbd5e1;
}

.tr-loop-btn {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--ink-muted);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.tr-loop-btn:hover,
.tr-loop-btn.active {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  font-weight: 600;
}

/* 右侧词汇与语法面板 */
.study-pane {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.study-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 13px 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 2.5px solid transparent;
  font-family: inherit;
}

.tab-btn.active {
  color: var(--primary);
  background: var(--surface);
  border-bottom-color: var(--primary);
}

.tab-count {
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--ink);
}

.study-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.study-progress-bar {
  padding: 12px 14px 8px;
  border-bottom: 1px solid var(--border);
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2563eb, #16a34a);
  transition: width 0.25s ease;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-soft);
  flex-wrap: wrap;
}

.analysis-hint {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-left: auto;
}

.card-list {
  padding: 12px 14px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.study-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
  background: var(--surface);
  transition: all 0.18s ease;
}

.study-card.mastered {
  background: #f8faf9;
  border-color: #bbf7d0;
}

.study-card.pulse {
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.28);
  border-color: var(--primary);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.word-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.word-main {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
}

.word-reading {
  font-size: 12.5px;
  color: var(--primary);
  font-weight: 500;
}

.card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.level-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
}

.level-C1 { color: var(--c1); background: var(--c1-bg); }
.level-B2 { color: var(--b2); background: var(--b2-bg); }
.level-B1 { color: var(--b1); background: var(--b1-bg); }

.pos-badge {
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #475569;
}

.status-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-muted);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s ease;
}

.status-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.status-toggle.mastered {
  background: var(--success-soft);
  border-color: #86efac;
  color: var(--success);
}

.meaning-zh {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 8px;
  line-height: 1.5;
}

.example-box {
  background: var(--surface-soft);
  border-left: 3px solid #cbd5e1;
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  line-height: 1.65;
  color: #334155;
}

.example-box mark {
  background: rgba(251, 191, 36, 0.45);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.grammar-pattern {
  font-size: 15.5px;
  font-weight: 700;
  color: #1d4ed8;
}

.grammar-conn {
  font-size: 12.5px;
  color: #475569;
  background: #f1f5f9;
  padding: 5px 9px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.grammar-note {
  margin-top: 8px;
  font-size: 12.5px;
  color: #9a3412;
  background: var(--accent-soft);
  padding: 7px 10px;
  border-radius: 6px;
  line-height: 1.55;
}

/* 快速释义浮窗 */
.word-popover {
  position: fixed;
  z-index: 80;
  width: 290px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.popover-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.pop-word {
  font-size: 16px;
  font-weight: 700;
  margin-right: 6px;
}

.pop-reading {
  font-size: 12.5px;
  color: var(--primary);
}

.pop-pos {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.pop-meaning {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 10px;
}

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

.btn-mini {
  flex: 1;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.btn-mini-ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.empty-filter {
  text-align: center;
  padding: 28px 12px;
  color: var(--ink-muted);
  font-size: 13px;
}

/* 响应式适配 */
@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 265px minmax(0, 1fr);
  }
  .sidebar {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .content-pane {
    grid-column: 2;
    grid-row: 1;
  }
  .study-pane {
    grid-column: 2;
    grid-row: 2;
    position: static;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }
  .workspace {
    grid-template-columns: 1fr;
    padding: 12px;
  }
  .sidebar,
  .content-pane,
  .study-pane {
    grid-column: 1;
    grid-row: auto;
    position: static;
    max-height: none;
  }
  .sidebar {
    max-height: 360px;
  }
  .audio-cover-overlay {
    flex-direction: column;
    align-items: flex-start;
  }
  .audio-cover-thumb {
    width: 160px;
  }
}
