/* 设计系统：英语启蒙风（天蓝渐变 + 阳光黄 CTA + 深蓝标题，大圆角，柔和阴影） */
:root {
  --brand: #3BA0ED;
  --brand-dark: #1F7CC7;
  --brand-soft: #E8F4FE;
  --accent: #FF9DB0;
  --accent-soft: #FFEef2;
  --sun: #FFC53D;
  --sun-deep: #F5A623;
  --ink: #16324F;
  --bg: #F5FBFF;
  --card: #ffffff;
  --text: #23405E;
  --muted: #7A8094;
  --line: #E4EEF6;
  --warn: #F5A623;
  --ok: #34C77B;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 8px 24px rgba(59, 160, 237, .10);
  --shadow-lg: 0 14px 38px rgba(59, 160, 237, .18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .9);
  backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line);
}
.topbar .row { display: flex; align-items: center; gap: 18px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; color: var(--brand-dark); }
.logo .mascot { font-size: 22px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(59,160,237,.25)); }
.logo .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.nav { display: flex; gap: 6px; margin-left: 8px; }
.nav a { padding: 9px 16px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; transition: .15s; }
.nav a.active, .nav a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.topbar .spacer { flex: 1; }
.user-chip {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 13px; cursor: pointer;
  transition: .15s;
}
.user-chip:hover { box-shadow: var(--shadow); }
.user-chip .ava { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; display: grid; place-items: center; font-size: 12px; }

/* ---------- Hero（旧版通用，内页仍用） ---------- */
.hero { padding: 30px 0 10px; }
.hero h1 { font-size: 28px; font-weight: 800; letter-spacing: .5px; }
.hero p { color: var(--muted); margin-top: 8px; }

