/* ============================================================
   学习刷 · app.css
   海洋色系双主题：日间 = 浅海雾 / 夜间 = 深海
   区块：1 设计令牌 2 基础 3 通用组件 4 起始页 5 泡泡动效
        6 规划页 7 视频流页 8 总结面板 9 知识回顾 10 错误页
        11 动效 12 响应式 13 减少动效
   ============================================================ */

/* ---------- 1. 设计令牌 ---------- */
:root {
  color-scheme: light;
  /* 浅海雾（日间） */
  --ink: #14313d;
  --muted: #55707d;
  --line: #d4e2e7;
  --paper: #edf4f5;
  --panel: #ffffff;
  --panel-soft: #f4f9fa;
  --sunk: #e7f0f2;

  /* 浪花青（主强调） */
  --accent: #0e8778;
  --accent-hover: #0b6e62;
  --accent-ink: #0c7a6d;
  --accent-soft: #dcf1ec;
  --accent-line: #a8d9cf;
  --wave: #7fd4c1;
  --aqua: #6ec6d8;

  /* 娱乐方向（深海蓝，邻近色相） */
  --fun: #2f6f9d;
  --fun-ink: #2c6792;
  --fun-soft: #e1eef7;
  --fun-line: #b3d2e6;

  --ok: #1e8a68;
  --ok-soft: #dcf2e9;
  --warn: #b0701a;
  --warn-soft: #fdf0da;
  --danger: #c2513a;
  --danger-soft: #fce8e2;

  /* 深海场景（视频流） */
  --deep: #081723;
  --deep-panel: #11232f;

  --radius-s: 8px;
  --radius-m: 12px;
  --radius-l: 16px;
  --radius-full: 999px;
  --shadow: 0 18px 50px rgba(13, 45, 60, 0.12);
  --shadow-soft: 0 10px 30px rgba(13, 45, 60, 0.08);

  --dur-fast: 0.18s;
  --dur-med: 0.32s;
  --dur-theme: 0.4s;
  --ease-out: cubic-bezier(0.22, 0.9, 0.32, 1);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  /* 深海（夜间） */
  --ink: #daedf2;
  --muted: #8aa7b4;
  --line: #25424f;
  --paper: #071420;
  --panel: #0e2230;
  --panel-soft: #0a1a26;
  --sunk: #10232f;

  --accent: #15937f;
  --accent-hover: #1aa68f;
  --accent-ink: #7fd4c1;
  --accent-soft: #123a34;
  --accent-line: #2a5f55;
  --wave: #7fd4c1;
  --aqua: #6ec6d8;

  --fun: #4d94c4;
  --fun-ink: #8ec8e8;
  --fun-soft: #14303f;
  --fun-line: #2b4f68;

  --ok: #5fc7a6;
  --ok-soft: #12382f;
  --warn: #e0a35c;
  --warn-soft: #3a2c17;
  --danger: #e0806c;
  --danger-soft: #3c211c;

  --deep: #050f18;
  --deep-panel: #0c1c28;

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  transition: background-color var(--dur-theme) ease, color var(--dur-theme) ease;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.35; }

.home-screen, .planning-screen, .plan-screen, .complete-screen, .error-screen { min-height: 100vh; }

/* ---------- 3. 通用组件 ---------- */
.primary-button, .secondary-button, .text-button {
  min-height: 44px;
  border-radius: var(--radius-s);
  border: 0;
  padding: 0 18px;
  font-weight: 800;
  transition: background-color var(--dur-fast) ease, color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.primary-button { background: var(--accent); color: #fff; }
.primary-button:hover { background: var(--accent-hover); }
.primary-button.large { min-height: 52px; margin-top: 26px; padding: 0 24px; }
.secondary-button { background: var(--accent-soft); color: var(--accent-ink); }
.secondary-button:hover { box-shadow: inset 0 0 0 1px var(--accent-line); }
.text-button { background: transparent; color: var(--muted); padding: 0 4px; }
.text-button:hover { color: var(--accent-ink); }
.text-button.light { color: rgba(255, 255, 255, 0.65); }
.text-button.light:hover { color: #fff; }

.brand, .feed-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  font-size: 18px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #157a8a);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 6px 16px rgba(14, 135, 120, 0.28);
}
.brand-mark.small { width: 30px; height: 30px; font-size: 15px; border-radius: 8px; }

.eyebrow { color: var(--accent-ink); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }

.status, .mode-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  transition: background-color var(--dur-theme) ease, border-color var(--dur-theme) ease;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.status.ready .status-dot { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 14%, transparent); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 320;
  transform: translateX(-50%);
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
}

.theme-toggle {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 300;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: background-color var(--dur-theme) ease, color var(--dur-theme) ease, border-color var(--dur-fast) ease;
}
.theme-toggle span { font-size: 21px; line-height: 1; }
.theme-toggle:hover { border-color: var(--accent-line); color: var(--accent-ink); }

/* 视频流页：主题按钮收进顶栏右侧，避免遮挡视频信息栏 */
@media (min-width: 761px) {
  body:has(.feed-screen) .theme-toggle { top: 7px; bottom: auto; left: auto; right: 132px; }
}

/* ---------- 4. 起始页 ---------- */
.home-screen {
  background:
    radial-gradient(900px 420px at 50% -140px, color-mix(in srgb, var(--aqua) 16%, transparent), transparent 70%),
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 4.5%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--accent) 4.5%, transparent) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 38px 38px, 38px 38px, auto;
  transition: background-color var(--dur-theme) ease;
}

