:root {
  --ink: #14213d;
  --ink-2: #3d4a63;
  --muted: #7b869c;
  --line: #e6ecf5;
  --card: #ffffff;
  --bg: #f4f8ff;
  --brand: #2563eb;
  --radius: 22px;
  --shadow: 0 8px 24px rgba(28, 54, 105, .08), 0 2px 6px rgba(28, 54, 105, .05);
  --font-en: "Baloo 2", "Nunito", "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-zh: "Nunito", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-zh);
  color: var(--ink);
  background: radial-gradient(1200px 600px at 12% -8%, #e8f1ff 0%, rgba(232, 241, 255, 0) 60%),
              radial-gradient(900px 520px at 92% 4%, #fff3e2 0%, rgba(255, 243, 226, 0) 58%),
              var(--bg);
  min-height: 100vh;
  padding: 0 16px 132px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: .45;
  pointer-events: none;
  z-index: -1;
}
.b1 { width: 320px; height: 320px; background: #cfe4ff; top: -90px; left: -80px; }
.b2 { width: 300px; height: 300px; background: #ffe6c9; top: 40px; right: -110px; }

/* ---------------- hero ---------------- */
.hero { max-width: 1180px; margin: 0 auto; padding: 26px 4px 6px; }

.hero-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 12px;
}

.tag-ai {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid #dbe7fb; color: #2b5fbd;
  font-size: 12.5px; font-weight: 700; letter-spacing: .2px;
  padding: 7px 12px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, .08);
}

.pill-done {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); color: var(--ink-2);
  font-family: var(--font-zh); font-size: 12.5px; font-weight: 700;
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  transition: .18s;
}
.pill-done:hover { border-color: #bfe6cf; background: #f6fffa; }
.pill-check {
  display: grid; place-items: center; width: 17px; height: 17px;
  background: #dcfce7; color: #15803d; border-radius: 50%; font-size: 11px;
}

h1 {
  font-family: var(--font-en);
  font-size: clamp(30px, 5.6vw, 44px);
  line-height: 1.12; margin: 0 0 8px; font-weight: 700; letter-spacing: -.5px;
  background: linear-gradient(120deg, #1e3a8a 0%, #2563eb 42%, #0d9488 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.sub { margin: 0; color: var(--muted); font-size: clamp(13px, 1.6vw, 15px); font-weight: 600; }

.hero-stat {
  margin: 10px 0 0; font-size: 12.5px; font-weight: 700; color: #6b7a93;
  display: inline-block; background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 13px;
}

/* ---------------- controls ---------------- */
.controls {
  position: sticky; top: 0; z-index: 30;
  max-width: 1180px; margin: 14px auto 0;
  padding: 12px 12px 13px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border: 1px solid rgba(230, 236, 245, .9);
  border-radius: 20px;
  box-shadow: 0 8px 26px rgba(28, 54, 105, .07);
}

.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 14px; font-size: 15px; opacity: .65; }

#search {
  width: 100%; height: 48px; padding: 0 44px 0 40px;
  font-family: var(--font-zh); font-size: 15px; font-weight: 600; color: var(--ink);
  background: #f5f8fe; border: 1.5px solid #e6ecf7; border-radius: 14px;
  outline: none; transition: .18s;
  appearance: none;
}
#search::placeholder { color: #a3aec2; font-weight: 500; }
#search:focus { border-color: #93b8f5; background: #fff; box-shadow: 0 0 0 4px rgba(147, 184, 245, .18); }
#search::-webkit-search-cancel-button { display: none; }

.clear-btn {
  position: absolute; right: 8px; width: 30px; height: 30px; border: 0;
  border-radius: 50%; background: #e8eefb; color: #5a6b88; font-size: 12px;
  cursor: pointer; font-weight: 700;
}

.setting-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px;
}

.seg {
  display: inline-flex; align-items: center; gap: 2px;
  background: #f2f6fd; border: 1px solid #e6ecf7; border-radius: 13px; padding: 3px;
}
.seg-label { font-size: 12px; color: var(--muted); font-weight: 700; padding: 0 4px 0 7px; }
.seg button {
  border: 0; background: transparent; color: #56657f;
  font-family: var(--font-zh); font-size: 13px; font-weight: 700;
  padding: 8px 13px; border-radius: 10px; cursor: pointer; transition: .16s;
  white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button.on { background: #fff; color: var(--brand); box-shadow: 0 2px 6px rgba(37, 99, 235, .14); }

.btn-all {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; border-radius: 13px; padding: 11px 18px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; font-family: var(--font-zh); font-size: 13.5px; font-weight: 800;
  cursor: pointer; box-shadow: 0 6px 16px rgba(37, 99, 235, .28); transition: .18s;
}
.btn-all:hover { transform: translateY(-1px); box-shadow: 0 9px 20px rgba(37, 99, 235, .34); }
.btn-all:active { transform: translateY(0); }
.btn-all.streaming { background: linear-gradient(135deg, #e11d48, #be123c); box-shadow: 0 6px 16px rgba(225, 29, 72, .28); }
.btn-all .ico { font-size: 11px; }

/* ---------------- chips ---------------- */
.chips {
  max-width: 1180px; margin: 18px auto 0;
  display: flex; gap: 9px; overflow-x: auto; padding: 2px 2px 8px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 15px; border-radius: 999px; cursor: pointer;
  background: #fff; border: 1.5px solid #e8eef8; color: #445068;
  font-family: var(--font-zh); font-size: 13.5px; font-weight: 700;
  transition: .16s; white-space: nowrap;
}
.chip:hover { border-color: #cddcf3; transform: translateY(-1px); }
.chip .num {
  font-size: 11px; font-weight: 800; color: #93a0b6; background: #f2f6fd;
  border-radius: 999px; padding: 1px 7px;
}
.chip.on {
  background: var(--c, #2563eb); border-color: var(--c, #2563eb); color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--c, #2563eb) 32%, transparent);
}
.chip.on .num { background: rgba(255, 255, 255, .26); color: #fff; }

/* ---------------- grid ---------------- */
.grid {
  max-width: 1180px; margin: 6px auto 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(324px, 100%), 1fr));
}

.grid.wide { grid-template-columns: repeat(auto-fill, minmax(min(432px, 100%), 1fr)); }

.card {
  position: relative;
  background: var(--card);
  border: 1.5px solid #e9eff8;
  border-radius: var(--radius);
  padding: 15px 16px 13px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .18s ease, border-color .18s ease;
  overflow: hidden;
  outline: none;
}
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  background: var(--c); opacity: .85;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(28, 54, 105, .12); border-color: #dbe6f7; }
.card:focus-visible { border-color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }

.card.playing {
  border-color: var(--c);
  background: linear-gradient(180deg, var(--s) 0%, #fff 78%);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--c) 16%, transparent), 0 14px 30px rgba(28, 54, 105, .11);
}

.card-head {
  display: flex; align-items: center; gap: 7px; margin-bottom: 9px;
}
.idx {
  font-family: var(--font-en); font-size: 11px; font-weight: 700; color: #9aa6bb;
  letter-spacing: .5px;
}
.scene-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 700; color: var(--c);
  background: var(--s); border-radius: 999px; padding: 3px 9px;
}
.done-dot {
  margin-left: auto; display: none; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 800; color: #16a34a;
  background: #eafaf0; border-radius: 999px; padding: 3px 8px;
}
.card[data-done="1"] .done-dot { display: inline-flex; }

.card-body { display: flex; align-items: flex-start; gap: 10px; }

.text-col { flex: 1; min-width: 0; }

.en {
  font-family: var(--font-en);
  font-size: clamp(18px, 2.1vw, 21.5px);
  font-weight: 600; line-height: 1.36; color: #101c33;
  margin: 0 0 5px; letter-spacing: -.2px;
  word-break: break-word;
}
.zh { font-size: 13.5px; font-weight: 600; color: #61708a; margin: 0; line-height: 1.45; }
.tip {
  margin: 9px 0 0; font-size: 12px; color: #8d98ad; line-height: 1.5;
  display: flex; gap: 6px; align-items: flex-start;
}
.tip .tip-i { flex: 0 0 auto; opacity: .8; }
.tip .tip-t { flex: 1; min-width: 0; }

.play-btn {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: var(--s); color: var(--c); font-size: 16px;
  border: 1.5px solid color-mix(in srgb, var(--c) 22%, #fff);
  transition: .18s;
}
.card:hover .play-btn { transform: scale(1.06); }
.play-btn svg { width: 19px; height: 19px; display: block; margin-left: 2px; }
.card.playing .play-btn svg { margin-left: 0; }
.pbtn-main svg { width: 19px; height: 19px; display: block; }

.card.playing .play-btn {
  background: var(--c); color: #fff; border-color: var(--c);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--c) 45%, transparent);
}

/* waveform */
.wave {
  position: absolute; bottom: 11px; right: 17px;
  display: flex; align-items: flex-end; gap: 2.5px; height: 14px;
  opacity: 0; transition: opacity .2s;
}
.card.playing .wave { opacity: 1; }
.wave i {
  display: block; width: 3px; border-radius: 2px; background: var(--c);
  height: 5px; animation: wv .9s ease-in-out infinite;
}
.wave i:nth-child(2) { animation-delay: .15s; }
.wave i:nth-child(3) { animation-delay: .3s; }
.wave i:nth-child(4) { animation-delay: .45s; }
@keyframes wv {
  0%, 100% { height: 4px; opacity: .55; }
  50% { height: 14px; opacity: 1; }
}

.progress {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: transparent;
}
.progress i {
  display: block; height: 100%; width: 0%;
  background: var(--c); opacity: .9; border-radius: 0 3px 3px 0;
  transition: width .12s linear;
}

/* ---------------- empty ---------------- */
.empty { max-width: 1180px; margin: 40px auto; text-align: center; color: var(--muted); }
.empty-emoji { font-size: 44px; margin-bottom: 6px; }
.empty p { font-size: 14px; font-weight: 600; }

/* ---------------- footer ---------------- */
.foot {
  max-width: 1180px; margin: 30px auto 0; padding: 16px 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  color: #64718a; font-size: 12.5px; line-height: 1.7;
}
.foot p { margin: 0 0 4px; }
.foot strong { color: #2b3a55; }
.foot-note { color: #98a3b8; font-size: 11.5px; }

/* ---------------- player ---------------- */
.player {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%) translateY(0);
  width: min(760px, calc(100% - 24px)); z-index: 60;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid #e2eaf7; border-radius: 20px;
  box-shadow: 0 18px 44px rgba(20, 40, 80, .18);
  padding: 10px 12px 8px;
  animation: rise .26s ease;
}
@keyframes rise { from { transform: translateX(-50%) translateY(26px); opacity: 0; } }

.player-row { display: flex; align-items: center; gap: 8px; }

.pbtn {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid #e6ecf7; background: #f7faff; color: #3f4f6b;
  font-size: 13px; cursor: pointer; display: grid; place-items: center; transition: .16s;
}
.pbtn:hover { background: #eef4ff; border-color: #cfdffa; }
.pbtn-main {
  width: 46px; height: 46px; font-size: 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; border: 0;
  box-shadow: 0 6px 16px rgba(37, 99, 235, .32);
}
.pbtn-close { margin-left: 2px; background: #fff; border-color: transparent; color: #9aa6bb; }

.player-info { flex: 1; min-width: 0; padding: 0 4px; }
.player-en {
  font-family: var(--font-en); font-size: 14.5px; font-weight: 700; color: #16233c;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.player-meta {
  font-size: 11.5px; font-weight: 600; color: #8d98ad;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px;
}

.player-bar { height: 4px; background: #eef3fb; border-radius: 99px; margin-top: 8px; overflow: hidden; }
.player-bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 99px;
}

/* ---------------- toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%);
  background: #1f2a3f; color: #fff; font-size: 13px; font-weight: 600;
  padding: 11px 16px; border-radius: 12px; z-index: 90;
  box-shadow: 0 12px 28px rgba(15, 25, 45, .3); max-width: calc(100% - 40px);
  text-align: center;
}

/* ---------------- 情景对话卡片 ---------------- */
.dlg-badge {
  margin-left: auto; font-size: 10.5px; font-weight: 800; color: #0891b2;
  background: #ecfeff; border-radius: 999px; padding: 3px 8px;
}
.card-dialog .done-dot { margin-left: 0; }
.card-dialog .wave { display: none; }

.dlg-title {
  font-family: var(--font-en); font-size: 16.5px; font-weight: 700; color: #16233c;
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 9px;
}
.dlg-sub { font-family: var(--font-zh); font-size: 11.5px; font-weight: 600; color: #93a0b6; }

.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lines li {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 5px 7px; border-radius: 10px; transition: background .16s, box-shadow .16s;
}
.lines li.on {
  background: color-mix(in srgb, var(--c) 9%, #fff);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 28%, transparent);
}

.spk {
  flex: 0 0 auto; font-size: 10px; font-weight: 800; line-height: 1.5;
  padding: 1px 6px; border-radius: 6px; margin-top: 2px; letter-spacing: .3px;
}
.spk-t { background: #e0f2fe; color: #0369a1; }
.spk-b { background: #ede9fe; color: #6d28d9; }
.spk-g { background: #fce7f3; color: #be185d; }

.ln { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.ln-en {
  font-family: var(--font-en); font-size: 15.5px; font-weight: 600;
  color: #101c33; line-height: 1.4; word-break: break-word;
}
.ln-zh { font-size: 12px; color: #8494ab; line-height: 1.45; }

.dlg-foot { display: flex; align-items: center; gap: 9px; margin-top: 10px; }
.play-btn.sm {
  width: 36px; height: 36px; position: static; flex: 0 0 auto;
}
.play-btn.sm svg { width: 15px; height: 15px; }
.dlg-hint { font-size: 11.5px; color: #98a3b8; font-weight: 600; }

/* ---------------- responsive ---------------- */
@media (min-width: 860px) {
  .chips { flex-wrap: wrap; overflow: visible; }
}

@media (max-width: 720px) {
  body { padding: 0 12px 150px; }
  .hero { padding-top: 18px; }
  .controls { border-radius: 18px; padding: 10px; }
  .setting-row { gap: 7px; }
  .btn-all { margin-left: 0; width: 100%; justify-content: center; padding: 12px; }
  .grid { grid-template-columns: 1fr; gap: 12px; }
  .card { padding: 14px 14px 12px; }
  .play-btn { width: 46px; height: 46px; }
  .seg button { padding: 8px 11px; }
  .player { bottom: max(10px, env(safe-area-inset-bottom)); width: calc(100% - 20px); }
  .player-en { font-size: 13.5px; }
  .toast { bottom: 118px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
