/* ============================================
   懂你英语 A+ UI 原型 · 设计令牌
   基准：375×667 手机竖屏
   ============================================ */

:root {
  /* 主色 - 清新护眼绿 */
  --color-primary: #3DB88A;
  --color-primary-dark: #2A9B74;
  --color-primary-light: #E8F5F0;
  --color-primary-ghost: rgba(61, 184, 138, 0.12);

  /* 强调色 */
  --color-accent: #FF8C42;
  --color-accent-light: #FFF0E6;

  /* 文字 */
  --color-text: #1A2B3C;
  --color-text-secondary: #8A9BAA;
  --color-text-tertiary: #B8C5D0;

  /* 背景 */
  --color-bg: #F5F8FA;
  --color-surface: #FFFFFF;
  --color-divider: #EEF2F6;

  /* 功能色 */
  --color-success: #3DB88A;
  --color-warning: #FFB84D;
  --color-error: #FF6B6B;

  /* 字体 */
  --font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;

  /* 字号 */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 18px;
  --text-xl: 22px;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 999px;

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;

  /* 跟读：上排左图右控，下排句子 */
  --roleplay-scene-height: clamp(160px, 20vh, 200px);
  --roleplay-top-height: clamp(150px, 20vh, 200px);

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(26, 43, 60, 0.06);
  --shadow-md: 0 4px 16px rgba(26, 43, 60, 0.08);
  --shadow-lg: 0 8px 24px rgba(61, 184, 138, 0.15);

  /* 布局 · 桌面三栏 */
  --sidebar-left-width: 220px;
  --sidebar-right-width: 232px;
  --main-max-width: 100%;
  --device-width: 375px;
  --device-height: 667px;
  --nav-height: 56px;
  --status-height: 44px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="ocean"] {
  --color-primary: #3B82F6;
  --color-primary-dark: #2563EB;
  --color-primary-light: #EFF6FF;
  --color-primary-ghost: rgba(59, 130, 246, 0.12);
  --color-success: #3B82F6;
  --shadow-lg: 0 8px 24px rgba(59, 130, 246, 0.15);
}
[data-theme="sunset"] {
  --color-primary: #F97316;
  --color-primary-dark: #EA580C;
  --color-primary-light: #FFF7ED;
  --color-primary-ghost: rgba(249, 115, 22, 0.12);
  --color-success: #F97316;
  --shadow-lg: 0 8px 24px rgba(249, 115, 22, 0.15);
}
[data-theme="grape"] {
  --color-primary: #8B5CF6;
  --color-primary-dark: #7C3AED;
  --color-primary-light: #F5F3FF;
  --color-primary-ghost: rgba(139, 92, 246, 0.12);
  --color-success: #8B5CF6;
  --shadow-lg: 0 8px 24px rgba(139, 92, 246, 0.15);
}
[data-theme="rose"] {
  --color-primary: #EC4899;
  --color-primary-dark: #DB2777;
  --color-primary-light: #FDF2F8;
  --color-primary-ghost: rgba(236, 72, 153, 0.12);
  --color-success: #EC4899;
  --shadow-lg: 0 8px 24px rgba(236, 72, 153, 0.15);
}
[data-theme="slate"] {
  --color-primary: #64748B;
  --color-primary-dark: #475569;
  --color-primary-light: #F1F5F9;
  --color-primary-ghost: rgba(100, 116, 139, 0.14);
  --color-success: #64748B;
  --shadow-lg: 0 8px 24px rgba(100, 116, 139, 0.15);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-family);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  margin: 0;
}

/* ---- 桌面三栏布局 ---- */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-left-width) minmax(0, 1fr) var(--layout-resizer-width, 8px) var(--sidebar-right-width);
  min-height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--color-bg);
}

.sidebar-left {
  background: var(--color-surface);
  border-right: 1px solid var(--color-divider);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.brand-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: linear-gradient(145deg, #2563eb 0%, #6366f1 55%, #7c3aed 100%);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.sidebar-brand-text {
  min-width: 0;
  flex: 1;
}

.sidebar-brand strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.3;
  font-weight: 700;
}

.sidebar-brand .brand-tagline {
  display: block;
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  line-height: 1.35;
  margin-top: 2px;
}

.sidebar-brand span:not(.brand-tagline):not(.hidden) {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px 14px;
  border: none;
  background: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  cursor: pointer;
  text-align: left;
  width: 100%;
}

.sidebar-nav-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
  box-shadow: inset 4px 0 0 var(--color-primary);
}

.nav-icon {
  font-size: 18px;
}

.sidebar-stage-progress {
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-size: var(--text-sm);
}

.sidebar-stage-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.sidebar-mini-bar {
  margin: 8px 0 4px;
}

.sidebar-stage-pct {
  font-size: var(--text-xs);
  color: var(--color-primary-dark);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-divider);
  margin-top: auto;
}

.edge-browser-banner {
  flex-shrink: 0;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(61, 184, 138, 0.35);
  background: rgba(61, 184, 138, 0.1);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

.edge-browser-banner.hidden {
  display: none !important;
}

.edge-browser-banner-text {
  margin: 0;
  flex: 1;
  min-width: 200px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--color-text);
}

.edge-browser-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.site-beian a {
  color: inherit;
  text-decoration: none;
}

.site-beian a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.site-beian--auth {
  margin-top: 16px;
  padding: 8px 0 0;
}

.site-beian--main {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin-top: auto;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(245, 248, 250, 0.92);
  border-top: 1px solid var(--color-divider);
  backdrop-filter: blur(6px);
}

@media (max-width: 768px) {
  .sidebar-left .site-beian {
    display: none;
  }
}

.sidebar-user-meta {
  flex: 1;
  min-width: 0;
}

.sidebar-user-nick {
  display: block;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-sub {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-logout-btn {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}

.sidebar-logout-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--color-text);
}

.sidebar-login {
  width: 100%;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-login-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.sidebar-login-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--color-divider);
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
}

.sidebar-login-input:focus {
  outline: none;
  border-color: rgba(61, 184, 138, 0.55);
  box-shadow: 0 0 0 2px rgba(61, 184, 138, 0.15);
}

.sidebar-login-sub {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--color-text-secondary);
}

.auth-page {
  display: none;
  box-sizing: border-box;
}

.auth-page.active {
  display: flex;
}

.auth-page-inner {
  width: min(440px, 100%);
  padding: 28px 24px 20px;
  border-radius: 20px;
  flex-shrink: 0;
}

/* 登录/注册：单独全屏滚动层，避免被 .main-panel / .app-main 截断 */
body.auth-only-mode {
  overflow: hidden;
  height: 100%;
}

body.auth-only-mode .sidebar-left,
body.auth-only-mode .sidebar-right,
body.auth-only-mode .layout-resizer {
  display: none !important;
}

body.auth-only-mode .app-shell {
  grid-template-columns: 1fr !important;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}

body.auth-only-mode .main-panel {
  max-width: none;
  padding: 0 !important;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden !important;
}

body.auth-only-mode .app-main {
  display: none !important;
}

body.auth-only-mode #page-auth.page.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: fixed;
  inset: 0;
  z-index: 300;
  width: 100%;
  height: 100%;
  max-height: 100dvh;
  margin: 0;
  padding: 24px 16px calc(48px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: scroll;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--color-bg);
  box-sizing: border-box;
}

body.auth-only-mode #page-auth .auth-page-inner {
  margin: 0 auto;
}

.auth-gate-brand {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-primary);
}

.auth-gate-title {
  margin: 0 0 8px;
  font-size: 22px;
}

.auth-gate-hint {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--color-text-secondary);
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--color-divider);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
}

.auth-tab.active {
  border-color: var(--color-primary);
  background: rgba(61, 184, 138, 0.08);
  color: var(--color-primary);
}

.auth-label {
  display: block;
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 600;
}

.auth-forgot-row {
  display: flex;
  justify-content: flex-end;
  margin: 6px 0 2px;
}

.auth-forgot-link {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

.auth-reset-help {
  margin: 8px 0 16px;
  padding: 14px 14px 16px;
  border-radius: 12px;
  background: rgba(61, 184, 138, 0.08);
  border: 1px solid rgba(61, 184, 138, 0.22);
}

.auth-reset-help-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.auth-reset-help-text {
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-text-secondary);
}

.auth-reset-email {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  word-break: break-all;
}

.auth-reset-email:hover {
  text-decoration: underline;
}

.auth-back-login {
  margin-top: 8px;
}

.auth-input {
  width: 100%;
}

.auth-password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-password-wrap .auth-input {
  padding-right: 44px;
}

.auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 4px 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  opacity: 0.7;
  color: var(--color-text-secondary);
}

.auth-password-toggle:hover {
  opacity: 1;
}

.auth-password-toggle[aria-pressed="true"] {
  opacity: 1;
  color: var(--color-primary);
}

.auth-error {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(198, 40, 40, 0.08);
  color: #b71c1c;
  font-size: 13px;
}

.auth-submit {
  margin-top: 16px;
}

.auth-guest {
  margin-top: 10px;
}

.auth-sms-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.auth-sms-input {
  flex: 1;
  min-width: 0;
}

.auth-sms-btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 108px;
}

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

.account-card {
  padding: 14px;
}

.account-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.account-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
}

.account-status {
  margin: 4px 0 0;
  font-weight: 600;
}

.account-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.account-head-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}

.account-sync-btn {
  margin-top: 12px;
}

.account-switch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.account-switch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--color-divider);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.account-switch-item.active {
  border-color: var(--color-primary);
  background: rgba(61, 184, 138, 0.06);
}

.account-switch-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}

.account-switch-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.account-switch-meta span {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.sidebar-user span {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.main-panel {
  display: flex;
  flex-direction: column;
  padding: var(--space-lg) var(--space-md);
  max-height: 100vh;
  overflow: hidden;
  position: relative;
}

.app-main {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  max-width: var(--main-max-width);
  margin: 0;
  width: 100%;
}

.sidebar-right {
  background: var(--color-surface);
  border-left: none;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  min-width: 0;
}

.layout-resizer {
  position: relative;
  z-index: 25;
  width: 8px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
  align-self: stretch;
}

.layout-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--color-divider);
  border-radius: 2px;
  transition: background 0.15s, width 0.15s;
}

.layout-resizer:hover::after,
.layout-resizer.is-dragging::after,
.layout-resizer:focus-visible::after {
  background: var(--color-primary);
  width: 3px;
}

.layout-resizer:focus-visible {
  outline: none;
}

body.layout-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.layout-resizing * {
  cursor: col-resize !important;
}

.right-card {
  padding: var(--space-lg);
}

.right-card-title {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.big-progress-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
}

.big-progress-num span {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  font-weight: 500;
}

.right-muted {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 8px;
}

.goal-line {
  font-size: var(--text-lg);
  margin-bottom: 8px;
}

.milestone-next {
  font-size: var(--text-md);
  font-weight: 600;
}

.quick-review-btn {
  margin-top: 8px;
}

.stage-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-lg);
  min-height: 140px;
}

.stage-hero-bg {
  position: absolute;
  inset: 0;
  opacity: 0.35;
}

.stage-hero-content {
  position: relative;
  padding: var(--space-xl);
  z-index: 1;
}

.stage-badge {
  font-size: var(--text-xs);
  background: rgba(61, 184, 138, 0.2);
  color: var(--color-primary-dark);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.stage-hero h2 {
  font-size: var(--text-xl);
  margin: 8px 0 4px;
}

.stage-hero p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.stage-hero-meta {
  display: flex;
  gap: var(--space-lg);
  margin-top: var(--space-md);
  font-size: var(--text-xs);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.stage-tabs {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.stage-tab {
  flex: 1;
  min-width: 100px;
  padding: 10px 12px;
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
}

.stage-tab.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.stage-tab-num {
  font-size: 10px;
  color: var(--color-text-secondary);
  display: block;
}

.stage-tab-name {
  font-size: var(--text-sm);
  font-weight: 600;
  display: block;
}

.stage-tab-prog {
  font-size: 10px;
  color: var(--color-primary);
}

.day-flow-wrap {
  overflow-x: auto;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-sm);
}

.day-flow-nodes {
  display: flex;
  align-items: center;
  min-width: min-content;
}

.day-node-wrap {
  display: flex;
  align-items: center;
}

.day-node {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-divider);
  background: var(--color-surface);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.day-node.done {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.day-node.skipped.done {
  background: var(--color-text-tertiary);
  border-color: var(--color-text-tertiary);
  font-size: 10px;
}

.day-node.current {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-light);
}

.day-node.selected {
  transform: scale(1.1);
  border-color: var(--color-primary-dark);
}

.day-node.locked {
  background: #EEF2F6;
  cursor: not-allowed;
  font-size: 14px;
}

.day-connector {
  width: 12px;
  height: 3px;
  background: var(--color-divider);
  flex-shrink: 0;
}

.day-connector.done {
  background: var(--color-primary);
}

.day-detail-hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0;
  overflow: hidden;
}

.day-detail-scene {
  min-height: 180px;
  position: relative;
}

.day-detail-scene-inner {
  height: 100%;
  min-height: 180px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-md);
}

.scene-illus-lg {
  min-height: 160px;
}

.day-detail-body {
  padding: var(--space-xl);
}

.day-detail-num {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
}

.difficulty-pill {
  font-size: 10px;
  background: var(--color-primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 8px;
}

.day-detail-head {
  margin-bottom: 8px;
}

.day-detail-body h3 {
  font-size: var(--text-xl);
  margin-bottom: 8px;
}

.day-detail-plot {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}

.day-detail-meta {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-lg);
}

.lock-hint {
  text-align: center;
  color: var(--color-text-secondary);
  padding: var(--space-md);
}

.milestone-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.milestone-item {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  text-align: center;
  font-size: var(--text-xs);
}