.home-header, .simple-header {
  height: 72px;
  width: min(1240px, calc(100% - 56px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.service-statuses { display: flex; align-items: center; gap: 8px; }

.home-content {
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
  padding: 54px 0 44px;
}
.home-content.wide { width: min(1180px, calc(100% - 48px)); padding-top: 26px; }

.home-copy { text-align: center; }
.home-copy.compact h1 { font-size: 42px; }
.home-copy.compact p { margin-top: 10px; }
.home-copy h1, .planning-card h1, .plan-intro h1 {
  margin: 13px 0 0;
  font-size: 48px;
  line-height: 1.12;
  letter-spacing: 0;
}
.home-copy p { max-width: 680px; margin: 16px auto 0; color: var(--muted); font-size: 17px; line-height: 1.7; }

.history-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: var(--panel);
  transition: background-color var(--dur-theme) ease, border-color var(--dur-theme) ease;
}
.history-status span { padding: 0 6px; color: var(--muted); font-size: 11px; }
.history-status button { min-height: 28px; border: 0; border-radius: var(--radius-full); padding: 0 9px; background: var(--sunk); color: var(--muted); font-size: 10px; }
.history-status button.is-danger { background: var(--danger-soft); color: var(--danger); }

.setup-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
  margin-top: 28px;
}

.goal-form {
  margin-top: 38px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--panel);
  box-shadow: var(--shadow);
  transition: background-color var(--dur-theme) ease, border-color var(--dur-theme) ease;
}
.goal-form.main-setup { margin-top: 0; box-shadow: var(--shadow-soft); }
.round-settings {
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition: background-color var(--dur-theme) ease, border-color var(--dur-theme) ease;
}

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.section-heading > div { display: flex; align-items: center; gap: 9px; }
.section-heading h2 { margin: 0; font-size: 16px; }
.section-heading > div > span { color: var(--accent-ink); font-size: 11px; font-weight: 900; }
.section-heading small { color: var(--muted); font-size: 11px; }
.section-heading.divided { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }

.selected-goals { min-height: 54px; display: grid; gap: 7px; margin-top: 12px; }
.selected-goals.empty { place-items: center; border: 1px dashed var(--line); border-radius: var(--radius-m); background: var(--panel-soft); }
.selected-goals.empty p { margin: 0; color: var(--muted); font-size: 12px; }
.goal-tag {
  min-height: 46px;
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  gap: 9px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-m);
  background: var(--accent-soft);
}
.goal-tag > span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; }
.goal-tag strong { font-size: 13px; line-height: 1.35; }
.goal-tag button { width: 27px; height: 27px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 18px; }
.goal-tag button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-ink); }

.interest-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 13px; }
.interest-grid.disabled { opacity: 0.48; }
.interest-option {
  position: relative;
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--panel);
  color: var(--muted);
  font-weight: 700;
  transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.interest-option.selected { border-color: var(--fun-line); background: var(--fun-soft); color: var(--fun-ink); }
.interest-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--fun-soft); color: var(--fun-ink); font-size: 13px; }
.interest-option .check { position: absolute; right: 9px; top: 8px; opacity: 0; color: var(--fun-ink); transition: opacity var(--dur-fast) ease; }
.interest-option.selected .check { opacity: 1; }

