/* tv-cms 前台样式 · 深色为主，跟随系统偏好 */
:root {
  --bg: #0e1015;
  --bg-2: #151922;
  --bg-3: #1c212c;
  --line: #262c3a;
  --fg: #e6e9f0;
  --fg-2: #9aa3b5;
  --fg-3: #6b7488;
  --brand: #ff5a5f;
  --brand-2: #ff8a5f;
  --ok: #35c07f;
  --radius: 10px;
  --wrap: 1280px;
  /* 强化版缓动：内置 ease-out 太弱（emil-design-eng） */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f7f9;
    --bg-2: #fff;
    --bg-3: #eef0f4;
    --line: #e2e5ea;
    --fg: #1b1f27;
    --fg-2: #5b6373;
    --fg-3: #8b93a3;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; display: block; border: 0; }
h1, h2, h3 { margin: 0; font-weight: 600; }
ul { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---------- CSS 图标（不用任何字符/图片，currentColor 跟随文字色） ---------- */
.i-play {
  display: inline-block; width: 0; height: 0; margin-right: 6px; vertical-align: -1px;
  border: 6px solid transparent; border-left: 9px solid currentColor; border-right: 0;
}
.i-star {
  display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px;
  background: currentColor; opacity: .38;
  clip-path: polygon(50% 0%, 63% 34%, 98% 36%, 70% 58%, 80% 92%, 50% 72%, 20% 92%, 30% 58%, 2% 36%, 37% 34%);
}
.faved .i-star, .i-star.on { opacity: 1; }
.i-arrow {
  display: inline-block; width: 6px; height: 6px; margin-left: 4px; vertical-align: 1px;
  border-top: 2px solid currentColor; border-right: 2px solid currentColor;
  transform: rotate(45deg);
}
.i-arrow.ne { transform: rotate(0deg); vertical-align: -1px; }
.i-menu {
  display: inline-block; width: 18px; height: 2px; background: currentColor;
  position: relative; vertical-align: 4px;
}
.i-menu::before, .i-menu::after {
  content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor;
}
.i-menu::before { top: -6px; }
.i-menu::after { top: 6px; }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 60px; }
.logo {
  font-size: 20px; font-weight: 700; letter-spacing: .5px; white-space: nowrap;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 6px 12px; border-radius: 999px; color: var(--fg-2);
  white-space: nowrap; font-size: 15px;
}
.nav a:hover { background: var(--bg-3); color: var(--fg); }
.nav a.on { background: var(--brand); color: #fff; }

.search { display: flex; align-items: center; }
.search input {
  width: 220px; height: 34px; padding: 0 12px;
  background: var(--bg-3); border: 1px solid var(--line);
  border-radius: 999px 0 0 999px; color: var(--fg); font-size: 14px; outline: none;
}
.search input:focus { border-color: var(--brand); }
.search button {
  height: 34px; padding: 0 16px; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; border-radius: 0 999px 999px 0; font-size: 14px;
}
.nav-toggle { display: none; background: none; border: 0; color: var(--fg); font-size: 22px; cursor: pointer; }

.notice { background: var(--bg-3); border-bottom: 1px solid var(--line); font-size: 14px; color: var(--fg-2); }
.notice .wrap { padding: 8px 16px; }

.main { padding: 24px 16px 48px; }

/* ---------- 面包屑 ---------- */
.crumbs { color: var(--fg-3); font-size: 13px; margin-bottom: 16px; }
.crumbs i { margin: 0 6px; font-style: normal; opacity: .5; }

/* ---------- 区块 ---------- */
.block { margin-bottom: 36px; }
.block-title {
  display: flex; align-items: center; font-size: 19px; margin-bottom: 16px;
  padding-left: 11px; border-left: 3px solid var(--brand); line-height: 1.2;
}
.block-title .more { margin-left: auto; font-size: 13px; font-weight: 400; color: var(--fg-3); }

/* ---------- 卡片网格 ---------- */
.grid {
  display: grid; gap: 18px 14px;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}
.card { display: block; }
.card .pic {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden;
  border-radius: var(--radius); background: var(--bg-3);
}
.card .pic img {
  width: 100%; height: 100%; object-fit: cover;
}
/* hover 放大只给真正有 hover 的设备：触屏点按会误触发 hover */
@media (hover: hover) and (pointer: fine) {
  .card .pic img { transition: transform 200ms var(--ease-out); }
  .card:hover .pic img { transform: scale(1.06); }
}
.card .noimg {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--fg-3); font-size: 13px;
}
.card .remarks {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 6px;
  font-style: normal; font-size: 12px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8));
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card .score {
  position: absolute; top: 6px; right: 6px; padding: 1px 6px; border-radius: 6px;
  font-style: normal; font-size: 12px; font-weight: 700; color: #fff;
  background: rgba(255, 90, 95, .92);
}
.card .name {
  display: block; margin-top: 8px; font-size: 14px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card .meta { display: block; font-size: 12px; color: var(--fg-3); }

/* ---------- 文字列表 ---------- */
.tlist li {
  display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.tlist li a { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlist li span { color: var(--fg-3); font-size: 12px; white-space: nowrap; }

/* ---------- 筛选 ---------- */
.filters {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 6px 14px; margin-bottom: 22px;
}
.frow { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.frow:last-child { border-bottom: 0; }
.frow > b { flex: 0 0 44px; color: var(--fg-3); font-weight: 400; padding-top: 2px; }
.fvals { display: flex; flex-wrap: wrap; gap: 4px 2px; min-width: 0; }
.fvals a { padding: 2px 10px; border-radius: 6px; color: var(--fg-2); }
.fvals a:hover { background: var(--bg-3); color: var(--fg); }
.fvals a.on { background: var(--brand); color: #fff; }
.fvals.letters a { padding: 2px 8px; min-width: 26px; text-align: center; }

/* ---------- 分页 ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 32px 0 8px; }
.pager a, .pager span, .pager i {
  min-width: 36px; height: 36px; padding: 0 10px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-2); border: 1px solid var(--line); font-size: 14px; font-style: normal;
}
.pager a:hover { border-color: var(--brand); color: var(--brand); }
.pager .on { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .dis, .pager i { color: var(--fg-3); background: transparent; border-color: transparent; }

/* ---------- 详情页 ---------- */
.detail { display: grid; grid-template-columns: 220px 1fr; gap: 26px; margin-bottom: 32px; }
.detail .poster { border-radius: var(--radius); overflow: hidden; background: var(--bg-3); aspect-ratio: 2/3; }
.detail .poster img { width: 100%; height: 100%; object-fit: cover; }
.detail h1 { font-size: 26px; margin-bottom: 4px; }
.detail .sub { color: var(--fg-3); font-size: 14px; margin-bottom: 14px; }
.dinfo li { display: flex; gap: 10px; padding: 5px 0; font-size: 14px; }
.dinfo li > b { flex: 0 0 56px; color: var(--fg-3); font-weight: 400; }
.dinfo li > span { flex: 1; min-width: 0; }
.dinfo li i { font-style: normal; color: var(--fg-3); }
.dscore { color: var(--brand); font-size: 22px; font-weight: 700; }
.dactions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 22px;
  border-radius: 999px; background: var(--brand); color: #fff; font-size: 15px;
  border: 0; cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.btn:hover { background: var(--brand-2); color: #fff; }
.btn:active { transform: scale(0.97); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--fg-2); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand); background: transparent; }

.plot { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.plot p { margin: 0; color: var(--fg-2); font-size: 14px; white-space: pre-wrap; }

/* ---------- 剧集列表 ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tabs button, .tabs a {
  padding: 6px 16px; border-radius: 999px; background: var(--bg-3);
  border: 1px solid var(--line); color: var(--fg-2); font-size: 14px; cursor: pointer;
  transition: transform 160ms var(--ease-out), border-color 150ms ease, color 150ms ease;
}
.tabs button:active, .tabs a:active { transform: scale(0.97); }
.tabs .on { background: var(--brand); border-color: var(--brand); color: #fff; }
.eps { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.eps a {
  display: block; padding: 9px 6px; text-align: center; font-size: 13px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  transition: transform 160ms var(--ease-out), border-color 150ms ease, color 150ms ease;
}
.eps a:hover { border-color: var(--brand); color: var(--brand); }
.eps a:active { transform: scale(0.97); }
.eps a.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.epgroup { display: none; }
.epgroup.on { display: block; animation: group-in 150ms var(--ease-out); }
/* keyframe 而非 transition：每次切换都是全新绘制，无中断续接需求 */
@keyframes group-in {
  from { opacity: 0; transform: translateY(4px); }
}

/* ---------- 播放页 ---------- */
.player-wrap { background: #000; border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.player-box { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player-box video, .player-box iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000;
}
.player-tip {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  color: #bbb; font-size: 14px; padding: 20px;
}
.play-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.play-head h1 { font-size: 20px; }
.play-head .ep { color: var(--brand); font-size: 15px; }
.play-head .to-detail { margin-left: auto; font-size: 13px; color: var(--fg-3); }

/* ---------- 两栏 ---------- */
.cols { display: grid; grid-template-columns: 1fr 300px; gap: 26px; align-items: start; }
.side .block { margin-bottom: 24px; }

/* ---------- 用户 ---------- */
.uauth { display: grid; place-items: center; padding: 32px 0 16px; }
.uauth-box {
  width: 100%; max-width: 400px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px 26px;
}
.uauth-box .tabs { margin-bottom: 18px; }
.uauth-box .field { display: block; margin-bottom: 14px; font-size: 14px; }
.uauth-box .field > span, .upwd .field > span { display: block; margin-bottom: 5px; color: var(--fg-2); }
.uauth-box input, .upwd input {
  width: 100%; height: 38px; padding: 0 12px; background: var(--bg-3);
  border: 1px solid var(--line); border-radius: 8px; color: var(--fg); outline: none;
  box-sizing: border-box;
}
.uauth-box input:focus, .upwd input:focus { border-color: var(--brand); }
.btn.wide { width: 100%; justify-content: center; }
.msg { display: block; min-height: 18px; color: var(--brand); font-size: 13px; margin-top: 8px; }
.page-head-fe { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.page-head-fe .block-title { margin-bottom: 0; flex: 1; }
.upwd { max-width: 400px; }
.upwd .field { display: block; margin-bottom: 14px; font-size: 14px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.tag.muted { background: var(--bg-3); color: var(--fg-3); }

/* ---------- 评论 ---------- */
.comment-form textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; resize: vertical;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--fg); font: inherit; font-size: 14px; outline: none; min-height: 72px;
}
.comment-form textarea:focus { border-color: var(--brand); }
.comment-actions { display: flex; align-items: center; gap: 12px; margin: 10px 0 20px; }
.comment-actions .msg { flex: 1; margin: 0; }
.clist li { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.clist .chead { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.clist .chead b { font-size: 14px; }
.clist .chead time { color: var(--fg-3); font-size: 12px; }
.clist p { margin: 0; font-size: 14px; color: var(--fg-2); white-space: pre-wrap; word-break: break-word; }
.myclist li { padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.myclist li time { color: var(--fg-3); font-size: 12px; margin-left: 8px; }
.myclist li p { margin: 4px 0; color: var(--fg-2); }
#fav-btn.faved { border-color: var(--brand); color: var(--brand); }

/* ---------- 历史页 ---------- */
.linklike {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--fg-3); font-size: 13px; font-family: inherit;
}
.linklike:hover { color: var(--brand); }
.hint-center { text-align: center; color: var(--fg-3); font-size: 12px; margin-top: 24px; }
.empty a { color: var(--brand); }

/* ---------- 空态 ---------- */
.empty { padding: 48px 16px; text-align: center; color: var(--fg-3); font-size: 14px; }
.empty.big { padding: 96px 16px; }
.empty.big h1 { font-size: 64px; color: var(--line); margin-bottom: 8px; }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--line); padding: 28px 0 40px;
  text-align: center; color: var(--fg-3); font-size: 13px;
}
.site-footer p { margin: 4px 0; }
.site-footer .links a { color: var(--fg-3); }
.site-footer .links a:hover { color: var(--brand); }

/* ---------- 响应式 ---------- */
/* 减少动效偏好：去位移/缩放，保留有助理解的透明度过渡 */
@media (prefers-reduced-motion: reduce) {
  .btn, .tabs button, .tabs a, .eps a { transition: none; }
  .btn:active, .tabs button:active, .tabs a:active, .eps a:active { transform: none; }
  .card .pic img { transition: none; }
  .card:hover .pic img { transform: none; }
  .epgroup.on { animation: none; }
}

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .detail { grid-template-columns: 140px 1fr; gap: 16px; }
  .detail h1 { font-size: 20px; }
}
@media (max-width: 720px) {
  .header-inner { height: 54px; gap: 10px; }
  .nav { display: none; }
  .nav.open {
    display: flex; position: absolute; top: 54px; left: 0; right: 0;
    flex-direction: column; gap: 0; padding: 8px;
    background: var(--bg-2); border-bottom: 1px solid var(--line);
  }
  .nav.open a { border-radius: 8px; }
  .nav-toggle { display: block; order: 3; }
  .search { flex: 1; }
  .search input { width: 100%; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px 10px; }
  .frow > b { flex-basis: 36px; }
  .main { padding: 16px 12px 40px; }
}
