:root {
  --bg-color: #F5F5F5;
  --text-color: #000000;
  --primary: #4285F4;
  --primary-text: #FFFFFF;
  --card-bg: #FFFFFF;
  --border: #E6E6E6;
  --hint: #6B7280;
  --danger: #B00020;
}

* { box-sizing: border-box; }

/* CSS for [hidden] attribute */
[hidden] {
  display: none !important;
}
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
}

.app { min-height: 100vh; display: flex; flex-direction: column; }
.app-header { padding: 16px; text-align: center; }
.brand { font-weight: 700; font-size: 20px; }

.card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.tab {
  appearance: none; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  background: #fafafa; cursor: pointer; font-weight: 500;
}
.tab.active { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }

.panel { display: none; }
.panel.active { display: block; }

.form { display: grid; gap: 12px; }
.form-group { display: grid; gap: 6px; }
label { font-size: 14px; font-weight: 500; }
input[type="email"], input[type="password"], input[type="text"], input[type="tel"] {
  width: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px;
  font-size: 16px; background: #fff; outline: none; line-height: 1.5;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(66,133,244,0.15); }
.hint { font-size: 12px; color: var(--hint); }

.btn { width: 100%; padding: 14px 16px; border-radius: 12px; border: none; cursor: pointer; font-size: 16px; font-weight: 600; }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
.btn-secondary { background: #f0f0f0; color: #333; width: auto; font-size: 14px; font-weight: 500; }
.btn-secondary:hover { background: #e0e0e0; }
.btn-secondary:disabled { background: #f5f5f5; color: #999; cursor: not-allowed; }

/* 登录方式切换按钮 */
.login-method-switch {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.method-btn {
  background: none;
  border: none;
  color: var(--hint);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem 0;
  position: relative;
}

.method-btn.active {
  color: var(--primary);
  font-weight: 500;
}

.method-btn.active::after {
  content: '';
  position: absolute;
  bottom: -0.5rem; /* 与父容器 padding-bottom 配合 */
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

/* 按钮禁用样式 */
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.switch-tip { margin-top: 8px; font-size: 14px; text-align: center; }
.switch-tip a { color: var(--primary); text-decoration: none; font-weight: 600; }

.message { margin-top: 14px; padding: 12px; border-radius: 12px; background: #f7fafc; border: 1px solid var(--border); min-height: 20px; }
.message.error { background: #fff5f5; border-color: #fca5a5; color: var(--danger); }
.message.success { background: #f0fdf4; border-color: #86efac; color: #065f46; }

.app-footer { padding: 16px; text-align: center; color: var(--hint); }

@media (max-width: 480px) {
  .card { border-radius: 0; border-left: none; border-right: none; box-shadow: none; }
  .app-header { padding: 12px; }
}

/* 对话页模板样式追加 */

/* 顶部导航栏 */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  z-index: 10;
}
.topbar .nav-left,
.topbar .nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar .nav-center {
  font-weight: 600;
  color: #000000;
  font-size: 16px;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #E0E0E0;
  background: #FFFFFF;
  cursor: pointer;
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: #000000;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #4285F4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

/* 页面容器 */
.dialog-page {
  background: #F5F5F5;
  color: #000000;
  min-height: 100vh;
}
.dialog-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 助手消息区 */
.assistant-area {
  flex: 1;
  margin-top: 56px; /* 顶部栏高度 */
  margin-bottom: 92px; /* 底部输入栏预留 */
  overflow-y: auto;
  padding: 16px;
}
.assistant-card {
  background: #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 16px;
}
.assistant-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}
.assistant-content {
  white-space: pre-line;
  font-size: 14px;
  line-height: 1.6;
  color: #000000;
}
.assistant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.assistant-option-btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid #E0E0E0;
  background: #FFFFFF;
  color: #000000;
  font-size: 13px;
  cursor: pointer;
}
.assistant-option-btn.primary {
  border-color: #4285F4;
  background: #EAF2FF;
  color: #1A73E8;
}

/* 用户气泡（显示最近一次用户输入） */
.user-bubble {
  position: fixed;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  z-index: 1000;
}
.user-bubble .bubble {
  min-width: 120px;
  max-width: 70vw;
  padding: 10px 14px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  font-size: 14px;
  line-height: 1.4;
}
/* 录音中：红底白字 */
.user-bubble .bubble.recording {
  background-color: #E53935; /* Red 600 */
  color: #FFFFFF;
}
/* 识别中：浅绿色底黑字 */
.user-bubble .bubble.recognizing {
  background-color: #A5D6A7; /* Green 200 */
  color: #1F2937; /* Gray 800 */
}
/* 普通态（识别结果）：白底黑字 */
.user-bubble .bubble.plain {
  background-color: #FFFFFF;
  color: #111827; /* Gray 900 */
}

/* 录音按钮禁用态（确保与 .disabled 类配合） */
.record-btn.disabled,
.record-btn:disabled {
  background-color: #9CA3AF !important; /* Gray 400 */
  color: #FFFFFF !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
}
/* 底部输入栏 */
.input-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  padding: 12px 16px;
  z-index: 10;
}
.input-bar .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* 语音态布局 */
.voice-mode .left,
.voice-mode .center,
.voice-mode .right {
  display: flex;
  align-items: center;
}
.voice-mode .center {
  flex: 1;
  justify-content: center;
  gap: 12px;
}
/* 录音按钮：禁用长按选择与触控调用菜单，并设置尺寸与外观 */
.record-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #4285F4;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 14px rgba(66,133,244,0.35);
  cursor: pointer;
  border: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}
.record-btn:active {
  transform: scale(0.98);
}
.record-btn svg {
  width: 28px;
  height: 28px;
}
/* 录音按钮禁用态（播放中） */
.record-btn.disabled,
.record-btn:disabled {
  background: #A0AEC0; /* 灰色 */
  box-shadow: 0 0 0 rgba(0,0,0,0.0);
  cursor: not-allowed;
  opacity: 0.7;
}
.record-hint {
  text-align: center;
  font-size: 12px;
  color: #666666;
  margin-top: 8px;
}

/* Web lesson entry / credit modal */
.credit-modal__overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 3000;
}
.credit-modal__overlay--deep {
  background: rgba(0, 0, 0, 0.72);
}
.credit-modal {
  width: min(320px, 100%);
  border-radius: 24px;
  background: rgba(28, 28, 28, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 20px 24px;
  color: #fff;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.credit-modal--loading {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  padding: 28px 24px;
}
.credit-modal--insufficient {
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15,23,42,0.95), rgba(17,24,39,0.95));
  border-color: rgba(245, 158, 11, 0.3);
}
.credit-modal__close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
}
.credit-modal__title-row,
.credit-modal__amount-row,
.credit-modal__balance,
.credit-modal__warning-row {
  display: flex;
  align-items: center;
  justify-content: center;
}
.credit-modal__title-row {
  gap: 8px;
}
.credit-modal__title {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(90deg, #FCD34D, #F59E0B);
  -webkit-background-clip: text;
  color: transparent;
}
.credit-modal__divider {
  margin: 16px 0 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251,191,36,0.35), transparent);
}
.credit-modal__label {
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
}
.credit-modal__amount-row {
  gap: 8px;
  margin-top: 12px;
}
.credit-modal__amount {
  font-size: 56px;
  line-height: 1;
  font-weight: 700;
  background: linear-gradient(180deg, #FCD34D, #EAB308);
  -webkit-background-clip: text;
  color: transparent;
}
.credit-modal__unit {
  margin-top: 24px;
  font-size: 16px;
  font-weight: 600;
  color: rgba(251,191,36,0.85);
}
.credit-modal__balance {
  gap: 4px;
  margin-top: 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
}
.credit-modal__balance strong {
  color: rgba(255,255,255,0.9);
}
.credit-modal__primary,
.credit-modal__secondary,
.credit-modal__ghost {
  width: 100%;
  border: none;
  cursor: pointer;
  border-radius: 22px;
  font-size: 16px;
  font-weight: 600;
}
.credit-modal__primary {
  margin-top: 20px;
  height: 43px;
  color: #fff;
  background: linear-gradient(90deg, #FBBF24, #F59E0B, #60A5FA);
  box-shadow: 0 20px 30px rgba(251,191,36,0.18);
}
.credit-modal__secondary {
  margin-top: 8px;
  height: 40px;
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
}
.credit-modal__ghost {
  margin-top: 10px;
  height: 40px;
  color: #9CA3AF;
  background: transparent;
}
.credit-modal__warning-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245,158,11,0.15);
  border: 1px solid rgba(245,158,11,0.25);
}
.credit-modal__warning-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
}
.credit-modal__warning-row {
  gap: 4px;
  color: #D1D5DB;
  margin-bottom: 8px;
  font-size: 13px;
}
.credit-modal__warning-row strong {
  color: #fff;
}
.credit-modal__warning-balance {
  color: #FB923C !important;
}
.credit-modal__coin {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}
.credit-modal__spinner {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #FBBF24;
  animation: lp-spin 0.8s linear infinite;
}
.credit-modal__loading-text {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
}
@keyframes lp-spin {
  to { transform: rotate(360deg); }
}