.preset-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 15px; }
.preset { min-width: 0; min-height: 58px; padding: 8px 5px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--panel); color: var(--muted); transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease; }
.preset strong, .preset span { display: block; }
.preset strong { color: var(--ink); font-size: 12px; }
.preset span { margin-top: 4px; font-size: 9px; white-space: nowrap; }
.preset.active { border-color: var(--accent-line); background: var(--accent-soft); }
.preset.active strong { color: var(--accent-ink); }

.count-settings { display: grid; gap: 8px; margin-top: 16px; }
.counter-row { min-height: 46px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 12px; border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--muted); font-size: 12px; }
.stepper { display: grid; grid-template-columns: 28px 32px 28px; align-items: center; text-align: center; }
.stepper button { width: 28px; height: 28px; border: 0; border-radius: 7px; background: var(--sunk); color: var(--ink); }
.stepper strong { color: var(--ink); }
.total-count { display: flex; justify-content: space-between; margin-top: 10px; padding: 10px 3px; color: var(--muted); font-size: 12px; }
.total-count strong { color: var(--ink); }

.summary-preference { margin-top: 9px; padding-top: 17px; border-top: 1px solid var(--line); }
.summary-preference > label { display: block; margin-bottom: 9px; font-size: 12px; font-weight: 800; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: var(--radius-m); background: var(--sunk); }
.segmented-control button { min-height: 49px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.segmented-control strong, .segmented-control span { display: block; }
.segmented-control strong { font-size: 12px; }
.segmented-control span { margin-top: 3px; font-size: 9px; }
.segmented-control button.active { background: var(--panel); color: var(--accent-ink); box-shadow: 0 2px 8px rgba(13, 45, 60, 0.12); }

.generate-button { width: 100%; min-height: 50px; margin-top: 18px; }
.course-note { margin: 10px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; text-align: center; opacity: 0.85; }

/* ---------- 5. 泡泡动效（顶部已选集合） ---------- */
.selection-tray {
  position: sticky;
  top: 10px;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  width: fit-content;
  max-width: min(960px, calc(100% - 32px));
  margin: 0 auto;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--panel) 76%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-soft);
}
.tray-label { color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: 0.1em; }
.tray-empty { color: var(--muted); font-size: 11px; opacity: 0.75; }

.tray-bubble, .fly-bubble {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 240px;
  min-height: 30px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  font-style: normal;
  white-space: nowrap;
}
.tray-bubble em, .fly-bubble em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.tray-bubble i {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: 0 0 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
}
.tray-bubble.goal, .fly-bubble.goal {
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 72%, transparent);
  color: var(--accent-ink);
}
.tray-bubble.fun, .fly-bubble.fun {
  border: 1px solid color-mix(in srgb, var(--fun) 34%, transparent);
  background: color-mix(in srgb, var(--fun-soft) 72%, transparent);
  color: var(--fun-ink);
}
.tray-bubble { animation: bubbleIdle 3.8s ease-in-out infinite; }
.tray-bubble:nth-child(2n) { animation-delay: 0.9s; }
.tray-bubble:nth-child(3n) { animation-delay: 1.7s; }
.tray-bubble.bubble-landed { animation: bubbleLand 0.45s var(--ease-out), bubbleIdle 3.8s ease-in-out 0.45s infinite; }
.tray-bubble button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  opacity: 0.6;
}
.tray-bubble button:hover { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }

.fly-bubble {
  position: fixed;
  z-index: 400;
  margin: 0;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 10px 26px rgba(13, 45, 60, 0.22);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ---------- 6. 规划页 ---------- */
.planning-screen, .complete-screen, .error-screen { display: grid; place-items: center; padding: 28px; background: var(--paper); }
.planning-card, .complete-card, .error-card { width: min(720px, 100%); text-align: center; }
.planning-card p, .complete-card > p, .error-card p { color: var(--muted); line-height: 1.7; }
.thinking-mark { display: flex; justify-content: center; gap: 8px; margin-bottom: 28px; }
.thinking-mark span { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); animation: thinking 1.2s infinite ease-in-out; }
.thinking-mark span:nth-child(2) { animation-delay: 0.16s; background: var(--aqua); }
.thinking-mark span:nth-child(3) { animation-delay: 0.32s; background: var(--fun); }
.planning-steps { margin: 32px auto 0; display: flex; justify-content: center; gap: 8px; }
.planning-steps span { padding: 8px 12px; border-radius: var(--radius-full); background: var(--sunk); color: var(--muted); font-size: 13px; }
.planning-steps span.active { background: var(--accent-soft); color: var(--accent-ink); }

