/* ============================================================
   我的自学站 · 科技感主题（深色霓虹玻璃拟态，默认深色）
   ============================================================ */

:root {
  /* 深色科技主题（默认） */
  --bg: #05070d;
  --card: rgba(16, 24, 42, 0.55);
  --card-strong: rgba(11, 17, 30, 0.88);
  --card-soft: rgba(20, 30, 52, 0.6);
  --text: #e8eef9;
  --muted: #8b9cb8;
  --border: rgba(120, 160, 255, 0.16);
  --border-strong: rgba(120, 160, 255, 0.34);
  --c1: #22d3ee;
  --c2: #6366f1;
  --c3: #a855f7;
  --grad: linear-gradient(135deg, var(--c1), var(--c2) 55%, var(--c3));
  --glow-c1: rgba(34, 211, 238, 0.4);
  --glow-c2: rgba(99, 102, 241, 0.45);
  --glow-c3: rgba(168, 85, 247, 0.35);
  --on-accent: #051018;
  --green: #34d399;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 22px 60px rgba(0, 0, 0, 0.55);
  --radius: 16px;
  --header-bg: rgba(5, 8, 15, 0.62);
}

html[data-theme="light"] {
  --bg: #edf1f8;
  --card: rgba(255, 255, 255, 0.75);
  --card-strong: rgba(255, 255, 255, 0.95);
  --card-soft: rgba(244, 247, 252, 0.9);
  --text: #16213a;
  --muted: #5b6a80;
  --border: rgba(30, 60, 120, 0.16);
  --border-strong: rgba(30, 60, 120, 0.34);
  --c1: #0891b2;
  --c2: #4f46e5;
  --c3: #9333ea;
  --grad: linear-gradient(135deg, var(--c1), var(--c2) 55%, var(--c3));
  --glow-c1: rgba(8, 145, 178, 0.28);
  --glow-c2: rgba(79, 70, 229, 0.3);
  --glow-c3: rgba(147, 51, 234, 0.25);
  --on-accent: #ffffff;
  --green: #059669;
  --shadow: 0 10px 30px rgba(23, 43, 99, 0.1);
  --shadow-lg: 0 22px 55px rgba(23, 43, 99, 0.18);
  --header-bg: rgba(237, 241, 248, 0.72);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(34, 211, 238, 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--c2), var(--c3));
  border-radius: 999px; border: 2px solid var(--bg);
}
:focus-visible { outline: 2px solid var(--c1); outline-offset: 2px; border-radius: 6px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
main.wrap { padding-top: 26px; padding-bottom: 48px; }
.hidden { display: none !important; }

/* ---------- 背景舞台：光球 + 网格 + 粒子 ---------- */
.bg-stage { position: fixed; inset: 0; z-index: -2; overflow: hidden; background: var(--bg); }
.bg-orb {
  position: absolute; border-radius: 50%; filter: blur(90px);
  animation: orbFloat 20s ease-in-out infinite alternate;
  pointer-events: none;
}
.orb-1 {
  width: 540px; height: 540px; top: -180px; left: -140px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.5), transparent 70%);
}
.orb-2 {
  width: 640px; height: 640px; top: 12%; right: -200px; animation-delay: -7s;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.55), transparent 70%);
}
.orb-3 {
  width: 480px; height: 480px; bottom: -180px; left: 28%; animation-delay: -13s;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.42), transparent 70%);
}
html[data-theme="light"] .bg-orb { opacity: 0.55; }
@keyframes orbFloat {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(70px, 46px) scale(1.16); }
}
.bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(120, 160, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 95% 75% at 50% 0%, #000 25%, transparent 78%);
  mask-image: radial-gradient(ellipse 95% 75% at 50% 0%, #000 25%, transparent 78%);
  pointer-events: none;
}
#bg-particles { position: absolute; inset: 0; }

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c1), var(--c2), var(--c3), transparent);
  opacity: 0.55; pointer-events: none;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 800; letter-spacing: 0.5px;
  color: var(--text); text-decoration: none;
}
.brand-emoji {
  width: 34px; height: 34px; border-radius: 10px; font-size: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(34, 211, 238, 0.18), rgba(168, 85, 247, 0.18));
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 14px var(--glow-c2), inset 0 0 10px rgba(99, 102, 241, 0.25);
}
.brand-name {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px var(--glow-c2));
}
.icon-btn {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  width: 36px; height: 36px; border-radius: 10px; cursor: pointer; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.icon-btn:hover { border-color: var(--c1); box-shadow: 0 0 16px var(--glow-c1); transform: translateY(-1px); }

/* ---------- 首页 ---------- */
.hero { margin: 8px 0 24px; }
.hero h1 {
  margin: 0 0 6px; font-size: 32px; font-weight: 800; letter-spacing: 1px;
  display: inline-block;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 14px var(--glow-c1));
}
.hero-sub { margin: 0; color: var(--muted); font-size: 14px; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.stat-chip {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 8px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.stat-chip .v {
  font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-chip .k { font-size: 12px; color: var(--muted); }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.course-card {
  position: relative; overflow: hidden;
  display: block; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.course-card::after {
  content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--c1), var(--c3), transparent);
  opacity: 0.4; transition: opacity .18s ease;
}
.course-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5), 0 0 26px var(--glow-c1);
}
.course-card:hover::after { opacity: 0.9; }
.course-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.course-emoji-wrap {
  flex: none; width: 46px; height: 46px; border-radius: 14px; font-size: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(34, 211, 238, 0.16), rgba(168, 85, 247, 0.16));
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.3), inset 0 0 12px rgba(99, 102, 241, 0.18);
}
.course-name { font-weight: 700; font-size: 16px; line-height: 1.35; }
.course-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.course-stats b { color: var(--text); font-variant-numeric: tabular-nums; }
.course-card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 12px; font-size: 13px; color: var(--muted);
}
.course-card-foot .pct {
  font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.course-card-foot .enter {
  color: var(--c1); font-weight: 600; transition: transform .15s ease, text-shadow .15s ease;
}
.course-card:hover .enter { transform: translateX(4px); text-shadow: 0 0 12px var(--glow-c1); }

/* ---------- 课程页 ---------- */
.back-link {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 14px;
  transition: color .15s ease, text-shadow .15s ease;
}
.back-link:hover { color: var(--c1); text-shadow: 0 0 12px var(--glow-c1); }

.course-head {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.course-head-top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 8px; margin-bottom: 12px;
}
.course-head-top h1 {
  margin: 0; font-size: 24px; font-weight: 800;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px var(--glow-c2));
}
.course-head-step { color: var(--muted); font-size: 13px; }
.course-stats-line {
  display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px;
}
.course-stats-line b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- 筛选与搜索 ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 8px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.chip:hover { border-color: var(--c1); color: var(--c1); }
.chip.active {
  background: var(--grad); border-color: transparent; color: var(--on-accent);
  font-weight: 700; box-shadow: 0 4px 18px var(--glow-c2);
}
.search-wrap { position: relative; }
.search-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .75; pointer-events: none; }
.search-input {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 12px; padding: 9px 12px 9px 34px; font-size: 14px; width: 250px; max-width: 100%;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input::placeholder { color: var(--muted); }
.search-input:focus {
  outline: none; border-color: var(--c1);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18), 0 0 18px rgba(34, 211, 238, 0.2);
}
.list-meta { color: var(--muted); font-size: 12.5px; margin: 6px 2px 10px; }