/* Purchase page */
.purchase-page {
  background: #0B1020;
  color: #fff;
}
.purchase-shell {
  max-width: 960px;
  margin: 72px auto 24px;
  padding: 0 16px 24px;
}
.purchase-summary {
  margin-bottom: 20px;
}
.purchase-summary h1 {
  margin: 0 0 8px;
  font-size: 28px;
}
.purchase-wallet {
  color: rgba(255,255,255,0.75);
}
.purchase-products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.purchase-product-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 18px;
}
.purchase-product__name {
  font-size: 18px;
  font-weight: 700;
}
.purchase-product__credits {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 700;
  color: #FBBF24;
}
.purchase-product__price {
  margin-top: 8px;
  font-size: 18px;
}
.purchase-product__meta {
  margin-top: 6px;
  color: rgba(255,255,255,0.65);
  font-size: 13px;
}
.purchase-product__btn {
  margin-top: 14px;
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, #FBBF24, #F59E0B, #60A5FA);
}

/* 文字态布局 */
.text-mode .left { width: 36px; }
.text-mode .center { flex: 1; }
.text-mode .right { width: 72px; }
.text-input {
  width: 100%;
  height: 40px;
  border: 1px solid #E0E0E0;
  border-radius: 20px;
  padding: 0 12px;
  font-size: 14px;
}