.plan-screen { background: var(--paper); transition: background-color var(--dur-theme) ease; }
.plan-layout {
  width: min(1160px, calc(100% - 56px));
  margin: 0 auto;
  padding: 48px 0 72px;
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 70px;
  align-items: center;
}
.plan-intro h1 { font-size: 42px; }
.objective { margin: 18px 0 0; color: var(--ink); font-size: 18px; line-height: 1.65; }
.plan-reason { margin: 14px 0 0; padding-left: 14px; border-left: 3px solid var(--ok); color: var(--muted); line-height: 1.65; }
.availability-notice { margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-s); background: var(--ok-soft); color: var(--ok); font-size: 12px; line-height: 1.55; }
.availability-notice.adjacent { background: var(--warn-soft); color: var(--warn); }
.goal-mini-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 17px; }
.goal-mini-list span { padding: 6px 8px; border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 700; }

.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.plan-item {
  min-height: 82px;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 13px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-m);
  background: var(--panel);
  box-shadow: 0 7px 20px rgba(13, 45, 60, 0.05);
  animation: cardIn 0.5s var(--ease-out) both;
  transition: background-color var(--dur-theme) ease, border-color var(--dur-theme) ease;
}
.plan-item:nth-child(2) { animation-delay: 0.05s; }
.plan-item:nth-child(3) { animation-delay: 0.1s; }
.plan-item:nth-child(4) { animation-delay: 0.15s; }
.plan-item:nth-child(5) { animation-delay: 0.2s; }
.plan-item:nth-child(6) { animation-delay: 0.25s; }
.plan-item.entertainment { border-left-color: var(--fun); }
.plan-number { color: var(--muted); font-size: 13px; font-weight: 800; opacity: 0.7; }
.plan-item strong { display: block; margin-top: 3px; line-height: 1.35; }
.plan-item small { display: block; margin-top: 5px; color: var(--muted); }
.item-type { color: var(--accent-ink); font-size: 11px; font-weight: 800; }
.plan-item.entertainment .item-type { color: var(--fun-ink); }

