/* ============================================================
   御梦有道 · Web 课程学习页
   移动端优先设计 · 还原微信小程序《御梦有道》视觉
   亮色主题：水彩蓝花卉背景（登录 / 御梦之境 / 我的）
   暗色主题：墨色渐变（课程 / 播放 / 统计 / 测试）
   ============================================================ */

:root {
  /* 主题色 */
  --ink-1: #1a1a1a;
  --ink-2: #2d2d2d;
  --card-dark: rgba(58, 58, 58, 0.95);
  --line-dark: rgba(255, 255, 255, 0.1);
  --text-dark-1: #ffffff;
  --text-dark-2: #cccccc;
  --text-dark-3: #999999;

  --indigo: #3a4a6b;          /* 亮色页主文字 */
  --indigo-deep: #2c3a57;
  --gold: #c9a86a;            /* 古风点缀金 */
  --gold-deep: #a8854a;

  --blue: #2196f3;
  --orange: #ff9800;
  --green: #4caf50;
  --red: #e57373;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);

  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --brush: "Ma Shan Zheng", "STKaiti", "KaiTi", "楷体", cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: var(--sans);
  background: #101216;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100dvh;
  color: var(--text-dark-1);
  overflow: hidden;
}

/* ---------- 手机壳 ---------- */
.phone-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}

@media (min-width: 520px) {
  body { background: radial-gradient(1200px 800px at 50% 20%, #1c2230 0%, #0b0d12 70%); }
  .phone-shell {
    height: min(92dvh, 900px);
    border-radius: 36px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 10px rgba(255, 255, 255, 0.03);
  }
}

.app-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-container::-webkit-scrollbar { display: none; }

/* ---------- 通用页面骨架 ---------- */
.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  animation: pageIn 0.35s ease;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 亮色水彩页 ---------- */
.page-light {
  position: relative;
  background: #dce7f5 url("../assets/background.jpeg") center / cover no-repeat fixed;
  color: var(--indigo);
}
.page-light::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(234, 242, 250, 0.55) 0%, rgba(214, 228, 244, 0.35) 45%, rgba(190, 208, 232, 0.55) 100%);
  pointer-events: none;
}
.page-light > * { position: relative; z-index: 1; }

/* ---------- 暗色墨页 ---------- */
.page-dark {
  background: linear-gradient(135deg, var(--ink-2) 0%, var(--ink-1) 100%);
  color: var(--text-dark-1);
  padding: 16px 16px 40px;
}

/* ============================================================
   组件
   ============================================================ */

/* 顶部导航 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 14px 2px;
  margin-bottom: 8px;
}
.navbar-wrap { flex-wrap: wrap; }
.navbar-wrap .navbar-title { flex: 1 1 100%; margin-bottom: 10px; }
.navbar-title {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  flex: 1;
  min-width: 0;
}
.navbar-right { display: flex; gap: 8px; flex-shrink: 0; }

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12px;
  color: #fff;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
  font-family: var(--sans);
}
.nav-btn:active { background: rgba(255, 255, 255, 0.28); transform: scale(0.94); }

/* 返回按钮（暗色内页） */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  cursor: pointer;
}
.back-btn:active { background: rgba(255, 255, 255, 0.25); }

.page-title-center {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
}

