/* ===== tvmao 全局样式 (移动端优先, 深色主题) ===== */
:root {
  --bg: #000000;
  --bg-soft: #0b0b0d;
  --card: #141417;
  --card-2: #1c1c21;
  --line: #26262c;
  --txt: #ffffff;
  --txt-2: #a6a6ad;
  --txt-3: #6f6f78;
  --brand: #ff3b30;
  --brand-2: #ff6a3d;
  --gold: #f5c451;
  --ok: #34c759;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 18px rgba(0, 0, 0, .55);
  --maxw: 480px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: .2px;
  -webkit-font-smoothing: antialiased;
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, .82);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.logo {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex-shrink: 0;
}
.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
}
.search input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--txt);
  font-size: 14px;
  width: 100%;
}
.search input::placeholder { color: var(--txt-3); }
.topbar .ic {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--txt-2);
  font-size: 15px;
  flex-shrink: 0;
}

/* ===== 分类 Tab ===== */
.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 12px;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--txt-2);
  background: var(--card);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tab.on {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  font-weight: 600;
}

/* ===== Section ===== */
.sec { padding: 4px 12px 16px; }
.sec-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 10px;
}
.sec-hd h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sec-hd h3 .bar {
  width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}
.sec-hd .more { font-size: 12px; color: var(--txt-3); }