.tts-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
}
.tts-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
}
.send-btn {
  width: 72px;
  height: 40px;
  border-radius: 20px;
  background: #4285F4;
  color: #FFFFFF;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

/* 简易响应式 */
@media (min-width: 768px) {
  .assistant-area { max-width: 640px; margin: 56px auto 92px; }
  .user-bubble { left: calc(50% - 320px + 16px); right: calc(50% - 320px + 16px); }
}
.play-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 18px;
  font-weight: 700;
  user-select: none;
  z-index: 999; /* 高于内容与输入栏 */
}
.play-overlay:focus { outline: none; }
/* 课程列表样式，参考 old 前端 */
.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding: 8px 0;
}
.assistant-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.assistant-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 8px;
}
.assistant-content {
  font-size: 14px;
  line-height: 1.5;
  color: #6b7280;
  margin-bottom: 12px;
  min-height: 40px;
}
.assistant-options {
  display: flex;
  gap: 8px;
}
.assistant-option-btn {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #374151;
  cursor: pointer;
}
.assistant-option-btn:hover {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

/* Summary Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1000;
}
.modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 90vw;
  max-width: 420px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
  z-index: 1001;
  display: grid;
  grid-template-rows: auto 1fr auto;
}
/* Modal styles moved to below */
.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 12px;
}
.summary-table th {
  background-color: #f9fafb;
  font-weight: 600;
  color: #374151;
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
  font-size: 13px;
}
.summary-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  color: #1f2937;
  font-size: 13px;
}
.modal-header {
  padding: 16px;
  border-bottom: 1px solid #e5e7eb;
  font-weight: 600;
  font-size: 18px;
  background-color: #f9fafb;
  border-radius: 12px 12px 0 0;
  color: #111827;
}
.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow: auto;
  font-size: 14px;
  background-color: #fff;
  color: #1f2937;
}
.modal-footer {
  padding: 16px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  background-color: #f9fafb;
  border-radius: 0 0 12px 12px;
}
.summary-overlay-practice {
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(7px);
}
.summary-modal-practice {
  --reward-title-from: #fbbf24;
  --reward-title-to: #9333ea;
  --reward-subtitle: #fbbf24;
  --reward-btn-from: #fbbf24;
  --reward-btn-to: #9333ea;
  --reward-btn-glow: rgba(251, 191, 36, 0.5);
  --reward-vignette: rgba(251, 191, 36, 0.12);
  left: 0;
  top: 0;
  transform: none;
  width: 100vw;
  max-width: none;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  background: transparent;
  color: #fff;
}
.summary-modal-practice::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 224, 130, 0.55) 0, rgba(255, 224, 130, 0.0) 4px),
    radial-gradient(circle at 76% 18%, rgba(251, 191, 36, 0.46) 0, rgba(251, 191, 36, 0.0) 4px),
    radial-gradient(circle at 82% 42%, rgba(255, 215, 0, 0.38) 0, rgba(255, 215, 0, 0.0) 3px),
    radial-gradient(circle at 14% 60%, rgba(255, 224, 130, 0.44) 0, rgba(255, 224, 130, 0.0) 3px),
    radial-gradient(circle at 30% 78%, rgba(255, 165, 0, 0.34) 0, rgba(255, 165, 0, 0.0) 3px),
    linear-gradient(180deg, rgba(0,0,0,0.66) 0%, rgba(0,0,0,0.76) 50%, rgba(0,0,0,0.60) 100%);
  pointer-events: none;
}
.summary-modal-practice::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, var(--reward-vignette) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
}
.summary-modal-practice.summary-modal--extend {
  --reward-title-from: #fbbf24;
  --reward-title-to: #9333ea;
  --reward-subtitle: #fbbf24;
  --reward-btn-from: #fbbf24;
  --reward-btn-to: #9333ea;
  --reward-btn-glow: rgba(251, 191, 36, 0.5);
  --reward-vignette: rgba(251, 191, 36, 0.12);
}
.summary-modal-practice.summary-modal--improvement {
  --reward-title-from: #fbbf24;
  --reward-title-to: #fb923c;
  --reward-subtitle: #fbbf24;
  --reward-btn-from: #fbbf24;
  --reward-btn-to: #fb923c;
  --reward-btn-glow: rgba(251, 146, 60, 0.5);
  --reward-vignette: rgba(251, 146, 60, 0.13);
}
.summary-modal-practice.summary-modal--normal {
  --reward-title-from: #ff9500;
  --reward-title-to: #ffd700;
  --reward-subtitle: rgba(255, 215, 0, 0.9);
  --reward-btn-from: #ff9500;
  --reward-btn-to: #ffd700;
  --reward-btn-glow: rgba(255, 215, 0, 0.5);
  --reward-vignette: rgba(255, 149, 0, 0.12);
}
.summary-modal-practice .modal-header {
  position: relative;
  z-index: 1;
  padding: 12vh 32px 0;
  border-bottom: 0;
  background: transparent;
  border-radius: 0;
  color: transparent;
  font-size: 40px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 2px;
  line-height: 1.05;
  background: linear-gradient(90deg, var(--reward-title-from), var(--reward-title-to));
  -webkit-background-clip: text;
  background-clip: text;
}
.summary-modal-practice .modal-body {
  position: relative;
  z-index: 1;
  max-height: none;
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 32px 24px;
}
.summary-modal-practice .modal-footer {
  position: relative;
  z-index: 1;
  border-top: 0;
  background: transparent;
  border-radius: 0;
  flex-direction: column-reverse;
  align-items: stretch;
  gap: 12px;
  padding: 20px 32px 4vh;
}
.summary-modal-practice .modal-footer .btn {
  width: 100%;
  max-width: 360px;
  min-height: 48px;
  margin: 0 auto;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}