.milestone-item.unlocked {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.milestone-item.locked {
  opacity: 0.55;
}

.milestone-badge {
  font-size: 24px;
  display: block;
  margin-bottom: 4px;
}

.fav-btn.fav-on {
  color: var(--color-accent);
}

.scene-airport { background: linear-gradient(180deg, #B8E0F0 0%, #6BA3D6 100%); }
.scene-hotel { background: linear-gradient(180deg, #E8D4F0 0%, #B39DDB 100%); }
.scene-client { background: linear-gradient(180deg, #D4E8F0 0%, #90CAF9 100%); }
.scene-presentation { background: linear-gradient(180deg, #C5E8F0 0%, #4ECDC4 100%); }
.scene-executive { background: linear-gradient(180deg, #2A4A5C 0%, #1A2B3C 100%); }
.scene-global { background: linear-gradient(180deg, #667eea 0%, #764ba2 100%); }
.scene-workshop { background: linear-gradient(180deg, #FFE8CC 0%, #FFCC80 100%); }
.scene-hr { background: linear-gradient(180deg, #F0EBFF 0%, #CE93D8 100%); }

.thumb-airport { background: linear-gradient(135deg, #B8E0F0, #6BA3D6); }
.thumb-executive { background: linear-gradient(135deg, #2A4A5C, #4ECDC4); }

.day-complete-modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 43, 60, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

#page-auth.page.active {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
}

.page-loading {
  margin: 24px 0;
  padding: 20px;
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 14px;
  border-radius: 12px;
  background: rgba(61, 184, 138, 0.06);
}

.page-loading.hidden {
  display: none;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 200px 1fr;
  }
  .sidebar-right,
  .layout-resizer {
    display: none;
  }
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar-left {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    flex-direction: row;
    padding: 8px;
    z-index: 100;
    border-top: 1px solid var(--color-divider);
    border-right: none;
  }
  .sidebar-brand,
  .sidebar-stage-progress,
  .sidebar-user {
    display: none;
  }
  .sidebar-nav {
    flex-direction: row;
    width: 100%;
    justify-content: space-around;
  }
  .sidebar-nav-item {
    flex-direction: column;
    font-size: 10px;
    padding: 8px;
    gap: 2px;
  }
  .main-panel {
    padding: var(--space-lg);
    padding-bottom: 72px;
    max-height: none;
    min-height: 100vh;
  }

  .word-lookup-dock {
    max-height: min(36vh, 260px);
    margin-bottom: var(--space-xs);
  }
  .day-detail-hero {
    grid-template-columns: 1fr;
  }
}

/* ---- 手机外壳（保留兼容，默认隐藏） ---- */
.device-frame {
  display: none;
}

.status-bar {
  height: var(--status-height);
  padding: 12px 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  font-weight: 600;
  background: var(--color-bg);
  position: relative;
  z-index: 10;
}

.status-icons {
  display: flex;
  gap: 4px;
  font-size: 10px;
}

.app-main {
  position: relative;
}

/* ---- 页面（桌面流式布局） ---- */
.page-day-study.active {
  display: flex;
  flex-direction: column;
}

/* ---- 通用组件 ---- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0 var(--space-lg);
  min-height: 44px;
}

.page-header h1 {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.page-header.with-back h1 {
  flex: 1;
  text-align: center;
  font-size: var(--text-lg);
}

.back-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--color-text);
  flex-shrink: 0;
}

.back-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--color-text-secondary);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.header-tag {
  font-size: var(--text-xs);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-weight: 600;
}

.section-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  margin-top: var(--space-xl);
}

.section-label:first-child {
  margin-top: 0;
}

/* 卡片 */
.card-elevated {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.card-flat {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-divider);
}

/* 按钮 */
.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--text-md);
  font-weight: 600;
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.97);
  background: linear-gradient(135deg, #4338CA 0%, #3730A3 100%);
  box-shadow: 0 4px 14px rgba(67, 56, 202, 0.35);
}

.btn-primary.btn-block {
  width: 100%;
  margin-top: var(--space-xl);
}

.btn-primary.btn-sm {
  padding: 8px 20px;
  font-size: var(--text-sm);
}

.btn-primary.btn-hero {
  width: 100%;
  margin-top: var(--space-md);
}

.btn-ghost-sm {
  background: var(--color-primary-ghost);
  color: var(--color-primary-dark);
  border: none;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  padding: 6px 14px;
  cursor: pointer;
  font-weight: 500;
}

/* 进度条 */
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-full);
  overflow: hidden;
  flex: 1;
}

.progress-fill {
  height: 100%;
  background: #fff;
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* ---- 首页 ---- */
.home-header {
  padding-top: 0;
}

.user-greeting {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.avatar-ring {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  padding: 2px;
}

.avatar {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-primary);
  font-size: var(--text-lg);
}

.greeting-text {
  font-size: var(--text-md);
  font-weight: 600;
}

.greeting-sub {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* 打卡 */
.streak-card {
  background: linear-gradient(135deg, #FFF8F0 0%, #FFF0E6 100%);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid rgba(255, 140, 66, 0.15);
}

.streak-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.streak-fire {
  font-size: 28px;
}

.streak-left strong {
  font-size: var(--text-md);
  display: block;
}

.streak-left p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.streak-days {
  display: flex;
  gap: 6px;
}

.streak-days .day {
  flex: 1;
  text-align: center;
  font-size: var(--text-xs);
  padding: 6px 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.6);
  color: var(--color-text-secondary);
}

.streak-days .day.done {
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
}

.streak-days .day.today {
  background: var(--color-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(61, 184, 138, 0.4);
}

.stage1-checkin-card {
  margin-bottom: var(--space-lg);
}

.checkin-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  margin-bottom: var(--space-sm);
}

.checkin-day {
  aspect-ratio: 1;
  min-height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.75);
  color: var(--color-text-secondary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.checkin-day.listen {
  background: #ffe8cc;
  color: #c45c00;
}

.checkin-day.done {
  background: var(--color-primary);
  color: #fff;
}

.checkin-day.current {
  box-shadow: 0 0 0 2px var(--color-primary-dark);
}

.checkin-day.no-content,
.checkin-day:disabled {
  background: rgba(240, 238, 232, 0.9);
  color: #c8c2b8;
  cursor: not-allowed;
  opacity: 0.72;
}

.checkin-legend {
  display: flex;
  gap: var(--space-md);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin: 0;
}

.checkin-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

.checkin-legend .dot.listen { background: #ffe8cc; border: 1px solid #f0a050; }
.checkin-legend .dot.done { background: var(--color-primary); }

.listen-blind-hint {
  text-align: center;
  padding: var(--space-md);
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.listen-blind-hint p { margin: 0; font-weight: 600; }
.listen-blind-sub { font-size: var(--text-sm); font-weight: 400; opacity: 0.9; margin-top: 4px !important; }

.listen-quiz-play {
  margin-bottom: var(--space-sm);
  min-height: 44px;
  padding: 10px 18px;
  cursor: pointer;
  position: relative;
  z-index: 2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.listen-quiz-play:disabled {
  opacity: 0.65;
  cursor: wait;
}

.listen-quiz-card {
  padding: var(--space-lg);
  position: relative;
  z-index: 1;
}

.listen-quiz-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}
.listen-quiz-tag {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary-dark);
  background: #e8f5ef;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}
.listen-quiz-tag--ai {
  background: linear-gradient(90deg, #6b4eff, #2a9b74);
  color: #fff;
}
.listen-quiz-loading {
  text-align: center;
  padding: var(--space-xl);
}
.listen-quiz-progress { font-size: var(--text-sm); color: var(--color-text-secondary); }
.listen-quiz-category { font-weight: 600; margin: 0 0 var(--space-sm); }
.listen-quiz-note {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-md);
}
.listen-quiz-prompt { font-weight: 600; margin-bottom: var(--space-sm); }
.listen-quiz-sentence {
  font-size: var(--text-md);
  padding: var(--space-md);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}
.listen-quiz-hint { font-size: var(--text-xs); color: var(--color-text-secondary); margin-bottom: var(--space-md); }

.listen-quiz-done {
  text-align: center;
  padding: var(--space-xl);
}
.listen-quiz-done-icon {
  width: 56px;
  height: 56px;
  line-height: 56px;
  border-radius: 50%;
  background: #e8f5ef;
  color: var(--color-primary-dark);
  font-size: 28px;
  margin: 0 auto var(--space-md);
}
.listen-quiz-done-hint { font-size: var(--text-sm); color: var(--color-text-secondary); }

/* 主课 Hero */
.hero-course {
  padding: var(--space-lg);
  background: linear-gradient(145deg, #3DB88A 0%, #2A9B74 55%, #1F8A66 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.hero-badge {
  font-size: var(--text-xs);
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-block;
  margin-bottom: var(--space-sm);
}

.hero-course h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--space-xs);
}

.hero-desc {
  font-size: var(--text-sm);
  opacity: 0.85;
  margin-bottom: var(--space-md);
}

.hero-progress {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: var(--text-xs);
  opacity: 0.9;
  margin-bottom: var(--space-sm);
}

.hero-deco {
  position: absolute;
  right: -20px;
  top: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

/* 快捷入口 */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  transition: background 0.15s;
}

.quick-item:active {
  background: var(--color-primary-ghost);
}

.quick-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.quick-icon.speak { background: #E8F5F0; }
.quick-icon.vocab { background: #F0EBFF; }
.quick-icon.listen { background: #E8F4FF; }
.quick-icon.review { background: #FFF0E6; }

/* 课程列表 */
.course-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.course-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: transform 0.15s;
}

.course-row:active {
  transform: scale(0.98);
}

.course-thumb {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.thumb-1 { background: linear-gradient(135deg, #A8E6CF, #3DB88A); }
.thumb-2 { background: linear-gradient(135deg, #B8D4F0, #6BA3D6); }

.course-info {
  flex: 1;
  min-width: 0;
}

.course-info h3 {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: 2px;
}

.course-info p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.course-meta {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: 6px;
}

.tag {
  font-size: var(--text-xs);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.rating {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.chevron {
  color: var(--color-text-tertiary);
  font-size: 20px;
  flex-shrink: 0;
}

/* ---- 课程详情 ---- */
.lesson-hero-banner {
  height: 140px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #4ECDC4, #3DB88A);
  position: relative;
  overflow: hidden;
}

.banner-overlay {
  position: absolute;
  inset: 0;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(transparent 20%, rgba(0,0,0,0.35));
  color: #fff;
}

.level-pill {
  font-size: var(--text-xs);
  background: rgba(255,255,255,0.25);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-sm);
}

.banner-overlay h2 {
  font-size: var(--text-lg);
  font-weight: 700;
}

.banner-overlay p {
  font-size: var(--text-sm);
  opacity: 0.85;
  margin-top: 4px;
}

.row-stats {
  display: flex;
  justify-content: space-around;
  padding: var(--space-lg) 0;
  text-align: center;
}

.row-stats strong {
  display: block;
  font-size: var(--text-xl);
  color: var(--color-primary);
  font-weight: 700;
}

.row-stats span {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.outline-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.outline-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
  cursor: pointer;
}

.outline-item.current {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.outline-item.locked {
  opacity: 0.55;
  cursor: default;
}

.outline-num {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-tertiary);
  width: 28px;
}

.outline-item.current .outline-num {
  color: var(--color-primary);
}

.outline-item h4 {
  font-size: var(--text-base);
  font-weight: 600;
}

.outline-item p {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.status-icon {
  font-size: var(--text-sm);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.status-icon.done {
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
}

.status-icon.play {
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
}

.status-icon.lock {
  background: var(--color-divider);
  font-size: 12px;
}

/* ---- AI 口语 ---- */
.speak-scene {
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.scene-label {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.scene-prompt {
  font-size: var(--text-base);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.scene-prompt strong {
  color: var(--color-text);
  font-size: var(--text-md);
}

.wave-container {
  text-align: center;
  padding: var(--space-xl) 0;
}

.ai-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--color-primary);
  position: relative;
}

.ai-ring {
  position: absolute;
  inset: -6px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-primary);
  opacity: 0.3;
  animation: pulse-ring 2s ease infinite;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.08); opacity: 0.15; }
}

.wave-bars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 48px;
  margin-bottom: var(--space-md);
}

.wave-bars span {
  width: 4px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 2px;
  transition: height 0.1s;
}

.wave-bars.recording span {
  animation: wave 0.6s ease infinite alternate;
}

.wave-bars.recording span:nth-child(1) { animation-delay: 0s; }
.wave-bars.recording span:nth-child(2) { animation-delay: 0.1s; }
.wave-bars.recording span:nth-child(3) { animation-delay: 0.2s; }
.wave-bars.recording span:nth-child(4) { animation-delay: 0.15s; }
.wave-bars.recording span:nth-child(5) { animation-delay: 0.05s; }
.wave-bars.recording span:nth-child(6) { animation-delay: 0.25s; }
.wave-bars.recording span:nth-child(7) { animation-delay: 0.1s; }
.wave-bars.recording span:nth-child(8) { animation-delay: 0.2s; }
.wave-bars.recording span:nth-child(9) { animation-delay: 0.15s; }
.wave-bars.recording span:nth-child(10) { animation-delay: 0.05s; }

@keyframes wave {
  from { height: 8px; }
  to { height: 36px; }
}

.wave-hint {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.score-panel {
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.score-panel--row {
  display: flex;
  gap: var(--space-md);
  align-items: stretch;
}

.score-panel--row .score-item {
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 0;
  gap: 6px;
  text-align: center;
}

.score-panel--row .score-label {
  width: auto;
}

.score-panel--row .score-val {
  width: auto;
}

@media (max-width: 640px) {
  .score-panel--row {
    flex-direction: column;
  }
}

.score-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.score-item:last-child {
  margin-bottom: 0;
}

.score-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  width: 48px;
  flex-shrink: 0;
}

.score-bar {
  flex: 1;
  height: 6px;
  background: var(--color-divider);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-bar div {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #4ECDC4);
  border-radius: var(--radius-full);
}

.score-val {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary);
  width: 28px;
  text-align: right;
}

.speak-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2xl);
  padding-bottom: var(--space-lg);
}

.ctrl-btn {
  width: 48px;
  height: 48px;
  border: none;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
}

.ctrl-btn svg {
  width: 22px;
  height: 22px;
}

.mic-btn {
  width: 72px;
  height: 72px;
  border: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}

.mic-btn svg {
  width: 28px;
  height: 28px;
}

.mic-btn:active,
.mic-btn.recording {
  transform: scale(0.95);
  box-shadow: 0 4px 16px rgba(61, 184, 138, 0.5);
}

.mic-btn.recording {
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
}

/* ---- 单词本 ---- */
.vocab-page-header {
  display: block;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-sm);
  border-bottom: 2px solid var(--color-primary-light);
}

.vocab-page-header h1 {
  margin: 0;
}

.vocab-page-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: var(--text-sm);
  line-height: 1.45;
}

.vocab-loc-module {
  font-weight: 700;
  color: var(--color-primary-dark);
}

.vocab-loc-sep {
  color: var(--color-text-secondary);
  font-weight: 600;
}

.vocab-loc-tab {
  font-weight: 700;
  color: var(--color-primary-dark);
  background: #fff;
  border: 1px solid rgba(61, 184, 138, 0.45);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 1px 0 rgba(61, 184, 138, 0.12);
}

.vocab-loc-desc {
  flex: 1 1 100%;
  margin: 2px 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.vocab-tabs-panel {
  background: linear-gradient(180deg, rgba(61, 184, 138, 0.08) 0%, rgba(61, 184, 138, 0.02) 100%);
  border: 1px solid rgba(61, 184, 138, 0.2);
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-md) var(--space-sm);
  margin-bottom: var(--space-lg);
}

.vocab-tabs-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-sm);
  letter-spacing: 0.02em;
}

.vocab-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: 0;
}

.vocab-tab {
  padding: 8px 16px;
  border: none;
  background: var(--color-surface);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  cursor: pointer;
  border: 1px solid var(--color-divider);
  font-weight: 500;
}

.vocab-tab.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(61, 184, 138, 0.35);
  font-weight: 700;
}

#page-vocab[data-vocab-tab="marked"] .section-label::before {
  content: '☆ ';
}

#page-vocab[data-vocab-tab="speak-learn"] .section-label::before {
  content: '💬 ';
}

.vocab-progress-card {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-sm);
  position: relative;
}

/* 标记句/单词本摘要：数字圈未包在 vocab-ring-wrap 内时勿铺满整页挡点击 */
.vocab-progress-card > .vocab-ring-text {
  position: static;
  inset: auto;
  width: 90px;
  min-width: 90px;
  flex-shrink: 0;
}

.vocab-ring-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.vocab-ring {
  width: 100%;
  height: 100%;
}

.vocab-ring-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.vocab-ring-text strong {
  font-size: var(--text-xl);
  color: var(--color-primary);
  line-height: 1;
}

.vocab-ring-text span {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.vocab-summary p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.vocab-summary strong {
  color: var(--color-text);
}

.vocab-summary .btn-primary {
  margin-top: var(--space-sm);
}

.vocab-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.vocab-card {
  padding: var(--space-lg);
}

.vocab-meta-row {
  margin: 0 0 var(--space-sm);
}

.vocab-last-studied {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.btn-vocab-learn {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.vocab-learn-card .vocab-learn-en {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin: 0 0 4px;
}

.vocab-learn-speak-row,
.vocab-learn-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.vocab-learn-toolbar--spell {
  margin-top: 0;
  margin-bottom: var(--space-sm);
}

.vocab-learn-notes {
  margin: var(--space-lg) 0;
}

.vocab-learn-notes-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: 6px;
}

.vocab-learn-notes-input {
  width: 100%;
  min-height: 96px;
  resize: vertical;
}

.vocab-learn-notes-hint {
  margin: 6px 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.vocab-learn-spell-head {
  margin-bottom: var(--space-md);
}

.vocab-learn-word-head {
  margin-bottom: var(--space-sm);
}

.marked-sentences-summary .vocab-summary p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.marked-sentence-card {
  border-left: 3px solid #f0a050;
}

.marked-sentence-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: var(--space-sm);
}

.marked-sentence-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.marked-sentence-topic {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.marked-sentence-en {
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.45;
  margin: 0 0 6px;
}

.marked-sentence-cn {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0 0 6px;
  line-height: 1.45;
}

.marked-sentence-speaker {
  font-size: var(--text-xs);
  color: var(--color-text-muted, #888);
  margin: 0 0 var(--space-sm);
}

.marked-sentences-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.vocab-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.vocab-summary-actions .btn-sm {
  flex: 1 1 auto;
  min-width: 120px;
}

.marked-recall-pass-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.marked-recall-due-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  color: #4338ca;
  background: #e0e7ff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.marked-recall-area {
  flex: 1;
  padding: var(--space-lg);
  overflow-y: auto;
}

.marked-recall-card {
  padding: var(--space-xl);
  max-width: 520px;
  margin: 0 auto;
}

.marked-recall-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: var(--space-md);
}

.marked-recall-label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xs);
}

.marked-recall-cn {
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--color-text-primary);
  margin: 0 0 var(--space-sm);
}

.marked-recall-alt-hint {
  margin: 0 0 var(--space-md);
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.marked-recall-alt-ok {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.5;
  color: #15803d;
}

.marked-recall-alt-miss {
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.5;
  color: #b45309;
}

.marked-recall-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 var(--space-sm);
  padding: 0;
  border-top: none;
}

.marked-recall-card-actions .btn-flash {
  flex: 1 1 calc(33% - 6px);
  min-width: 0;
  padding: 10px 6px;
  font-size: 13px;
  line-height: 1.25;
}

.marked-recall-card-actions.hidden {
  display: none;
}

#vocabCnRecallTypeSection.hidden {
  display: none;
}

.marked-recall-hint {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-md);
}

.marked-recall-speak-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-md);
}

.marked-recall-result {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-divider);
}

.marked-recall-spoken {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-sm);
}

.marked-recall-scores {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.marked-recall-verdict {
  margin: 0;
  font-weight: 700;
}

.marked-recall-verdict.ok {
  color: var(--color-primary-dark);
}

.marked-recall-verdict.err {
  color: #c45a2a;
}

.marked-recall-answer {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--color-bg-soft);
  border-radius: var(--radius-md);
}

.marked-recall-answer-label {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.marked-recall-en {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-base);
  line-height: 1.5;
}

.marked-recall-type-label {
  display: block;
  font-size: var(--text-sm);
  margin: var(--space-md) 0 var(--space-xs);
}

.marked-recall-type {
  width: 100%;
  margin-bottom: var(--space-sm);
}

.marked-recall-done {
  text-align: center;
  padding: var(--space-xl);
  max-width: 400px;
  margin: var(--space-xl) auto;
}

.vocab-word {
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
  margin-bottom: 4px;
}

.vocab-word h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary-dark);
}

.phonetic {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.vocab-meaning {
  font-size: var(--text-base);
  margin-bottom: var(--space-sm);
}

.vocab-example {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-style: italic;
  margin-bottom: var(--space-md);
  padding-left: var(--space-md);
  border-left: 2px solid var(--color-primary-light);
}

.vocab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.vocab-actions .btn-ghost-sm {
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.vocab-actions .btn-ghost-sm:hover {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.15);
}

.vocab-actions .btn-vocab-learn:hover {
  background: var(--color-primary);
  color: #fff;
}

.vocab-actions .btn-vocab-delete:hover {
  background: #fee2e2;
  color: #b91c1c;
  box-shadow: 0 0 0 1px rgba(185, 28, 28, 0.12);
}

.vocab-edit-card {
  max-width: 480px;
  width: 100%;
  text-align: left;
}

.vocab-edit-card h2 {
  text-align: center;
  margin-bottom: var(--space-md);
}

.vocab-edit-card label {
  display: block;
  margin-top: var(--space-sm);
  margin-bottom: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.vocab-edit-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.context-ai-card {
  max-width: min(96vw, 980px);
  width: 720px;
  height: 540px;
  min-width: 420px;
  min-height: 320px;
  max-height: 92vh;
  text-align: left;
  display: flex;
  flex-direction: column;
  resize: both;
  overflow: hidden;
  position: relative;
}

.context-ai-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.context-ai-size-tools {
  display: flex;
  gap: 4px;
  align-items: center;
  grid-area: tools;
}

.context-ai-size-btn {
  border: none;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.context-ai-size-btn.active {
  background: var(--color-primary);
  color: #fff;
}

.context-ai-resize-hint {
  position: absolute;
  right: 10px;
  bottom: 6px;
  font-size: 10px;
  color: #9ca3af;
  pointer-events: none;
}

.context-ai-head {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  grid-template-areas:
    "title tools badge close"
    "subtitle subtitle subtitle subtitle";
  gap: 6px 8px;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.context-ai-head-text {
  display: contents;
}

.context-ai-title {
  grid-area: title;
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

.context-ai-subtitle {
  grid-area: subtitle;
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.5;
  word-break: break-word;
  white-space: normal;
}

.context-ai-subtitle.hidden {
  display: none;
}

.context-ai-head > .sentence-ai-badge {
  grid-area: badge;
}

.context-ai-head > [data-action="close-context-ai"] {
  grid-area: close;
}

.context-ai-messages {
  flex: 1;
  min-height: 160px;
  max-height: none;
  overflow-y: auto;
}

#page-speak .speak-zone--settings .speak-compose--settings,
#page-speak .speak-zone--dialog .speak-compose {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: transparent;
  box-shadow: none;
}

.speak-compose-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}

.speak-compose-attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #f0faf5;
  color: #166534;
  border: 1px solid rgba(61, 184, 138, 0.35);
}

.speak-compose-attach-chip button {
  border: none;
  background: transparent;
  cursor: pointer;
  color: #9ca3af;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}

.speak-compose-attach-btn {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 10px;
  border: none;
  border-radius: 12px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

.speak-msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.speak-msg-action {
  border: none;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #4b5563;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.speak-msg-action--danger {
  color: #b91c1c;
  box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.18);
}

.speak-msg-action--danger:hover {
  background: #fef2f2;
}

.speak-msg-attach-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.speak-msg-attach-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #6b7280;
}

.btn-vocab-delete {
  color: #c0392b;
  border-color: rgba(192, 57, 43, 0.35);
}

.btn-vocab-delete:hover {
  background: #fff5f5;
}

/* ---- 我的 ---- */
.profile-header {
  padding: var(--space-sm) 0 var(--space-lg);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-md);
}

.profile-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  font-weight: 700;
}

.profile-top h2 {
  font-size: var(--text-xl);
  font-weight: 700;
}

.profile-top p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.profile-badges {
  display: flex;
  gap: var(--space-sm);
}

.badge-item {
  font-size: var(--text-xs);
  background: var(--color-surface);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-divider);
  font-weight: 500;
}

.profile-stats {
  display: flex;
  justify-content: space-around;
  padding: var(--space-lg);
  text-align: center;
  margin-bottom: var(--space-sm);
}

.profile-stats strong {
  display: block;
  font-size: var(--text-xl);
  color: var(--color-primary);
  font-weight: 700;
}

.profile-stats span {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.chart-card {
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100px;
  gap: 6px;
  margin-bottom: var(--space-md);
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
}

.bar-col .bar {
  width: 100%;
  max-width: 28px;
  background: var(--color-primary-light);
  border-radius: 4px 4px 0 0;
  min-height: 8px;
  transition: background 0.2s;
}

.bar-col .bar.active {
  background: linear-gradient(180deg, var(--color-primary), var(--color-primary-dark));
}

.bar-col span {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.chart-note {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  border: none;
  cursor: pointer;
  font-size: var(--text-base);
  text-align: left;
  width: 100%;
  color: var(--color-text);
}

.menu-icon {
  font-size: 20px;
}

.menu-item span:nth-child(2) {
  flex: 1;
}

/* ---- 发现 ---- */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-full);
  padding: 12px 16px;
  margin-bottom: var(--space-lg);
  border: 1px solid var(--color-divider);
}

.search-bar svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-tertiary);
  flex-shrink: 0;
}

.search-bar input {
  border: none;
  background: none;
  font-size: var(--text-base);
  color: var(--color-text);
  flex: 1;
  outline: none;
}

.search-bar input::placeholder {
  color: var(--color-text-tertiary);
}

.discover-tags {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.disc-tag {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  color: var(--color-text-secondary);
  cursor: pointer;
}

.disc-tag.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.discover-banner {
  padding: var(--space-lg);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  margin-bottom: var(--space-sm);
}

.discover-banner h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 4px;
}

.discover-banner p {
  font-size: var(--text-sm);
  opacity: 0.85;
  margin-bottom: var(--space-md);
}

.topic-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.topic-card {
  height: 80px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: flex-end;
  padding: var(--space-md);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 600;
}

.topic-1 { background: linear-gradient(135deg, #3DB88A, #2A9B74); }
.topic-2 { background: linear-gradient(135deg, #4ECDC4, #44A08D); }
.topic-3 { background: linear-gradient(135deg, #667eea, #764ba2); }
.topic-4 { background: linear-gradient(135deg, #FF8C42, #FF6B35); }

/* ---- 底部导航 ---- */
.bottom-nav {
  height: var(--nav-height);
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  display: flex;
  align-items: center;
  padding-bottom: var(--safe-bottom);
  position: relative;
  z-index: 20;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-tertiary);
  padding: 6px 0;
  transition: color 0.2s;
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item span {
  font-size: 10px;
  font-weight: 500;
}

.nav-item.active {
  color: var(--color-primary);
}

/* ---- 学习练习 ---- */
.study-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) 0 var(--space-md);
}

.study-progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.study-progress-bar {
  flex: 1;
  height: 8px;
  background: var(--color-divider);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.study-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #4ECDC4);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  width: 0;
}

.study-content {
  flex: 1;
  min-height: 0;
}

.study-footer {
  padding-top: var(--space-md);
}

.exercise-card {
  padding: var(--space-xl);
  margin-bottom: var(--space-md);
}

.exercise-type {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 600;
  display: block;
  margin-bottom: var(--space-md);
}

.exercise-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.exercise-head .exercise-type {
  margin-bottom: 0;
}

.quiz-source-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  flex-shrink: 0;
}

.quiz-source-tag--local {
  background: #f0f2f5;
  color: var(--color-text-secondary);
}

.quiz-type-hint {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-sm);
}

.quiz-file-hint {
  font-size: 11px;
  line-height: 1.4;
  color: #8a5a00;
  background: #fff8e6;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  margin: 0 0 var(--space-sm);
}

.quiz-reveal-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: var(--space-sm) 0;
}

.quiz-reveal-panel {
  margin: var(--space-xs) 0 var(--space-sm);
  padding: 10px 12px;
  background: var(--color-primary-light, #eef8f3);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.quiz-reveal-panel.hidden {
  display: none;
}

.quiz-reveal-line {
  margin: 0 0 6px;
}

.quiz-reveal-line:last-child {
  margin-bottom: 0;
}

.quiz-dialogue-scene {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: var(--color-primary-light);
  border-radius: var(--radius-sm);
}

.quiz-loading {
  padding: var(--space-xl);
  text-align: center;
}

.quiz-loading-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto var(--space-md);
  border: 3px solid var(--color-primary-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: quiz-spin 0.8s linear infinite;
}

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

.quiz-loading-title {
  font-weight: 700;
  margin: 0 0 var(--space-xs);
}

.quiz-loading-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

.learn-en {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

.learn-cn {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.learn-tip {
  font-size: var(--text-sm);
  background: var(--color-primary-light);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  color: var(--color-primary-dark);
  margin-bottom: var(--space-md);
}

.exercise-q {
  font-size: var(--text-md);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

.fill-hint {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.fill-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--color-divider);
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  outline: none;
  transition: border-color 0.2s;
}

.fill-input:focus {
  border-color: var(--color-primary);
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.choice-btn {
  padding: 14px 16px;
  border: 2px solid var(--color-divider);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: var(--text-base);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.choice-btn.selected {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.choice-btn.correct {
  border-color: var(--color-success);
  background: var(--color-primary-light);
}

.choice-btn.acceptable {
  border-color: #5B9BD5;
  background: #EFF6FF;
}

.choice-btn.wrong {
  border-color: var(--color-error);
  background: #FFF0F0;
}

.choice-btn:disabled {
  cursor: default;
}

.feedback {
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-md);
  border-radius: var(--radius-md);
}

.feedback.ok {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.feedback.err {
  background: #FFF0F0;
  color: var(--color-error);
}

.speak-hint {
  font-size: var(--text-sm);
  color: var(--color-primary-dark);
  margin-top: var(--space-sm);
  font-style: italic;
}

.study-speak-area {
  text-align: center;
  margin-top: var(--space-lg);
}

.mic-sm {
  width: 56px;
  height: 56px;
  font-size: 24px;
  border: none;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
}

.wave-result {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-top: var(--space-md);
}

.wave-result.hidden {
  display: none;
}

/* ---- 闪卡复习 ---- */
.flashcard-area {
  padding: var(--space-lg) 0;
  min-height: 280px;
}

.flashcard {
  min-height: 240px;
  padding: var(--space-2xl);
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.flashcard h2 {
  font-size: 32px;
  color: var(--color-primary-dark);
  margin-bottom: var(--space-sm);
}

.flash-tap {
  font-size: var(--text-sm);
  color: var(--color-text-tertiary);
  margin-top: var(--space-xl);
}

.flash-back {
  display: none;
}

.flashcard.flipped .flash-front {
  display: none;
}

.flashcard.flipped .flash-back {
  display: block;
}

.flashcard-actions {
  display: flex;
  gap: var(--space-md);
  padding-bottom: var(--space-lg);
}

.flashcard-actions.hidden {
  display: none;
}

.btn-flash {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-weight: 600;
  cursor: pointer;
}

.btn-flash.wrong {
  background: #FFF0F0;
  color: var(--color-error);
}

.btn-flash.right {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.btn-flash.mark {
  background: #fff7ed;
  color: #c2410c;
  box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.28);
}

.flashcard-actions,
.marked-recall-actions,
#vocabCnRecallActions,
#markedRecallActions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

#vocabCnRecallActions .btn-flash,
#markedRecallActions .btn-flash {
  flex: 1 1 30%;
  min-width: 100px;
}

/* ---- Toast ---- */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 43, 60, 0.92);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-align: center;
  z-index: 1100;
  max-width: 400px;
  animation: toast-in 0.25s ease;
}

.toast.hidden {
  display: none;
}

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

.empty-hint {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  padding: var(--space-2xl);
}

.banner-thumb-1,
.lesson-hero-banner.banner-thumb-1 { background: linear-gradient(135deg, #4ECDC4, #3DB88A); }
.banner-thumb-2,
.lesson-hero-banner.banner-thumb-2 { background: linear-gradient(135deg, #B8D4F0, #6BA3D6); }

/* ---- 剧情 & Day 进度条 ---- */
.story-banner {
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  background: linear-gradient(135deg, #E8F5F0 0%, #fff 100%);
  border: 1px solid rgba(61, 184, 138, 0.2);
}

.story-banner h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 4px;
}

.story-banner p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.story-banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
}

.story-progress-text {
  font-size: var(--text-xs);
  color: var(--color-primary-dark);
  margin-top: 8px;
  font-weight: 600;
}

.story-avatars {
  display: flex;
  gap: 6px;
}

.story-avatars span {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-sm);
}

.section-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
  margin-top: var(--space-lg);
}

.section-label-row .section-label {
  margin: 0;
}

.section-extra {
  font-size: var(--text-xs);
  color: var(--color-primary);
  font-weight: 600;
}

.day-flow-section-main {
  margin-top: var(--space-md);
  width: 100%;
  --cp-btn-h: 2.2rem;
}

.day-path-wrap {
  position: relative;
  width: 100%;
}

.day-path-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  margin: 0;
  padding: 10px 12px;
  pointer-events: none;
}

.day-path-overlay .section-label,
.day-path-overlay .section-extra {
  pointer-events: none;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 4px rgba(62, 52, 38, 0.08);
}

.day-path-overlay .section-label {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  font-weight: 600;
}

.day-flow-section-main #coursePathRoot {
  margin-top: 0;
  width: 100%;
}

.day-rail-wrap {
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.day-rail {
  display: flex;
  gap: var(--space-md);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.day-rail::-webkit-scrollbar {
  display: none;
}

.day-card {
  flex: 0 0 148px;
  scroll-snap-align: start;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  border: 2px solid var(--color-divider);
  position: relative;
  min-height: 140px;
}

.day-card.current {
  border-color: var(--color-primary);
  background: linear-gradient(180deg, #fff 0%, var(--color-primary-light) 100%);
  box-shadow: var(--shadow-md);
}

.day-card.completed {
  border-color: rgba(61, 184, 138, 0.35);
}

.day-card.locked {
  background: #F0F3F6;
  opacity: 0.85;
}

.day-num {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
}

.day-topic {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 6px 0 4px;
  line-height: 1.3;
}

.day-scene {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.day-lock-hint {
  font-size: 10px;
  color: var(--color-text-tertiary);
  margin-top: 8px;
}

.day-card-lock {
  font-size: 24px;
  margin-bottom: 4px;
}

.day-done-badge {
  display: inline-block;
  font-size: 10px;
  background: var(--color-primary);
  color: #fff;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 8px;
}

.day-start-btn {
  margin-top: 10px;
  width: 100%;
}

.day-card.clickable,
.day-card.current {
  cursor: pointer;
}

/* ---- Day 学习四步流程 ---- */
.page-day-study.active {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}

.day-study-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-sm);
  padding-bottom: var(--space-sm);
}

.back-btn--header {
  margin-left: auto;
}

.day-study-titles {
  flex: 1;
  min-width: 0;
}

.day-study-titles span:first-child {
  display: block;
  font-size: var(--text-md);
  font-weight: 700;
}

.day-study-titles span:last-child {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.dual-progress {
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-divider);
}

.dual-progress-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.dual-progress-row:last-child {
  margin-bottom: 0;
}

.mini-bar {
  flex: 1;
  height: 6px;
  background: var(--color-divider);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s;
  width: 0;
}

.day-study-step-panel {
  background: linear-gradient(180deg, rgba(61, 184, 138, 0.1) 0%, rgba(61, 184, 138, 0.02) 100%);
  border: 1px solid rgba(61, 184, 138, 0.22);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.day-study-step-context {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 var(--space-sm);
  font-size: var(--text-sm);
  line-height: 1.45;
}

.day-study-step-row {
  display: flex;
  gap: var(--space-md);
  align-items: stretch;
}

.day-study-split {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  flex: 1;
  min-height: 0;
}

.day-study-split-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.step-tabs-col {
  flex: 0 0 36%;
  min-width: 132px;
  max-width: 220px;
}

.day-step-loc-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary-dark);
}

.day-step-loc-current {
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  border: 1px solid var(--color-primary-dark);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(61, 184, 138, 0.35);
}

.day-step-loc-progress {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: 600;
}

.step-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 0;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.step-tabs::-webkit-scrollbar {
  display: none;
}

.step-tab--phrases {
  font-weight: 700;
  flex: 0 0 auto;
  min-width: 72px;
}

.step-tab.hidden {
  display: none;
}

.step-tab {
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  padding: 10px 8px;
  white-space: nowrap;
  border: none;
  background: #fff;
  border-radius: var(--radius-md);
  font-size: 11px;
  color: var(--color-text-secondary);
  border: 1px solid var(--color-divider);
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s, transform 0.12s;
}

.step-tab.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary-dark);
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(61, 184, 138, 0.45);
  transform: translateY(-1px);
}

.step-tab.done:not(.active) {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border-color: var(--color-primary-ghost);
  font-weight: 600;
}

.step-tab.done:not(.active)::after {
  content: ' ✓';
  font-size: 10px;
}

.step-tab[data-step-state="pending"]:not(.active) {
  background: #fff;
  color: var(--color-text-secondary);
}

@media (max-width: 720px) {
  .step-tab {
    flex: 0 0 auto;
    min-width: 64px;
    font-size: 10px;
    padding: 8px 6px;
  }

  .day-phrase-panel {
    max-height: none;
  }
}

.step-tab:hover:not(.active) {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.word-lookup-dock {
  flex-shrink: 0;
  width: 100%;
  max-width: var(--main-max-width);
  margin: var(--space-sm) 0 0;
  padding-top: var(--space-sm);
  border-top: 1px solid var(--color-divider);
  background: var(--color-bg);
  max-height: min(40vh, 300px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 40;
}

.word-lookup-dock--collapsed {
  max-height: none;
  overflow: hidden;
}

.word-lookup-dock.hidden {
  display: none;
}

.word-lookup-inner {
  padding: 0;
}

.word-lookup-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.word-lookup-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.word-lookup-toggle:hover .word-lookup-title {
  color: var(--color-primary-dark);
}

.word-lookup-chevron {
  margin-left: auto;
  font-size: 10px;
  color: var(--color-text-secondary);
  flex-shrink: 0;
}

.word-lookup-action {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary-ghost);
  cursor: pointer;
}

.word-lookup-action:hover {
  background: var(--color-primary-ghost);
}

.word-lookup-preview {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary-dark);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-lookup-body {
  padding: var(--space-sm) 0 0;
}

.word-lookup-body.hidden {
  display: none;
}

.word-lookup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.word-lookup-title {
  font-weight: 600;
  font-size: var(--text-sm);
}

.word-lookup-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.word-lookup-tag.tag-ok {
  background: rgba(76, 175, 80, 0.15);
  color: #2e7d32;
}

.word-lookup-tag.tag-muted {
  background: var(--color-bg-soft);
  color: var(--color-text-muted);
}

.word-lookup-form {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.word-lookup-form .fill-input {
  flex: 1;
  min-width: 0;
}

.lookup-result {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-divider);
}

.lookup-result-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.lookup-result-head strong {
  font-size: var(--text-lg);
}

.lookup-pos {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  background: var(--color-bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
}

.lookup-source {
  font-size: 11px;
  color: var(--color-text-muted);
  margin: var(--space-xs) 0 var(--space-sm);
}

.lookup-session-hint {
  margin: var(--space-sm) 0 0;
  font-size: var(--text-xs);
  color: var(--color-primary-dark);
}

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

/* 划词浮层释义 */
.selection-lookup-tip {
  position: fixed;
  z-index: 6000;
  max-width: min(320px, calc(100vw - 24px));
  pointer-events: auto;
  filter: drop-shadow(0 8px 24px rgba(15, 23, 42, 0.18));
}

.selection-lookup-tip.hidden {
  display: none;
}

.selection-lookup-tip-inner {
  padding: 10px 12px 8px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid rgba(99, 102, 241, 0.35);
}

.selection-lookup-tip-word {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary, #6366f1);
}

.selection-lookup-tip-meaning {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--color-text, #1f2937);
}

.selection-lookup-tip-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selection-lookup-tip-add {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  border: 1px solid var(--color-primary, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  color: var(--color-primary-dark, #4f46e5);
  cursor: pointer;
}

.selection-lookup-tip-add:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.15);
}

.selection-lookup-tip-add:disabled {
  opacity: 0.5;
  cursor: default;
}

.selection-lookup-tip-speak {
  padding: 4px 8px;
  font-size: 14px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
}

.selection-lookup-tip-speak:hover {
  background: rgba(0, 0, 0, 0.06);
}

.selection-lookup-tip-arrow {
  position: absolute;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid rgba(99, 102, 241, 0.35);
  border-bottom: 1px solid rgba(99, 102, 241, 0.35);
  transform: rotate(45deg);
  margin-left: -6px;
}

.selection-lookup-tip--below .selection-lookup-tip-arrow {
  bottom: auto;
  top: -6px;
  transform: rotate(225deg);
}

.vocab-relations {
  margin: var(--space-xs) 0 var(--space-sm);
}

.vocab-relations-row {
  margin: 4px 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--color-text-secondary);
}

.vocab-relations-label {
  display: inline-block;
  min-width: 2.2em;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-muted);
  margin-right: 4px;
}

.vocab-rel-chip {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 1px 8px;
  font-size: var(--text-xs);
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  border-radius: var(--radius-full);
}

.vocab-rel-chip--ant {
  color: #9a4d2e;
  background: rgba(240, 160, 80, 0.18);
}

.vocab-relations-note {
  margin: 6px 0 0;
  padding: 6px 10px;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--color-text-secondary);
  background: var(--color-bg-soft);
  border-radius: var(--radius-sm);
}

.flash-back .vocab-relations {
  margin: var(--space-sm) 0;
  text-align: left;
}

.day-study-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.day-study-footer {
  padding-top: var(--space-md);
  flex-shrink: 0;
}

.day-study-footer:empty {
  display: none;
  padding: 0;
  margin: 0;
}

.footer-row {
  display: flex;
  gap: var(--space-md);
}

.btn-ghost-block {
  flex: 1;
  padding: 14px;
  border: 2px solid var(--color-divider);
  background: var(--color-surface);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  cursor: pointer;
}

.btn-ghost-block:disabled {
  opacity: 0.4;
}

/* 场景插画 */
.scene-stage {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: var(--space-md);
}

.scene-illus {
  height: 140px;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-md);
}

.scene-office { background: linear-gradient(180deg, #B8E0D2 0%, #7EC8A8 100%); }
.scene-meeting { background: linear-gradient(180deg, #C5D8F0 0%, #8EB4E0 100%); }
.scene-cafe { background: linear-gradient(180deg, #FFE8CC 0%, #FFCC99 100%); }
.scene-desk { background: linear-gradient(180deg, #E8ECF0 0%, #C5D0DB 100%); }
.scene-coffee { background: linear-gradient(180deg, #D4C4B0 0%, #A89078 100%); }

.thumb-office { background: linear-gradient(135deg, #A8E6CF, #3DB88A); }
.thumb-meeting { background: linear-gradient(135deg, #B8D4F0, #6BA3D6); }
.thumb-cafe { background: linear-gradient(135deg, #FFE0B2, #FFAB40); }
.thumb-desk { background: linear-gradient(135deg, #E8ECF0, #A0AEC0); }
.thumb-coffee { background: linear-gradient(135deg, #D7CCC8, #8D6E63); }

.scene-char {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  animation: char-float 3s ease-in-out infinite;
}

.scene-char-left { position: absolute; left: 24px; bottom: 28px; }
.scene-char-right { position: absolute; right: 24px; bottom: 36px; animation-delay: 0.5s; }

@keyframes char-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.scene-label-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255,255,255,0.9);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
}

.scene-plot {
  padding: var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  line-height: 1.5;
}

/* 字幕面板 */
.subtitle-panel {
  max-height: 200px;
  overflow-y: auto;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.subtitle-line {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.subtitle-line.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}

.subtitle-head {
  margin-bottom: 6px;
}

.char-avatar {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin-right: 6px;
}

.char-name {
  font-size: var(--text-xs);
  font-weight: 600;
}

.subtitle-en {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 4px;
}

.subtitle-cn {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.listen-controls {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.ctrl-chip {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--color-divider);
  background: var(--color-surface);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  cursor: pointer;
}

.ctrl-chip.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  font-weight: 600;
}

/* 跟读 */
.roleplay-card {
  padding: var(--space-lg);
}

.roleplay-progress {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.roleplay-row {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.roleplay-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  color: #fff;
  font-weight: 700;
  font-size: var(--text-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.roleplay-en {
  font-size: var(--text-md);
  font-weight: 600;
  line-height: 1.5;
  margin: 6px 0;
  user-select: text;
  cursor: text;
}

.roleplay-cn {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.roleplay-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  margin-bottom: var(--space-md);
}

.roleplay-result {
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
}

.roleplay-result.ok { color: var(--color-primary-dark); }
.roleplay-result.err { color: var(--color-error); }

.roleplay-jump {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--space-md);
}

.jump-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--color-divider);
  cursor: pointer;
  padding: 0;
}

.jump-dot.current { background: var(--color-primary); transform: scale(1.2); }
.jump-dot.done { background: var(--color-primary-light); border: 2px solid var(--color-primary); }

/* 知识点 */
.step-desc {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.knowledge-card {
  padding: var(--space-lg);
}

.knowledge-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.knowledge-head h3 {
  color: var(--color-primary-dark);
  font-size: var(--text-lg);
}

.knowledge-pattern {
  font-size: var(--text-sm);
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
  margin-top: var(--space-md);
}

.day-phrase-panel {
  padding: var(--space-md);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.day-phrase-panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.day-phrase-panel-head strong {
  color: var(--color-primary-dark);
  font-size: var(--text-md);
}

.day-phrase-count {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

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

.day-phrase-item {
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: #fff;
}

.day-phrase-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}

.day-phrase-item summary::-webkit-details-marker {
  display: none;
}

.day-phrase-term {
  font-weight: 700;
  color: var(--color-primary-dark);
}

.day-phrase-meaning {
  color: var(--color-text);
  font-size: var(--text-sm);
}

.day-phrase-example {
  margin: 8px 0 6px;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.day-phrase-speak {
  margin-top: 4px;
}

.quiz-result-card {
  text-align: center;
  padding: var(--space-2xl);
}

.quiz-result-score {
  font-size: 48px;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: var(--space-md);
}

.quiz-result-msg {
  margin-top: var(--space-md);
  color: var(--color-text-secondary);
}

/* Day 完成弹窗 */
.day-complete-modal {
  position: absolute;
  inset: 0;
  background: rgba(26, 43, 60, 0.55);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.day-complete-modal.hidden {
  display: none;
}

.day-complete-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  text-align: center;
  width: 100%;
  max-width: 300px;
  animation: pop-in 0.35s ease;
}

/* 覆盖 .day-complete-card 的 300px 上限，避免 AI 对话框被压成竖条 */
.day-complete-card.context-ai-card {
  width: 720px;
  max-width: min(96vw, 980px);
  min-width: 420px;
  text-align: left;
}

@keyframes pop-in {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.day-complete-badge {
  font-size: 48px;
  margin-bottom: var(--space-md);
  animation: bounce 0.6s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.day-complete-card h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-sm);
}

.day-complete-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xl);
}

.locked-row {
  opacity: 0.65;
}

#page-day-study.active,
#page-vocab-review.active,
#page-marked-recall.active,
#page-vocab-cn-recall.active,
#page-study.active {
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.ai-hosted-mode .ai-hosted-hide {
  display: none !important;
}

.settings-hosted-hint {
  display: none !important;
}

/* 面向用户的说明/提示文案统一隐藏 */
.auth-gate-hint,
.membership-hint,
.membership-meta,
.account-meta,
.speak-paste-hint,
.speak-restart-hint,
.page-header-desc,
.tools-session-hint,
.quiz-file-hint,
.quiz-type-hint,
.lookup-session-hint,
.fill-hint,
.empty-hint,
.settings-collapse-desc,
.chart-note,
.analytics-meta,
.admin-page-sub,
.level-test-listen-hint,
.level-test-self-card .step-desc,
.level-test-setup-card .step-desc,
.level-test-loading .step-desc,
.level-test-result-card .step-desc,
.speak-role-setup-desc,
.hard-listen-header .step-desc,
.speak-learn-header .step-desc,
.listening-lab-empty,
.mic-modal-body > p {
  display: none !important;
}

.membership-plan-item {
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.membership-plan-title {
  margin: 0 0 var(--space-sm);
  font-size: 0.95rem;
}

.membership-pay-row {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.membership-pay-btn--wechat {
  background: #07c160;
  border-color: #07c160;
}

.membership-pay-btn--alipay {
  background: #1677ff;
  border-color: #1677ff;
}

.admin-card {
  padding: var(--space-md);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin: var(--space-md) 0;
}

.admin-block {
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.admin-order-row,
.admin-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-subtle, rgba(0, 0, 0, 0.06));
  font-size: 0.88rem;
}

.admin-orders-list,
.admin-users-list {
  max-height: 220px;
  overflow: auto;
}

/* ---- 第三轮：水平测试 / 弱项分析 / 生活场景 / 跟读升级 ---- */
.home-quick-panel {
  margin-bottom: var(--space-lg);
  overflow: hidden;
}

.home-quick-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 16px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}

.home-quick-panel-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-primary);
  flex-shrink: 0;
}

.home-quick-panel-meta {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-quick-panel-arrow {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.home-quick-panel-body {
  padding: 0 16px 14px;
}

.home-top-bar--nested {
  margin-bottom: var(--space-md);
}

.home-quick-panel-body .home-quick-entry-btns {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.home-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
}

.home-top-left,
.home-top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.home-sidebar-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.home-sidebar-panel.hidden {
  display: none;
}

.home-top-bar--sidebar {
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 0;
  gap: 10px;
}

.home-top-bar--sidebar .home-top-left,
.home-top-bar--sidebar .home-top-actions {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.btn-block-sm {
  width: 100%;
  justify-content: center;
}

.home-quick-entry--sidebar {
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 0;
  padding: var(--space-md);
  gap: 10px;
}

.home-quick-entry--sidebar .home-quick-entry-btns {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex: none;
  width: 100%;
}

.home-quick-entry--sidebar .home-quick-entry-title {
  white-space: normal;
}

.home-tools-mobile {
  display: none;
}

@media (max-width: 1100px) {
  .home-tools-mobile {
    display: block;
    margin-bottom: var(--space-md);
  }

  .home-tools-mobile .home-top-bar {
    margin-bottom: var(--space-sm);
  }

  .home-tools-mobile .home-quick-entry {
    margin-bottom: var(--space-md);
  }
}

/* 首页 · 单行快速入口 */
.home-quick-strip {
  padding: 10px 12px;
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-primary-light) 120%);
  border: 1px solid var(--color-divider);
  overflow: hidden;
}

.home-quick-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.home-quick-scroll::-webkit-scrollbar {
  height: 4px;
}

.level-badge--inline {
  flex-shrink: 0;
}

.quick-sep {
  width: 1px;
  height: 22px;
  background: var(--color-divider);
  flex-shrink: 0;
  margin: 0 2px;
}

.quick-pill {
  flex-shrink: 0;
  border: none;
  border-radius: var(--radius-full);
  padding: 7px 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  white-space: nowrap;
}

.quick-pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.quick-pill--sky {
  background: #E0F2FE;
  color: #0369A1;
}

.quick-pill--mint {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.quick-pill--amber {
  background: #FEF3C7;
  color: #B45309;
}

.quick-pill--violet {
  background: #EDE9FE;
  color: #6D28D9;
}

.quick-pill--slate {
  background: #E2E8F0;
  color: #334155;
}

.quick-pill--muted {
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-divider);
}

.quick-pill--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border: 1px dashed var(--color-divider);
}

.home-quick-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
}

.home-quick-entry-title {
  font-size: var(--text-sm);
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}

.home-quick-entry-btns {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  flex: 1;
  justify-content: flex-end;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: var(--text-sm);
  font-weight: 700;
}

.recommend-section {
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
}

.recommend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.recommend-chip {
  border: 1px solid var(--color-primary);
  background: var(--color-primary-ghost);
  color: var(--color-primary-dark);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
}

.recommend-chip:hover {
  background: var(--color-primary-light);
}

.live-wave span {
  background: var(--color-primary);
  transition: height 0.08s ease;
}

.live-wave.recording span {
  animation: none;
}

.word-feedback {
  margin-top: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.word-fb-item {
  font-size: var(--text-sm);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.word-fb-item.ok { color: var(--color-primary-dark); }
.word-fb-item.err { color: var(--color-error); background: #FFF5F5; }

.roleplay-recog-live {
  font-size: var(--text-xs);
  color: var(--color-primary-dark);
  margin: var(--space-xs) 0 0;
  padding: 6px 10px;
  background: #f0faf5;
  border-radius: var(--radius-sm);
}

.sentence-ai-panel {
  margin-top: var(--space-sm);
  padding: var(--space-md);
  background: linear-gradient(135deg, #f8fbff 0%, #f0faf5 100%);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  line-height: 1.55;
}

.sentence-ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-sm);
}

.sentence-ai-title {
  font-weight: 700;
  color: var(--color-text);
}

.sentence-ai-badge {
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
}

.sentence-ai-messages {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px;
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-divider);
  margin-bottom: var(--space-sm);
}

.sentence-ai-welcome {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
}

.sentence-ai-msg {
  margin-bottom: 10px;
}

.sentence-ai-msg:last-child {
  margin-bottom: 0;
}

.sentence-ai-msg-role {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 4px;
}

.sentence-ai-msg--user .sentence-ai-msg-role {
  color: var(--color-primary-dark);
}

.sentence-ai-msg-body {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
}

.sentence-ai-msg--user .sentence-ai-msg-body {
  background: #e8f5ef;
}

.sentence-ai-msg--assistant .sentence-ai-msg-body {
  background: #f5f8fb;
}

.sentence-ai-msg--pending .sentence-ai-msg-body {
  color: var(--color-text-secondary);
  font-style: italic;
}

.sentence-ai-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: var(--space-sm);
}

.sentence-ai-chip {
  font-size: var(--text-xs);
  padding: 4px 10px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full);
  background: #fff;
  color: var(--color-text-secondary);
  cursor: pointer;
}

.sentence-ai-chip:hover {
  border-color: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.sentence-ai-form {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sentence-ai-input {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.btn-sentence-ai.active {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.word-feedback-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary-dark);
}

.word-feedback-spoken {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin: 4px 0 0;
}

.word-feedback-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.word-chip--ok {
  background: #e8f5ef;
  color: var(--color-primary-dark);
}

.word-chip--err {
  background: #fff0f0;
  color: var(--color-error);
}

.word-chips-hint {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: var(--space-sm);
}

.word-chip {
  display: inline-block;
  padding: 2px 8px;
  margin: 2px;
  border-radius: var(--radius-full);
  background: var(--color-divider);
  font-weight: 600;
}

.ai-feedback-card {
  margin-top: var(--space-lg);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #F0FAF6, #E8F5F0);
  border: 1px solid rgba(61, 184, 138, 0.25);
}

.ai-feedback-card h4 {
  margin-bottom: var(--space-sm);
  font-size: var(--text-md);
}

.ai-feedback-card p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: 6px;
  line-height: 1.5;
}

.analytics-panel {
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.analytics-meta {
  font-size: var(--text-xs);
  color: var(--color-text-tertiary);
  margin-bottom: var(--space-md);
}

.weakness-list {
  margin: var(--space-sm) 0 var(--space-lg);
  padding-left: var(--space-lg);
}

.weakness-list li {
  margin-bottom: 6px;
  font-size: var(--text-sm);
}

.practice-history {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.practice-item {
  padding: var(--space-md);
  font-size: var(--text-sm);
}

.settings-api {
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.settings-api label {
  font-size: var(--text-sm);
  font-weight: 600;
}

/* AI 分析页 · 可折叠 Key 设置 */
.settings-collapse {
  margin-bottom: var(--space-md);
  overflow: hidden;
}

.settings-collapse-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.settings-collapse-title {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-primary, #1e293b);
}

.settings-collapse-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
}

.settings-collapse-badge--ok {
  background: #d1fae5;
  color: #047857;
}

.settings-collapse-arrow {
  font-size: 12px;
  color: #94a3b8;
  flex-shrink: 0;
}

.settings-collapse-body {
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.settings-collapse-body.hidden {
  display: none;
}

.settings-collapse-desc {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

.settings-collapse-body label {
  font-size: var(--text-sm);
  font-weight: 600;
}

/* 会员与邀请码 */
.membership-card {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.membership-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.membership-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
}

.membership-status {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.membership-status--active {
  color: #0f766e;
}

.membership-status--expired {
  color: #b45309;
}

.membership-meta {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.membership-hint {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(61, 184, 138, 0.08);
  font-size: 12px;
  color: #334155;
  line-height: 1.5;
}

.membership-hint--warn {
  background: rgba(245, 158, 11, 0.12);
  color: #92400e;
}

.membership-field-label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.membership-api-row,
.membership-invite-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.membership-api-row .fill-input,
.membership-invite-row .fill-input {
  flex: 1 1 180px;
  min-width: 0;
}

.membership-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--color-divider);
}

.membership-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}

.membership-plan-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--color-divider);
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.membership-plan-btn strong {
  font-size: 14px;
}

.membership-plan-btn span {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.membership-plan-btn:hover {
  border-color: rgba(61, 184, 138, 0.45);
  background: rgba(61, 184, 138, 0.04);
}

/* 实用工具 · 邮件写作 */
.email-writer-root,
.email-writer-sections {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: none;
}

.email-session-bar {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.email-session-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.email-session-select {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 13px;
}

.email-session-hint {
  margin: 0;
  font-size: 12px;
}

.email-section {
  overflow: hidden;
}

.email-section-head {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: none;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.email-section-head--split {
  padding: 8px 10px 8px 14px;
  cursor: default;
}

.email-section-head-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.email-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  flex-shrink: 0;
}

.email-section-meta {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-section-arrow {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.email-section-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--color-divider);
}

.email-section-lead {
  margin: 10px 0 8px;
}

.email-section-action {
  flex-shrink: 0;
}

.email-section--collapsed .email-section-head {
  border-bottom: none;
}

.email-writer-form {
  max-width: 960px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.email-writer-intro {
  margin: 0;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.65;
  color: #334155;
}

.email-writer-label {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.email-writer-textarea {
  min-height: 64px;
  resize: vertical;
  line-height: 1.55;
}

.email-writer-textarea--compact {
  min-height: 52px;
}

.email-writer-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.email-writer-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.email-writer-phrase-pool {
  padding: 12px;
  border-radius: 12px;
  background: rgba(61, 184, 138, 0.06);
  border: 1px solid rgba(61, 184, 138, 0.15);
}

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

.email-phrase-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.email-phrase-chip {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--color-divider);
  font-size: 12px;
  color: #0f766e;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-phrase-chip--marked {
  border-color: rgba(236, 72, 153, 0.35);
  background: rgba(236, 72, 153, 0.08);
  color: #9d174d;
}

.email-writer-pool-stats {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.email-writer-pool-stats strong {
  color: #9d174d;
}

.email-writer-muted {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}

.email-writer-loading {
  padding: 20px;
  text-align: center;
  color: var(--color-text-secondary);
}

.email-writer-error {
  padding: 14px;
  color: #b45309;
}

.email-result-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.email-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.email-result-head h3 {
  margin: 0;
  font-size: 16px;
}

.email-result-actions {
  display: flex;
  gap: 6px;
}

.email-result-subject {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 14px;
}

.email-result-subject span {
  color: var(--color-text-secondary);
  font-weight: 600;
  margin-right: 6px;
}

.email-result-body {
  padding: 14px;
  border-radius: 12px;
  border: 1px solid var(--color-divider);
  background: #fff;
  font-size: 14px;
  line-height: 1.7;
}

.email-result-body p {
  margin: 0 0 10px;
}

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

.email-result-used ul {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
}

.email-result-tips {
  padding: 12px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.email-result-tips p:last-child {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.page-header-desc {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--color-text-secondary);
}

.tools-page-header {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-bottom: 12px;
}

.tools-page-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.tools-page-title-block h1 {
  margin: 0;
}

.tools-page-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}

.btn-tools-save {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #0d9488 0%, #059669 100%);
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.28);
}

.btn-tools-save:hover {
  filter: brightness(1.05);
}

.btn-tools-new {
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #4338ca;
  cursor: pointer;
  background: rgba(99, 102, 241, 0.08);
}

.btn-tools-new:hover {
  background: rgba(99, 102, 241, 0.14);
}

.tools-session-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.tools-session-select {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 13px;
}

.tools-session-hint {
  flex: 1 1 160px;
  font-size: 12px;
  color: var(--color-text-secondary);
}

.email-section--active {
  box-shadow: 0 0 0 2px rgba(61, 184, 138, 0.22);
}

.email-section--collapsed .email-section-head,
.email-section--collapsed .email-section-head--split {
  border-bottom: none;
}

.email-writer-upload-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-divider);
}

.email-writer-upload-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.email-upload-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.email-upload-btn input {
  display: none;
}

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

.email-attach-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.email-attach-chip--weak {
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(255, 251, 235, 0.6);
}

.email-attach-len {
  font-size: 11px;
  color: #059669;
  font-weight: 600;
}

.email-attach-len--warn {
  color: #b45309;
}

.email-attach-preview-btn {
  border: none;
  background: transparent;
  color: #6366f1;
  font-size: 12px;
  cursor: pointer;
  padding: 0 4px;
}

.email-attach-preview {
  flex: 1 1 100%;
  margin: 4px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  background: #f8fafc;
  border-radius: 8px;
  max-height: 120px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.email-analysis-list--files {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.email-attach-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.email-attach-kind {
  font-size: 11px;
  color: var(--color-text-secondary);
}

.email-attach-remove {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
}

.email-analysis-box {
  margin-bottom: 4px;
}

.email-analysis-card {
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border: 1px solid rgba(61, 184, 138, 0.2);
  font-size: 13px;
  line-height: 1.55;
}

.email-analysis-lead {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 500;
}

.email-analysis-block {
  margin: 8px 0;
}

.email-analysis-block strong {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: #0f766e;
}

.email-analysis-angle {
  margin: 10px 0 0;
  padding-top: 8px;
  border-top: 1px dashed rgba(61, 184, 138, 0.25);
}

.email-analysis-files {
  margin: 8px 0 0;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.email-analysis-list--ol {
  list-style: decimal;
  padding-left: 18px;
}

.email-analysis-list--risk li {
  color: #b45309;
}

.email-analysis-sub {
  margin: 8px 0 0;
  color: #334155;
}

.email-analysis-list {
  margin: 6px 0 0;
  padding-left: 18px;
}

.email-writer-workspace {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.email-chat-panel {
  padding: 0;
  display: flex;
  flex-direction: column;
}

.email-chat-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.email-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0 8px;
  max-height: min(360px, 42vh);
  min-height: 120px;
}

.email-chat-empty {
  margin: 0;
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.65;
}

.email-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 96%;
}

.email-chat-msg--user {
  align-self: flex-end;
  align-items: flex-end;
}

.email-chat-msg--assistant {
  align-self: flex-start;
}

.email-chat-role {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-secondary);
}

.email-chat-bubble {
  padding: 12px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.7;
}

.email-chat-msg--user .email-chat-bubble {
  background: rgba(61, 184, 138, 0.15);
  border: 1px solid rgba(61, 184, 138, 0.25);
}

.email-chat-msg--assistant .email-chat-bubble {
  background: #f8fafc;
  border: 1px solid var(--color-divider);
}

.email-chat-section-title--final {
  color: #b45309;
  font-size: 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 2px solid rgba(245, 158, 11, 0.35);
}

.email-chat-verdict {
  margin: 5px 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.95) 0%, rgba(240, 253, 244, 0.95) 100%);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.email-chat-situation {
  margin: 2px 0 2px 8px;
  font-size: 13px;
  color: #475569;
}

.email-chat-option {
  margin: 4px 0;
  padding: 6px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  font-size: 13px;
}

.email-chat-recommend {
  margin: 4px 0 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(61, 184, 138, 0.12);
  font-size: 13px;
  font-weight: 600;
}

.email-chat-section-title {
  margin: 10px 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f766e;
}

.email-chat-section-title:first-child {
  margin-top: 0;
}

.email-chat-priority {
  margin: 4px 0;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
}

.email-chat-priority--p0 {
  background: rgba(239, 68, 68, 0.08);
  border-left: 3px solid #ef4444;
  font-weight: 600;
}

.email-chat-priority--p1 {
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
}

.email-chat-priority--p2 {
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid #6366f1;
}

.email-chat-bullet,
.email-chat-num,
.email-chat-line {
  margin: 3px 0;
  padding-left: 4px;
  font-size: 13px;
}

.email-chat-num {
  font-weight: 500;
}

.email-chat-bubble strong {
  color: var(--color-text-primary);
  font-weight: 700;
}

.email-chat-compose {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0 2px;
  flex-shrink: 0;
}

.email-chat-attach-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px #e5e7eb;
}

.email-chat-attach-btn:hover {
  background: #f8fafc;
}

.email-chat-input {
  flex: 1;
  min-height: 40px;
  max-height: 88px;
  resize: none;
  font-size: 14px;
  line-height: 1.45;
  padding: 8px 10px;
}

.email-chat-compose .btn-primary {
  flex-shrink: 0;
  min-height: 40px;
  padding: 0 14px;
}

.email-generate-btn {
  white-space: nowrap;
}

.email-draft-panel {
  width: 100%;
}

@media (max-width: 640px) {
  .email-section-head--split {
    flex-wrap: wrap;
  }

  .email-section-action {
    width: 100%;
  }
}

/* 学习方案卡片 */
.study-plan-card {
  margin-top: 16px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
  border: 1px solid rgba(99, 102, 241, 0.2);
}

.study-plan-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.study-plan-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.study-plan-stat {
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
}

.study-plan-stat strong {
  display: block;
  font-size: 22px;
  color: #4338ca;
  line-height: 1.2;
}

.study-plan-stat span {
  font-size: 11px;
  color: #64748b;
}

.study-plan-target {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: #334155;
}

.study-plan-routine {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.65;
  color: #475569;
}

.study-plan-routine li {
  margin-bottom: 4px;
}

.level-self-block {
  margin-bottom: 14px;
}

.level-self-label {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.level-self-choices .choice-btn.selected {
  border-color: #6366f1;
  background: #eef2ff;
  color: #4338ca;
  font-weight: 600;
}

.level-test-self-card .step-desc {
  margin-bottom: 14px;
}

.level-test-listen {
  margin: 12px 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
}

.level-test-listen-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #4338ca;
}

.level-test-listen-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.level-test-listen-status {
  font-size: 12px;
  color: #64748b;
}

.level-test-setup-card .step-desc {
  margin-bottom: 12px;
}

.level-track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin: 10px 0 4px;
}

.level-track-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}

.level-track-card.selected {
  border-color: rgba(61, 184, 138, 0.55);
  background: rgba(240, 253, 244, 0.9);
  box-shadow: inset 0 0 0 1px rgba(61, 184, 138, 0.35);
}

.level-track-icon {
  font-size: 20px;
  line-height: 1;
}

.level-track-label {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.level-track-desc {
  font-size: 11px;
  line-height: 1.4;
  color: #64748b;
}

.level-test-mode-row {
  margin: 8px 0 14px;
}

.level-test-mode-row .choice-btn.selected {
  border-color: rgba(61, 184, 138, 0.55);
  background: rgba(240, 253, 244, 0.95);
}

.level-test-loading-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.scene-restaurant { background: linear-gradient(180deg, #FFE0CC 0%, #FF9A6B 100%); }
.scene-homework { background: linear-gradient(180deg, #E8EAF6 0%, #9FA8DA 100%); }
.scene-bbq { background: linear-gradient(180deg, #C8E6C9 0%, #66BB6A 100%); }
.scene-supermarket { background: linear-gradient(180deg, #FFF9C4 0%, #FFD54F 100%); }
.scene-school { background: linear-gradient(180deg, #B3E5FC 0%, #4FC3F7 100%); }
.scene-hotel { background: linear-gradient(180deg, #F3E5F5 0%, #CE93D8 100%); }
.scene-client { background: linear-gradient(180deg, #E0F2F1 0%, #4DB6AC 100%); }
.scene-airport { background: linear-gradient(180deg, #B8E0F0 0%, #6BA3D6 100%); }
.scene-executive { background: linear-gradient(180deg, #2A4A5C 0%, #4ECDC4 100%); }
.scene-global { background: linear-gradient(180deg, #1A2B3C 0%, #3DB88A 100%); }
.scene-presentation { background: linear-gradient(180deg, #E1BEE7 0%, #BA68C8 100%); }

.stage-hero-bg.scene-restaurant,
.stage-hero-bg.scene-homework,
.stage-hero-bg.scene-bbq,
.stage-hero-bg.scene-supermarket,
.stage-hero-bg.scene-school,
.stage-hero-bg.scene-hotel,
.stage-hero-bg.scene-client,
.stage-hero-bg.scene-airport,
.stage-hero-bg.scene-executive,
.stage-hero-bg.scene-global,
.stage-hero-bg.scene-presentation,
.stage-hero-bg.scene-meeting,
.stage-hero-bg.scene-office {
  opacity: 0.45;
}

.thumb-restaurant { background: linear-gradient(135deg, #FFCC99, #FF8C42); }
.thumb-homework { background: linear-gradient(135deg, #C5CAE9, #7986CB); }
.thumb-bbq { background: linear-gradient(135deg, #A5D6A7, #43A047); }
.thumb-supermarket { background: linear-gradient(135deg, #FFF176, #F9A825); }
.thumb-school { background: linear-gradient(135deg, #81D4FA, #039BE5); }
.thumb-hotel { background: linear-gradient(135deg, #E1BEE7, #8E24AA); }
.thumb-client { background: linear-gradient(135deg, #80CBC4, #00897B); }
.thumb-airport { background: linear-gradient(135deg, #B8E0F0, #6BA3D6); }

.day-detail-scene {
  min-height: 120px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
  overflow: hidden;
}

.day-detail-scene-inner {
  position: relative;
  min-height: 120px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-md);
}

/* ---- 麦克风权限与录音状态 ---- */
.mic-status-line {
  font-size: var(--text-sm);
  margin-top: var(--space-sm);
  line-height: 1.5;
  text-align: center;
}

.mic-status-ok { color: var(--color-primary-dark); font-weight: 600; }
.mic-status-prompt { color: var(--color-text-secondary); }
.mic-status-rec { color: var(--color-accent); font-weight: 700; }
.mic-status-err { color: var(--color-error); }

.btn-record-mic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  min-height: 36px;
}

.btn-record-mic.mic-sm {
  padding: 6px 14px;
  font-size: var(--text-xs);
}

.btn-record-mic:hover:not(:disabled) {
  background: var(--color-primary-ghost);
}

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

.btn-record-mic.recording {
  background: linear-gradient(135deg, #FF8C42, #FF6B35);
  border-color: #FF8C42;
  color: #fff;
  animation: mic-pulse 1.2s ease-in-out infinite;
}

@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 140, 66, 0.45); }
  50% { box-shadow: 0 0 0 8px rgba(255, 140, 66, 0); }
}

.mic-permission-card {
  max-width: 420px;
  text-align: left;
}

.mic-modal-body {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.mic-modal-body p {
  margin-bottom: var(--space-sm);
}

.mic-guide-list {
  margin: var(--space-md) 0 0;
  padding-left: var(--space-lg);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.mic-guide-list li {
  margin-bottom: 6px;
}

.mic-denied-text {
  color: var(--color-error);
  font-weight: 600;
}

.mic-status-hint {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.recording-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: var(--space-sm) 0;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-error);
}

.recording-indicator.hidden {
  display: none;
}

.rec-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  background: var(--color-error);
  animation: rec-dot-pulse 1s ease-in-out infinite;
}

@keyframes rec-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ---- 跟读沉浸式 + 场景插画 ---- */
.roleplay-immersive {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.roleplay-scene-banner {
  position: relative;
  height: 120px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}

.scene-art-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.85) 100%);
  pointer-events: none;
}

.roleplay-scene-meta {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-secondary);
  z-index: 2;
}

.roleplay-dialogue-panel {
  padding: var(--space-lg);
  background: var(--color-surface);
}

.char-illus-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.char-illus {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  border: 3px solid var(--char-color, var(--color-primary));
  background: var(--color-primary-light);
  position: relative;
  flex-shrink: 0;
}

.char-illus::after {
  font-size: 26px;
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-illus-catherine::after { content: '👩‍💼'; }
.char-illus-manager::after, .char-illus-boss::after { content: '👔'; }
.char-illus-mike::after { content: '👨‍💼'; }
.char-illus-child::after { content: '👧'; }
.char-illus-waiter::after { content: '🧑‍🍳'; }
.char-illus-teacher::after { content: '👩‍🏫'; }
.char-illus-client::after { content: '🤝'; }
.char-illus-james::after, .char-illus-emma::after { content: '👩‍💻'; }
.char-illus-generic::after { content: '🙂'; }

.char-display-name {
  font-size: var(--text-md);
  color: var(--color-text);
}

.char-role-tag {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  font-weight: 600;
}

.roleplay-en.text-block {
  font-size: var(--text-lg);
  line-height: 1.55;
  margin-bottom: var(--space-sm);
  transition: background 0.2s;
}

.roleplay-en.text-playing {
  background: var(--color-primary-ghost);
  border-radius: var(--radius-sm);
  padding: 8px;
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.kw-highlight {
  background: #FFF3CD;
  color: var(--color-text);
  padding: 0 4px;
  border-radius: 4px;
  font-weight: 700;
}

.listen-progress-wrap {
  margin: var(--space-md) 0 var(--space-sm);
}

.listen-progress-bar {
  height: 6px;
  background: var(--color-divider);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.listen-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
  transition: width 0.08s linear;
}

.flow-guide {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  text-align: center;
  margin: 0;
}

.roleplay-scores {
  margin: var(--space-md) var(--space-lg);
  padding: var(--space-md);
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
}

.score-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  text-align: center;
}

.score-mini-item span {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.score-mini-item strong {
  font-size: var(--text-xl);
  color: var(--color-primary-dark);
}

.record-countdown {
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

/* 场景插画（CSS 轻量平面图） */
.scene-art-manager_office {
  background: linear-gradient(135deg, #C5D8F0 0%, #8EB4E0 50%, #6B9BD1 100%);
}
.scene-art-manager_office::before {
  content: '🏢';
  position: absolute;
  right: 16px;
  top: 20px;
  font-size: 48px;
  opacity: 0.35;
}

.scene-art-homework_desk {
  background: linear-gradient(135deg, #E8EAF6 0%, #9FA8DA 100%);
}
.scene-art-homework_desk::before {
  content: '📚';
  position: absolute;
  right: 20px;
  top: 24px;
  font-size: 44px;
  opacity: 0.4;
}

.scene-art-restaurant_dining {
  background: linear-gradient(135deg, #FFE0CC 0%, #FF9A6B 100%);
}
.scene-art-restaurant_dining::before {
  content: '🍽';
  position: absolute;
  right: 18px;
  top: 22px;
  font-size: 46px;
  opacity: 0.4;
}

.scene-art-school_classroom {
  background: linear-gradient(135deg, #B3E5FC 0%, #4FC3F7 100%);
}
.scene-art-school_classroom::before {
  content: '🏫';
  position: absolute;
  right: 16px;
  top: 20px;
  font-size: 44px;
  opacity: 0.35;
}

.scene-art-meeting_room {
  background: linear-gradient(135deg, #D1E8F5 0%, #7EB8DA 100%);
}
.scene-art-meeting_room::before { content: '💼'; position: absolute; right: 16px; top: 22px; font-size: 42px; opacity: 0.35; }

.scene-art-supermarket {
  background: linear-gradient(135deg, #FFF9C4 0%, #FFD54F 100%);
}
.scene-art-supermarket::before { content: '🛒'; position: absolute; right: 16px; top: 22px; font-size: 44px; opacity: 0.4; }

.scene-art-outdoor_bbq {
  background: linear-gradient(135deg, #C8E6C9 0%, #66BB6A 100%);
}
.scene-art-outdoor_bbq::before { content: '🍖'; position: absolute; right: 16px; top: 22px; font-size: 44px; opacity: 0.4; }

.scene-art-hotel_front {
  background: linear-gradient(135deg, #F3E5F5 0%, #CE93D8 100%);
}
.scene-art-hotel_front::before { content: '🏨'; position: absolute; right: 16px; top: 22px; font-size: 44px; opacity: 0.35; }

.scene-art-client_office, .scene-art-office_desk {
  background: linear-gradient(135deg, #B8E0D2 0%, #7EC8A8 100%);
}
.scene-art-client_office::before, .scene-art-office_desk::before {
  content: '💼';
  position: absolute;
  right: 16px;
  top: 22px;
  font-size: 42px;
  opacity: 0.35;
}

.scene-art-airport { background: linear-gradient(135deg, #B8E0F0 0%, #6BA3D6 100%); }
.scene-art-airport::before { content: '✈️'; position: absolute; right: 16px; top: 22px; font-size: 42px; opacity: 0.35; }

.scene-art-cafe { background: linear-gradient(135deg, #FFE8CC 0%, #FFCC99 100%); }
.scene-art-cafe::before { content: '☕'; position: absolute; right: 16px; top: 22px; font-size: 42px; opacity: 0.4; }

.scene-art-global_city { background: linear-gradient(135deg, #1A2B3C 0%, #3DB88A 100%); }
.scene-art-global_city::before { content: '🌏'; position: absolute; right: 16px; top: 22px; font-size: 42px; opacity: 0.45; }

.scene-art { position: relative; }

.wave-bars.live-wave.recording span,
.wave-bars.recording span {
  animation: wave-bar 0.5s ease-in-out infinite alternate;
}

/* ---- 响应式：真机全屏 ---- */
@media (max-width: 480px) {
  body {
    padding: 0;
    background: var(--color-bg);
  }

  .device-frame {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }

  .app {
    height: calc(100vh - var(--status-height) - var(--nav-height));
  }
}

/* ---- 盲听听力页 ---- */
.listen-scene-banner {
  position: relative;
  height: 180px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.listen-scene-banner .scene-art-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.75) 100%);
}

.listen-scene-banner .scene-label-tag {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 2;
}

.scene-load-spinner {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  font-size: var(--text-xs);
  background: rgba(255,255,255,0.9);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
}

.scene-load-err {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  font-size: var(--text-xs);
  background: #fff3f0;
  color: var(--color-error);
  border: 1px solid #f5c6c0;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.listen-phase-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 4px;
}

.listen-blind-hint {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
  line-height: 1.5;
}

.listen-blind-wrap,
.listen-segment-wrap,
.listen-review-wrap {
  margin-bottom: var(--space-md);
}

.scene-plot-muted {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
}

.listen-progress-main {
  margin: var(--space-md) 0;
}

.listen-time-label {
  display: block;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin-top: 4px;
}

.listen-segment-chars {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.segment-char {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  border: 2px solid var(--color-divider);
  font-size: var(--text-xs);
  font-weight: 600;
  transition: all 0.2s;
}

.segment-char.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(42, 155, 116, 0.2);
}

.segment-text-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.segment-speaker {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary-dark);
  margin-bottom: 6px;
}

.segment-en {
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 4px;
}

.segment-cn {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.listen-activities-wrap {
  padding: var(--space-lg);
}

.feedback.ok { color: var(--color-primary-dark); }
.feedback.err { color: var(--color-error); }

/* 跟读：角色高亮 + 波形对比 */
.char-illus-wrap.char-speaking .char-illus {
  box-shadow: 0 0 0 4px rgba(42, 155, 116, 0.45);
  transform: scale(1.05);
  transition: all 0.2s;
}

.compare-wave-panel {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  background: var(--color-surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-divider);
}

.compare-wave-label {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  margin: 4px 0;
}

.wave-canvas {
  width: 100%;
  height: 48px;
  display: block;
  margin-bottom: var(--space-sm);
}

.word-score.word-ok {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.word-score.word-err,
.roleplay-en .word-err {
  color: var(--color-error);
  font-weight: 600;
}

.char-avatar-mini {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
  flex-shrink: 0;
}

.listen-char-row {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.listen-char-item {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 2px solid transparent;
  transition: all 0.2s;
}

.listen-char-item.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(42, 155, 116, 0.15);
}

.listen-text-actions {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.listen-seek-bar {
  width: 100%;
  margin-bottom: 4px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.listen-progress-under {
  margin-top: 0;
}

.listen-audio-err {
  font-size: var(--text-xs);
  color: var(--color-error);
  margin-top: var(--space-sm);
}

.ai-side-summary {
  font-size: var(--text-sm);
  line-height: 1.5;
  margin-bottom: var(--space-sm);
  color: var(--color-text-secondary);
}

.weakness-history {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

/* 本地场景背景分层 */
.scene-stage-layered {
  position: relative;
  min-height: 420px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.bg-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.78;
  z-index: 1;
}

.bg-layer-fallback {
  background: linear-gradient(135deg, #E8F5F0 0%, #B8D4F0 100%);
  opacity: 0.85;
}

.content-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: var(--space-md);
}

.text-container {
  background: rgba(255, 255, 255, 0.78);
  padding: 10px 12px;
  border-radius: 6px;
  backdrop-filter: blur(2px);
}

.roleplay-dialogue-panel.text-container {
  background: rgba(255, 255, 255, 0.88);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.listen-layout {
  display: flex;
  flex-direction: column;
  min-height: 520px;
  padding: var(--space-md);
  padding-bottom: var(--space-lg);
}

.listen-header {
  flex-shrink: 0;
  margin-bottom: var(--space-sm);
}

.listen-header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.listen-hero-spacer {
  flex: 1 1 auto;
  min-height: 200px;
  pointer-events: none;
}

.listen-bottom-panel {
  flex-shrink: 0;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.listen-blind-wrap.scene-stage-layered {
  min-height: 560px;
}

.listen-blind-wrap .listen-layout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: var(--space-md);
  padding-bottom: 0;
}

.listen-blind-wrap .listen-hero-spacer {
  flex: 1 1 auto;
  min-height: 0;
}

.listen-bottom-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  margin-top: 0;
  background: transparent !important;
  pointer-events: auto;
}

.listen-bottom-compact {
  padding: 10px 14px 14px;
  background: transparent !important;
}

.listen-controls-compact {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.listen-controls-compact .ctrl-chip {
  flex: 1;
  padding: 8px 6px;
  font-size: 12px;
  min-height: 36px;
}

.ctrl-chip--glass {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.listen-bottom-compact .listen-progress-wrap {
  margin: 0;
}

.listen-bottom-compact .listen-seek-bar {
  width: 100%;
  margin-bottom: 2px;
}

.listen-bottom-compact .listen-time-label {
  display: block;
  text-align: center;
  font-size: 11px;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}


.listen-bottom-overlay .listen-blind-hint {
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  margin-bottom: var(--space-xs);
}

.listen-progress-transparent,
.listen-bottom-overlay .listen-progress-transparent {
  background: transparent;
  backdrop-filter: none;
  padding: 0;
}

.listen-bottom-overlay .listen-time-label {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.listen-bottom-overlay .ctrl-chip {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
}

.listen-controls-bottom {
  margin-bottom: 0;
  margin-top: var(--space-xs);
}

.scene-top-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-sm);
}

.listen-phase-inline {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.roleplay-immersive.scene-stage-layered {
  min-height: 480px;
}

/* 跟读：图上展示 + 下方文字控件 */
.roleplay-stage {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--color-surface);
}

/* 跟读：上排左图右按钮，下排句子 */
.roleplay-stage--stack {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.roleplay-top-row {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  height: var(--roleplay-top-height);
  max-height: var(--roleplay-top-height);
  min-height: 200px;
  border-bottom: 1px solid var(--color-divider);
}

.roleplay-controls-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: #fff;
  border-left: 1px solid var(--color-divider);
  min-width: 0;
}

.roleplay-controls-side .roleplay-split-head {
  margin-bottom: 0;
}

.roleplay-controls-side .flow-guide--compact {
  text-align: left;
}

.roleplay-controls-side--tight {
  gap: 6px;
  padding: var(--space-sm) var(--space-md);
}

.roleplay-split-meta--solo {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: var(--color-text-secondary);
}

.study-nav-strip {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  padding: var(--space-sm) var(--space-md);
  background: #fff;
  border-bottom: 1px solid var(--color-divider);
}

.study-nav-strip .char-illus-wrap {
  margin: 0;
  flex: 0 1 auto;
  max-width: 36%;
}

.study-nav-strip .inline-sentence-nav {
  flex: 1;
  justify-content: flex-end;
}

.roleplay-top-row--short {
  height: auto;
  max-height: none;
  min-height: 0;
}

.echo-stage--airy .roleplay-visual-side {
  min-height: 140px;
  max-height: 160px;
}

.roleplay-top-row--short .roleplay-visual-side {
  min-height: 130px;
  max-height: 150px;
}

.roleplay-actions--primary {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 6px;
}

.roleplay-actions-secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.btn-ctrl-sub {
  font-size: 10px !important;
  padding: 4px 8px !important;
}

.btn-link-marked {
  border: none;
  background: none;
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
  margin-left: 6px;
}

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

.btn-link-marked.active {
  color: var(--color-accent);
}

.roleplay-jump--scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  overflow-x: auto;
  max-width: 100%;
  padding: 2px 0;
  scrollbar-width: none;
}

.roleplay-jump--scroll::-webkit-scrollbar {
  display: none;
}

.roleplay-jump--scroll .jump-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
}

.roleplay-text-section--airy {
  padding: var(--space-sm) var(--space-md);
}

.roleplay-text-section--airy .roleplay-text-head {
  margin-bottom: var(--space-xs);
}

.roleplay-text-section--airy .roleplay-en {
  font-size: var(--text-md);
  margin-bottom: var(--space-xs);
}

.roleplay-text-section--airy .roleplay-cn {
  padding: var(--space-xs) var(--space-sm);
  margin-bottom: var(--space-xs);
}

.echo-feedback-zone {
  padding: 0 var(--space-md) var(--space-sm);
}

.echo-rec-hint {
  font-size: 10px;
  color: var(--color-accent);
  margin: 0;
  line-height: 1.35;
}

.echo-file-banner {
  margin: 0;
  padding: 8px var(--space-md);
  font-size: 11px;
  line-height: 1.4;
  color: #8a5a00;
  background: #fff8e6;
  border-bottom: 1px solid #ffe082;
}

.btn-echo-skip {
  border: none;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
}

.btn-echo-skip:hover {
  color: var(--color-primary-dark);
}

.roleplay-actions-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.roleplay-actions--grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.roleplay-actions--grid .btn-ctrl-xs,
.roleplay-actions--grid .btn-record-mic {
  width: 100%;
  justify-content: center;
}

.roleplay-pass-stats {
  font-size: 11px;
  color: var(--color-text-secondary);
  margin: 0;
}

.roleplay-text-section {
  padding: var(--space-md);
  background: #fff;
}

.roleplay-text-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}

.roleplay-text-head .char-illus-wrap {
  margin-bottom: 0;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 42%;
}

.inline-sentence-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.sentence-nav-btn {
  padding: 5px 10px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s, transform 0.1s, background 0.15s;
}

.sentence-nav-prev {
  background: #d8f0e8;
  color: #2a7d5f;
}

.sentence-nav-prev:hover:not(:disabled) {
  background: #c5e8dc;
}

.sentence-nav-next {
  background: linear-gradient(135deg, #3db88a 0%, #2a9b74 100%);
  color: #fff;
  box-shadow: 0 1px 4px rgba(42, 155, 116, 0.35);
}

.sentence-nav-next:hover:not(:disabled) {
  filter: brightness(1.06);
}

.sentence-nav-btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}

.inline-nav-progress {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary);
  padding: 0 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.roleplay-text-tools {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.roleplay-text-section .roleplay-en {
  font-size: var(--text-md);
  line-height: 1.5;
  margin: 0 0 var(--space-sm);
  cursor: pointer;
}

.roleplay-text-section .roleplay-en:hover {
  color: var(--color-primary-dark);
}

.roleplay-text-section .roleplay-cn {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin: 0 0 var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-primary-light);
  border-radius: var(--radius-sm);
}

.roleplay-text-section .roleplay-cn.hidden {
  display: none;
}

.roleplay-en-blind {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px dashed rgba(148, 163, 184, 0.45);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.55;
  text-align: center;
}

.roleplay-en-blind.hidden {
  display: none;
}

.roleplay-text-section .word-chips-hint--compact {
  margin-top: var(--space-sm);
}

.word-chip--clickable {
  cursor: pointer;
  border: none;
  font: inherit;
  font-size: inherit;
}

.word-chip--clickable:hover {
  background: var(--color-primary-ghost);
  color: var(--color-primary-dark);
}

@media (max-width: 720px) {
  .roleplay-top-row {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  .roleplay-visual-side {
    height: var(--roleplay-scene-height);
    max-height: var(--roleplay-scene-height);
  }

  .roleplay-controls-side {
    border-left: none;
    border-top: 1px solid var(--color-divider);
  }

  .roleplay-actions--grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* 跟读：旧左右分栏（复读等复用 visual-side） */
.roleplay-stage--split {
  overflow: hidden;
}

.roleplay-split {
  display: grid;
  grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
  height: var(--roleplay-top-height);
  max-height: var(--roleplay-top-height);
  min-height: 200px;
}

.roleplay-visual-side {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #E8F5F0 0%, #B8D4F0 100%);
  min-height: 0;
}

.roleplay-visual-side .roleplay-scene-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.roleplay-visual-side .scene-load-err,
.roleplay-visual-side .scene-load-spinner {
  position: absolute;
  z-index: 3;
  bottom: 8px;
  left: 8px;
}

.roleplay-scene-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.roleplay-scene-img--missing {
  display: none;
}

.roleplay-content-side {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: #fff;
  border-left: 1px solid var(--color-divider);
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
}

.roleplay-split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.roleplay-split-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-secondary);
}

.roleplay-content-side .roleplay-dialogue-panel {
  flex: 1;
  min-height: 0;
  margin-bottom: 0;
  padding: var(--space-sm) 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.roleplay-content-side .roleplay-en {
  font-size: var(--text-md);
  line-height: 1.45;
  margin: var(--space-xs) 0;
}

.roleplay-content-side .roleplay-cn {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.4;
}

.roleplay-content-side .char-illus-wrap {
  margin-bottom: var(--space-xs);
}

.roleplay-content-side .char-illus {
  width: 36px;
  height: 36px;
}

.roleplay-content-side .char-meta {
  font-size: var(--text-xs);
}

.roleplay-content-side .roleplay-control-bar {
  border-top: 1px solid var(--color-divider);
  padding: var(--space-sm) 0 0;
  margin-top: 0;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .roleplay-split {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }

  .roleplay-visual-side {
    height: var(--roleplay-scene-height);
    max-height: var(--roleplay-scene-height);
  }

  .roleplay-content-side {
    border-left: none;
    border-top: 1px solid var(--color-divider);
    max-height: none;
    overflow-y: visible;
  }
}

/* 跟读/复读场景图（竖排备用） */

.roleplay-visual {
  position: relative;
  width: 100%;
  height: var(--roleplay-scene-height);
  min-height: var(--roleplay-scene-height);
  max-height: var(--roleplay-scene-height);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #E8F5F0 0%, #B8D4F0 100%);
}

.roleplay-visual .roleplay-scene-img {
  object-fit: cover;
}

.roleplay-scene-img--missing {
  display: none;
}

.roleplay-visual .bg-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: contain;
  background-position: center center;
  background-repeat: no-repeat;
  opacity: 1;
}

.roleplay-visual-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}

.roleplay-visual-meta button,
.roleplay-visual-meta .roleplay-jump--inline {
  pointer-events: auto;
}

.roleplay-visual-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: linear-gradient(transparent, rgba(255, 255, 255, 0.88));
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-secondary);
}

.roleplay-visual--compact {
  height: var(--roleplay-scene-height);
  min-height: var(--roleplay-scene-height);
  max-height: var(--roleplay-scene-height);
}

.roleplay-body {
  flex: 1;
  padding: var(--space-lg);
  background: #fff;
  border-top: 1px solid var(--color-divider);
}

.roleplay-body .roleplay-dialogue-panel {
  background: #f8faf9;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.roleplay-body--compact {
  padding: var(--space-sm) var(--space-md) var(--space-md);
}

.roleplay-body--compact .roleplay-dialogue-panel {
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-sm);
}

.roleplay-body--compact .roleplay-en {
  font-size: var(--text-base);
  margin: var(--space-xs) 0;
}

.roleplay-body--compact .roleplay-cn {
  font-size: var(--text-sm);
  margin: 0;
}

.listen-progress-wrap--thin {
  margin-top: var(--space-xs);
}

.roleplay-control-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-sm) 0;
  border-top: 1px solid var(--color-divider);
}

.flow-guide--compact {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
  text-align: center;
}

.roleplay-actions--compact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 0;
  width: 100%;
}

.btn-ctrl-xs {
  padding: 4px 10px !important;
  font-size: 11px !important;
  min-height: 28px;
}

.btn-record-mic.mic-xs {
  padding: 5px 14px;
  font-size: 12px;
  min-height: 30px;
}

.live-wave--compact {
  height: 22px;
  gap: 3px;
  margin: 0;
}

.live-wave--compact span {
  width: 4px;
  min-height: 4px;
}

.live-wave--compact.hidden {
  display: none;
}

.record-countdown--inline {
  margin: 0;
  font-size: 11px;
  padding: 0;
  background: none;
  color: var(--color-accent);
  font-weight: 700;
}

.roleplay-jump--inline {
  display: flex;
  gap: 4px;
  margin: 0;
  margin-left: auto;
}

.roleplay-jump--inline .jump-dot {
  width: 7px;
  height: 7px;
}

.word-chips-hint--compact {
  font-size: 11px;
  margin: var(--space-xs) 0 0;
  color: var(--color-text-secondary);
}

.word-chips-hint--compact .word-chip {
  padding: 1px 6px;
  font-size: 10px;
}

.roleplay-result--compact {
  margin: var(--space-xs) 0 0;
  font-size: 11px;
}

/* 句子导航条 */
.study-nav-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 5px;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

.study-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  white-space: nowrap;
}

.study-nav-btn:hover:not(:disabled) {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.study-nav-btn:active:not(:disabled) {
  transform: scale(0.98);
}

.study-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.study-nav-prev {
  flex-shrink: 0;
  min-width: 88px;
}

.study-nav-next {
  flex: 1;
  min-width: 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(61, 184, 138, 0.35);
}

.study-nav-next:hover:not(:disabled) {
  background: linear-gradient(135deg, #45c896 0%, var(--color-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(61, 184, 138, 0.45);
}

.study-nav-icon {
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}

.study-nav-center {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 52px;
  padding: 0 4px;
}

.study-nav-progress {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-secondary);
  font-variant-numeric: tabular-nums;
}

.study-nav-sep {
  margin: 0 1px;
  opacity: 0.5;
}

.study-nav-badge {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-accent);
  background: var(--color-accent-light);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.btn-mark-line {
  padding: 4px 10px;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-mark-line:hover {
  border-color: #FFB84D;
  color: var(--color-accent);
}

.btn-mark-line.active {
  border-color: #FFB84D;
  background: var(--color-accent-light);
  color: #c45a00;
}

.btn-practice-marked {
  width: 100%;
  padding: 8px 12px;
  border: 1px dashed var(--color-accent);
  border-radius: var(--radius-md);
  background: rgba(255, 184, 77, 0.08);
  font-size: 11px;
  font-weight: 700;
  color: #c45a00;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-practice-marked:hover:not(:disabled) {
  background: var(--color-accent-light);
}

.btn-practice-marked.active {
  border-style: solid;
  background: var(--color-accent-light);
}

.btn-practice-marked:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.jump-dot.marked {
  background: #FFB84D;
  box-shadow: 0 0 0 2px rgba(255, 140, 66, 0.35);
}

.jump-dot.marked.current {
  background: var(--color-accent);
  transform: scale(1.25);
}

.jump-dot.marked.done {
  background: #FFB84D;
  border: 2px solid var(--color-primary);
}

.footer-row--compact {
  gap: var(--space-sm);
}

.btn-nav-sm {
  padding: 10px 14px !important;
  font-size: var(--text-sm) !important;
  min-height: 40px;
}

.day-study-footer {
  padding-top: var(--space-sm);
}

.roleplay-body .roleplay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.roleplay-body .roleplay-actions .btn-ghost-sm {
  background: #fff;
  border: 1px solid var(--color-divider);
}

.roleplay-body .mic-status-line {
  margin-bottom: var(--space-sm);
}

.listen-controls-only {
  background: rgba(255, 255, 255, 0.92);
  padding: var(--space-md);
  border-radius: var(--radius-md);
}

.listen-header-minimal {
  background: rgba(255, 255, 255, 0.75);
  padding: 8px 12px;
  border-radius: 6px;
}

.listen-advance-hint {
  text-align: center;
  color: var(--color-primary-dark);
  font-size: var(--text-sm);
  font-weight: 600;
}

.echo-text-section--compact {
  padding: var(--space-sm) var(--space-md) !important;
  gap: var(--space-xs);
}

.echo-inline-head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 32px;
}

.echo-inline-head .echo-blind-badge {
  flex-shrink: 0;
  margin: 0;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-primary-dark);
  background: var(--color-primary-light);
  border-radius: var(--radius-full);
  text-align: left;
}

.echo-inline-head .char-illus-wrap {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 38%;
  margin: 0;
  gap: var(--space-xs);
}

.echo-inline-head .inline-sentence-nav {
  flex: 1;
  justify-content: center;
}

.echo-inline-head .char-illus {
  width: 28px;
  height: 28px;
}

.echo-inline-head .char-display-name {
  font-size: var(--text-sm);
}

.echo-inline-head .char-role-tag {
  font-size: 10px;
}

.echo-pulse-ring--sm {
  width: 22px;
  height: 22px;
  margin: 0;
  flex-shrink: 0;
  border-width: 2px;
}

.echo-pulse-ring--sm.speaking {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ghost);
}

.echo-blind-badge {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-primary-dark);
}

.echo-score-panel {
  margin-top: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: #f8faf9;
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
}

.echo-score-panel.hidden {
  display: none;
}

.echo-score-metrics {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-start;
  margin-bottom: 0;
}

.echo-score-item {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 2px 8px;
  background: var(--color-surface);
  border-radius: var(--radius-full);
}

.echo-score-label {
  font-size: 10px;
  color: var(--color-text-secondary);
}

.echo-score-item strong {
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--color-text);
}

.echo-score-item strong.score-ok {
  color: var(--color-primary-dark);
}

.echo-score-item strong.score-warn {
  color: var(--color-accent);
}

.echo-score-item strong.score-bad {
  color: var(--color-error);
}

.echo-word-feedback {
  font-size: 10px;
  margin-top: 6px;
  line-height: 1.4;
}

.echo-word-fb-title {
  display: inline;
  margin-right: 4px;
  color: var(--color-text-secondary);
}

.word-chip--warn {
  background: #fff0e6;
  color: #c45a00;
  border: 1px solid #ffcc80;
}

.echo-word-fb-ok {
  color: var(--color-primary-dark);
  font-weight: 600;
}

.echo-word-feedback .word-chip {
  padding: 1px 6px;
  font-size: 10px;
  margin: 2px 2px 0 0;
}

.echo-reveal {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--color-divider);
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--color-text);
}

.echo-result-line {
  margin: 6px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--color-divider);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.echo-result-line.ok {
  color: var(--color-primary-dark);
}

.echo-result-line.err {
  color: var(--color-error);
}

.echo-reveal-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-secondary);
  margin-right: 6px;
}

.echo-reveal-cn {
  display: block;
  margin-top: 4px;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.echo-pulse-ring {
  width: 48px;
  height: 48px;
  margin: var(--space-sm) auto;
  border-radius: 50%;
  border: 3px solid var(--color-divider);
  transition: all 0.2s;
}

.echo-pulse-ring.speaking {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 6px rgba(42, 155, 116, 0.2);
  animation: rec-dot-pulse 1s ease-in-out infinite;
}

.quiz-report-section {
  margin-top: var(--space-md);
  text-align: left;
  font-size: var(--text-sm);
}

.quiz-report-section h4 {
  margin-bottom: 6px;
  font-size: var(--text-sm);
}

.quiz-wrong-list {
  margin: 0;
  padding-left: 1.2em;
  color: var(--color-text-secondary);
}

.echo-body .char-meta {
  display: none;
}

.echo-body .roleplay-cn,
.echo-body .word-chips-hint {
  display: none;
}

.quiz-oral-wave {
  margin: var(--space-sm) 0;
  justify-content: center;
}

.exercise-card--oral {
  padding: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.exercise-card--oral .exercise-q {
  margin-bottom: var(--space-sm);
}

.quiz-oral-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-top: var(--space-md);
}

.quiz-oral-toolbar .btn-record-mic {
  flex-shrink: 0;
}

.quiz-oral-toolbar .btn-ghost-sm {
  flex-shrink: 0;
}

.quiz-oral-toolbar .quiz-oral-submit {
  margin-left: auto;
  min-width: 96px;
  padding-left: 16px;
  padding-right: 16px;
}

.oral-score {
  font-size: var(--text-sm);
  color: var(--color-primary-dark);
  margin-top: var(--space-sm);
}

.roleplay-immersive .content-wrap {
  padding: var(--space-lg);
}

.roleplay-scene-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--space-md);
}

/* ---- 听力专项 ---- */
.listening-lab-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.listening-lab-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  padding: var(--space-lg);
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.12s;
  position: relative;
  overflow: hidden;
  background: linear-gradient(108deg, #FAFFFE 0%, #F0FDF9 52%, #F5F3FF 100%);
  border: 1px solid rgba(61, 184, 138, 0.14);
}

.listening-lab-card::before {
  content: '🎧';
  position: absolute;
  right: 14px;
  bottom: 6px;
  font-size: 2.4rem;
  opacity: 0.07;
  pointer-events: none;
  line-height: 1;
}

.listening-lab-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--color-primary) 0%, #818CF8 100%);
  opacity: 0.4;
}

.listening-lab-list .listening-lab-card:nth-child(3n + 2) {
  background: linear-gradient(108deg, #FFFBEB 0%, #FEF9C3 45%, #FAF5FF 100%);
  border-color: rgba(245, 158, 11, 0.14);
}

.listening-lab-list .listening-lab-card:nth-child(3n) {
  background: linear-gradient(108deg, #EFF6FF 0%, #E0F2FE 48%, #F0FDF4 100%);
  border-color: rgba(59, 130, 246, 0.12);
}

.listening-lab-card.listening-lab-card--done {
  background: linear-gradient(108deg, #F0FDF4 0%, #DCFCE7 50%, #ECFDF5 100%);
  border-color: rgba(34, 197, 94, 0.18);
}

.listening-lab-card.listening-lab-card--done::after {
  background: linear-gradient(180deg, #22C55E, #16A34A);
  opacity: 0.55;
}

.listening-lab-card-main {
  position: relative;
  z-index: 1;
}

.listening-lab-card-meta {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.listening-lab-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
  transform: translateY(-1px);
}

.listening-upload-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.listening-upload-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}

.listening-lab-local {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #4338ca;
  background: #e0e7ff;
  vertical-align: middle;
}

.listening-lab-id {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.listening-lab-card h3 {
  font-size: var(--text-lg);
  margin: 0 0 4px;
}

.listening-lab-scene {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  margin: 0;
}

.listening-lab-done {
  font-size: var(--text-xs);
  color: var(--color-primary-dark);
  font-weight: 600;
}

.listening-lab-pending {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.listening-lab-empty code {
  font-size: var(--text-sm);
  background: var(--color-surface);
  padding: 2px 6px;
  border-radius: 4px;
}

.listening-play-content {
  min-height: 60vh;
}

.listening-lab-stage {
  position: relative;
  width: 100%;
  min-height: min(68vh, 620px);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #2a3a2e;
}

.listening-lab-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.listening-lab-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  font-size: var(--text-sm);
}

.listening-lab-spinner.hidden {
  display: none;
}

.listening-lab-retry {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(255, 255, 255, 0.9);
  font-size: var(--text-xs);
  cursor: pointer;
}

.listening-lab-subtitle {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 132px;
  z-index: 4;
  max-height: 34%;
  overflow-y: auto;
  padding: 8px 12px 10px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  box-shadow: none;
  color: #fff;
  line-height: 1.55;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
}

.listening-lab-subtitle--dragging {
  cursor: grabbing;
  opacity: 0.92;
}

.listening-lab-subtitle-grip {
  display: block;
  width: 28px;
  height: 4px;
  margin: 0 auto 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  pointer-events: none;
}

.listening-lab-subtitle .listening-sub-en {
  display: block;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 6px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 12px rgba(0, 0, 0, 0.65);
  user-select: text;
  cursor: text;
}

.listening-lab-subtitle .listening-sub-zh {
  display: block;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9), 0 0 10px rgba(0, 0, 0, 0.6);
}

.listening-lab-subtitle.hidden {
  display: none;
}

.listening-lab-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 12px 14px 16px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.72) 35%, rgba(0, 0, 0, 0.85) 100%);
  pointer-events: auto;
}

.listening-ui-badge {
  position: absolute;
  top: -28px;
  right: 10px;
  z-index: 5;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.app-build-badge {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.02em;
}

.listening-lab-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.listening-lab-toolbar-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  margin-right: 2px;
}

.listening-lab-toolbar--rate {
  align-items: center;
}

.listening-select {
  min-width: 88px;
  max-width: 120px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 12px;
}

.listening-rate-slider {
  flex: 1;
  min-width: 100px;
  max-width: 220px;
  accent-color: var(--color-primary);
}

.listening-rate-label {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  min-width: 36px;
}

.listening-rate-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.65);
}

.listening-sentence-hint {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  padding: 4px 8px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

[data-listen-ui-mode="full"] .ctrl-sentence-only {
  display: none !important;
}

[data-listen-ui-mode="sentence"] .ctrl-full-only {
  display: none !important;
}

.listening-lab-controls--compact {
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.listening-lab-controls--compact::-webkit-scrollbar {
  display: none;
}

.listening-lab-controls--compact .ctrl-chip {
  flex: 0 0 auto;
  padding: 7px 10px;
  font-size: 12px;
  min-height: 34px;
  white-space: nowrap;
}

.listening-lab-controls--compact .listening-icon-btn {
  min-width: 36px;
  padding: 7px 8px;
  font-size: 15px;
  line-height: 1;
}

.listening-lab-controls--compact .listening-mode-btn.active,
.listening-lab-controls--compact .listening-subtitle-btn.active,
.listening-lab-controls--compact .ctrl-chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.listening-lab-controls {
.listening-lab-toolbar .listening-accent-chip,
.listening-lab-toolbar .listening-subtitle-btn {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
}

.listening-lab-toolbar .listening-accent-chip.active,
.listening-lab-toolbar .listening-mode-btn.active,
.listening-lab-toolbar .listening-subtitle-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.listening-lab-progress {
  margin-bottom: 8px;
}

.listening-lab-progress .listen-seek-bar {
  width: 100%;
}

.listening-lab-progress .listen-time-label {
  display: block;
  text-align: center;
  font-size: 11px;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.92);
}

.listening-lab-controls {
  display: flex;
  gap: 8px;
}

.listening-lab-controls .ctrl-chip {
  flex: 1;
  padding: 10px 8px;
  font-size: 13px;
  min-height: 40px;
}

.listening-lab-controls .ctrl-chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.listening-accent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-md) 0;
  padding: 0 var(--space-md);
}

.listening-accent-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
}

.listening-accent-chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ========== AI 口语页 · 设置区 + 对话区 ========== */
.speak-page {
  flex-direction: column;
  gap: 12px;
  max-width: none;
  width: 100%;
  margin: 0;
}

#page-speak.page.active {
  display: flex;
}

.app-main:has(#page-speak.active) {
  max-width: 100%;
}

.speak-body {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  width: 100%;
}

.speak-settings-col,
.speak-chat-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.speak-chat-col {
  gap: 12px;
}

.speak-section-label {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-text-secondary);
  letter-spacing: 0.08em;
  margin: 0 0 8px 2px;
}

@media (max-width: 860px) {
  .speak-body {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.speak-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 8px;
}

.speak-hero h1 {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}

.speak-hero-sub {
  margin: 4px 0 0;
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.speak-hero-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.speak-panel {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 42%, #EEF2FF 100%);
  border: 1px solid rgba(61, 184, 138, 0.2);
  box-shadow: 0 2px 14px rgba(61, 184, 138, 0.07);
  position: relative;
  z-index: 5;
  overflow: hidden;
}

.speak-panel::before {
  content: '';
  position: absolute;
  top: -48px;
  right: -32px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.1) 0%, transparent 68%);
  pointer-events: none;
}

.speak-panel::after {
  content: '';
  position: absolute;
  bottom: -36px;
  left: -24px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(61, 184, 138, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.speak-select-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  position: relative;
  z-index: 1;
  scrollbar-width: thin;
}

.speak-select-row::-webkit-scrollbar {
  height: 4px;
}

.speak-select-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 78px;
}

.speak-select-field.hidden {
  display: none;
}

.speak-select-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--color-text-tertiary);
  letter-spacing: 0.02em;
}

.speak-native-select {
  width: 100%;
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 9px 28px 9px 10px;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--color-divider);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}

.speak-native-select:hover,
.speak-native-select:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

.speak-dd-trigger,
.speak-listen-toggle,
.speak-upload-link,
.speak-start-btn,
.speak-link-btn {
  pointer-events: auto;
  cursor: pointer;
}

.speak-paste-hint {
  font-size: 10px;
  color: var(--color-text-tertiary);
}

.speak-dd-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.speak-dd-row::-webkit-scrollbar { display: none; }

.speak-dd { position: relative; flex-shrink: 0; }
.speak-dd.hidden { display: none; }

.speak-dd-trigger {
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-full);
  padding: 8px 13px;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--color-divider);
  transition: transform 0.12s, background 0.12s;
}

.speak-dd-trigger:hover,
.speak-dd-trigger.open {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.speak-dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 120;
  min-width: 148px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 5px;
}

.speak-dd-menu--scroll { max-height: 300px; }

.speak-dd-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  cursor: pointer;
  color: var(--color-text);
}

.speak-dd-item:hover { background: var(--color-primary-ghost); }

.speak-dd-item.active {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
}

.speak-listen-toggle {
  flex-shrink: 0;
  align-self: flex-end;
  border: none;
  background: var(--color-surface);
  color: var(--color-text-secondary);
  border-radius: var(--radius-full);
  padding: 8px 13px;
  font-size: var(--text-xs);
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--color-divider);
  transition: background 0.12s, color 0.12s, transform 0.1s;
}

.speak-listen-toggle:active {
  transform: scale(0.97);
  background: #FEF3C7;
  color: #92400E;
  box-shadow: inset 0 0 0 2px #F59E0B;
}

.speak-listen-toggle.active {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.speak-listen-toggle.active:active {
  background: #4338CA;
  color: #fff;
  box-shadow: inset 0 0 0 2px #312E81;
}

.speak-tts-badge {
  font-size: 10px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: var(--color-divider);
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.speak-tts-badge--cloud {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-weight: 700;
}

.speak-upload-row,
.speak-role-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  margin-bottom: 4px;
  padding-top: 10px;
  border-top: 1px dashed rgba(61, 184, 138, 0.25);
  position: relative;
  z-index: 1;
}

.speak-role-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-divider);
}

.speak-upload-link {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary-dark);
  cursor: pointer;
}

.speak-link-btn {
  border: none;
  background: none;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  cursor: pointer;
  text-decoration: underline;
}

.speak-material-name {
  font-size: var(--text-xs);
  color: var(--color-text-secondary);
}

.speak-settings-col .speak-select-row {
  flex-wrap: wrap;
}

.speak-settings-col .speak-start-row {
  flex-direction: column;
  align-items: stretch;
}

.speak-settings-col .speak-topic-preset {
  flex: 1 1 auto;
  width: 100%;
}

.speak-start-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.speak-topic-preset {
  flex: 0 0 100px;
  padding: 10px 8px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-divider);
}

.speak-chat-topic-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-divider);
}

.speak-start-btn,
.speak-send-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 700;
  transition: background 0.12s, transform 0.1s;
}

#page-speak .speak-start-btn:active:not(:disabled),
#page-speak .speak-send-btn:active:not(:disabled) {
  background: linear-gradient(135deg, #EA580C 0%, #C2410C 100%);
  transform: scale(0.98);
}

#page-speak .speak-native-select:active {
  box-shadow: inset 0 0 0 2px #8B5CF6;
  background: #F5F3FF;
}

.speak-chat-messages {
  max-height: min(52vh, 520px);
  min-height: 160px;
  overflow-y: auto;
  padding: 12px 14px;
  margin: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 253, 244, 0.6) 100%);
  border: 1px solid rgba(61, 184, 138, 0.28);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 6px rgba(61, 184, 138, 0.06);
}

.speak-chat-messages:not(.speak-chat-messages--guide) {
  scroll-behavior: smooth;
}

.speak-chat-messages--guide {
  max-height: none;
  border-color: rgba(61, 184, 138, 0.4);
}

.speak-chat-welcome {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

#page-speak .sentence-ai-msg {
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
}

#page-speak .sentence-ai-msg--user {
  background: var(--color-surface);
  box-shadow: inset 0 0 0 1px var(--color-divider);
  margin-left: 12%;
}

#page-speak .sentence-ai-msg--assistant { margin-right: 8%; }

.speak-chat-en {
  margin: 0 0 6px;
  font-size: var(--text-md);
  line-height: 1.55;
  font-weight: 500;
}

.speak-chat-user {
  margin: 0;
  line-height: 1.55;
}

.lookup-selectable {
  user-select: text;
  cursor: text;
}

.speak-stage {
  padding: 18px 16px 14px;
  text-align: center;
  min-height: 220px;
  background: linear-gradient(165deg, #FFF7ED 0%, #FFEDD5 45%, #FDE68A 100%);
  border: 1px solid #FDBA74;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 2px 10px rgba(249, 115, 22, 0.08);
}

.speak-stage-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(249, 115, 22, 0.25);
}

.speak-ai-orb { flex-shrink: 0; }

#page-speak .speak-wave {
  flex: 1;
  max-width: 220px;
  margin-bottom: 0;
  height: 52px;
}

#page-speak .speak-wave span {
  width: 5px;
  background: linear-gradient(180deg, #FB923C 0%, #EA580C 100%);
  border-radius: 3px;
  opacity: 0.85;
}

#page-speak .speak-wave.recording span,
#page-speak .wave-bars.speak-wave.recording span {
  background: linear-gradient(180deg, #C084FC 0%, #9333EA 100%);
  animation: speak-wave-pulse 0.55s ease-in-out infinite alternate;
}

@keyframes speak-wave-pulse {
  from { height: 10px; opacity: 0.75; }
  to { height: 40px; opacity: 1; }
}

.speak-hint {
  font-size: var(--text-sm);
  color: #9A3412;
  margin: 0 0 6px;
}

.speak-controls--inline {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.speak-ctrl {
  border: none;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--color-divider);
  transition: background 0.12s, color 0.12s, box-shadow 0.12s, transform 0.1s;
}

.speak-ctrl:active:not(:disabled) {
  transform: scale(0.96);
  background: #EDE9FE;
  color: #5B21B6;
  box-shadow: inset 0 0 0 2px #8B5CF6;
}

.speak-ctrl--mic {
  background: #FFEDD5;
  color: #C2410C;
  box-shadow: inset 0 0 0 1px #FDBA74;
}

.speak-ctrl--mic:active:not(:disabled) {
  background: #FED7AA;
  color: #9A3412;
  box-shadow: inset 0 0 0 2px #F97316;
}

.speak-compose {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: var(--color-surface);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-md);
}

.speak-chat-text-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--color-divider);
}

#speakReplayBtn:active:not(:disabled),
#speakClearBtn:active:not(:disabled) {
  background: #DBEAFE;
  color: #1D4ED8;
  box-shadow: inset 0 0 0 2px #3B82F6;
}

.speak-ctrl--mic.recording {
  box-shadow: 0 0 0 4px rgba(147, 51, 234, 0.25);
  background: #F3E8FF;
  color: #7E22CE;
}

#page-speak .wave-bars.recording span {
  animation: speak-wave-pulse 0.55s ease-in-out infinite alternate;
}

.speak-upload-btn { cursor: pointer; }

/* 我的 · 主题选择 */
.theme-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

@media (min-width: 640px) {
  .theme-picker {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.theme-swatch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
}

.theme-swatch:hover {
  transform: translateY(-1px);
}

.theme-swatch.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.theme-swatch-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
}

.theme-swatch-name {
  font-size: 10px;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: 1.2;
}

/* 我的 · 主题选择 */