/* 统计概览卡 */
.stats-overview {
  display: flex;
  justify-content: space-around;
  background: var(--card-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 18px 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.stat-item { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 64px; }
.stat-value { font-size: 22px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--text-dark-2); }

/* 课程列表 */
.course-list { display: flex; flex-direction: column; gap: 14px; }

.course-item {
  background: var(--card-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
  cursor: pointer;
}
.course-item:active { transform: scale(0.985); }

.course-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.course-title {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  line-height: 1.45;
  flex: 1;
  min-width: 0;
}
.course-tag {
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.course-tag.not-started { background: rgba(33, 150, 243, 0.8); border-color: rgba(33, 150, 243, 0.5); color: #fff; }
.course-tag.in-progress { background: rgba(255, 152, 0, 0.8); border-color: rgba(255, 152, 0, 0.5); color: #fff; }
.course-tag.completed   { background: rgba(76, 175, 80, 0.8); border-color: rgba(76, 175, 80, 0.5); color: #fff; }
.course-tag.basic       { background: rgba(76, 175, 80, 0.2); border-color: rgba(76, 175, 80, 0.3); color: #81c784; }

.course-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-dark-3); margin-bottom: 12px; }

/* 课程进度条 */
.course-progress { margin-bottom: 12px; }
.mini-bar { height: 5px; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.mini-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--orange), #ffb74d);
  transition: width 0.4s ease;
}
.mini-bar-fill.done { background: linear-gradient(90deg, #66bb6a, var(--green)); }

.action-buttons { display: flex; justify-content: flex-end; }

.btn-continue {
  border: none;
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #5b6ee1, #7c5be1);
  box-shadow: 0 4px 14px rgba(91, 110, 225, 0.4);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
  font-family: var(--sans);
}
.btn-continue:active { transform: scale(0.95); }
.btn-continue.in-progress { background: linear-gradient(135deg, #ffa726, #fb8c00); box-shadow: 0 4px 14px rgba(255, 152, 0, 0.35); }
.btn-continue.completed { background: linear-gradient(135deg, #66bb6a, #43a047); box-shadow: 0 4px 14px rgba(76, 175, 80, 0.35); }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 44px; margin-bottom: 14px; }
.empty-text { font-size: 16px; color: var(--text-dark-2); margin-bottom: 8px; }
.empty-subtext, .empty-desc { font-size: 13px; color: var(--text-dark-3); }

/* 加载 */
.loading-container { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 90px 0; gap: 14px; }
.loading-spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.page-light .loading-spinner { border-color: rgba(58, 74, 107, 0.25); border-top-color: var(--indigo); }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 13px; color: var(--text-dark-2); }
.page-light .loading-text { color: var(--indigo); }

/* ============================================================
   登录页（亮色）
   ============================================================ */
.login-page { justify-content: center; padding: 32px 28px 48px; }

.brand { text-align: center; margin-bottom: 44px; }
.brand-moon {
  width: 74px; height: 74px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fdfbf4 0%, #f0e6cd 45%, #d9c69a 100%);
  box-shadow: 0 0 34px rgba(233, 220, 180, 0.85), inset -6px -8px 18px rgba(160, 140, 90, 0.35);
  position: relative;
}
.brand-moon::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 68% 30%, rgba(255,255,255,0.9) 0%, transparent 28%);
  opacity: 0.7;
}
.brand-title {
  font-family: var(--brush);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 3px;
  text-indent: 3px;
  white-space: nowrap;
  color: var(--indigo-deep);
  margin-bottom: 10px;
}
.brand-subtitle {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(58, 74, 107, 0.72);
}

.login-card {
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 20px;
  padding: 26px 22px;
  box-shadow: 0 12px 40px rgba(58, 74, 107, 0.18);
}
.login-card-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--indigo-deep);
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 6px;
}
.login-card-desc { font-size: 12px; color: rgba(58, 74, 107, 0.65); text-align: center; margin-bottom: 20px; }

.login-tip {
  font-size: 12px;
  line-height: 1.7;
  color: #7a5b1e;
  background: rgba(255, 239, 204, 0.75);
  border: 1px solid rgba(214, 178, 102, 0.55);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 18px;
  text-align: center;
}

.input-group { margin-bottom: 16px; }
.input-label { display: block; font-size: 13px; font-weight: 600; color: var(--indigo); margin-bottom: 8px; letter-spacing: 1px; }
.input-field {
  width: 100%;
  border: 1.5px solid rgba(58, 74, 107, 0.25);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 12px;
  padding: 13px 14px;
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--indigo-deep);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
  font-family: var(--sans);
}
.input-field::placeholder { color: rgba(58, 74, 107, 0.35); letter-spacing: 1px; }
.input-field:focus { border-color: var(--indigo); box-shadow: 0 0 0 3px rgba(58, 74, 107, 0.12); }
.input-field.input-error { border-color: #d84343; }
.error-text { font-size: 12px; color: #d84343; margin-top: 6px; }
.input-hint { font-size: 11px; color: rgba(58, 74, 107, 0.5); margin-top: 6px; }

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 4px;
  text-indent: 4px;
  color: #fdfbf4;
  background: linear-gradient(135deg, #5a6d99, #3a4a6b);
  box-shadow: 0 8px 22px rgba(58, 74, 107, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
  font-family: var(--sans);
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary.btn-disabled { opacity: 0.45; pointer-events: none; }

.login-footnote { text-align: center; font-size: 11px; color: rgba(58, 74, 107, 0.55); margin-top: 22px; letter-spacing: 1px; }

/* ============================================================
   御梦之境（亮色 hub）
   ============================================================ */
.hub-page { padding: 0 0 40px; }

.title-container { text-align: center; padding: 64px 24px 20px; }
.main-title {
  display: block;
  font-family: var(--brush);
  font-size: 26px;
  font-weight: 400;
  letter-spacing: 3px;
  text-indent: 3px;
  white-space: nowrap;
  color: var(--indigo-deep);
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.8);
  margin-bottom: 14px;
}
.subtitle {
  display: block;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 3px;
  color: rgba(58, 74, 107, 0.75);
}

/* 星与月装饰 */
.decoration-moon {
  position: absolute;
  top: 52px; right: 40px;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #fdfbf4 0%, #efe4c8 50%, #dcc79c 100%);
  box-shadow: 0 0 26px rgba(240, 226, 185, 0.9);
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.decoration-stars { position: absolute; inset: 0; pointer-events: none; }
.star {
  position: absolute;
  width: 5px; height: 5px;
  background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0) 70%);
  border-radius: 50%;
  animation: twinkle 2.6s ease-in-out infinite;
}
.star-1 { top: 18%; left: 12%; }
.star-2 { top: 26%; left: 78%; animation-delay: 0.4s; }
.star-3 { top: 38%; left: 30%; animation-delay: 0.8s; }
.star-4 { top: 12%; left: 55%; animation-delay: 1.2s; }
.star-5 { top: 44%; left: 86%; animation-delay: 1.6s; }
.star-6 { top: 33%; left: 60%; animation-delay: 2s; }
.star-7 { top: 50%; left: 8%; animation-delay: 0.6s; }
.star-8 { top: 20%; left: 34%; animation-delay: 1.4s; }
@keyframes twinkle { 0%,100% { opacity: 0.15; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }

.button-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 30px 24px 0;
}
.yumeng-button {
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.55));
  backdrop-filter: blur(12px);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: 0 10px 30px rgba(58, 74, 107, 0.16);
  cursor: pointer;
  transition: transform 0.15s ease;
  text-align: left;
  font-family: var(--sans);
}
.yumeng-button:active { transform: scale(0.97); }
.button-icon {
  width: 46px; height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  border-radius: 14px;
  margin-right: 16px;
  color: #fff;
}
.dream-analysis-button .button-icon { background: linear-gradient(135deg, #7ba7d9, #4a6fa5); }
.sleep-practice-button .button-icon { background: linear-gradient(135deg, #9a8fd9, #6a5ba5); }
.tutorial-button .button-icon { background: linear-gradient(135deg, #d9b57b, #a5804a); }
.button-text-group { flex: 1; min-width: 0; }
.button-title { display: block; font-size: 17px; font-weight: 700; color: var(--indigo-deep); letter-spacing: 2px; margin-bottom: 4px; }
.button-desc { display: block; font-size: 12px; color: rgba(58, 74, 107, 0.65); letter-spacing: 1px; }
.button-arrow { color: rgba(58, 74, 107, 0.4); font-size: 18px; }

/* 权限不足提示 */
.permission-denied {
  margin: 26px 24px 0;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 18px;
  padding: 26px 20px;
  text-align: center;
  backdrop-filter: blur(10px);
}
.permission-icon { font-size: 34px; margin-bottom: 10px; }
.permission-text { display: block; font-size: 15px; font-weight: 600; color: var(--indigo-deep); margin-bottom: 6px; }
.permission-hint { display: block; font-size: 12px; color: rgba(58, 74, 107, 0.6); }

.bottom-decoration {
  margin-top: 44px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(58, 74, 107, 0.45);
}

/* ============================================================
   我的（亮色）
   ============================================================ */
.me-page { padding-bottom: 44px; }

.notice-bar {
  margin: 14px 16px 0;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  padding: 9px 16px;
  backdrop-filter: blur(8px);
  overflow: hidden;
  white-space: nowrap;
}
.notice-text {
  display: inline-block;
  font-size: 12px;
  color: var(--indigo);
  letter-spacing: 1px;
  animation: marquee 14s linear infinite;
  padding-left: 100%;
}
@keyframes marquee { to { transform: translateX(-100%); } }

.user-info { display: flex; flex-direction: column; align-items: center; padding: 34px 24px 8px; }
.avatar-container { position: relative; margin-bottom: 14px; }
.avatar {
  width: 84px; height: 84px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.8);
  display: block;
}
.avatar-ring {
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.55), inset 0 0 12px rgba(255, 255, 255, 0.4);
}
.user-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--indigo-deep);
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-name .edit-pen { font-size: 12px; opacity: 0.5; }
.name-decoration {
  width: 120px; height: 1px;
  margin: 10px auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.membership-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(201, 168, 106, 0.92), rgba(168, 133, 74, 0.92));
  color: #fff;
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 999px;
  letter-spacing: 1px;
  box-shadow: 0 4px 14px rgba(168, 133, 74, 0.35);
}
.membership-badge.expired { background: linear-gradient(135deg, #9aa2b1, #6f7787); }

/* 我的 - 列表卡 */
.list-card {
  margin: 26px 20px 0;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(58, 74, 107, 0.12);
}
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 18px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.list-item:active { background: rgba(58, 74, 107, 0.07); }
.list-item + .list-item { border-top: 1px solid rgba(58, 74, 107, 0.08); }
.item-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  color: #fff;
  background: linear-gradient(135deg, #d9b57b, #a5804a);
  flex-shrink: 0;
}
.item-title { flex: 1; font-size: 15px; font-weight: 600; color: var(--indigo-deep); letter-spacing: 1px; }
.item-badge {
  font-size: 11px;
  color: #fff;
  background: linear-gradient(135deg, #7ba7d9, #4a6fa5);
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 1px;
}
.item-arrow { color: rgba(58, 74, 107, 0.35); font-size: 16px; }

.action-section { margin: 30px 20px 0; display: flex; flex-direction: column; gap: 12px; }
.action-btn {
  position: relative;
  width: 100%;
  border: 1px solid rgba(58, 74, 107, 0.25);
  background: rgba(255, 255, 255, 0.7);
  color: var(--indigo-deep);
  border-radius: 14px;
  padding: 13px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 4px;
  text-indent: 4px;
  cursor: pointer;
  font-family: var(--sans);
  transition: transform 0.15s ease;
}
.action-btn:active { transform: scale(0.97); }
.action-btn.danger { color: #b04a4a; border-color: rgba(176, 74, 74, 0.3); }

/* ============================================================
   视频播放页（暗色）
   ============================================================ */
.player-page { padding: 0 0 30px; }
.player-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}
.player-topbar .page-title-center { flex: 1; text-align: center; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-spacer { width: 64px; flex-shrink: 0; }

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}
.video-wrap video { width: 100%; height: 100%; object-fit: contain; display: block; }

.player-placeholder {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #23272f, #12141a);
}
.player-placeholder .ph-icon { font-size: 40px; opacity: 0.7; }
.player-placeholder .ph-text { font-size: 13px; color: var(--text-dark-3); }

/* 自定义控制条 */
.custom-controls {
  padding: 12px 16px 16px;
  background: var(--card-dark);
  border-bottom: 1px solid var(--line-dark);
}
.seek-bar { position: relative; height: 22px; display: flex; align-items: center; cursor: pointer; }
.seek-track { width: 100%; height: 4px; background: rgba(255, 255, 255, 0.18); border-radius: 999px; overflow: hidden; }
.seek-fill { height: 100%; background: linear-gradient(90deg, #7c5be1, #5b6ee1); border-radius: 999px; position: relative; }
.seek-fill::after {
  content: "";
  position: absolute; right: -6px; top: 50%;
  transform: translateY(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 8px rgba(124, 91, 225, 0.9);
}
.controls-row { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.ctrl-btn {
  background: none; border: none;
  color: #fff; font-size: 17px;
  cursor: pointer; padding: 4px 6px;
  font-family: var(--sans);
}
.time-text { font-size: 11px; color: var(--text-dark-2); font-variant-numeric: tabular-nums; flex: 1; text-align: center; }

.player-info { padding: 18px 16px 0; }
.player-course-title { font-size: 17px; font-weight: 700; line-height: 1.5; margin-bottom: 8px; }
.player-course-meta { font-size: 12px; color: var(--text-dark-3); margin-bottom: 18px; }

.tip-card {
  background: rgba(124, 91, 225, 0.12);
  border: 1px solid rgba(124, 91, 225, 0.3);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  color: #b9aee8;
  line-height: 1.7;
}

/* ============================================================
   学习统计（暗色）
   ============================================================ */
.overview-card {
  background: var(--card-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 18px 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.overview-title {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 16px;
  padding-left: 10px;
  border-left: 3px solid var(--gold);
}
.overview-stats { display: flex; justify-content: space-around; flex-wrap: wrap; gap: 12px; }
.stat-number { font-size: 20px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; display: block; margin-bottom: 5px; }

.chart-tabs {
  display: flex;
  background: var(--card-dark);
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
}
.tab-item {
  flex: 1;
  text-align: center;
  font-size: 13px;
  color: var(--text-dark-2);
  padding: 9px 0;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 2px;
}
.tab-item.active { background: linear-gradient(135deg, #5b6ee1, #7c5be1); color: #fff; font-weight: 600; }

.section-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 12px;
  padding-left: 9px;
  border-left: 3px solid var(--gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.score-summary { display: flex; gap: 10px; font-size: 11px; color: var(--text-dark-3); font-weight: 400; letter-spacing: 0; }

.progress-list, .scores-list { display: flex; flex-direction: column; gap: 12px; }
.progress-item {
  background: var(--card-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.progress-item .course-title { font-size: 14px; margin-bottom: 6px; }
.progress-item .course-meta { margin-bottom: 10px; }
.progress-meta-text { color: var(--text-dark-3); }
.status-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.status-chip.done { background: rgba(76, 175, 80, 0.2); color: #81c784; }
.status-chip.doing { background: rgba(255, 152, 0, 0.2); color: #ffb74d; }

.progress-bar-container { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.progress-bar { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width 0.4s ease; }
.progress-text { font-size: 12px; color: var(--text-dark-2); min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }

.view-btn {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  padding: 9px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--sans);
  letter-spacing: 2px;
}
.view-btn:active { background: rgba(255, 255, 255, 0.18); }

/* 测试成绩行 */
.score-item {
  background: var(--card-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.score-ring {
  width: 46px; height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background: conic-gradient(var(--green) calc(var(--pct) * 1%), rgba(255,255,255,0.12) 0);
  position: relative;
}
.score-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #33373d; }
.score-ring span { position: relative; z-index: 1; }
.score-info { flex: 1; min-width: 0; }
.score-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score-sub { font-size: 11px; color: var(--text-dark-3); }

/* ============================================================
   随堂测试（暗色）
   ============================================================ */
.test-item {
  background: var(--card-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.test-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.test-title { font-size: 15px; font-weight: 700; flex: 1; min-width: 0; }
.test-status { flex-shrink: 0; font-size: 11px; padding: 3px 10px; border-radius: 999px; }
.test-status.not-started { background: rgba(33, 150, 243, 0.2); color: #64b5f6; }
.test-status.completed { background: rgba(76, 175, 80, 0.2); color: #81c784; }
.test-desc { font-size: 12px; color: var(--text-dark-2); line-height: 1.6; margin-bottom: 10px; }
.test-meta { display: flex; gap: 12px; font-size: 11px; color: var(--text-dark-3); margin-bottom: 14px; }

.start-btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, #5b6ee1, #7c5be1);
  cursor: pointer;
  font-family: var(--sans);
}
.start-btn:active { transform: scale(0.97); }
.start-btn.review-btn { background: linear-gradient(135deg, #66bb6a, #43a047); }

/* 答题页 */
.test-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin-bottom: 14px;
}
.test-header-bar .t-title { font-size: 15px; font-weight: 700; flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 8px; }
.quiz-exit-btn { background: none; border: none; color: var(--text-dark-2); font-size: 14px; padding: 4px 8px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.quiz-exit-btn:active { opacity: 0.6; }
.test-timer { display: flex; align-items: center; gap: 5px; font-size: 13px; color: #ffb74d; font-variant-numeric: tabular-nums; }
.test-timer.warn { color: var(--red); animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: 0.4; } }

.quiz-progress { margin-bottom: 18px; }
.quiz-progress .progress-text { display: block; text-align: center; margin-top: 8px; font-size: 12px; color: var(--text-dark-2); }

.question-card {
  background: var(--card-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 20px 18px;
  margin-bottom: 16px;
}
.question-number {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #5b6ee1, #7c5be1);
  border-radius: 8px;
  padding: 3px 10px;
  margin-bottom: 12px;
  letter-spacing: 1px;
}
.question-text { font-size: 16px; font-weight: 600; line-height: 1.7; margin-bottom: 20px; }

.option-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  line-height: 1.5;
}
.option-item:active { transform: scale(0.98); }
.option-item.selected {
  border-color: #7c5be1;
  background: rgba(124, 91, 225, 0.18);
}
.option-key {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.option-item.selected .option-key { background: #7c5be1; border-color: #7c5be1; }

/* 结果页 */
.result-card {
  background: var(--card-dark);
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  margin-bottom: 16px;
}
.result-emoji { font-size: 46px; margin-bottom: 12px; }
.result-score { font-size: 52px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 6px; }
.result-score small { font-size: 20px; color: var(--text-dark-3); font-weight: 400; }
.result-label { font-size: 13px; color: var(--text-dark-2); margin-bottom: 16px; }
.result-detail { display: flex; justify-content: center; gap: 26px; }
.result-detail .rd-item { font-size: 13px; color: var(--text-dark-3); }
.result-detail .rd-item b { display: block; font-size: 18px; color: #fff; margin-bottom: 3px; }

/* ============================================================
   IP 声明弹窗
   ============================================================ */
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 32px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  width: 100%;
  max-width: 340px;
  background: #2e2e2e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 24px 20px 18px;
  animation: popIn 0.25s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.modal-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.modal-content { font-size: 13px; line-height: 1.9; color: var(--text-dark-2); max-height: 46dvh; overflow-y: auto; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; }
.modal-btn {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--sans);
}
.modal-cancel { background: rgba(255, 255, 255, 0.1); color: var(--text-dark-2); }
.modal-confirm { background: linear-gradient(135deg, #5b6ee1, #7c5be1); color: #fff; }

/* ============================================================
   Toast / 全局 Loading
   ============================================================ */
.toast {
  position: absolute;
  left: 50%; bottom: 90px;
  transform: translateX(-50%) translateY(10px);
  background: rgba(20, 20, 20, 0.88);
  color: #fff;
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 18px;
  border-radius: 10px;
  max-width: 78%;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  backdrop-filter: blur(6px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.loading-mask {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 300;
}
.loading-mask .loading-spinner { width: 38px; height: 38px; border-color: rgba(255,255,255,0.25); border-top-color: #fff; }
.loading-mask .loading-text { color: #fff; font-size: 13px; letter-spacing: 2px; }

.hidden { display: none !important; }

/* 页面淡入动画辅助 */
.fade-in { animation: pageIn 0.3s ease; }