.summary-modal-practice .modal-footer .btn-primary {
  border: 0;
  background: linear-gradient(90deg, var(--reward-btn-from), var(--reward-btn-to));
  box-shadow: 0 4px 16px var(--reward-btn-glow);
}
.summary-modal-practice .modal-footer .btn:not(.btn-primary) {
  background: transparent !important;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0;
}
.summary-practice-reward {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.summary-practice-reward__subtitle {
  margin-top: 12px;
  color: var(--reward-subtitle);
  font-size: 18px;
  font-weight: 400;
}
.summary-practice-reward__body {
  margin-top: 14px;
  max-width: 304px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 15.5px;
  line-height: 1.55;
}
.summary-practice-anchor {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.summary-practice-anchor--stars {
  min-height: 128px;
}
.summary-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.summary-star {
  display: inline-block;
  background: linear-gradient(180deg, #ffe082 0%, #ffb300 100%);
  border: 2px solid #ff8f00;
  clip-path: polygon(50% 0%, 62.875% 32.75%, 98.5% 36.83%, 72.92% 56.71%, 75.75% 92.12%, 50% 74.25%, 24.25% 91.75%, 27.08% 56.33%, 1.5% 36.54%, 37.125% 32.38%);
}
.summary-star--small {
  width: 64px;
  height: 64px;
}
.summary-star--medium {
  width: 68px;
  height: 68px;
}
.summary-star--large {
  width: 80px;
  height: 80px;
}
.summary-star--glow {
  box-shadow:
    0 0 11px rgba(251, 191, 36, 0.6),
    0 0 20px rgba(147, 51, 234, 0.3);
  animation: reward-star-pulse 350ms ease-out 700ms 1;
}
.summary-star--outline {
  background: transparent;
  border-color: rgba(251, 191, 36, 0.5);
}
.summary-medal {
  position: relative;
  width: 168px;
  height: 168px;
}
.summary-medal__sunburst {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    rgba(255, 213, 90, 0.35) 0deg 5deg,
    transparent 5deg 16deg
  );
  mask-image: radial-gradient(circle, transparent 0 30%, #000 30% 64%, transparent 64%);
  -webkit-mask-image: radial-gradient(circle, transparent 0 30%, #000 30% 64%, transparent 64%);
}
.summary-medal__ribbons {
  position: absolute;
  left: 41px;
  top: 84px;
  width: 86px;
  display: flex;
  justify-content: space-between;
}
.summary-medal__ribbon {
  width: 30px;
  height: 64px;
  background: linear-gradient(180deg, #ff9f1c 0%, #e0560a 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%);
  transform: rotate(-15deg);
}
.summary-medal__ribbon--right {
  transform: rotate(15deg);
}
.summary-medal__rim {
  position: absolute;
  left: 29px;
  top: 29px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: conic-gradient(#fff0b8, #ffb300, #ff8f00, #ffe082, #ffb300, #fff0b8);
  box-shadow:
    0 0 14px 3px rgba(255, 215, 0, 0.45),
    0 0 38px 9px rgba(255, 149, 0, 0.32);
}
.summary-medal__rim::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 18%, rgba(255,255,255,0.6) 0%, rgba(255,255,255,0) 48%);
}
.summary-medal__disc {
  position: absolute;
  left: 12px;
  top: 12px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 143, 0, 0.55);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0) 38%),
    linear-gradient(0deg, rgba(170,80,0,0.45) 0%, rgba(170,80,0,0) 42%),
    radial-gradient(circle at 38% 30%, #fff8dc 0%, #ffcb45 52%, #ff9e1b 100%);
}
.summary-medal__star {
  position: absolute;
  left: 19px;
  top: 19px;
  width: 48px;
  height: 48px;
  clip-path: polygon(50% 0%, 62.875% 32.75%, 98.5% 36.83%, 72.92% 56.71%, 75.75% 92.12%, 50% 74.25%, 24.25% 91.75%, 27.08% 56.33%, 1.5% 36.54%, 37.125% 32.38%);
  background: linear-gradient(180deg, #ffffff 0%, #fff0b0 50%, #ffd24a 100%);
  border: 1px solid rgba(255, 143, 0, 0.55);
}
.summary-medal__spark {
  position: absolute;
  width: 14px;
  height: 14px;
  clip-path: polygon(50% 0%, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0% 50%, 42% 42%);
  background: #fff1b8;
  filter: drop-shadow(0 0 6px rgba(255,215,0,0.8));
  animation: reward-sparkle 1800ms ease-in-out infinite;
}
.summary-medal__spark--1 { left: 20px; top: 28px; width: 16px; height: 16px; animation-delay: 0ms; }
.summary-medal__spark--2 { left: 134px; top: 40px; width: 12px; height: 12px; animation-delay: 600ms; }
.summary-medal__spark--3 { left: 128px; top: 108px; width: 14px; height: 14px; animation-delay: 1100ms; }
.summary-medal__spark--4 { left: 26px; top: 104px; width: 10px; height: 10px; animation-delay: 1500ms; }
@keyframes reward-star-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes reward-sparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.6); }
  50% { opacity: 1; transform: scale(1.2); }
}
.summary-overlay-lesson {
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(7px);
}
.summary-modal-lesson {
  --reward-btn-from: #ff9500;
  --reward-btn-to: #ffd700;
  --reward-btn-glow: rgba(255, 215, 0, 0.5);
  --reward-vignette: rgba(255, 215, 0, 0.12);
  left: 0;
  top: 0;
  transform: none;
  width: 100vw;
  max-width: none;
  height: 100vh;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  background: transparent;
  color: #fff;
}
.summary-modal-lesson::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 224, 130, 0.55) 0, rgba(255, 224, 130, 0.0) 4px),
    radial-gradient(circle at 76% 18%, rgba(251, 191, 36, 0.46) 0, rgba(251, 191, 36, 0.0) 4px),
    radial-gradient(circle at 82% 42%, rgba(255, 215, 0, 0.38) 0, rgba(255, 215, 0, 0.0) 3px),
    radial-gradient(circle at 14% 60%, rgba(255, 224, 130, 0.44) 0, rgba(255, 224, 130, 0.0) 3px),
    radial-gradient(circle at 30% 78%, rgba(255, 165, 0, 0.34) 0, rgba(255, 165, 0, 0.0) 3px),
    linear-gradient(180deg, rgba(0,0,0,0.66) 0%, rgba(0,0,0,0.76) 50%, rgba(0,0,0,0.60) 100%);
  pointer-events: none;
}
.summary-modal-lesson::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, var(--reward-vignette) 0%, rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
}
.summary-modal-lesson .modal-header {
  position: relative;
  z-index: 1;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.summary-modal-lesson .modal-body {
  position: relative;
  z-index: 1;
  max-height: none;
  padding: 4vh 24px 18px;
  background: transparent;
  color: #fff;
  overflow: hidden;
}
.summary-modal-lesson .modal-footer {
  position: relative;
  z-index: 1;
  border-top: 0;
  background: transparent;
  border-radius: 0;
  justify-content: center;
  padding: 16px 24px 4vh;
}
.summary-modal-lesson .modal-footer .btn {
  width: 100%;
  max-width: 360px;
  min-height: 48px;
  margin: 0 auto;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}
.summary-modal-lesson .modal-footer .btn-primary {
  border: 0;
  background: linear-gradient(90deg, var(--reward-btn-from), var(--reward-btn-to));
  box-shadow: 0 4px 16px var(--reward-btn-glow);
}
.summary-lesson-reward {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.summary-lesson-anchor {
  margin-top: 2vh;
  min-height: 176px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.summary-trophy {
  position: relative;
  width: 168px;
  height: 168px;
  animation: reward-trophy-entry 500ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.summary-trophy__sunburst {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-conic-gradient(
    rgba(255, 213, 90, 0.32) 0deg 5deg,
    transparent 5deg 16deg
  );
  mask-image: radial-gradient(circle, transparent 0 26%, #000 26% 62%, transparent 62%);
  -webkit-mask-image: radial-gradient(circle, transparent 0 26%, #000 26% 62%, transparent 62%);
  animation: reward-sunburst-spin 24s linear infinite;
}
.summary-trophy__halo {
  position: absolute;
  left: 24px;
  top: 24px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.32) 0%, rgba(255, 215, 0, 0) 70%);
}
.summary-trophy__cup {
  position: absolute;
  left: 26px;
  top: 20px;
  width: 116px;
  height: 128px;
}
.summary-trophy__handle {
  position: absolute;
  top: 15px;
  width: 24px;
  height: 36px;
  border: 6px solid #ffd24a;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  border-bottom-color: transparent;
  background: transparent;
}
.summary-trophy__handle--left {
  left: 0;
  border-right-color: transparent;
  transform: rotate(-8deg);
}
.summary-trophy__handle--right {
  right: 0;
  border-left-color: transparent;
  transform: rotate(8deg);
}
.summary-trophy__bowl {
  position: absolute;
  left: 20px;
  top: 0;
  width: 76px;
  height: 72px;
  border-radius: 0 0 38px 38px;
  background: linear-gradient(180deg, #fff3c4 0%, #ffd24a 45%, #ff9500 100%);
  clip-path: polygon(0% 0%, 100% 0%, 100% 35%, 96% 54%, 89% 72%, 78% 87%, 64% 98%, 50% 100%, 36% 98%, 22% 87%, 11% 72%, 4% 54%, 0% 35%);
  border: 1px solid rgba(255, 143, 0, 0.5);
}
.summary-trophy__rim-highlight {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.5);
}
.summary-trophy__gloss {
  position: absolute;
  left: 10px;
  top: 10px;
  width: 18px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.34) 0%, rgba(255,255,255,0) 100%);
  transform: rotate(-12deg);
}
.summary-trophy__emblem {
  position: absolute;
  left: 26px;
  top: 22px;
  width: 24px;
  height: 24px;
  clip-path: polygon(50% 0%, 62.875% 32.75%, 98.5% 36.83%, 72.92% 56.71%, 75.75% 92.12%, 50% 74.25%, 24.25% 91.75%, 27.08% 56.33%, 1.5% 36.54%, 37.125% 32.38%);
  background: #fffdf2;
  border: 1px solid rgba(255, 143, 0, 0.45);
}
.summary-trophy__stem {
  position: absolute;
  left: 53px;
  top: 72px;
  width: 10px;
  height: 14px;
  background: linear-gradient(180deg, #ffd24a 0%, #e0780a 100%);
}
.summary-trophy__base {
  position: absolute;
  left: 0;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffd24a 0%, #e0780a 100%);
}
.summary-trophy__base--mid {
  left: 44px;
  top: 86px;
  width: 28px;
  height: 7px;
}
.summary-trophy__base--bottom {
  left: 36px;
  top: 94px;
  width: 44px;
  height: 9px;
}
.summary-trophy__spark {
  position: absolute;
  width: 14px;
  height: 14px;
  clip-path: polygon(50% 0%, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0% 50%, 42% 42%);
  background: #fff1b8;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
  animation: reward-sparkle 1800ms ease-in-out infinite;
}
.summary-trophy__spark--1 { left: 22px; top: 26px; width: 15px; height: 15px; animation-delay: 0ms; }
.summary-trophy__spark--2 { left: 132px; top: 36px; width: 12px; height: 12px; animation-delay: 600ms; }
.summary-trophy__spark--3 { left: 128px; top: 96px; width: 13px; height: 13px; animation-delay: 1100ms; }
.summary-trophy__spark--4 { left: 24px; top: 92px; width: 10px; height: 10px; animation-delay: 1500ms; }
.summary-lesson-cloud {
  width: min(100%, 620px);
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.summary-lesson-cloud__header {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  animation: reward-cloud-header-fade 260ms ease-out 640ms forwards;
}
.summary-lesson-cloud__line {
  width: 34px;
  height: 1px;
}
.summary-lesson-cloud__line--left {
  background: linear-gradient(90deg, rgba(147, 51, 234, 0), rgba(147, 51, 234, 0.7));
}
.summary-lesson-cloud__line--right {
  background: linear-gradient(90deg, rgba(217, 119, 6, 0.7), rgba(217, 119, 6, 0));
}
.summary-lesson-cloud__title {
  background: linear-gradient(90deg, #9333ea, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 15px;
  font-weight: 700;
}
.summary-lesson-cloud__hint {
  margin-top: 6px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  opacity: 0;
  animation: reward-cloud-header-fade 260ms ease-out 700ms forwards;
}
.summary-lesson-cloud__fade {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 14px;
}
.summary-lesson-cloud__fade::before,
.summary-lesson-cloud__fade::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  z-index: 2;
  pointer-events: none;
}
.summary-lesson-cloud__fade::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}
.summary-lesson-cloud__fade::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
}
.summary-lesson-cloud__scroll {
  height: 100%;
  overflow: auto;
  padding: 8px 2px 10px;
}
.summary-lesson-cloud__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 10px;
}
.summary-mastery-chip {
  --drift-x: 3px;
  --drift-y: -5px;
  --chip-drift-duration: 3600ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 7px 5px;
  max-width: 280px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid rgba(255, 213, 90, 0.4);
  box-shadow: 0 0 12px rgba(255, 200, 60, 0.14);
  opacity: 0;
  transform: translateY(12px) scale(0.9);
  animation:
    reward-chip-entry 340ms ease-out calc(700ms + var(--chip-index) * 40ms) forwards,
    reward-chip-drift var(--chip-drift-duration) ease-in-out calc(1040ms + var(--chip-index) * 40ms) infinite alternate;
}
.summary-mastery-chip:nth-child(2n) {
  --drift-x: -3px;
  --chip-drift-duration: 3920ms;
}
.summary-mastery-chip:nth-child(3n) {
  --drift-y: -7px;
  --chip-drift-duration: 4240ms;
}
.summary-mastery-chip:nth-child(5n) {
  --chip-drift-duration: 4560ms;
}
.summary-mastery-chip--word {
  background: linear-gradient(180deg, rgba(255,255,255,0.13) 0%, rgba(255,255,255,0.05) 100%);
}
.summary-mastery-chip--phrase {
  padding: 9px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.07) 100%);
}
.summary-mastery-chip__text {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.2px;
  color: #ffe9a8;
}
.summary-mastery-chip--phrase .summary-mastery-chip__text {
  font-size: 16px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.94);
}
.summary-mastery-chip__count {
  color: rgba(255, 206, 92, 0.78);
  font-size: 12.5px;
  font-weight: 700;
}
.summary-lesson-empty {
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  text-align: center;
}
@keyframes reward-trophy-entry {
  0% { transform: scale(0.6) rotate(360deg); }
  65% { transform: scale(1.05) rotate(80deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@keyframes reward-sunburst-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes reward-cloud-header-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes reward-chip-entry {
  from { opacity: 0; transform: translateY(12px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes reward-chip-drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(var(--drift-x), var(--drift-y)) scale(1); }
}
@media (min-width: 768px) {
  .summary-modal-lesson .modal-body {
    padding: 6vh 48px 22px;
  }
  .summary-modal-lesson .modal-footer {
    padding: 18px 48px 6vh;
  }
}
.assistant-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: block;
  margin: 0 auto 12px auto; /* 顶部居中并与内容留白 */
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

/* 设置页：开关控件 */
.setting-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; display: inline-block; width: 52px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; cursor: pointer; background: #ddd; border-radius: 999px; transition: background 0.2s; }
.switch .slider:before { content: ""; position: absolute; height: 24px; width: 24px; left: 2px; top: 2px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.2); transition: transform 0.2s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(24px); }

/* 顶部进度条 */
.practice-progress {
  position: fixed;
  top: 56px; /* Below topbar */
  left: 0;
  right: 0;
  background: #FFFFFF;
  padding: 8px 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.practice-progress .progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #666;
}
.practice-progress .progress-bar-bg {
  height: 4px;
  background: #E0E0E0;
  border-radius: 2px;
  overflow: hidden;
}
.practice-progress .progress-bar-fill {
  height: 100%;
  background: #4285F4;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.onboarding-page {
  background: #1a1a2e;
  min-height: 100vh;
}
.onboarding-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}
.onboarding-overlay-card {
  width: 100%;
  max-width: 360px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.24);
  padding: 18px 16px;
  text-align: center;
}
.onboarding-overlay-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}
.onboarding-overlay-desc {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.5;
  margin-bottom: 14px;
}
.onboarding-overlay-btn {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  background: #4285f4;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.onboarding-overlay-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.onboarding-card {
  width: 100%;
  max-width: 420px;
  border-radius: 24px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.onboarding-header {
  background: linear-gradient(135deg, #4285f4, #7b1fa2);
  color: #ffffff;
  padding: 20px 16px;
  text-align: center;
}
.onboarding-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.onboarding-header p {
  margin: 6px 0 0 0;
  font-size: 13px;
  opacity: 0.9;
}
.onboarding-content {
  background: #f0f4f8;
  padding: 22px 18px;
}
.onboarding-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}
.onboarding-pip {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: #e2e8f0;
}
.onboarding-pip.active {
  background: #4285f4;
}
.onboarding-text {
  min-height: 72px;
  line-height: 2;
  font-size: 16px;
  font-weight: 500;
  color: #718096;
  margin-bottom: 16px;
  word-break: break-word;
  white-space: pre-wrap;
}
.onboarding-char {
  transition: color 0.12s ease, background-color 0.1s ease;
}
.onboarding-char.read {
  color: #1a202c;
  font-weight: 600;
}
.onboarding-char.current {
  color: #4285f4;
  font-weight: 700;
  background: rgba(66, 133, 244, 0.16);
  border-radius: 3px;
}
.onboarding-video-wrap {
  border-radius: 18px;
  overflow: hidden;
  background: #0f172a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  margin-bottom: 18px;
}
.onboarding-video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  background: #111827;
}
.onboarding-question {
  margin-bottom: 14px;
  font-size: 22px;
  line-height: 1.4;
  font-weight: 700;
  text-align: center;
  color: #1a202c;
}
.onboarding-options {
  display: grid;
  gap: 10px;
}
.onboarding-options.cols-1 {
  grid-template-columns: 1fr;
}
.onboarding-options.cols-2 {
  grid-template-columns: 1fr 1fr;
}
.onboarding-option {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  padding: 16px 14px;
  font-size: 15px;
  font-weight: 500;
  color: #1a202c;
  cursor: pointer;
  transition: all 0.2s ease;
}
.onboarding-option:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
  transform: translateY(-1px);
}
.onboarding-option.is-submitting {
  pointer-events: none;
  opacity: 0.75;
}
.onboarding-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  flex-shrink: 0;
}
.onboarding-option.selected {
  border-color: #4285f4;
  background: #eef6ff;
}
.onboarding-option.selected .onboarding-dot {
  border-color: #4285f4;
  background: radial-gradient(circle at center, #ffffff 0 28%, #4285f4 30% 100%);
}

/* ─── icon_detail_button ─────────────────────────────── */
.onboarding-option.icon-detail-btn {
  border-width: 2px;
  border-style: solid;
  flex-direction: row;
  align-items: center;
  padding: 14px 16px;
}
.onboarding-option.icon-detail-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.ob-icon {
  font-size: 28px;
  flex-shrink: 0;
  margin-right: 14px;
  line-height: 1;
}
.ob-texts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
}
.ob-main {
  font-size: 16px;
  font-weight: 600;
  color: #1a202c;
  line-height: 1.3;
}
.ob-sub {
  font-size: 13px;
  color: #64748b;
  line-height: 1.3;
}
.onboarding-option.icon-detail-btn.selected {
  border-color: #4285f4 !important;
  background: rgba(66, 133, 244, 0.12) !important;
}