/* ---------- 首页大 Banner（英语启蒙风） ---------- */
.theme-home .topbar {
  background: rgba(255, 255, 255, .62); border-bottom: none;
  backdrop-filter: saturate(180%) blur(14px);
}
.hero-band {
  background: linear-gradient(180deg, #BFE7FF 0%, #D9F1FF 52%, #EFFAFF 100%);
  border-radius: 0 0 36px 36px;
  padding: 34px 0 0;
  overflow: hidden;
}
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; align-items: center; }
.hero-copy { padding: 26px 0 40px; }
.hero-copy h1 {
  font-size: 44px; line-height: 1.22; font-weight: 900; color: var(--ink); letter-spacing: 1px;
}
.hero-copy p { color: #4A6B8A; font-size: 17px; margin-top: 16px; font-weight: 600; }
.hero-btns { display: flex; gap: 14px; margin-top: 26px; flex-wrap: wrap; }
.btn.sun {
  background: linear-gradient(180deg, #FFD24D, var(--sun)); color: #5A3A00;
  box-shadow: 0 10px 22px rgba(255, 197, 61, .45); font-size: 15px; padding: 13px 26px;
}
.btn.sun:hover { background: linear-gradient(180deg, #FFC93C, var(--sun-deep)); }
.btn.ghost { background: rgba(255,255,255,.9); color: var(--ink); border: 1.5px solid #CFE6F7; }
.hero-art svg { width: 100%; height: auto; display: block; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 8px 0 0; text-align: center; }
  .hero-copy h1 { font-size: 30px; }
  .hero-btns { justify-content: center; }
  .hero-art { max-width: 420px; margin: 0 auto; }
}

/* ---------- 四大特色卡 ---------- */
.feature-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin: -8px auto 6px; position: relative; z-index: 2;
}
.feat {
  background: #fff; border-radius: 20px; padding: 20px 16px; display: flex; align-items: center; gap: 13px;
  box-shadow: var(--shadow); border: 1.5px solid #EAF3FB; font-size: 15px; transition: .18s;
}
.feat:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.feat b { color: var(--ink); font-weight: 800; }
.fi {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; flex: none;
}
.fi.blue { background: #E3F2FE; }
.fi.green { background: #E4F8EE; }
.fi.pink { background: #FFEAF0; }
.fi.yellow { background: #FFF4D6; }
@media (max-width: 900px) { .feature-strip { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .feature-strip { grid-template-columns: 1fr; } .feat { padding: 15px 14px; } }

/* ---------- Filter tabs ---------- */
.filterbar { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 6px; }
.filter-label { font-size: 13px; color: var(--muted); font-weight: 700; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  padding: 9px 18px; border-radius: 999px; background: #fff; border: 1.5px solid var(--line);
  color: var(--muted); font-weight: 600; font-size: 14px; transition: .15s;
}
.tab:hover { border-color: var(--brand); color: var(--brand-dark); transform: translateY(-1px); }
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow); }

/* ---------- Grid + cards ---------- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin: 20px 0 44px; }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px)  { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1.5px solid var(--line);
  box-shadow: var(--shadow); transition: .2s; cursor: pointer; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: #d7eaf9; }
.card .cover { position: relative; aspect-ratio: 4/3; background: linear-gradient(135deg, #eef2ff, #ffeef2); }
.card .cover img { width: 100%; height: 100%; object-fit: cover; }
.card .badge {
  position: absolute; top: 12px; left: 12px; background: rgba(59,160,237,.94); color: #fff;
  font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; box-shadow: var(--shadow);
}
.card .badge.topic { left: auto; right: 12px; background: rgba(255,157,176,.94); }
.card .body { padding: 14px 16px 18px; }
.card .title { font-weight: 700; font-size: 15px; line-height: 1.4; }
.card .meta { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.card .desc { color: var(--muted); font-size: 12.5px; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 11px 20px; border-radius: 999px;
  background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; transition: .15s; box-shadow: var(--shadow);
}
.btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: #fff; color: var(--brand-dark); border: 1.5px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brand); }
.btn.coral { background: var(--accent); }
.btn.coral:hover { background: #ff85a0; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Album detail ---------- */
.album-head { display: flex; gap: 20px; margin: 22px 0; background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1.5px solid var(--line); }
.album-head .cover { width: 200px; flex: none; border-radius: 16px; overflow: hidden; aspect-ratio: 4/3; background: linear-gradient(135deg, #eef2ff, #ffeef2); }
.album-head .cover img { width: 100%; height: 100%; object-fit: cover; }
.album-head h2 { font-size: 22px; }
.album-head .tags { display: flex; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); }
.tag.green { background: #e7fbf3; color: #18a878; }
.album-head .desc { color: var(--muted); margin-top: 6px; }
@media (max-width: 600px) { .album-head { flex-direction: column; } .album-head .cover { width: 100%; } }

.ep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 14px 0 40px; }
.ep {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; background: #fff; border: 1.5px solid var(--line);
  border-radius: 16px; font-weight: 600; transition: .15s; cursor: pointer;
}
.ep:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.ep .num { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; flex: none; }
.ep.watched .num { background: var(--ok); color: #fff; }
.ep .thumb { position: relative; width: 68px; height: 42px; border-radius: 10px; overflow: hidden; flex: none; background: var(--brand-soft); }
.ep .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ep .thumb .badge {
  position: absolute; left: 4px; bottom: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: rgba(30, 34, 60, .72); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; line-height: 1;
}
.ep.watched .thumb { box-shadow: 0 0 0 2px var(--ok); }
.ep .name { font-size: 14px; }
.ep .done { margin-left: auto; color: var(--ok); font-size: 12px; font-weight: 700; }
.ep .dur { color: var(--muted); font-size: 12px; }

/* ---------- Player ---------- */
.player-wrap { max-width: 1000px; margin: 18px auto 40px; }
.video-box { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/9; }
.video-box video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.player-meta h2 { font-size: 20px; }
.cast-tip { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; padding: 10px 14px; border-radius: 14px; font-size: 13px; margin-top: 14px; }
.timer-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; padding: 7px 14px; border-radius: 999px; font-size: 13px; }

/* ---------- Book read ---------- */
.read-layout { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 16px 0 40px; }
.read-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: #fff; padding: 12px; border-radius: 16px; box-shadow: var(--shadow); position: sticky; top: 74px; z-index: 10; border: 1.5px solid var(--line); }
.read-tools .grow { flex: 1; }
.pdf-stage { background: #525659; border-radius: 16px; padding: 16px; min-height: 60vh; display: flex; justify-content: center; overflow: auto; }
.pdf-stage canvas { background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.4); max-width: 100%; }
.read-text { background: #fff; border-radius: 16px; padding: 18px; box-shadow: var(--shadow); border: 1.5px solid var(--line); }
.read-text h3 { font-size: 15px; margin-bottom: 10px; }
.sentence { cursor: pointer; padding: 2px 0; border-radius: 6px; }
.sentence:hover { background: #f1f5f9; }
.sentence.active { background: #fde68a; }
.tts-status { font-size: 13px; color: var(--muted); }

/* ---------- Profile ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 20px 0; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1.5px solid var(--line); }
.stat .v { font-size: 28px; font-weight: 800; color: var(--brand); }
.stat .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.section-title { font-size: 18px; font-weight: 800; margin: 24px 0 10px; }
.record { display: flex; gap: 12px; padding: 13px 16px; background: #fff; border: 1.5px solid var(--line); border-radius: 16px; margin-bottom: 8px; font-size: 14px; }
.record .ico { width: 38px; height: 38px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-weight: 800; flex: none; }
.record .when { color: var(--muted); font-size: 12px; }

/* ---------- Admin ---------- */
.admin-grid { display: grid; grid-template-columns: 240px 1fr; gap: 16px; margin: 18px 0 40px; }
@media (max-width: 760px){ .admin-grid{ grid-template-columns: 1fr; } }
.admin-side { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); height: fit-content; border: 1.5px solid var(--line); }
.admin-side a { display: block; padding: 11px 14px; border-radius: 14px; font-weight: 600; color: var(--muted); transition: .15s; }
.admin-side a.active, .admin-side a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.panel { background: #fff; border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1.5px solid var(--line); }
.form-row { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.form-row label { font-size: 13px; font-weight: 700; color: var(--muted); }
.form-row input, .form-row select, .form-row textarea {
  padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; width: 100%; background: #fbfcff; transition: .15s;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; overflow: hidden; border-radius: 14px; }
table.tbl th, table.tbl td { padding: 11px 13px; border-bottom: 1px solid var(--line); text-align: left; }
table.tbl th { color: var(--muted); font-weight: 700; background: var(--brand-soft); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl tbody tr:hover { background: #fbfcff; }
.mini-link { color: var(--brand-dark); font-weight: 700; cursor: pointer; }
.mini-link:hover { text-decoration: underline; }

/* ---------- 上传组件（一目了然的两段式） ---------- */
.seg { display: inline-flex; background: var(--brand-soft); border-radius: 999px; padding: 4px; gap: 4px; }
.seg button { padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); transition: .15s; }
.seg button.active { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow); }

.dropzone {
  border: 2px dashed #cfd7f5; border-radius: var(--radius); background: #fbfcff; padding: 28px 20px;
  text-align: center; color: var(--muted); transition: .15s; cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.dropzone .big { font-size: 30px; line-height: 1; }
.dropzone .hint { font-size: 13px; margin-top: 8px; }
.dropzone .pick { display: inline-block; margin-top: 12px; padding: 9px 18px; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; }

.filechip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fbfcff;
  border: 1.5px solid var(--line); border-radius: 14px; margin-top: 8px; font-size: 13px;
}
.filechip .ico { width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand-dark); display: grid; place-items: center; font-size: 15px; flex: none; }
.filechip .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filechip .sz { color: var(--muted); font-size: 12px; margin-left: auto; flex: none; }
.filechip .x { color: var(--muted); cursor: pointer; font-weight: 800; padding: 0 4px; flex: none; }
.filechip .x:hover { color: var(--accent); }

.batch-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.batch-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; font-size: 13px; }
.batch-item .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.batch-item .st { font-size: 12px; font-weight: 700; flex: none; }
.batch-item .st.wait { color: var(--muted); }
.batch-item .st.up { color: var(--brand-dark); }
.batch-item .st.ok { color: var(--ok); }
.batch-item .st.err { color: var(--warn); }
.batch-item .bar { width: 80px; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; flex: none; }
.batch-item .bar > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .3s; }

.toggle-row { display: flex; align-items: center; gap: 10px; margin: 12px 0; font-size: 13.5px; font-weight: 600; color: var(--text); }
.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; background: #d8deee; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: .2s; }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:disabled + .track { opacity: .5; cursor: not-allowed; }
.note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.note.warn { color: var(--warn); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px); background: #2B2F3A; color: #fff; padding: 12px 20px; border-radius: 14px; font-weight: 600; opacity: 0; transition: .25s; z-index: 200; pointer-events: none; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 50px 0; }
.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 30px 0 40px; }
.back-link { color: var(--brand-dark); font-weight: 700; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; margin: 16px 0; }

/* ---------- 首页：每日学习时长 ---------- */
.study-strip { margin: 14px 0 6px; }
.study-card {
  background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; display: grid; grid-template-columns: auto 1fr auto auto; gap: 22px; align-items: center;
}
.study-today { display: flex; align-items: center; gap: 12px; }
.study-today .face { font-size: 34px; line-height: 1; }
.study-today .num b { font-size: 32px; font-weight: 800; color: var(--brand-dark); }
.study-today .num span { font-size: 13px; color: var(--muted); margin-left: 4px; font-weight: 700; }
.study-today .say { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.study-goal { min-width: 180px; }
.study-goal .goal-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.study-goal .goal-pct { color: var(--brand-dark); }
.study-goal .sub { font-size: 12px; color: var(--muted); margin-top: 7px; }
.bar { height: 9px; border-radius: 999px; background: var(--brand-soft); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .4s; }
.bar.big { height: 14px; margin: 10px 0; }
.study-nums { display: flex; gap: 18px; text-align: center; }
.study-nums b { display: block; font-size: 20px; font-weight: 800; color: var(--brand-dark); }
.study-nums span { font-size: 11.5px; color: var(--muted); }
.ai-btn { background: linear-gradient(135deg, var(--brand), #7FC3F5); }

/* ---------- AI 助手 ---------- */
.ai-panel { margin-bottom: 16px; }
.ai-h3 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }
.ai-form .form-row { margin-bottom: 14px; }
.age-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.age-row input { width: 90px; }
.age-row .unit { color: var(--muted); font-weight: 700; }
.chip {
  padding: 7px 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 700; font-size: 13px; border: 1.5px solid transparent; transition: .15s;
}
.chip:hover { border-color: var(--brand); }
.age-chips, .qa-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.qa-chips { margin-bottom: 12px; }
.seg-btn.on, .seg button.on { background: #fff; color: var(--brand-dark); box-shadow: var(--shadow); }
.qa-answer {
  background: var(--brand-soft); border-radius: 14px; padding: 14px 16px; font-size: 13.5px;
  line-height: 1.7; color: #3C4260;
}
.qa-answer .qa-title { font-weight: 800; margin-bottom: 6px; color: var(--brand-dark); }
.ai-result { margin-bottom: 16px; }
.ai-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.ai-head .ai-emoji { font-size: 40px; }
.ai-head > div { flex: 1; }
.ai-band { font-size: 17px; font-weight: 800; }
.ai-goalline { font-size: 13px; color: var(--muted); margin-top: 3px; }
.ai-goalline b { color: var(--brand-dark); font-size: 15px; }
.ai-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.ai-metrics .m { background: var(--brand-soft); border-radius: 14px; padding: 12px 8px; text-align: center; }
.ai-metrics .m b { display: block; font-size: 22px; font-weight: 800; color: var(--brand-dark); }
.ai-metrics .m span { font-size: 11.5px; color: var(--muted); }
.ai-why { font-size: 13.5px; line-height: 1.75; color: #3C4260; }
.ai-sub { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 16px; }
.ai-col ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.9; color: #3C4260; }
.ai-verdict { font-size: 16px; font-weight: 800; margin-bottom: 8px; }
.ai-verdict.none { color: var(--muted); }
.ai-verdict.low { color: var(--warn); }
.ai-verdict.good { color: var(--ok); }
.ai-verdict.over { color: var(--accent); }
.ai-action { font-size: 14px; font-weight: 700; color: var(--brand-dark); margin-top: 10px; }

/* ---------- 只听声音模式 ---------- */
.video-box.audio-mode video { opacity: 0; pointer-events: none; }
.audio-veil {
  position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; background: linear-gradient(160deg, #2A2F4A, #3D4470); color: #fff; border-radius: var(--radius); text-align: center; padding: 20px;
}
.video-box.audio-mode .audio-veil { display: flex; }
.audio-veil .veil-emoji { font-size: 44px; }
.audio-veil .veil-title { font-size: 17px; font-weight: 800; }
.audio-veil .veil-sub { font-size: 12.5px; opacity: .75; }
.audio-veil .wave { display: flex; align-items: flex-end; gap: 5px; height: 34px; margin: 10px 0 6px; }
.audio-veil .wave i { width: 5px; border-radius: 3px; background: var(--accent); animation: wv 1s ease-in-out infinite; }
.audio-veil .wave i:nth-child(2) { animation-delay: .12s; }
.audio-veil .wave i:nth-child(3) { animation-delay: .24s; }
.audio-veil .wave i:nth-child(4) { animation-delay: .36s; }
.audio-veil .wave i:nth-child(5) { animation-delay: .48s; }
.audio-veil .wave i:nth-child(6) { animation-delay: .6s; }
.audio-veil .wave i:nth-child(7) { animation-delay: .72s; }
@keyframes wv { 0%, 100% { height: 8px; } 50% { height: 30px; } }
.audio-veil .veil-btns { display: flex; gap: 10px; margin-top: 6px; }
.audio-veil .veil-tip { font-size: 11.5px; opacity: .6; margin-top: 10px; }

/* ---------- 悬浮 AI 助手 ---------- */
.ai-fab {
  position: fixed; right: 18px; bottom: 22px; z-index: 900; width: 54px; height: 54px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #7FC3F5); color: #fff; font-size: 24px; cursor: pointer;
  display: grid; place-items: center; box-shadow: 0 8px 22px rgba(59, 160, 237, .45); transition: .18s;
}
.ai-fab:hover { transform: translateY(-2px) scale(1.05); }
.ai-float {
  position: fixed; right: 18px; bottom: 86px; z-index: 901; width: 330px; max-width: calc(100vw - 32px);
  background: #fff; border: 1.5px solid var(--line); border-radius: 18px; box-shadow: 0 14px 40px rgba(30, 34, 60, .18);
  display: none; flex-direction: column; overflow: hidden;
}
.ai-float.open { display: flex; }
.ai-float .af-head {
  display: flex; align-items: center; justify-content: space-between; padding: 12px 14px;
  background: linear-gradient(135deg, var(--brand), #7FC3F5); color: #fff; font-weight: 800; font-size: 14px;
}
.ai-float .af-close { background: none; border: none; color: #fff; font-size: 15px; cursor: pointer; }
.ai-float .af-body { padding: 14px; max-height: 58vh; overflow-y: auto; }
.ai-float .af-stat { background: var(--brand-soft); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.ai-float .af-stat-num { font-size: 13px; font-weight: 700; color: var(--brand-dark); }
.ai-float .af-stat-num b { font-size: 20px; }
.ai-float .af-stat .bar { margin: 8px 0 6px; }
.ai-float .af-stat-sub { font-size: 12px; color: var(--muted); }
.ai-float .af-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.ai-float .af-shot img { width: 100%; border-radius: 12px; margin-bottom: 10px; display: block; }
.ai-float .af-item { display: block; margin-bottom: 10px; font-size: 12.5px; line-height: 1.65; color: #3C4260; }
.ai-float .af-item b { display: block; font-size: 13px; color: var(--brand-dark); margin-bottom: 2px; }
.ai-float .af-loading { font-size: 12.5px; color: var(--muted); padding: 8px 0; }
.ai-float .af-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.ai-float .af-chips .chip { font-size: 12px; padding: 6px 11px; }
.ai-float .af-answer { background: var(--brand-soft); border-radius: 12px; padding: 11px 12px; font-size: 12.5px; line-height: 1.7; color: #3C4260; }
.ai-float .af-more { display: block; margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--brand-dark); }

/* ---------- 后台：封面上传 ---------- */
.upload-area { margin-top: 10px; }
.dropzone.over { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.file-chip {
  display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 10px 14px;
  background: var(--brand-soft); border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--brand-dark);
}
.file-chip .fc-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .fc-size { color: var(--muted); font-weight: 600; }
.file-chip .fc-del { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 0 4px; }

/* ---------- Mobile optimization ---------- */
@media (max-width: 760px) {
  .topbar .row { height: auto; min-height: 56px; padding: 8px 0; flex-wrap: wrap; }
  .topbar .logo { font-size: 16px; }
  .topbar .nav { order: 3; width: 100%; margin: 8px 0 0 0; overflow-x: auto; flex-wrap: nowrap; gap: 6px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .topbar .nav::-webkit-scrollbar { display: none; }
  .topbar .nav a { white-space: nowrap; padding: 7px 12px; font-size: 13px; }
  .topbar .user-chip { font-size: 12px; padding: 6px 12px; }
  .hero { padding: 18px 0 6px; }
  .hero h1 { font-size: 22px; }
  .filterbar { gap: 8px; margin: 14px 0 6px; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 4px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 7px 14px; font-size: 13px; }
}
@media (max-width: 640px) {
  .player-wrap { padding: 0 12px; margin: 8px auto 24px; }
  .player-meta { flex-wrap: wrap; gap: 8px; }
  .player-meta .title-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
  .player-meta h2 { font-size: 16px; }
  .player-meta .spacer { display: none; }
  .player-meta .speed-label { font-size: 12px; font-weight: 700; color: var(--muted); }
  .player-meta .speed-label select { margin-left: 4px; padding: 4px 6px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; }
  .player-actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
  .video-box { border-radius: 16px; }
  .cast-tip { font-size: 12px; padding: 8px 12px; }
  .album-head { padding: 14px; gap: 14px; }
  .album-head h2 { font-size: 18px; }
  .ep-list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
  .ep { padding: 10px; gap: 8px; }
  .ep .thumb { width: 56px; height: 36px; }
  .ep .num { width: 28px; height: 28px; font-size: 13px; }
  .ep .name { font-size: 13px; }
  .ep .dur { font-size: 11px; }
  .btn.sm { padding: 7px 12px; font-size: 13px; }
  .panel { padding: 16px; }
}
@media (max-width: 420px) {
  .grid { grid-template-columns: 1fr; }
  .card .cover { aspect-ratio: 16/10; }
  .player-meta .title-wrap { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 760px) {
  .study-card { grid-template-columns: 1fr; gap: 14px; }
  .study-nums { justify-content: space-between; }
  .ai-metrics { grid-template-columns: repeat(2, 1fr); }
  .ai-cols { grid-template-columns: 1fr; gap: 14px; }
  .ai-head { flex-wrap: wrap; }
}