/* ---------- 课时卡片 ---------- */
.step-list { display: flex; flex-direction: column; gap: 8px; }
.step-card {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; cursor: pointer;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.step-card::before {
  content: ""; position: absolute; left: 0; top: 16%; bottom: 16%; width: 3px;
  border-radius: 3px; background: var(--grad);
  opacity: 0; transform: scaleY(0.35);
  transition: opacity .14s ease, transform .14s ease;
  box-shadow: 0 0 10px var(--glow-c1);
}
.step-card:hover {
  transform: translateX(4px);
  border-color: var(--border-strong);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.4), 0 0 18px rgba(99, 102, 241, 0.14);
}
.step-card:hover::before { opacity: 1; transform: scaleY(1); }

.cc-badge {
  flex: none; font-size: 10.5px; font-weight: 800; letter-spacing: 0.5px;
  color: var(--c1); border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 1px 6px; background: rgba(34, 211, 238, 0.08);
}
.step-no {
  flex: none; min-width: 34px; text-align: right;
  color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums;
}
.type-badge {
  flex: none; font-size: 11.5px; padding: 2px 9px; border-radius: 999px;
  font-weight: 600; white-space: nowrap;
}
.t-video { color: #7dd3fc; background: rgba(14, 165, 233, 0.14); box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.28); }
.t-practice { color: #6ee7b7; background: rgba(16, 185, 129, 0.14); box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.28); }
.t-review { color: #fcd34d; background: rgba(245, 158, 11, 0.14); box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.28); }
.t-exam { color: #fca5a5; background: rgba(239, 68, 68, 0.14); box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.3); }
.t-drill { color: #d8b4fe; background: rgba(168, 85, 247, 0.16); box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.3); }
.t-reading { color: #5eead4; background: rgba(20, 184, 166, 0.14); box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.28); }
.t-writing { color: #f9a8d4; background: rgba(236, 72, 153, 0.14); box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.28); }
.t-end, .t-other { color: #94a3b8; background: rgba(148, 163, 184, 0.12); box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.2); }
html[data-theme="light"] .t-video { color: #0369a1; background: rgba(14, 165, 233, 0.12); }
html[data-theme="light"] .t-practice { color: #047857; background: rgba(16, 185, 129, 0.12); }
html[data-theme="light"] .t-review { color: #b45309; background: rgba(245, 158, 11, 0.14); }
html[data-theme="light"] .t-exam { color: #b91c1c; background: rgba(239, 68, 68, 0.12); }
html[data-theme="light"] .t-drill { color: #7e22ce; background: rgba(168, 85, 247, 0.14); }
html[data-theme="light"] .t-reading { color: #0f766e; background: rgba(20, 184, 166, 0.12); }
html[data-theme="light"] .t-writing { color: #be185d; background: rgba(236, 72, 153, 0.12); }

.step-title { flex: 1 1 auto; min-width: 0; font-size: 14.5px; overflow-wrap: anywhere; }
.step-right { flex: none; display: inline-flex; align-items: center; gap: 8px; }
.play-btn {
  border: none; cursor: pointer; color: var(--on-accent); font-weight: 700; font-size: 12.5px;
  background: var(--grad);
  padding: 6px 14px; border-radius: 999px;
  box-shadow: 0 4px 16px var(--glow-c1), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.play-btn:hover {
  transform: translateY(-1px) scale(1.05);
  box-shadow: 0 8px 26px var(--glow-c2), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  filter: brightness(1.1);
}
.wait-badge {
  font-size: 11.5px; color: var(--muted);
  border: 1px dashed var(--border-strong); padding: 3px 10px; border-radius: 999px; white-space: nowrap;
}

/* ---------- 视频弹窗 ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: modalIn .22s ease;
}
@keyframes modalIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(3, 6, 12, 0.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.modal-box {
  position: relative; width: min(920px, 100%);
  background: var(--card-strong);
  border: 1px solid rgba(120, 160, 255, 0.28);
  border-radius: 18px; overflow: hidden;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.12),
    0 26px 70px rgba(0, 0, 0, 0.65),
    0 0 60px rgba(99, 102, 241, 0.25);
  animation: modalPop .28s cubic-bezier(.22, .9, .36, 1);
}
@keyframes modalPop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-title { font-weight: 700; font-size: 16px; }
.modal-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.modal-player { background: #000; position: relative; }
/* 自绘字幕层：覆盖在视频画面之上，不依赖浏览器原生字幕 */
.caption-overlay {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 0 6% 11%; pointer-events: none;
}
.caption-box {
  max-width: 92%; text-align: center;
  color: #fff; background: rgba(0, 0, 0, 0.75);
  padding: 5px 14px; border-radius: 8px;
  font-size: clamp(14px, 2.5vw, 20px); line-height: 1.45;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}
.modal-player iframe, .modal-player .native-video {
  display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; background: #000;
}
/* 视频弹窗：限制最大宽度，避免 480p 源被过度放大导致模糊（手机端无影响） */
#video-modal .modal-box { width: min(720px, 100%); }
.player-status {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 18px; border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted);
}
.player-status .switch-btn { padding: 5px 12px; font-size: 12px; }
.native-video::cue {
  color: #ffffff; background: rgba(0, 0, 0, 0.75); font-size: 15px;
}

/* ---------- 登录门禁 ---------- */
.header-actions { display: inline-flex; align-items: center; gap: 10px; }
.login-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(4, 7, 13, 0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: modalIn .3s ease;
  overflow-y: auto;
}
.login-card {
  width: min(400px, 100%);
  margin: auto;
  background: var(--card-strong);
  border: 1px solid rgba(120, 160, 255, 0.3);
  border-radius: 20px;
  padding: 34px 30px 30px;
  text-align: center;
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.14),
    0 26px 70px rgba(0, 0, 0, 0.65),
    0 0 70px rgba(99, 102, 241, 0.3);
  animation: modalPop .35s cubic-bezier(.22, .9, .36, 1), cardFloat 6s ease-in-out 0.4s infinite alternate;
}
@keyframes cardFloat {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}
.login-logo {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 18px; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, rgba(34, 211, 238, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid var(--border-strong);
  box-shadow: 0 0 26px var(--glow-c2), inset 0 0 16px rgba(99, 102, 241, 0.3);
}
.login-title {
  margin: 0 0 4px; font-size: 24px; font-weight: 800; letter-spacing: 1px;
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 12px var(--glow-c1));
}
.login-sub { margin: 0 0 22px; color: var(--muted); font-size: 13px; letter-spacing: 1px; }
.login-field { position: relative; display: block; margin-bottom: 12px; text-align: left; }
.login-field-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 15px; opacity: 0.8; pointer-events: none;
}
.login-field input {
  width: 100%; border: 1px solid var(--border); background: rgba(8, 13, 24, 0.6);
  color: var(--text); border-radius: 12px; padding: 12px 14px 12px 40px; font-size: 15px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login-field input:focus {
  outline: none; border-color: var(--c1);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18), 0 0 20px rgba(34, 211, 238, 0.25);
}
.login-err { margin: 2px 0 10px; font-size: 12.5px; color: #f87171; text-align: center; }
.login-btn {
  width: 100%; border: none; cursor: pointer; margin-top: 4px;
  background: var(--grad); color: var(--on-accent);
  font-size: 15px; font-weight: 800; letter-spacing: 2px;
  padding: 12px; border-radius: 12px;
  box-shadow: 0 6px 24px var(--glow-c2), inset 0 0 0 1px rgba(255, 255, 255, 0.2);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px var(--glow-c1); filter: brightness(1.1); }
html[data-theme="light"] .login-overlay { background: rgba(214, 223, 240, 0.55); }
html[data-theme="light"] .login-field input { background: rgba(255, 255, 255, 0.85); }
.shake { animation: shake 0.45s ease !important; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}
body.locked { overflow: hidden; }

/* ---------- 练习题弹窗 ---------- */
.quiz-btn {
  border: 1px solid var(--border-strong); cursor: pointer;
  color: var(--c1); background: rgba(34, 211, 238, 0.07);
  font-size: 12.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
  transition: background .15s ease, box-shadow .15s ease, transform .15s ease;
}
.quiz-btn:hover { background: rgba(34, 211, 238, 0.16); box-shadow: 0 0 14px var(--glow-c1); transform: translateY(-1px); }
.step-right { flex-wrap: wrap; justify-content: flex-end; }
.quiz-box { width: min(780px, 100%); }
.quiz-body { padding: 18px 20px 14px; max-height: 66vh; overflow-y: auto; }
.quiz-counter { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.quiz-img {
  display: block; max-width: 100%; margin: 0 auto 14px;
  border-radius: 12px; border: 1px solid var(--border);
}
.quiz-q { font-size: 16px; line-height: 1.7; margin-bottom: 14px; white-space: pre-wrap; }
.quiz-opts { display: flex; flex-direction: column; gap: 10px; }
.quiz-opt {
  display: flex; align-items: center; gap: 10px; text-align: left;
  width: 100%; border: 1px solid var(--border); background: var(--card-soft);
  color: var(--text); border-radius: 12px; padding: 11px 14px;
  font-size: 14.5px; cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease, transform .15s ease;
}
.quiz-opt:hover { border-color: var(--border-strong); transform: translateX(3px); }
.quiz-opt.selected {
  border-color: var(--c1); background: rgba(34, 211, 238, 0.12);
  box-shadow: 0 0 16px var(--glow-c1), inset 0 0 0 1px rgba(34, 211, 238, 0.4);
}
.quiz-opt img { max-width: 100%; max-height: 120px; border-radius: 8px; display: block; margin: 0 auto; }
.quiz-opt-letter {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  background: rgba(120, 160, 255, 0.14); color: var(--c1);
}
.quiz-opt.selected .quiz-opt-letter { background: var(--grad); color: var(--on-accent); }
.quiz-opt-text { flex: 1 1 auto; }
.quiz-tip {
  font-size: 13px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: 12px;
  padding: 12px 16px;
}
.quiz-nav { display: flex; justify-content: space-between; margin-top: 16px; }
.quiz-nav .chip:disabled { opacity: 0.4; cursor: not-allowed; }
.quiz-note {
  border-top: 1px solid var(--border); padding: 10px 20px;
  font-size: 12px; color: var(--muted); text-align: center;
}

/* ---------- 页脚与提示 ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px; padding: 16px 0 26px;
}
.empty-note {
  background: var(--card); border: 1px dashed var(--border-strong);
  border-radius: var(--radius); padding: 26px; text-align: center; color: var(--muted);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.empty-note code { color: var(--c1); }

html[data-theme="light"] .course-card:hover {
  box-shadow: var(--shadow-lg), 0 0 26px var(--glow-c1);
}
html[data-theme="light"] .step-card:hover {
  box-shadow: 0 10px 26px rgba(23, 43, 99, 0.14), 0 0 18px rgba(99, 102, 241, 0.12);
}

/* ---------- 入场动画 ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.reveal { animation: fadeUp 0.5s cubic-bezier(0.22, 0.9, 0.36, 1) both; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .hero h1 { font-size: 24px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-input { width: 100%; }
  .step-card { flex-wrap: wrap; padding: 12px; }
  .step-title { flex-basis: 100%; order: 5; }
  .step-right { margin-left: auto; }
  .play-btn { padding: 8px 16px; font-size: 13px; }
  .quiz-btn { padding: 8px 14px; font-size: 13px; }
  .chip { padding: 8px 15px; }
  .icon-btn { width: 40px; height: 40px; }
  .course-head { padding: 16px; }
  .modal { padding: 12px; }
  .quiz-body { padding: 14px 14px 12px; max-height: 60vh; max-height: 60dvh; }
  .quiz-opt { padding: 13px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