/* planning level icon_detail_btn */
.planning-level-btn.icon-detail-btn {
  flex-direction: row;
  align-items: center;
  border-width: 2px;
  border-style: solid;
}
.planning-level-btn.icon-detail-btn:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.onboarding-continue {
  width: 100%;
  margin-top: 4px;
  border: 0;
  border-radius: 14px;
  background: #4285f4;
  color: #ffffff;
  font-size: 16px;
  font-weight: 700;
  padding: 15px 16px;
  cursor: pointer;
}
.onboarding-continue:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.onboarding-content .message {
  margin-top: 14px;
  min-height: 0;
}

/* ─── V3 onboarding：连续进度条 ────────────────────────── */
.onboarding-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: #e8eaf0;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}
.onboarding-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #4285f4 0%, #34a853 100%);
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ─── V3 onboarding：route_select 选路线 ────────────────────────── */
.onboarding-options.route-select .route-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 16px;
  border-width: 2px;
  border-style: solid;
  text-align: left;
}
.onboarding-options.route-select .route-card .route-emoji {
  font-size: 36px;
  line-height: 1;
  flex-shrink: 0;
}
.onboarding-options.route-select .route-card .route-texts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.onboarding-options.route-select .route-card .route-title {
  font-size: 17px;
  font-weight: 600;
  color: #1a202c;
}
.onboarding-options.route-select .route-card .route-desc {
  font-size: 13px;
  color: #64748b;
}
.onboarding-options.route-select .route-card.theme-amber {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}
.onboarding-options.route-select .route-card.theme-amber:hover {
  background: rgba(251, 191, 36, 0.16);
}
.onboarding-options.route-select .route-card.theme-purple {
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.08);
}
.onboarding-options.route-select .route-card.theme-purple:hover {
  background: rgba(167, 139, 250, 0.16);
}

