:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #14161a;
  --ink-soft: #3d4552;
  --muted: #7b8595;
  --line: #e5e8ee;
  --accent: #b45309;
  --accent-2: #d97706;
  --accent-soft: #fdf3e3;
  --shadow: 0 1px 2px rgba(20, 22, 26, .04), 0 8px 24px rgba(20, 22, 26, .06);
  --serif: Georgia, "Times New Roman", "Songti SC", "Noto Serif SC", serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 固定头部：剧名 + 搜索 + 示例词 ---------------- */
.hero {
  position: sticky; top: 0; z-index: 30;
  background: rgba(245, 246, 248, .92);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 13px 24px 12px;
  transition: padding .18s ease, box-shadow .18s ease;
}
.hero.shrink { padding: 8px 24px 10px; box-shadow: 0 6px 20px rgba(20, 22, 26, .05); }
.hero-top { display: flex; align-items: center; justify-content: space-between; max-width: 1180px; margin: 0 auto 1px; }
/* 左上角季数标签 */
.season-tag {
  font-size: 11.5px; letter-spacing: .18em; color: #6f7a89;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 11px 3px 12px;
}
.hero-title-wrap { max-width: 1180px; margin: 0 auto; text-align: center; }
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--line) 20%, var(--line) 80%, transparent); }