.course-card { margin-bottom: 12px; padding: 16px; border: 1px solid var(--warn); border-left: 4px solid var(--warn); border-radius: var(--radius-m); background: var(--warn-soft); }
.feature-card { margin-bottom: 12px; padding: 16px; border: 1px solid var(--ok); border-left: 4px solid var(--ok); border-radius: var(--radius-m); background: var(--ok-soft); }
.course-kicker { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.course-kicker span { color: var(--warn); font-size: 11px; font-weight: 900; }
.feature-card .course-kicker span { color: var(--ok); }
.course-kicker small { color: var(--muted); font-size: 10px; }
.course-card h2, .feature-card h2 { margin: 8px 0 0; font-size: 17px; line-height: 1.35; }
.course-card > p, .feature-card > p { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.course-topic { margin: 10px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.course-card .secondary-button, .feature-card .secondary-button { min-height: 34px; font-size: 11px; }

/* ---------- 7. 视频流页（深海场景，视频为绝对主角） ---------- */
.feed-screen { height: 100vh; min-height: 620px; overflow: hidden; background: var(--deep); color: #fff; }
.feed-header { height: 58px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.feed-header > :last-child { justify-self: end; }
.round-progress { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, 0.58); font-size: 12px; }
.round-progress strong { color: #fff; }
.progress-dots { display: flex; gap: 5px; }
.progress-dots i { width: 22px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); }
.progress-dots i.done { background: var(--wave); }
.progress-dots i.current { background: #fff; }

.feed-layout { height: calc(100vh - 58px); display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 14px; width: min(1380px, 100%); margin: 0 auto; padding: 14px; }
.feed-layout.summary-open { width: min(1600px, 100%); grid-template-columns: minmax(560px, 1fr) minmax(340px, 410px) 78px; }
.video-column { min-width: 0; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--radius-m); background: #050b11; }
.video-frame-wrap { min-height: 0; display: grid; place-items: center; background: #02070c; }
.video-frame-wrap iframe { width: 100%; height: 100%; min-height: 410px; border: 0; display: block; }
.video-information { min-height: 104px; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 14px 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); background: var(--deep-panel); }
.video-title-block { min-width: 0; }
.video-title-block h1 { margin: 7px 0 0; max-width: 900px; font-size: 20px; line-height: 1.3; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.video-title-block p { margin: 6px 0 0; color: rgba(255, 255, 255, 0.55); font-size: 12px; }
.video-labels { display: flex; align-items: center; gap: 8px; color: rgba(255, 255, 255, 0.58); font-size: 11px; }
.content-label, .long-label { padding: 4px 7px; border-radius: 6px; background: rgba(127, 212, 193, 0.16); color: var(--wave); font-weight: 800; }
.content-label.entertainment { background: rgba(110, 198, 216, 0.16); color: var(--aqua); }
.long-label { background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.75); }
.compact-actions { flex: 0 0 auto; display: flex; gap: 6px; }
.compact-actions button { min-height: 32px; border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 6px; padding: 0 9px; background: rgba(255, 255, 255, 0.06); color: rgba(255, 255, 255, 0.66); font-size: 11px; }
.compact-actions button.selected { border-color: var(--wave); color: var(--wave); background: rgba(127, 212, 193, 0.14); }

.side-controls { height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.control-button { width: 100%; min-height: 58px; display: grid; place-items: center; align-content: center; gap: 2px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: var(--radius-m); background: var(--deep-panel); color: rgba(255, 255, 255, 0.7); transition: border-color var(--dur-fast) ease, background-color var(--dur-fast) ease, color var(--dur-fast) ease; }
.control-button strong { font-size: 16px; }
.control-button span { font-size: 10px; }
.control-button:hover, .control-button.active { border-color: rgba(127, 212, 193, 0.65); background: rgba(21, 147, 127, 0.24); color: var(--wave); }
.control-button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.control-button.primary:hover { background: var(--accent-hover); }
.nav-spacer { height: 18px; }

/* ---------- 8. 总结面板（侧栏，不遮挡视频） ---------- */
.summary-panel { display: none; height: 100%; min-width: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: var(--radius-m); background: var(--panel); color: var(--ink); }
.summary-open .summary-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.summary-header { height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid var(--line); background: var(--panel); }
.summary-header span { display: block; color: var(--accent-ink); font-size: 9px; font-weight: 900; letter-spacing: 0.11em; }
.summary-header strong { display: block; margin-top: 2px; }
.summary-head-actions { display: flex; align-items: center; gap: 8px; }
.summary-mode-switch { display: flex; padding: 3px; border-radius: 8px; background: var(--sunk); }
.summary-mode-switch button { min-height: 27px; border: 0; border-radius: 6px; padding: 0 9px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 700; }
.summary-mode-switch button.active { background: var(--panel); color: var(--accent-ink); box-shadow: 0 1px 5px rgba(13, 45, 60, 0.12); }
.close-button { width: 32px; height: 32px; border: 0; border-radius: 8px; background: var(--sunk); color: var(--muted); font-size: 22px; line-height: 1; }
.summary-content { overflow-y: auto; padding: 16px; }
.source-quality { display: inline-flex; margin-bottom: 12px; padding: 5px 8px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); font-size: 11px; font-weight: 800; }
.source-quality.weak { background: var(--warn-soft); color: var(--warn); }
.quick-take { padding: 15px; border: 1px solid var(--accent-line); border-radius: var(--radius-m); background: var(--accent-soft); }
.quick-take span, .watch-advice span { color: var(--accent-ink); font-size: 11px; font-weight: 900; }
.quick-take p { margin: 8px 0 0; line-height: 1.65; font-weight: 650; }
.summary-section { padding: 17px 2px; border-bottom: 1px solid var(--line); }
.summary-section h2 { margin: 0 0 10px; font-size: 14px; }
.summary-section p, .summary-section li { color: var(--muted); font-size: 13px; line-height: 1.7; }
.summary-section ol, .summary-section ul { margin: 0; padding-left: 23px; display: grid; gap: 7px; }
.summary-section.takeaway { border: 0; }
.watch-advice { padding: 14px; border-radius: var(--radius-m); background: var(--ok-soft); }
.watch-advice span { color: var(--ok); }
.watch-advice p { margin: 7px 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.limitations { margin-top: 14px; color: var(--muted); font-size: 12px; }
.limitations p { line-height: 1.6; }
.summary-loading, .summary-error { min-height: 340px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px; }
.summary-loading p, .summary-error p { margin: 8px 0; color: var(--muted); line-height: 1.55; }
.summary-loading span { color: var(--muted); font-size: 11px; opacity: 0.8; }
.summary-pulse { width: 44px; height: 44px; margin-bottom: 18px; border: 3px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }

/* ---------- 9. 轮末知识回顾 ---------- */
.complete-check, .error-card > span { width: 54px; height: 54px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 24px; }
.complete-actions { display: flex; justify-content: center; gap: 10px; }
.error-card > span { background: var(--warn); }

.round-review-screen { min-height: 100vh; background: var(--paper); color: var(--ink); transition: background-color var(--dur-theme) ease; }
.review-header { height: 62px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--line); background: var(--panel); transition: background-color var(--dur-theme) ease; }
.review-header > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.review-header > :last-child { justify-self: end; }
.dark-text { color: var(--ink); }
.review-wrap { width: min(1320px, calc(100% - 36px)); margin: 0 auto; padding: 28px 0 42px; }
.review-intro { display: grid; grid-template-columns: 58px 1fr auto; gap: 16px; align-items: center; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--panel); transition: background-color var(--dur-theme) ease; }
.review-intro .complete-check { margin: 0; width: 48px; height: 48px; font-size: 20px; }
.review-intro h1 { margin: 5px 0 0; font-size: 25px; line-height: 1.25; }
.review-intro p { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.review-stats { display: grid; grid-template-columns: auto auto auto auto; gap: 8px; align-items: baseline; padding-left: 20px; border-left: 1px solid var(--line); }
.review-stats strong { color: var(--accent-ink); font-size: 24px; }
.review-stats span { color: var(--muted); font-size: 11px; }

.knowledge-layout { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 16px; }
.knowledge-layout.detail-open { grid-template-columns: minmax(0, 1fr) 390px; }
.knowledge-map { min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--panel); overflow: hidden; transition: background-color var(--dur-theme) ease; }
.map-root { width: min(620px, 86%); margin: 0 auto; padding: 14px 18px; border: 1px solid var(--accent-line); border-radius: var(--radius-m); background: var(--accent-soft); text-align: center; }
.map-root span { display: block; color: var(--accent-ink); font-size: 10px; font-weight: 900; }
.map-root strong { display: block; margin-top: 5px; line-height: 1.4; }
.map-trunk { width: 2px; height: 22px; margin: 0 auto; background: var(--line); }
.map-branches { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.map-branch { min-width: 0; padding: 14px; border: 1px solid var(--line); border-top: 3px solid var(--accent); border-radius: var(--radius-m); background: var(--panel-soft); transition: background-color var(--dur-theme) ease; }
.map-branch.entertainment { border-top-color: var(--fun); }
.branch-label span { display: block; color: var(--accent-ink); font-size: 9px; font-weight: 900; }
.map-branch.entertainment .branch-label span { color: var(--fun-ink); }
.branch-label strong { display: block; margin-top: 4px; font-size: 14px; }
.branch-nodes { display: grid; gap: 7px; margin-top: 10px; }
.knowledge-node { min-width: 0; min-height: 82px; display: block; width: 100%; padding: 10px 11px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--panel); text-align: left; transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease, background-color var(--dur-theme) ease; }
.knowledge-node:hover, .knowledge-node.active { border-color: var(--accent-line); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 10%, transparent); }
.knowledge-node > span { display: block; color: var(--accent-ink); font-size: 9px; font-weight: 800; }
.map-branch.entertainment .knowledge-node > span { color: var(--fun-ink); }
.knowledge-node strong { display: block; margin-top: 4px; overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.knowledge-node small { display: -webkit-box; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

.map-detail { height: min(680px, calc(100vh - 112px)); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--panel); box-shadow: var(--shadow); }
.map-detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 15px; border-bottom: 1px solid var(--line); }
.map-detail-head span { display: block; color: var(--accent-ink); font-size: 10px; font-weight: 900; }
.map-detail-head strong { display: block; margin-top: 4px; font-size: 13px; line-height: 1.4; }
.map-detail-head button { flex: 0 0 30px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--sunk); color: var(--muted); font-size: 18px; }
.map-detail-body { overflow-y: auto; padding: 16px; }
.map-detail-actions { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px; border-top: 1px solid var(--line); }
.map-detail-actions button { min-height: 34px; font-size: 10px; }
.map-summary-empty { min-height: 270px; display: grid; place-content: center; text-align: center; }
.map-summary-empty p { max-width: 260px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.summary-loading.compact { min-height: 270px; }
.map-summary h2 { margin: 18px 0 8px; font-size: 13px; }
.map-summary p, .map-summary li { color: var(--muted); font-size: 12px; line-height: 1.7; }
.map-summary ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.review-wrap > .complete-actions { margin-top: 16px; }

/* ---------- 9.5 轮末匿名反馈 ---------- */
.feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(3, 15, 24, 0.72);
}
.round-feedback-dialog {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow-y: auto;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.feedback-kicker { color: var(--accent-ink); font-size: 11px; font-weight: 900; }
.round-feedback-dialog h2 { margin: 8px 0 0; font-size: 25px; letter-spacing: 0; }
.round-feedback-dialog > p { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.rating-options { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 22px; }
.rating-options button {
  min-width: 0;
  min-height: 76px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
}
.rating-options button strong { color: var(--ink); font-size: 21px; }
.rating-options button span { font-size: 10px; }
.rating-options button:hover, .rating-options button.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.feedback-comment { display: grid; gap: 8px; margin-top: 22px; }
.feedback-comment > span { font-size: 13px; font-weight: 800; }
.feedback-comment small { color: var(--muted); font-weight: 500; }
.feedback-comment textarea {
  width: 100%;
  resize: vertical;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  outline: none;
  background: var(--panel-soft);
  color: var(--ink);
  line-height: 1.6;
}
.feedback-comment textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.feedback-comment em { justify-self: end; color: var(--muted); font-size: 10px; font-style: normal; }
.feedback-error { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 12px; }
.feedback-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 10. 错误页 ---------- */
.error-card h1 { margin: 0; font-size: 28px; }

/* ---------- 11. 动效 ---------- */
@keyframes thinking { 0%, 70%, 100% { transform: translateY(0); opacity: 0.45; } 35% { transform: translateY(-9px); opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bubbleIdle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes bubbleLand { 0% { transform: scale(0.7); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 11.5 欢迎页（landing） ---------- */
.landing-screen {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  background:
    radial-gradient(1000px 520px at 50% -180px, color-mix(in srgb, var(--aqua) 18%, transparent), transparent 72%),
    radial-gradient(720px 460px at 88% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--paper);
  transition: background-color var(--dur-theme) ease;
}
.landing-header {
  position: relative;
  z-index: 2;
  height: 72px;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
}
.landing-hero {
  position: relative;
  z-index: 2;
  place-self: center;
  width: min(860px, calc(100% - 40px));
  margin: 0 auto;
  padding: 20px 0 72px;
  text-align: center;
}
.landing-hero h1 {
  margin: 16px 0 0;
  font-size: clamp(38px, 8.5vw, 88px);
  line-height: 1.08;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, var(--ink) 30%, var(--accent-ink) 85%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.landing-sub {
  max-width: 560px;
  margin: 20px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}
.landing-features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 26px auto 0;
  padding: 0;
}
.landing-features li {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--panel) 72%, transparent);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
.landing-features li::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent-ink);
}
.landing-start { min-width: 180px; margin-top: 36px; font-size: 16px; }
.landing-privacy {
  margin: 14px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.landing-privacy a { color: var(--accent-ink); }

.privacy-page {
  min-height: 100vh;
  padding: 48px 20px 80px;
  background: var(--paper);
  color: var(--ink);
}
.privacy-document { width: min(760px, 100%); margin: 0 auto; }
.privacy-document h1 { margin: 28px 0 10px; font-size: 32px; }
.privacy-document h2 { margin: 30px 0 10px; font-size: 18px; }
.privacy-document p,
.privacy-document li { color: var(--muted); line-height: 1.8; }
.privacy-document ul { padding-left: 22px; }
.privacy-document .privacy-updated { margin-top: 0; font-size: 13px; }

/* 环境泡泡：仅 transform/opacity，尊重 prefers-reduced-motion */
.landing-ambient { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.landing-ambient i {
  position: absolute;
  bottom: -90px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--aqua) 34%, transparent);
  background: color-mix(in srgb, var(--accent-soft) 42%, transparent);
  opacity: 0;
  animation: ambientRise 16s linear infinite;
}
.landing-ambient i:nth-child(1) { left: 8%; width: 64px; height: 64px; animation-delay: 0s; }
.landing-ambient i:nth-child(2) { left: 22%; width: 30px; height: 30px; animation-delay: 3.5s; animation-duration: 13s; }
.landing-ambient i:nth-child(3) { left: 38%; width: 46px; height: 46px; animation-delay: 7s; animation-duration: 18s; }
.landing-ambient i:nth-child(4) { left: 55%; width: 24px; height: 24px; animation-delay: 1.8s; animation-duration: 12s; }
.landing-ambient i:nth-child(5) { left: 68%; width: 56px; height: 56px; animation-delay: 5.5s; animation-duration: 17s; }
.landing-ambient i:nth-child(6) { left: 82%; width: 34px; height: 34px; animation-delay: 9s; animation-duration: 14s; }
.landing-ambient i:nth-child(7) { left: 92%; width: 20px; height: 20px; animation-delay: 11.5s; animation-duration: 11s; }
@keyframes ambientRise {
  0% { transform: translateY(0) translateX(0) scale(0.9); opacity: 0; }
  12% { opacity: 0.5; }
  85% { opacity: 0.32; }
  100% { transform: translateY(-108vh) translateX(-24px) scale(1.05); opacity: 0; }
}

/* ---------- 12. 响应式 ---------- */
@media (max-width: 1000px) {
  .setup-grid { grid-template-columns: 1fr; }
  .round-settings { width: 100%; }
  .plan-layout { grid-template-columns: 1fr; gap: 32px; }
  .feed-layout.summary-open { grid-template-columns: minmax(0, 1fr) minmax(300px, 38%) 70px; }
  .video-information { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .compact-actions { width: 100%; flex-wrap: wrap; }
  .knowledge-layout.detail-open { grid-template-columns: 1fr; }
  .map-detail { height: auto; max-height: 680px; }
}

@media (max-width: 760px) {
  .home-header, .simple-header, .home-content, .plan-layout { width: min(100% - 28px, 100%); }
  .home-header, .simple-header { height: auto; min-height: 60px; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
  .brand { white-space: nowrap; }
  .status, .mode-badge { white-space: nowrap; }
  .home-screen { padding-bottom: 88px; }
  .home-content { padding-top: 24px; }
  .home-copy h1, .planning-card h1, .complete-card h1 { font-size: 34px; }
  .home-copy.compact h1 { font-size: 32px; }
  .interest-grid { grid-template-columns: repeat(2, 1fr); }
  .service-statuses { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }
  .service-statuses .status:first-child { display: none; }
  .history-status { flex-wrap: wrap; justify-content: center; }
  .selection-tray { top: 6px; gap: 5px; padding: 6px 10px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--panel); }
  .tray-bubble { min-height: 34px; }

  /* 欢迎页移动端 */
  .landing-header { width: min(100% - 28px, 100%); }
  .landing-hero { width: min(100% - 32px, 100%); padding-bottom: 56px; }
  .landing-hero h1 { font-size: clamp(34px, 11vw, 48px); }
  .landing-sub { font-size: 15px; }
  .landing-features { gap: 6px; }
  .landing-features li { min-height: 36px; font-size: 12px; }
  .landing-start { width: 100%; max-width: 320px; min-height: 52px; }
  .landing-ambient i:nth-child(n+5) { display: none; }
  /* 触控目标 ≥44px */
  .interest-option { min-height: 56px; }
  .stepper { grid-template-columns: 44px 32px 44px; }
  .stepper button { width: 44px; height: 44px; }
  .preset { min-height: 62px; }
  .goal-tag button { width: 44px; height: 44px; }
  .history-status button { min-height: 34px; }

  .feed-screen { height: auto; min-height: 100vh; overflow: auto; }
  .feed-header { grid-template-columns: auto 1fr; }
  .feed-header > :last-child { display: none; }
  .round-progress { justify-self: end; }
  .round-progress > span { display: none; }
  .feed-layout, .feed-layout.summary-open { height: auto; min-height: calc(100vh - 58px); grid-template-columns: 1fr; padding: 8px; }
  .video-column { height: auto; }
  .video-frame-wrap iframe { height: 56vw; min-height: 260px; }
  .video-title-block h1 { white-space: normal; font-size: 17px; }
  .summary-panel { height: auto; max-height: 72vh; order: 3; }
  .side-controls { order: 2; height: auto; flex-direction: row; overflow-x: auto; justify-content: flex-start; }
  .control-button { flex: 0 0 68px; min-height: 54px; }
  .nav-spacer { display: none; }

  .review-header { grid-template-columns: auto 1fr; }
  .review-header > span { display: none; }
  .review-intro { grid-template-columns: 48px 1fr; }
  .review-stats { grid-column: 1 / -1; border: 0; padding: 8px 0 0; }
  .map-branches { grid-template-columns: 1fr; }
  .round-feedback-dialog { padding: 22px 18px; }
  .rating-options { grid-template-columns: repeat(5, minmax(52px, 1fr)); overflow-x: auto; }
  .rating-options button { min-height: 68px; }
  .feedback-actions { flex-direction: column-reverse; }
  .feedback-actions button { width: 100%; }
}

/* ---------- 13. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .tray-bubble, .tray-bubble.bubble-landed { animation: none; }
  .landing-ambient { display: none; }
}