/* ─── V3 onboarding：level_select 选难度 L1/L2/L3 ────────────────────────── */
.onboarding-options.level-select .level-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 16px;
  border-width: 2px;
  border-style: solid;
  text-align: left;
}
.onboarding-options.level-select .level-badge {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.onboarding-options.level-select .level-texts {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.onboarding-options.level-select .level-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a202c;
}
.onboarding-options.level-select .level-ref {
  font-size: 13px;
  color: #64748b;
  font-style: italic;
}
.onboarding-options.level-select .level-card.theme-purple .level-badge { background: #8b5cf6; }
.onboarding-options.level-select .level-card.theme-purple { border-color: #a78bfa; background: rgba(167, 139, 250, 0.06); }
.onboarding-options.level-select .level-card.theme-amber .level-badge { background: #f59e0b; }
.onboarding-options.level-select .level-card.theme-amber { border-color: #fbbf24; background: rgba(251, 191, 36, 0.06); }
.onboarding-options.level-select .level-card.theme-green .level-badge { background: #10b981; }
.onboarding-options.level-select .level-card.theme-green { border-color: #34d399; background: rgba(52, 211, 153, 0.06); }

/* ─── V3 onboarding：recognize_textbook 拍照入口 ────────────────────────── */
.onboarding-options.recognize-textbook {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.onboarding-options.recognize-textbook .photo-card.primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px;
  width: 100%;
  border: 2px solid #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  text-align: center;
}
.onboarding-options.recognize-textbook .photo-card.primary:hover {
  background: rgba(251, 191, 36, 0.16);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(251, 191, 36, 0.2);
}
.onboarding-options.recognize-textbook .photo-camera-icon {
  font-size: 48px;
  line-height: 1;
}
.onboarding-options.recognize-textbook .photo-texts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.onboarding-options.recognize-textbook .photo-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a202c;
}
.onboarding-options.recognize-textbook .photo-desc {
  font-size: 13px;
  color: #64748b;
}
.onboarding-options.recognize-textbook .manual-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  text-decoration: underline;
}
.onboarding-options.recognize-textbook .manual-link:hover {
  color: #4285f4;
}

/* ─── V3 onboarding：识别确认弹窗 ────────────────────────── */
.onboarding-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.onboarding-confirm-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  max-width: 340px;
  width: calc(100% - 40px);
  text-align: center;
}
.onboarding-confirm-card .confirm-title {
  font-size: 18px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 10px;
}
.onboarding-confirm-card .confirm-desc {
  font-size: 15px;
  color: #475569;
  margin-bottom: 20px;
}
.onboarding-confirm-card .confirm-actions {
  display: flex;
  gap: 10px;
}
.onboarding-confirm-card .confirm-cancel,
.onboarding-confirm-card .confirm-ok {
  flex: 1;
  padding: 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #e2e8f0;
}
.onboarding-confirm-card .confirm-cancel {
  background: #f8fafc;
  color: #64748b;
}
.onboarding-confirm-card .confirm-ok {
  background: #4285f4;
  color: #fff;
  border-color: #4285f4;
}

/* ─── Planning Page ─────────────────────────────────────────── */
.planning-page {
  background: #1a1a2e;
  min-height: 100vh;
}

.planning-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.planning-overlay-card {
  background: #fff;
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  max-width: 320px;
  width: 90%;
}
.planning-overlay-title {
  font-size: 20px;
  font-weight: 700;
  color: #1a202c;
  margin-bottom: 8px;
}
.planning-overlay-desc {
  font-size: 14px;
  color: #718096;
  margin-bottom: 20px;
  line-height: 1.5;
}
.planning-overlay-btn {
  background: #4285f4;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}
.planning-overlay-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.planning-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px 16px;
}

.planning-card {
  background: #fff;
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.planning-header {
  background: linear-gradient(135deg, #1A202C, #2D3748);
  padding: 32px 24px 24px;
  text-align: center;
}
.planning-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}
.planning-header p {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  margin: 0;
}

.planning-content {
  padding: 20px 20px 28px;
}

.planning-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.planning-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #f7f7f7;
  border: 1px solid #e6e6e6;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a202c;
  transition: background 0.15s;
}
.planning-back-btn:hover {
  background: #eeeeee;
}
.planning-topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a202c;
}

/* typewriter text area */
.ob-text {
  min-height: 56px;
  font-size: 15px;
  line-height: 1.6;
  color: #2d3748;
  margin-bottom: 16px;
  word-break: break-word;
}
.ob-text .onboarding-char {
  display: inline;
}
.ob-text .onboarding-char.current {
  color: #1a202c;
  font-weight: 500;
}
.ob-text .onboarding-char.read {
  color: #a0aec0;
}

/* level select grid */
.planning-level-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}
.planning-level-grid.cols-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.planning-level-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: #f7f7f7;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  width: 100%;
}
.planning-level-btn:hover:not(:disabled) {
  background: #eee;
  border-color: #c0c0c0;
}
.planning-level-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}
.planning-level-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #4285f4;
  flex-shrink: 0;
}
.planning-level-text {
  font-size: 15px;
  font-weight: 500;
  color: #1a202c;
}