/* 彩色艺术字标题：渐变底色裁进字里 + 双层投影 */
.hero-title {
  font-family: "Arial Black", "Segoe UI Black", Impact, "Microsoft YaHei", var(--serif);
  font-weight: 900;
  font-size: clamp(22px, 3.4vw, 44px);
  letter-spacing: .055em;
  line-height: 1.06;
  margin: 6px 0 0;
  text-transform: uppercase;
  background: linear-gradient(96deg, #f7b733 0%, #fc8a1a 20%, #f2452c 40%, #e91e63 60%, #9c27b0 78%, #3f51b5 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .10)) drop-shadow(0 10px 22px rgba(233, 30, 99, .16));
  transition: font-size .18s ease, margin .18s ease;
}
/* 中文剧名：小字、宽字距，像片尾字幕 */
.hero-cn {
  margin-top: 3px;
  font-family: "Songti SC", "Noto Serif SC", "Microsoft YaHei", serif;
  font-size: clamp(12px, 1.3vw, 16px);
  letter-spacing: .42em;
  text-indent: .46em;
  color: #464e5a;
  font-weight: 600;
}
.hero.shrink .hero-title { font-size: clamp(18px, 2.3vw, 28px); }
.hero.shrink .hero-cn { font-size: 11px; letter-spacing: .3em; margin-top: 3px; }
.hero-line {
  margin: 6px 0 9px; font-family: var(--serif); font-style: italic;
  font-size: clamp(12px, 1.15vw, 14.5px); color: #9aa3b0; letter-spacing: .05em;
}
.hero-line em::before, .hero-line em::after { content: "　·　"; color: #d3d9e2; font-style: normal; }
.hero.shrink .hero-line { display: none; }

.hero-search {
  display: flex; align-items: center; gap: 10px;
  max-width: 660px; margin: 0 auto;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 5px 5px 5px 14px; box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.hero-search:focus-within { border-color: #ead2b3; box-shadow: 0 0 0 4px rgba(217, 119, 6, .08), var(--shadow); }
.mag { color: var(--muted); font-size: 17px; line-height: 1; }
#q { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); padding: 7px 2px; }
#q::placeholder { color: #a9b1bd; }
#go {
  border: 0; background: var(--ink); color: #fff; font-weight: 600;
  padding: 9px 19px; border-radius: 10px; font-size: 14px; cursor: pointer; transition: background .15s;
}
#go:hover { background: #2a2f38; }

.scope-note {
  margin: 7px 0 0; text-align: center; font-size: 11.5px; color: #a2abb8; letter-spacing: .02em;
}
.hero.shrink .scope-note { display: none; }
.chips-row { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
.chips-label { font-size: 12.5px; color: #97a1af; letter-spacing: .04em; white-space: nowrap; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.hero.shrink .chips-row { display: none; }
.chip {
  cursor: pointer; font-size: 12.5px; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px;
  transition: all .15s;
}
.chip:hover { color: var(--accent); border-color: #ecd7b8; background: var(--accent-soft); }


.badge { font-size: 12px; color: var(--muted); }
.badge b { color: var(--ink-soft); font-weight: 600; }
.badge + .badge::before { content: "·"; margin-right: 8px; color: #cfd6e0; }

/* ---------------- 卡片区 ---------------- */
.board { max-width: 1180px; margin: 0 auto; padding: 26px 24px 70px; }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.bh-left { display: flex; align-items: baseline; gap: 10px; }
.bh-right { display: flex; align-items: center; gap: 14px; }
.stats { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; }
.stats b { color: var(--ink-soft); font-weight: 600; }
.stats .badge + .badge::before { content: "·"; margin-right: 8px; color: #cfd6e0; }
button.mini {
  cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 5px 13px; font-size: 12.5px; transition: all .15s;
}
button.mini:hover { color: var(--accent); border-color: #ecd7b8; background: var(--accent-soft); }
.board-head h2 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.board-sub { font-size: 12.5px; color: var(--muted); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
/* 卡片：剧照铺满 + 底部渐变压暗，台词浮在画面上 */
.card {
  position: relative; border: 0; padding: 0; background: none; cursor: pointer;
  border-radius: 16px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(20, 22, 26, .06), 0 12px 28px rgba(20, 22, 26, .10);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(20, 22, 26, .10), 0 20px 40px rgba(20, 22, 26, .18); }
.card:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; }

.thumb { position: relative; aspect-ratio: 16 / 9; background: #12161c; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease; }
.card:hover .thumb img { transform: scale(1.05); }
.scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0) 26%, rgba(8, 10, 14, .30) 52%, rgba(8, 10, 14, .82) 88%, rgba(8, 10, 14, .92) 100%);
}
.play {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  opacity: 0; transition: opacity .2s ease;
}
.play span {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; padding-left: 3px;
  background: rgba(255, 255, 255, .94); color: #14161a; font-size: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.card:hover .play { opacity: 1; }
.ov { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 15px 14px; color: #fff; }
.ov-meta { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: rgba(255, 255, 255, .78); margin-bottom: 5px; }
.ov-meta .tc { margin-left: auto; font-size: 10.5px; color: rgba(255, 255, 255, .55); font-variant-numeric: tabular-nums; }
.ov-meta .ep {
  color: #14161a; background: rgba(255, 233, 196, .96); border-radius: 5px; padding: 1.5px 7px; font-weight: 700;
}
.ov-zh {
  font-size: 15px; font-weight: 650; line-height: 1.45; letter-spacing: .01em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ov-en {
  margin-top: 3px; font-size: 11.5px; color: rgba(255, 255, 255, .74); line-height: 1.38;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.empty { text-align: center; color: var(--muted); padding: 70px 0; font-size: 14px; }
.empty b { color: var(--accent); }

/* ---------------- 悬浮播放层 ---------------- */
.modal {
  position: fixed; inset: 0; background: rgba(15, 17, 20, .5); backdrop-filter: blur(3px);
  display: none; align-items: flex-start; justify-content: center;
  padding: 4vh 16px; z-index: 40; overflow: auto;
}
.modal.open { display: flex; }
.modal-card {
  width: min(860px, 100%); background: #fff; border-radius: 18px; padding: 14px;
  position: relative; box-shadow: 0 30px 70px rgba(10, 12, 16, .28);
}
.close {
  position: absolute; right: 10px; top: 10px; z-index: 3; width: 30px; height: 30px;
  background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: 9px;
  color: #444; cursor: pointer; font-size: 13px;
}
.stage { position: relative; background: #000; border-radius: 12px; overflow: hidden; }
.stage video { width: 100%; aspect-ratio: 16 / 9; display: block; background: #000; position: relative; z-index: 0; }
.subs { position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; padding: 0 5%; pointer-events: none; z-index: 5; transform: translateZ(0); will-change: transform; }
.subs .en { color: #fff; font-size: clamp(13px, 1.6vw, 17px); line-height: 1.35; text-shadow: 0 2px 8px #000, 0 0 3px #000; }
.subs .zh { color: #ffd479; font-size: clamp(15px, 2vw, 22px); font-weight: 700; margin-top: 3px; text-shadow: 0 2px 8px #000, 0 0 3px #000; }

.modal-body { padding: 12px 4px 2px; }
.segpos { font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.quote { margin-top: 8px; }
.quote .en { font-size: 14px; color: var(--ink-soft); line-height: 1.55; }
.quote .zh { font-size: 16px; color: var(--ink); font-weight: 600; line-height: 1.55; margin-top: 3px; }
.lines { margin-top: 10px; max-height: 168px; overflow: auto; font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.lines span { display: block; }
.lines span b { color: var(--ink-soft); font-weight: 500; }

.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; padding: 12px 4px 2px; border-top: 1px solid var(--line); margin-top: 10px; }
button { font-family: inherit; }
.toolbar button, .share-out button {
  cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 8px 14px; font-size: 13px; transition: all .15s;
}
.toolbar button:hover { border-color: #d9dfe8; background: #fafbfc; }
.toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.toolbar #shareBtn { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.toolbar #shareBtn:hover { background: #2a2f38; }
.share-out { display: flex; gap: 8px; flex: 1; min-width: 240px; }
.share-out input {
  flex: 1; background: #f7f8fa; color: var(--ink-soft); border: 1px solid var(--line);
  border-radius: 9px; padding: 8px 10px; font-size: 12.5px;
}

/* ---------------- 分享页 ---------------- */
.wrap { max-width: 900px; margin: 0 auto; padding: 26px 18px 70px; }
.share-brand { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.logo {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center;
  background: var(--ink); color: #fff; font-family: var(--serif); font-weight: 700; font-size: 14px;
  letter-spacing: .06em; text-decoration: none;
}
.share-title { font-size: 16px; font-weight: 600; }
.share-sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.back-link { margin-left: auto; font-size: 13px; color: var(--accent); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.bar button {
  cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 7px 13px; font-size: 12.5px;
}
.bar button:hover { border-color: #d9dfe8; }
.bar button.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }

.script { margin-top: 18px; display: grid; gap: 10px; }
.script .line {
  display: grid; grid-template-columns: 62px 1fr; gap: 12px; padding: 12px 15px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.script .t { color: var(--muted); font-size: 11.5px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.script .en { color: var(--ink-soft); font-size: 13.5px; line-height: 1.55; }
.script .zh { color: var(--ink); font-size: 15px; font-weight: 600; margin-top: 4px; line-height: 1.55; }
.share-foot { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 11.5px; }

/* ---------------- 页脚 / 提示 ---------------- */
.foot {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: center;
  max-width: 1180px; margin: 0 auto; padding: 6px 24px 46px;
  color: #98a1ae; font-size: 11.5px;
}
.foot a { color: #7f8a99; text-decoration: none; border-bottom: 1px dotted #c9d1db; padding-bottom: 1px; }
.foot a:hover { color: var(--accent); border-bottom-color: #e8cfae; }
.foot .dot { color: #cdd4de; }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 16px);
  background: #1c2027; color: #f4f5f7; border-radius: 11px;
  padding: 11px 18px; font-size: 13px; opacity: 0; pointer-events: none;
  transition: all .2s; z-index: 60; max-width: min(560px, 90vw); box-shadow: 0 12px 30px rgba(0, 0, 0, .25);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 关于页（PRODUCT.md 渲染） ---------------- */
.top.simple { display: flex; align-items: center; gap: 12px; padding: 22px 24px 8px; max-width: 880px; margin: 0 auto; }
.prose-title { font-size: 13.5px; color: var(--muted); letter-spacing: .02em; }
.prose-wrap { max-width: 880px; margin: 0 auto; padding: 6px 24px 80px; }
.about-lead {
  margin: 4px 0 26px; padding: 13px 16px; border: 1px dashed #dfe4eb; border-radius: 11px;
  background: #fff; color: var(--ink-soft); font-size: 13.5px;
}
.about-lead a { color: var(--accent); }
.prose { color: var(--ink-soft); font-size: 15px; line-height: 1.9; }
.prose h1 { font-family: var(--serif); font-size: 28px; margin: 30px 0 10px; color: var(--ink); letter-spacing: .01em; }
.prose h2 { font-size: 20px; margin: 36px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink); }
.prose h3 { font-size: 16.5px; margin: 24px 0 8px; color: var(--accent); }
.prose h4 { font-size: 15px; margin: 18px 0 6px; color: var(--ink); }
.prose p { margin: 10px 0; }
.prose a { color: var(--accent); }
.prose strong { color: var(--ink); }
.prose code { background: #f2f4f7; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 13px; color: #8a4a12; }
.prose pre { background: #f7f8fa; border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; overflow: auto; font-size: 12.5px; line-height: 1.7; }
.prose pre code { background: none; border: 0; padding: 0; color: var(--ink-soft); }
.prose blockquote { margin: 16px 0; padding: 12px 16px; border-left: 3px solid #e6c69a; background: #fff; border-radius: 0 10px 10px 0; color: var(--ink-soft); }
.prose ul, .prose ol { margin: 10px 0 10px 4px; padding-left: 22px; }
.prose li { margin: 5px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.prose .table-wrap { overflow-x: auto; margin: 14px 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 13.5px; background: #fff; }
.prose th, .prose td { border: 1px solid var(--line); padding: 9px 11px; text-align: left; vertical-align: top; }
.prose th { background: #fafbfc; color: var(--ink); font-weight: 600; white-space: nowrap; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding: 12px 16px 12px; }
  .board { padding: 20px 16px 60px; }
  .hero-title { letter-spacing: .1em; }
}
@media (max-width: 620px) {
  .grid { grid-template-columns: 1fr; }
  .hero-line em::before, .hero-line em::after { content: "·"; }
  .hero-search { max-width: 100%; }
  .chips-row { display: none; }
  .hero-title { font-size: 20px; }
  .modal { padding: 2vh 10px; }
  .script .line { grid-template-columns: 52px 1fr; }
  .top.simple { padding: 16px 16px 4px; flex-wrap: wrap; }
  .prose-wrap { padding: 4px 16px 70px; }
  .prose h1 { font-size: 23px; }
  .prose h2 { font-size: 18px; }
}

/* 加载骨架 */
.card.skeleton {
  background: linear-gradient(100deg, #eceff3 20%, #f7f9fc 40%, #eceff3 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  box-shadow: none;
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

/* 台词列表：加高 + 当前句高亮 */
.lines .line-item { padding: 2px 6px; border-radius: 6px; transition: background .15s, color .15s; }
.lines .line-item.cur { background: var(--accent-soft); color: var(--ink); }
.lines .line-item.cur b { color: var(--accent); }

/* 命中高亮：卡片在深色剧照上，用琥珀底 + 深色字；文字区用浅黄底 */
.ov-zh mark, .ov-en mark {
  background: rgba(255, 199, 87, .96); color: #1b1d22;
  border-radius: 3px; padding: 0 2px; box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}
.quote mark, .lines mark {
  background: #fde68a; color: #5a3a06; border-radius: 3px; padding: 0 2px; font-weight: 600;
}

/* 分页按钮 */
.more-wrap { display: flex; justify-content: center; margin: 24px 0 0; }
#moreBtn {
  cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  border-radius: 999px; padding: 10px 22px; font-size: 13px; transition: all .15s;
  box-shadow: 0 2px 8px rgba(20, 22, 26, .05);
}
#moreBtn:hover { color: var(--accent); border-color: #ecd7b8; background: var(--accent-soft); }

/* 搜不到时的建议 */
.sug { font-size: 13px; color: var(--ink-soft); }
.sug a { color: var(--accent); font-weight: 600; text-decoration: none; border-bottom: 1px solid #f0d3ab; }
.sug a:hover { border-bottom-color: var(--accent); }
.sug-py { color: var(--muted); font-size: 12px; }

/* 空结果示例词 */
.sug-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.sug-chip {
  cursor: pointer; font-size: 12.5px; color: var(--ink-soft); background: #fff;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; transition: all .15s;
}
.sug-chip:hover { color: var(--accent); border-color: #ecd7b8; background: var(--accent-soft); }
