:root {
  --bg: #0b0d10;
  --panel: rgba(20, 23, 28, .72);
  --panel-solid: #15181d;
  --line: rgba(255, 255, 255, .08);
  --text: #e9ecf1;
  --muted: #8b93a1;
  --accent: #ff5c39;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color .3s;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: var(--bg);
  background-image: var(--bg-image, none);
  background-size: cover;
  background-position: center;
  opacity: .28;
  filter: saturate(.9);
}

a { color: inherit; text-decoration: none; }
img { display: block; }

/* ---------- 布局 ---------- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

header.topbar {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(11,13,16,.92), rgba(11,13,16,.66));
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; gap: 28px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .5px; }
.logo .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 12px var(--accent);
}
nav.main { display: flex; gap: 4px; flex: 1; }
nav.main a {
  padding: 7px 14px; border-radius: 999px; color: var(--muted);
  font-size: 14px; transition: .2s;
}
nav.main a:hover { color: var(--text); background: rgba(255,255,255,.06); }
nav.main a.active { color: #fff; background: rgba(255,255,255,.1); }

/* ---------- 首页 Hero ---------- */
.hero { padding: 72px 0 48px; }
.hero h1 { font-size: clamp(30px, 5vw, 56px); line-height: 1.1; margin: 0 0 16px; letter-spacing: -1px; }
.hero .sub { color: var(--muted); font-size: 17px; max-width: 640px; }
.hero .badges { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 26px; }
.badge {
  font-size: 12px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.03);
}
.badge.hot { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.notice {
  margin: 0 0 28px; padding: 12px 16px; border-left: 3px solid var(--accent);
  background: rgba(255,255,255,.04); border-radius: 0 10px 10px 0; color: var(--muted); font-size: 14px;
}

/* ---------- 区块 ---------- */
.section { margin: 44px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.section-head h2 { font-size: 21px; margin: 0; }
.section-head .more { margin-left: auto; color: var(--muted); font-size: 13px; }
.section-head .more:hover { color: var(--accent); }

/* ---------- 卡片 ---------- */
.grid { display: grid; gap: 18px; }
.grid.movies { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.comics { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.grid.music  { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.card {
  display: block; border-radius: var(--radius); overflow: hidden;
  background: var(--panel-solid); border: 1px solid var(--line);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s;
  position: relative;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.card .thumb { aspect-ratio: 2/3; background: #0f1216 center/cover; position: relative; }
.card .thumb.wide { aspect-ratio: 16/9; }
.card .thumb.square { aspect-ratio: 1/1; }
.card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.75));
}
.card .meta { padding: 10px 12px 14px; }
.card .ttl { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .desc { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.card .tagline { position: absolute; left: 10px; top: 10px; z-index: 2; }
.card .tagline span {
  font-size: 11px; padding: 3px 8px; border-radius: 6px; background: rgba(0,0,0,.6);
  border: 1px solid rgba(255,255,255,.14); margin-right: 4px;
}
.card .play-badge {
  position: absolute; right: 10px; bottom: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 85%, transparent); color: #fff; font-size: 13px;
}

/* ---------- 播放页 ---------- */
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; padding: 28px 0 60px; }
@media (max-width: 1000px) { .watch-layout { grid-template-columns: 1fr; } }

.player-box { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); }
video { width: 100%; display: block; background: #000; max-height: 72vh; }

.player-ctrl {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,.85), transparent);
  display: flex; align-items: center; gap: 12px; font-size: 13px;
  opacity: 0; transition: opacity .25s;
}
.player-box:hover .player-ctrl, .player-box.show-ctrl .player-ctrl { opacity: 1; }
.ctrl-btn {
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.16);
  color: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; font-size: 12px;
}
.ctrl-btn:hover { background: rgba(255,255,255,.2); }
.speed-menu {
  position: absolute; right: 14px; bottom: 58px; z-index: 20;
  width: 250px; padding: 10px; border-radius: 12px;
  background: rgba(20,23,28,.97); border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(0,0,0,.6);
  display: none; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.speed-menu.open { display: grid; }
.speed-menu button {
  padding: 7px 0; border-radius: 7px; cursor: pointer; font-size: 13px;
  background: rgba(255,255,255,.05); border: 1px solid transparent; color: var(--text);
}
.speed-menu button:hover { background: rgba(255,255,255,.12); }
.speed-menu button.cur { background: var(--accent); color: #fff; font-weight: 700; }
.speed-menu .hint { grid-column: 1/-1; font-size: 11px; color: var(--muted); margin-top: 4px; padding: 0 2px; }

.info-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; height: fit-content; }
.info-panel h1 { font-size: 22px; margin: 0 0 6px; }
.info-panel .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.info-panel p.desc { color: #c4cad5; font-size: 14px; white-space: pre-wrap; }
.tag-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.tag { font-size: 11px; padding: 3px 9px; border-radius: 6px; background: rgba(255,255,255,.06); color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; cursor: pointer; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: var(--text); font-size: 14px; transition: .2s;
}
.btn:hover { background: rgba(255,255,255,.12); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.wide { width: 100%; }
.btn.dim { color: var(--muted); }

.q-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.q-item { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 9px; background: rgba(255,255,255,.04); font-size: 13px; }
.q-item .lbl { font-weight: 600; }
.q-item .sz { color: var(--muted); font-size: 12px; }

/* ---------- 漫画阅读 ---------- */
.reader-topbar { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.reader-topbar .title { font-weight: 600; }
.reader-topbar .sel {
  background: rgba(255,255,255,.06); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px 10px; font-size: 13px;
}
.reader { max-width: 880px; margin: 0 auto; padding-bottom: 120px; }
.pages { display: flex; flex-direction: column; gap: 8px; }
.pages img { width: 100%; border-radius: 6px; background: #111; min-height: 40px; }

.chapter-foot {
  margin: 34px auto 0; max-width: 880px; padding: 22px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  text-align: center;
}
.chapter-foot .tip { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.chapter-foot .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.float-nav {
  position: fixed; right: 22px; bottom: 26px; z-index: 30;
  display: flex; flex-direction: column; gap: 8px;
}
.float-nav .btn { padding: 9px 14px; font-size: 13px; backdrop-filter: blur(10px); background: rgba(20,23,28,.85); }
.progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 50; transition: width .1s; }

/* ---------- 音乐 ---------- */
.music-layout { padding: 28px 0 140px; }
.track {
  display: flex; align-items: center; gap: 16px; padding: 12px; border-radius: 12px;
  border: 1px solid transparent; transition: .2s; cursor: pointer;
}
.track:hover { background: rgba(255,255,255,.05); }
.track.playing { background: rgba(255,255,255,.07); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.track .no { width: 26px; text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.track .cover { width: 48px; height: 48px; border-radius: 8px; background: #111 center/cover; flex: 0 0 auto; }
.track .t { flex: 1; min-width: 0; }
.track .t .name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track .t .by { color: var(--muted); font-size: 12px; }
.track .dl { font-size: 12px; color: var(--muted); padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); }
.track .dl:hover { color: var(--text); background: rgba(255,255,255,.08); }
.eq { width: 14px; height: 14px; flex: 0 0 auto; }

.playbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: rgba(15,18,22,.95); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 10px 24px; display: flex; align-items: center; gap: 16px;
}
.playbar .cover { width: 46px; height: 46px; border-radius: 8px; background: #111 center/cover; flex: 0 0 auto; }
.playbar .info { min-width: 0; width: 200px; }
.playbar .info .n { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playbar .info .a { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.playbar .mid { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.playbar .row1 { display: flex; align-items: center; justify-content: center; gap: 12px; }
.playbar .seek { width: 100%; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: rgba(255,255,255,.16); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: none; border-radius: 50%; background: var(--accent); }
.time { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; width: 84px; text-align: right; }
.playbar .icon-btn { background: none; border: none; color: var(--text); font-size: 15px; cursor: pointer; padding: 4px 6px; opacity: .85; }
.playbar .icon-btn:hover { opacity: 1; }
.playbar .icon-btn.play { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; }

/* ---------- 空状态 / 页脚 ---------- */
.empty { padding: 48px 0; text-align: center; color: var(--muted); font-size: 14px; }
footer.site { border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 60px; color: var(--muted); font-size: 12.5px; }
footer.site .sponsor {
  margin-bottom: 18px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
}
footer.site .sponsor h4 { margin: 0 0 6px; color: var(--text); font-size: 14px; }
footer.site .sponsor p { margin: 0 0 12px; }
footer.site .sponsor a { color: var(--accent); }

/* ---------- 后台 ---------- */
.admin-body { background: #0c0e12; }
.login-wrap { max-width: 360px; margin: 14vh auto; padding: 28px; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px; }
.login-wrap h2 { margin: 0 0 6px; }
.login-wrap .hint { color: var(--muted); font-size: 12.5px; margin-bottom: 20px; }
input[type=text], input[type=password], input[type=number], textarea, select {
  width: 100%; padding: 9px 12px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(255,255,255,.05); color: var(--text); font-size: 14px; font-family: inherit;
  outline: none;
}
input:focus, textarea:focus, select:focus { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.admin-tabs { display: flex; gap: 6px; margin: 18px 0 22px; flex-wrap: wrap; }
.admin-tabs button { padding: 8px 16px; border-radius: 9px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.admin-tabs button.on { background: rgba(255,255,255,.1); color: #fff; }

.panel-box { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 14px; padding: 20px; margin-bottom: 20px; }
.panel-box h3 { margin: 0 0 14px; font-size: 15px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .grow .s { color: var(--muted); font-size: 12px; }
.mini { font-size: 12px; padding: 5px 10px; border-radius: 7px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; }
.mini:hover { color: #fff; background: rgba(255,255,255,.08); }
.mini.danger:hover { color: #ff6b6b; border-color: rgba(255,107,107,.4); }
.upload-bar { height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; margin-top: 8px; display: none; }
.upload-bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .15s; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: #1c2027; border: 1px solid var(--line); color: #fff; padding: 10px 20px;
  border-radius: 10px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.thumbs img { width: 62px; height: 62px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- 剧集 / 播放页补充 ---------- */
.panel-h {
  font-size: 16px; font-weight: 700; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
.aside-note { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-top: 14px; }
.fine-print { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 14px; }

.ep-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px; max-height: 320px; overflow-y: auto; padding-right: 4px;
}
.ep-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.04);
  color: var(--muted); font-size: 12px; transition: .18s;
  min-height: 62px;
}
.ep-item:hover { background: rgba(255,255,255,.09); color: var(--text); }
.ep-item.on { border-color: var(--accent); color: #fff; background: rgba(255,255,255,.1); }
.ep-item .idx { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.ep-item .nm { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }

.ep-nav { display: flex; gap: 10px; margin-top: 16px; }
.ep-nav .btn { padding: 7px 16px; font-size: 13px; }
.btn:disabled, .btn[disabled] { opacity: .35; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.q-right { display: flex; align-items: center; gap: 10px; }

.next-mask {
  position: absolute; inset: 0; z-index: 15;
  display: none; place-items: center;
  background: rgba(4,6,9,.82);
}
.next-mask.on { display: grid; }
.next-card { text-align: center; padding: 22px 28px; border-radius: 14px; background: rgba(18,21,26,.96); border: 1px solid var(--line); }
.next-card .tip { color: var(--muted); font-size: 12.5px; margin-bottom: 8px; }
.next-card .name { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.next-card .act { display: flex; gap: 10px; justify-content: center; }
.next-card .count { margin-top: 14px; color: var(--muted); font-size: 12px; }

/* ---------- 二创图 ---------- */
.art-grid { columns: 4 220px; column-gap: 16px; }
@media (max-width: 900px) { .art-grid { columns: 2 160px; } }
@media (max-width: 560px) { .art-grid { columns: 1; } }

.art-item {
  break-inside: avoid; margin-bottom: 16px; position: relative;
  border-radius: var(--radius); overflow: hidden; background: #10131a;
  border: 1px solid var(--line); cursor: zoom-in; transition: border-color .2s, transform .2s;
}
.art-item:hover { border-color: color-mix(in srgb, var(--accent) 42%, transparent); transform: translateY(-2px); }
.art-item img { width: 100%; display: block; background: #10131a; }
.art-item .ov {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 12px 10px;
  background: linear-gradient(0deg, rgba(0,0,0,.78), transparent);
  display: flex; align-items: flex-end; gap: 8px;
}
.art-item .ov .t { flex: 1; min-width: 0; }
.art-item .ov .n { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-item .ov .a { font-size: 11.5px; color: rgba(233,236,241,.66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.art-item .dl-btn {
  flex: 0 0 auto; font-size: 11.5px; padding: 4px 10px; border-radius: 7px;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.2); color: #fff;
}
.art-item .dl-btn:hover { background: var(--accent); border-color: var(--accent); }

.viewer {
  position: fixed; inset: 0; z-index: 90; display: none;
  background: rgba(5,7,10,.94); backdrop-filter: blur(4px);
}
.viewer.on { display: flex; flex-direction: column; }
.viewer .bar {
  display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.viewer .bar .grow { flex: 1; min-width: 0; }
.viewer .bar .n { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .bar .m { font-size: 12px; color: var(--muted); }
.viewer .stage { flex: 1; display: flex; align-items: center; justify-content: center; padding: 16px; min-height: 0; }
.viewer .stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.viewer .nav-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 72px; display: grid; place-items: center;
  background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.12); color: #fff;
  border-radius: 10px; cursor: pointer; font-size: 18px;
}
.viewer .nav-btn.prev { left: 12px; }
.viewer .nav-btn.next { right: 12px; }
.viewer .nav-btn:hover { background: rgba(255,255,255,.14); }
