/* 聚影 · 样式
 * 深色为主：影视站看海报，浅底会把海报压灰。变量集中在 :root，
 * 换主色只改一处。移动端优先，桌面靠 grid 自适应。
 */
:root {
  --bg: #0a0c10;
  --bg2: #11141b;
  --bg3: #171b24;
  --line: #232936;
  --fg: #e8ecf4;
  --dim: #8b95a7;
  --dim2: #5f6b7f;
  --acc: #3ddab4;
  --acc2: #2bb894;
  --warn: #ffb545;
  --bad: #ff5f6d;
  --score: #ffc247;
  --r: 12px;
  --sh: 0 6px 24px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #16202b 0%, transparent 60%), var(--bg);
  color: var(--fg);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  padding-bottom: 40px;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }

/* ---------- 顶栏 ---------- */
header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 18px;
  background: rgba(10, 12, 16, .82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { font-size: 19px; font-weight: 800; letter-spacing: .5px; }
.logo b { color: var(--acc); }
.brand { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.brand small { color: var(--dim2); font-size: 11px; letter-spacing: .5px; }

.search { flex: 1; display: flex; align-items: center; gap: 8px; max-width: 640px; }
.search input {
  flex: 1; min-width: 0;
  background: var(--bg3); border: 1px solid var(--line); color: var(--fg);
  border-radius: 999px; padding: 9px 16px; outline: none; transition: border-color .18s;
}
.search input:focus { border-color: var(--acc); }
.search input::placeholder { color: var(--dim2); }
.btn {
  padding: 9px 16px; border-radius: 999px; background: var(--bg3);
  border: 1px solid var(--line); white-space: nowrap; transition: .18s;
}
.btn:hover { border-color: #3a4356; }
.btn.pri { background: linear-gradient(135deg, var(--acc), var(--acc2)); color: #06221b; font-weight: 700; border: 0; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim2); display: inline-block; }
.dot.ok { background: var(--acc); box-shadow: 0 0 8px var(--acc); }
.dot.bad { background: var(--bad); }
.health { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 12px; cursor: pointer; }
.health:hover { color: var(--fg); }

/* ---------- 导航 ---------- */
nav.tabs { display: flex; gap: 6px; padding: 14px 18px 4px; overflow-x: auto; scrollbar-width: none; }
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  padding: 7px 15px; border-radius: 999px; color: var(--dim);
  border: 1px solid transparent; white-space: nowrap;
}
nav.tabs button.on { color: #06221b; background: var(--acc); font-weight: 700; }
nav.tabs button:hover:not(.on) { color: var(--fg); border-color: var(--line); }

main { padding: 8px 18px 0; max-width: 1500px; margin: 0 auto; }

/* ---------- 海报行 ---------- */
.row { margin: 22px 0 4px; }
.row h2 { font-size: 15px; margin: 0 0 10px; display: flex; align-items: baseline; gap: 10px; }
.row h2 span { font-size: 12px; color: var(--dim2); font-weight: 400; }
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.scroller::-webkit-scrollbar { height: 6px; }
.scroller::-webkit-scrollbar-thumb { background: #2a3140; border-radius: 3px; }

.card { cursor: pointer; }
.card .pic {
  position: relative; aspect-ratio: 2/3; border-radius: var(--r); overflow: hidden;
  background: linear-gradient(160deg, #1b212c, #12161d); box-shadow: var(--sh);
}
.card .pic img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .pic img { transform: scale(1.06); }
.card .sc {
  position: absolute; right: 6px; bottom: 6px; padding: 1px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, .72); color: var(--score); font-size: 12px; font-weight: 700;
}
.card .t { margin-top: 7px; font-size: 13px; line-height: 1.35; height: 2.7em; overflow: hidden; }
.card .y { color: var(--dim2); font-size: 11px; }

/* ---------- 搜索结果 ---------- */
.res { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.hit {
  display: flex; gap: 12px; padding: 12px; border-radius: var(--r);
  background: var(--bg2); border: 1px solid var(--line); cursor: pointer; transition: .18s;
}
.hit:hover { border-color: #35405a; transform: translateY(-1px); }
.hit .pic { width: 78px; flex: 0 0 78px; aspect-ratio: 2/3; border-radius: 9px; overflow: hidden; background: var(--bg3); }
.hit .pic img { width: 100%; height: 100%; object-fit: cover; }
.hit .info { min-width: 0; flex: 1; }
.hit .h { display: flex; align-items: baseline; gap: 8px; }
.hit .h b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hit .meta { color: var(--dim); font-size: 12px; margin: 3px 0 7px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: #1d2531; color: #a9b6c9; border: 1px solid #2a3344;
}
.tag.src { color: var(--acc); border-color: #23594c; background: #10231f; }
.tag.tv { color: #9db8ff; border-color: #2b3a63; background: #131a2b; }

/* ---------- 详情抽屉 ---------- */
.sheet {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(4, 6, 9, .72); backdrop-filter: blur(6px);
}
.sheet.on { display: block; }
.sheet .panel {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(560px, 100%);
  background: var(--bg2); border-left: 1px solid var(--line);
  overflow-y: auto; padding: 20px; animation: slide .22s ease;
}
@keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet .close { position: absolute; right: 14px; top: 12px; font-size: 22px; color: var(--dim); }
.dt-head { display: flex; gap: 14px; }
.dt-head .pic { width: 104px; flex: 0 0 104px; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; background: var(--bg3); }
.dt-head .pic img { width: 100%; height: 100%; object-fit: cover; }
.dt-head h3 { margin: 2px 0 4px; font-size: 18px; }
.desc { color: var(--dim); font-size: 13px; margin: 14px 0; }
.sec-t { font-size: 13px; color: var(--dim); margin: 18px 0 8px; display: flex; justify-content: space-between; }
.srcrow {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg3); margin-bottom: 8px; cursor: pointer; transition: .15s;
}
.srcrow:hover { border-color: #3a4356; }
.srcrow.on { border-color: var(--acc); background: #10231f; }
.srcrow .n { flex: 1; }
.srcrow .m { color: var(--dim); font-size: 12px; }
.eps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ep {
  padding: 6px 12px; border-radius: 8px; background: var(--bg3);
  border: 1px solid var(--line); font-size: 12px; cursor: pointer;
}
.ep:hover { border-color: var(--acc); color: var(--acc); }
.ep.on { background: var(--acc); color: #06221b; border-color: var(--acc); font-weight: 700; }

/* ---------- 播放页 ---------- */
#player-wrap { display: none; }
#player-wrap.on { display: block; }
.player-box { background: #000; border-radius: var(--r); overflow: hidden; box-shadow: var(--sh); }
#player { width: 100%; aspect-ratio: 16/9; }
.play-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.play-bar select, .play-bar .btn { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; color: var(--fg); }
.ep-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; max-height: 320px; overflow-y: auto; }
.ep-list .ep { text-align: center; }

/* ---------- 源面板 ---------- */
.srcpanel .item { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.srcpanel .item .n { flex: 1; }
.srcpanel .item .m { color: var(--dim2); font-size: 11px; }

.note { color: var(--dim2); font-size: 12px; text-align: center; padding: 26px 10px; }
.loading { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 36px; color: var(--dim); }
.spin { width: 16px; height: 16px; border: 2px solid #2b3444; border-top-color: var(--acc); border-radius: 50%; animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  header { padding: 10px 12px; gap: 10px; flex-wrap: wrap; }
  .brand small { display: none; }
  .search { order: 3; flex: 1 0 100%; max-width: none; }
  main { padding: 6px 12px 0; }
  .scroller { grid-auto-columns: 108px; }
  .res { grid-template-columns: 1fr; }
  .sheet .panel { width: 100%; }
}
