:root {
  --bg: #101514;
  --panel: #18211f;
  --soft: #edf1ea;
  --ink: #f7faf6;
  --muted: #a8b6ad;
  --line: rgba(255,255,255,.1);
  --green: #6dd39a;
  --cyan: #64c6cf;
  --gold: #d8b268;
  --shadow: 0 18px 44px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: hidden; scroll-behavior: smooth; }
body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 0, rgba(109,211,154,.14), transparent 32%), var(--bg);
  color: var(--ink);
  font: 16px/1.6 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
button, input, select { font: inherit; }
.topbar, .shell, .footer {
  width: min(1320px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  margin: 0 auto;
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto 1fr minmax(220px, 320px);
  align-items: center;
  gap: 24px;
  min-height: 78px;
  background: rgba(16,21,20,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 900; }
.brand span { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 16px; background: linear-gradient(135deg,var(--green),var(--cyan)); color: #07110d; }
.nav { display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; }
.nav a { color: var(--muted); font-weight: 800; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.search input { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.06); color: var(--ink); padding: 0 16px; }
.search input::placeholder, .footer p, .footer a, .guide-grid p, .line-item small, .library-card p, .detail-sub, .detail-copy p { color: var(--muted); }
.shell { padding: 28px 0 54px; }
.headline-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px,.75fr);
  gap: 18px;
  min-width: 0;
  margin-bottom: 18px;
}
.headline-main, .headline-rank, .channel-card, .poster-band, .library-top, .filter-drawer, .library-card, .panel, .footer > div, .guide-grid article {
  background: rgba(24,33,31,.86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.headline-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  min-width: 0;
  border-radius: 30px;
  padding: 26px;
}
.headline-main > div { display: grid; align-content: center; gap: 16px; min-width: 0; }
.headline-main span, .section-head span, .library-top span, .detail-state { color: var(--green); font-size: .78rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0; }
.headline-main h1 { margin: 0; font-size: clamp(2rem, 4vw, 4.2rem); line-height: 1.03; }
.headline-main p, .library-top p, .detail-desc { margin: 0; color: #d8e5dd; }
.headline-main > div > a { display: inline-flex; align-items: center; justify-content: center; width: fit-content; min-width: 126px; height: 46px; padding: 0 20px; border-radius: 999px; background: linear-gradient(135deg,var(--green),var(--cyan)); color: #07110d; font-weight: 900; }
.headline-main img { align-self: center; height: 100%; object-fit: cover; border-radius: 22px; max-height: 390px; }
.headline-rank { border-radius: 24px; padding: 20px; min-width: 0; }
.section-head { display: grid; gap: 6px; margin-bottom: 14px; }
.section-head h2, .section-head h3, .library-top h1, .detail-main h1 { margin: 0; line-height: 1.16; }
.line-item {
  display: grid;
  grid-template-columns: 34px minmax(0,1fr) 42px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 15px;
  background: rgba(255,255,255,.05);
  margin-bottom: 8px;
  min-width: 0;
}
.line-item:hover { background: rgba(255,255,255,.09); transform: translateY(-1px); }
.line-item b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: rgba(109,211,154,.12); color: var(--green); }
.line-item span { display: grid; min-width: 0; }
.line-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-item em { justify-self: end; color: var(--gold); font-style: normal; font-weight: 900; }
.quick-panel, .channel-board, .poster-bands, .guide-grid, .library-top, .filter-drawer, .library-board, .detail-stage, .detail-columns, .panel { margin-bottom: 18px; }
.quick-panel { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 10px; }
.quick-panel a { display: grid; place-items: center; min-height: 52px; border-radius: 16px; background: rgba(255,255,255,.07); border: 1px solid var(--line); font-weight: 900; }
.quick-panel a:hover { background: rgba(109,211,154,.14); }
.channel-board { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; min-width: 0; }
.channel-card, .poster-band, .panel { border-radius: 24px; padding: 20px; min-width: 0; }
.poster-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 12px; min-width: 0; }
.poster-grid.mini { grid-template-columns: repeat(3,minmax(0,1fr)); }
.poster-card { display: grid; gap: 8px; min-width: 0; }
.poster-cover { position: relative; overflow: hidden; border-radius: 18px; aspect-ratio: 2/3; background: #22302d; }
.poster-cover img { height: 100%; object-fit: cover; transition: transform 220ms ease; }
.poster-card:hover img { transform: scale(1.04); }
.poster-cover > span, .poster-cover > b { position: absolute; top: 10px; z-index: 1; display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border-radius: 999px; color: #fff; font-size: .84rem; font-weight: 900; }
.poster-cover > span { left: 10px; background: rgba(0,0,0,.58); }
.poster-cover > b { right: 10px; background: rgba(216,178,104,.92); color: #15100a; }
.poster-hover { position: absolute; inset: auto 0 0; display: grid; padding: 18px 14px 14px; color: #fff; background: linear-gradient(180deg,transparent,rgba(0,0,0,.88)); transform: translateY(100%); transition: transform 220ms ease; }
.poster-card:hover .poster-hover { transform: translateY(0); }
.poster-title, .library-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 900; }
.guide-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; }
.guide-grid article { border-radius: 20px; padding: 18px; }
.library-top { display: flex; justify-content: space-between; align-items: end; gap: 20px; border-radius: 26px; padding: 24px; }
.library-top strong { display: grid; place-items: center; min-width: 170px; min-height: 54px; border-radius: 16px; background: rgba(109,211,154,.12); color: var(--green); }
.filter-drawer { display: grid; gap: 14px; border-radius: 22px; padding: 16px; }
.filter-row, .select-row, .meta-row, .tag-row { display: flex; flex-wrap: wrap; gap: 10px; }
.filter { min-height: 40px; padding: 0 15px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.05); color: var(--ink); cursor: pointer; }
.filter:hover, .filter.active { background: rgba(109,211,154,.14); border-color: rgba(109,211,154,.34); }
.select-row label { display: grid; gap: 6px; color: var(--muted); font-size: .9rem; }
.select-row select { height: 42px; min-width: 150px; padding: 0 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: #1d2522; }
.library-board { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; min-width: 0; }
.library-card { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 12px; min-width: 0; border-radius: 22px; padding: 12px; }
.library-poster { position: relative; overflow: hidden; border-radius: 16px; background: #22302d; }
.library-poster img { height: 100%; object-fit: cover; aspect-ratio: 2/3; }
.library-poster span { position: absolute; inset: auto 0 0; display: grid; place-items: center; min-height: 38px; color: #fff; background: linear-gradient(180deg,transparent,rgba(0,0,0,.88)); transform: translateY(100%); transition: transform 180ms ease; }
.library-poster:hover span { transform: translateY(0); }
.library-copy { display: grid; align-content: start; gap: 8px; min-width: 0; }
.card-top { display: flex; justify-content: space-between; color: var(--gold); font-weight: 900; }
.meta-row span, .tag-row a { display: inline-flex; align-items: center; min-height: 30px; padding: 0 9px; border-radius: 999px; background: rgba(109,211,154,.1); color: var(--green); font-size: .9rem; font-weight: 800; }
.detail-stage { display: grid; grid-template-columns: minmax(260px,320px) minmax(0,1fr); gap: 22px; border-radius: 26px; padding: 22px; background: rgba(24,33,31,.86); border: 1px solid var(--line); }
.detail-poster { overflow: hidden; border-radius: 22px; background: #22302d; }
.detail-poster img { height: 100%; object-fit: cover; }
.detail-main { display: grid; align-content: start; gap: 14px; min-width: 0; }
.detail-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; }
.detail-grid div { padding: 13px 15px; border-radius: 16px; background: rgba(255,255,255,.06); }
.detail-grid dt { color: var(--muted); margin-bottom: 5px; }
.detail-grid dd { margin: 0; font-weight: 900; }
.detail-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.episode-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; }
.episode-grid button { min-height: 42px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.05); color: var(--ink); cursor: pointer; }
.detail-copy { display: grid; gap: 10px; }
.footer { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; padding: 0 0 34px; }
.footer > div { border-radius: 20px; padding: 18px; background: rgba(24,33,31,.86); border: 1px solid var(--line); }
.copy { grid-column: 1 / -1; margin: 0; text-align: center; color: var(--muted); }
@media (max-width: 1120px) {
  .topbar, .headline-grid, .channel-board, .detail-stage, .detail-columns, .footer { grid-template-columns: 1fr; }
  .topbar { padding: 12px 0; }
  .nav { justify-content: flex-start; }
  .headline-main { grid-template-columns: 1fr; }
  .headline-main img { width: min(240px,100%); }
  .poster-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .poster-grid.mini, .library-board, .guide-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
  .quick-panel, .poster-grid, .poster-grid.mini, .library-board, .guide-grid, .detail-grid, .footer { grid-template-columns: 1fr; }
  .library-card, .library-top { grid-template-columns: 1fr; flex-direction: column; align-items: start; }
  .library-poster { width: min(170px,100%); }
  .shell, .topbar, .footer { width: min(100% - 20px,1320px); max-width: calc(100% - 20px); }
  .episode-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}


/* stable responsive guards */
html, body { max-width: 100%; overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
img, video, canvas, svg { max-width: 100%; }
h1, h2, h3, h4, p, a, span, strong, small, b, em, li { min-width: 0; overflow-wrap: anywhere; }
main, header, footer, section, article, aside, nav, div { min-width: 0; }
.poster-grid, .feature-grid, .movie-grid, .library-grid, .library-list, .related-grid, .content-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