/* lesson list section */
.planning-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.planning-section-label {
  font-size: 15px;
  font-weight: 700;
  color: #1a202c;
}
.planning-section-hint {
  font-size: 12px;
  color: #a0aec0;
}

/* horizontal scroll lesson cards */
.pl-lessons-scroll {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  gap: 12px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.pl-lessons-scroll::-webkit-scrollbar {
  height: 4px;
}
.pl-lessons-scroll::-webkit-scrollbar-track {
  background: #f0f0f0;
  border-radius: 2px;
}
.pl-lessons-scroll::-webkit-scrollbar-thumb {
  background: #c0c0c0;
  border-radius: 2px;
}

.pl-lesson-card {
  width: 160px;
  flex-shrink: 0;
  scroll-snap-align: start;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border: 1px solid #e6e6e6;
  transition: transform 0.15s, box-shadow 0.15s;
}
.pl-lesson-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.pl-lesson-cover {
  width: 100%;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  overflow: hidden;
}
.pl-lesson-cover.done {
  background: linear-gradient(135deg, #48bb78, #38a169);
}
.pl-lesson-cover.current {
  background: linear-gradient(135deg, #9f7aea, #805ad5);
}
.pl-lesson-cover.pending {
  background: linear-gradient(135deg, #cbd5e0, #a0aec0);
}
.pl-lesson-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pl-lesson-info {
  padding: 10px 12px 12px;
}
.pl-lesson-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a202c;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-lesson-desc {
  font-size: 11px;
  color: #718096;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-progress-bar {
  height: 4px;
  background: #edf2f7;
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}
.pl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #9f7aea, #805ad5);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.pl-lesson-status {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
  padding: 3px 0;
}
.pl-lesson-status.status-done {
  color: #276749;
  background: #c6f6d5;
}
.pl-lesson-status.status-current {
  color: #553c9a;
  background: #e9d8fd;
}
.pl-lesson-status.status-pending {
  color: #4a5568;
  background: #edf2f7;
}

/* advance message */
.planning-advance-msg {
  text-align: center;
  font-size: 14px;
  color: #4a5568;
  padding: 10px 0;
  margin-top: 8px;
}
.planning-advance-msg.all-complete {
  font-size: 18px;
  font-weight: 700;
  color: #276749;
  padding: 16px 0;
}

/* message area */
.planning-content .message {
  margin-top: 12px;
}