/* ===== 海报网格 ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px 9px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.poster {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--card);
  box-shadow: var(--shadow);
}
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 6px 6px;
  background: linear-gradient(0deg, rgba(0,0,0,.92), rgba(0,0,0,0));
  color: #fff;
}
.poster .t {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.poster .y { font-size: 10px; color: var(--txt-2); }
.poster .sc {
  position: absolute; top: 4px; left: 4px;
  background: rgba(0,0,0,.65);
  color: var(--gold);
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 5px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}
.poster .rk {
  position: absolute; top: 0; left: 0;
  color: #fff; font-weight: 800; font-size: 13px;
  padding: 5px 7px 6px 8px;
  background: linear-gradient(135deg, rgba(255,59,48,.95), rgba(255,106,61,.85));
  border-bottom-right-radius: 10px;
  letter-spacing: .5px;
}
.poster .rk.top { color: var(--gold); }

/* ===== 榜单卡片 ===== */
.rank-list { display: flex; flex-direction: column; gap: 8px; }
.rank-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.rank-item .no {
  width: 22px; flex-shrink: 0;
  font-size: 16px; font-weight: 800;
  color: var(--txt-3); text-align: center;
  font-variant-numeric: tabular-nums;
}
.rank-item:nth-child(1) .no { color: var(--brand); }
.rank-item:nth-child(2) .no { color: var(--brand-2); }
.rank-item:nth-child(3) .no { color: var(--gold); }
.rank-item .pic {
  width: 42px; height: 58px; flex-shrink: 0;
  border-radius: 6px; overflow: hidden; background: var(--card-2);
}
.rank-item .pic img { width: 100%; height: 100%; object-fit: cover; }
.rank-item .txt { flex: 1; min-width: 0; }
.rank-item .tt {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rank-item .meta {
  font-size: 11px; color: var(--txt-3);
  margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ===== 新闻卡 ===== */
.news-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.news-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.news-item .cv { aspect-ratio: 16/10; overflow: hidden; background: var(--card-2); }
.news-item .cv img { width: 100%; height: 100%; object-fit: cover; }
.news-item .bd { padding: 8px 9px 10px; }
.news-item .nt {
  font-size: 13px; line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item .nm { font-size: 11px; color: var(--txt-3); margin-top: 5px; }

.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-row {
  display: flex; gap: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.news-row .cv {
  width: 116px; flex-shrink: 0;
  aspect-ratio: 16/10; overflow: hidden; background: var(--card-2);
  align-self: stretch;
}
.news-row .cv img { width: 100%; height: 100%; object-fit: cover; }
.news-row .bd { flex: 1; padding: 10px 10px 10px 0; min-width: 0; }
.news-row .tt {
  font-size: 14px; font-weight: 600; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-row .mt { font-size: 11px; color: var(--txt-3); margin-top: 6px; }

/* ===== 底部导航 ===== */
.tabbar {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: var(--maxw);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: rgba(10,10,12,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  z-index: 60;
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 10px; color: var(--txt-3);
}
.tabbar a .i { font-size: 19px; line-height: 1; }
.tabbar a.on { color: var(--brand); font-weight: 600; }
main { padding-bottom: 72px; }

/* ===== 通用 ===== */
.chips {
  display: flex; gap: 6px; overflow-x: auto;
  padding: 0 12px 12px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 5px 11px;
  font-size: 12px; color: var(--txt-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.chip.on { color: #fff; background: var(--card-2); border-color: var(--brand); }

.muted { color: var(--txt-2); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.center { text-align: center; }
.pad { padding: 12px; }

.hero {
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/9;
  margin: 0 12px 14px;
}
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero .info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 12px;
  background: linear-gradient(0deg, rgba(0,0,0,.9), rgba(0,0,0,0));
}
.hero .info h2 { margin: 0; font-size: 18px; font-weight: 800; }
.hero .info p { margin: 4px 0 0; font-size: 12px; color: var(--txt-2); }

/* ===== 详情页 ===== */
.d-hero { position: relative; }
.d-hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.d-hero .ov {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 34px 14px 14px;
  background: linear-gradient(0deg, #000 25%, rgba(0,0,0,0));
}
.d-title { font-size: 20px; font-weight: 800; }
.d-en { font-size: 12px; color: var(--txt-3); margin-top: 2px; }
.d-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 12px; color: var(--txt-2); margin-top: 8px;
}
.d-meta b { color: var(--gold); font-weight: 700; }
.d-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.d-tags span {
  font-size: 11px; padding: 3px 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; color: var(--txt-2);
}
.d-score {
  display: flex; align-items: baseline; gap: 4px;
}
.d-score .n { font-size: 26px; font-weight: 800; color: var(--brand); }

.panel { margin: 0 12px 12px; padding: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); }
.panel h4 {
  margin: 0 0 8px; font-size: 15px; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
}
.panel h4 .bar { width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2)); }
.syn { font-size: 14px; line-height: 1.75; color: #e6e6ea; }
.syn p { margin: 0 0 8px; }
.syn p:last-child { margin-bottom: 0; }

.info-row {
  display: flex; padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,.05);
  font-size: 13px;
}
.info-row:last-child { border-bottom: 0; }
.info-row .k { width: 74px; flex-shrink: 0; color: var(--txt-3); }
.info-row .v { flex: 1; color: var(--txt); }

.cast-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.cast-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; background: var(--card-2);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.cast-item .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; color: #fff;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.cast-item .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-item .rl { font-size: 11px; color: var(--txt-3); }

.epi { display: flex; flex-direction: column; gap: 8px; }
.epi-item {
  background: var(--card-2); border-radius: var(--radius-sm);
  font-size: 13px; line-height: 1.65;
  overflow: hidden;
}
.epi-item .epi-hd {
  display: flex; align-items: baseline; gap: 8px;
  padding: 10px 11px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.epi-item .epi-hd:active { opacity: .7; }
.epi-item .no {
  color: var(--brand); font-weight: 700; font-size: 12px;
  flex: none;
}
.epi-item .sum {
  flex: 1; min-width: 0; color: var(--txt-2);
  font-size: 12.5px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.epi-item .arrow {
  flex: none; color: var(--txt-3); font-size: 11px;
  transition: transform .22s ease;
}
.epi-item.open .arrow { transform: rotate(180deg); }
.epi-item .epi-body {
  max-height: 0; overflow: hidden;
  transition: max-height .28s ease;
}
.epi-item.open .epi-body { max-height: 1200px; }
.epi-item .epi-inner {
  padding: 2px 11px 12px 11px; color: var(--txt-2);
  border-top: 1px solid var(--line);
}
.epi-item .epi-inner p { margin: 8px 0 0 0; }

/* 详情 Tab */
.dtabs {
  position: sticky; top: 55px; z-index: 40;
  display: flex; gap: 4px;
  background: rgba(0,0,0,.9);
  backdrop-filter: blur(10px);
  padding: 8px 10px;
  border-top: 1px solid rgba(255,255,255,.05);
  border-bottom: 1px solid rgba(255,255,255,.05);
  overflow-x: auto; scrollbar-width: none;
}
.dtabs::-webkit-scrollbar { display: none; }
.dtabs a {
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; color: var(--txt-2); white-space: nowrap;
  background: var(--card); border: 1px solid var(--line);
}
.dtabs a.on {
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent; font-weight: 600;
}

/* 骨架屏 */
.sk { background: var(--card); border-radius: var(--radius-sm);
  animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.45} }

.empty { padding: 50px 12px; text-align: center; color: var(--txt-3); font-size: 13px; }

.footer {
  padding: 18px 14px 8px; text-align: center;
  font-size: 11px; color: var(--txt-3);
  border-top: 1px solid rgba(255,255,255,.05);
  margin-top: 16px;
}

.line-clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}