/* ==========================================================================
   前台样式（深色主题，移动优先）
   ========================================================================== */
:root {
  --accent: #dc2626;
  --accent-hover: #ef4444;
  --bg: #0b0d12;
  --bg-2: #12151c;
  --bg-3: #1a1e27;
  --line: #262b36;
  --text: #e8eaef;
  --text-2: #a3a9b6;
  --text-3: #6f7685;
  --star: #f5c518;
  --radius: 10px;
  --header-h: 60px;
  --maxw: 1320px;
  --gutter: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
a:hover { color: #fff; }
img { max-width: 100%; height: auto; display: block; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--header-h);
  background: rgba(11, 13, 18, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { display: flex; align-items: center; height: 100%; gap: 24px; }
.logo { font-weight: 800; font-size: 20px; letter-spacing: -.5px; white-space: nowrap; }
.logo span { color: var(--accent); }
.main-nav { display: flex; gap: 4px; flex: 1; }
.main-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.main-nav a:hover { color: #fff; background: var(--bg-3); }
.main-nav a.active { color: #fff; background: var(--bg-3); }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 8px; border: 0; background: transparent; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { background: var(--bg-3); color: #fff; }
.icon-btn svg { width: 22px; height: 22px; }
.menu-toggle { display: none; }

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }
  .main-nav {
    display: none; position: absolute; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px;
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px; }
}

/* ---------- Search overlay ---------- */
.search-overlay {
  position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 100; background: rgba(5, 6, 9, .9);
  display: none; padding: 80px var(--gutter) 24px;
}
.search-overlay.open { display: block; }
.search-overlay .box { max-width: 720px; margin: 0 auto; }
.search-close { position: absolute; top: 16px; right: 16px; }

/* ---------- Search form + suggest ---------- */
.search-form { position: relative; }
.search-form input {
  width: 100%; height: 56px; padding: 0 56px 0 20px; border-radius: 28px;
  border: 1px solid var(--line); background: var(--bg-2); font-size: 17px; outline: none;
}
.search-form input:focus { border-color: var(--accent); }
.search-form button {
  position: absolute; right: 6px; top: 6px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--accent); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.search-form button svg { width: 20px; height: 20px; color: #fff; }
.suggest {
  position: absolute; left: 0; right: 0; top: 62px; z-index: 20;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,.5);
}
.suggest a { display: flex; gap: 12px; padding: 8px 12px; align-items: center; }
.suggest a:hover, .suggest a.active { background: var(--bg-3); }
.suggest img, .suggest .ph { width: 40px; height: 60px; object-fit: cover; border-radius: 4px; background: var(--bg-3); flex-shrink: 0; }
.suggest .t { font-weight: 600; }
.suggest .m { font-size: 13px; color: var(--text-2); }
.suggest .all { justify-content: center; color: var(--accent); font-weight: 600; padding: 12px; }

/* ---------- Home hero ---------- */
.hero-search {
  position: relative; min-height: 440px; display: flex; align-items: center;
  background: var(--bg-2) center/cover no-repeat;
}
.hero-search::before {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, rgba(11,13,18,.55) 0%, rgba(11,13,18,.75) 60%, var(--bg) 100%);
}
.hero-search .container { position: relative; width: 100%; text-align: center; padding-top: 40px; padding-bottom: 40px; }
.hero-search h1 { font-size: 40px; margin-bottom: 8px; }
.hero-search .sub { color: var(--text-2); margin-bottom: 28px; font-size: 17px; }
.hero-search .search-form { max-width: 680px; margin: 0 auto; text-align: left; }
.hot-words { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; font-size: 14px; }
.hot-words span { color: var(--text-3); }
.hot-words a { color: var(--text-2); padding: 2px 10px; border: 1px solid var(--line); border-radius: 20px; }
.hot-words a:hover { border-color: var(--accent); color: #fff; }
@media (max-width: 600px) { .hero-search h1 { font-size: 28px; } .hero-search { min-height: 360px; } }

/* ---------- Section / rail ---------- */
.section { margin: 36px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head a { color: var(--accent); font-weight: 600; font-size: 14px; white-space: nowrap; }
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; scrollbar-width: thin;
}
.rail > * { scroll-snap-align: start; }
@media (min-width: 900px) { .rail { grid-auto-columns: 170px; } }

/* ---------- Card ---------- */
.card { display: block; min-width: 0; }
.card .poster {
  position: relative; aspect-ratio: 2/3; border-radius: var(--radius); overflow: hidden; background: var(--bg-3);
}
.card .poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.card:hover .poster img { transform: scale(1.04); }
.card .badge {
  position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.75); font-size: 12px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
}
.card .badge.type { left: auto; right: 8px; background: var(--accent); }
.card .rating {
  position: absolute; bottom: 8px; left: 8px; background: rgba(0,0,0,.75); font-size: 12px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
}
.card .rating::before { content: "★ "; color: var(--star); }
.card .title { margin-top: 8px; font-weight: 600; font-size: 14px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { font-size: 13px; color: var(--text-3); }
.noimg { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 12px; text-align: center; padding: 8px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 14px; }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); } }

/* ---------- Skeleton ---------- */
.skel { background: linear-gradient(90deg, var(--bg-2) 0%, var(--bg-3) 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-card { aspect-ratio: 2/3; }

/* ---------- Page header / breadcrumb ---------- */
.breadcrumb { font-size: 13px; color: var(--text-3); margin: 18px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { color: var(--text-3); }
.page-head { margin: 8px 0 18px; }
.page-head .intro { color: var(--text-2); max-width: 900px; }

/* ---------- Filters ---------- */
.filters { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 22px; }
.filter-row { display: flex; gap: 12px; align-items: flex-start; padding: 6px 0; }
.filter-row + .filter-row { border-top: 1px dashed var(--line); }
.filter-label { width: 72px; flex-shrink: 0; color: var(--text-3); font-size: 13px; padding-top: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 12px; border-radius: 16px; font-size: 13px; color: var(--text-2); background: var(--bg-3); border: 1px solid transparent; white-space: nowrap;
}
.chip:hover { color: #fff; border-color: var(--line); }
.chip.active { background: var(--accent); color: #fff; }
.select {
  background: var(--bg-3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; min-width: 160px;
}
@media (max-width: 600px) { .filter-row { flex-direction: column; gap: 6px; } .filter-label { padding-top: 0; } }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 8px 16px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); cursor: pointer; font-weight: 500; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin: 30px 0; }
.pagination a, .pagination span { min-width: 40px; height: 40px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); }
.pagination a:hover { color: #fff; border-color: var(--text-3); }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-3); cursor: pointer; font-weight: 600; }
.btn:hover { border-color: var(--text-3); color: #fff; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn svg { width: 18px; height: 18px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }

/* ---------- Player ---------- */
.player-wrap { margin: 10px 0 20px; }
.player-box {
  position: relative; aspect-ratio: 16/9; width: 100%; background: #000 center/cover no-repeat; border-radius: var(--radius); overflow: hidden;
}
.player-box iframe { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; border: 0; }
.player-cover { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(0,0,0,.45); cursor: pointer; border: 0; width: 100%; }
.play-circle { width: 84px; height: 84px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: transform .15s; }
.player-cover:hover .play-circle { transform: scale(1.08); }
.play-circle svg { width: 36px; height: 36px; color: #fff; margin-left: 4px; }
.player-cover .label { font-weight: 700; font-size: 17px; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
.player-cover .resume-actions { display: flex; gap: 10px; }
.player-msg { position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 20px; background: rgba(0,0,0,.82); }
.player-msg code { background: var(--bg-3); padding: 6px 10px; border-radius: 6px; font-size: 13px; word-break: break-all; max-width: 100%; }
.server-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; font-size: 14px; }
.server-bar .lbl { color: var(--text-3); }
.server-bar button { padding: 6px 14px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; color: var(--text-2); }
.server-bar button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ep-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.next-countdown {
  position: absolute; right: 16px; bottom: 16px; z-index: 5; background: rgba(10,12,16,.92); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; max-width: 320px; font-size: 14px;
}
.next-countdown .btn { padding: 6px 12px; font-size: 13px; }

/* ---------- Detail ---------- */
.detail-top { display: grid; grid-template-columns: 220px 1fr; gap: 28px; margin: 10px 0 24px; }
.detail-top .poster { border-radius: var(--radius); overflow: hidden; aspect-ratio: 2/3; background: var(--bg-3); }
.detail-top .poster img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .detail-top { grid-template-columns: 120px 1fr; gap: 16px; } .detail-top h1 { font-size: 22px; } }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--text-2); font-size: 14px; margin-bottom: 12px; }
.meta-line .cert { border: 1px solid var(--text-3); padding: 0 6px; border-radius: 4px; font-size: 12px; }
.tmdb-rating { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.tmdb-rating .star { color: var(--star); }
.tmdb-rating .src { font-size: 11px; font-weight: 700; background: #0d253f; color: #01b4e4; padding: 1px 5px; border-radius: 3px; }
.tagline { font-style: italic; color: var(--text-2); }
.genre-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.info-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.info-table th { text-align: left; color: var(--text-3); font-weight: 500; width: 150px; padding: 7px 10px 7px 0; vertical-align: top; }
.info-table td { padding: 7px 0; color: var(--text-2); }
.info-table td a { color: var(--text); text-decoration: underline; text-decoration-color: var(--text-3); }
.crew-line { margin: 4px 0; color: var(--text-2); font-size: 14px; }
.crew-line b { color: var(--text); font-weight: 600; }
.intro-box { background: var(--bg-2); border-left: 3px solid var(--accent); padding: 12px 16px; border-radius: 6px; color: var(--text-2); font-size: 14px; }

.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 14px; }
.cast { text-align: center; font-size: 13px; }
.cast .ph { width: 92px; height: 92px; border-radius: 50%; overflow: hidden; margin: 0 auto 8px; background: var(--bg-3); }
.cast .ph img { width: 100%; height: 100%; object-fit: cover; }
.cast .n { font-weight: 600; }
.cast .c { color: var(--text-3); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { font-size: 13px; padding: 4px 12px; border-radius: 16px; background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); }
.tag-cloud a:hover { border-color: var(--accent); color: #fff; }
.tag-cloud a small { color: var(--text-3); margin-left: 4px; }


.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 32px; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- Seasons / episodes ---------- */
.ep-status { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 24px; margin: 14px 0; }
.ep-status b { color: var(--text); }
.season-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.season-tabs a, .season-tabs button { flex-shrink: 0; }
.ep-list { display: flex; flex-direction: column; gap: 10px; }
.ep {
  display: grid; grid-template-columns: 180px 1fr; gap: 14px; padding: 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line);
}
.ep:hover { border-color: var(--text-3); }
.ep.current { border-color: var(--accent); }
.ep .still { aspect-ratio: 16/9; border-radius: 6px; overflow: hidden; background: var(--bg-3); position: relative; }
.ep .still img { width: 100%; height: 100%; object-fit: cover; }
.ep .no { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.75); font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.ep .name { font-weight: 600; }
.ep .m { font-size: 13px; color: var(--text-3); margin: 2px 0 6px; }
.ep .ov { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.ep .label { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; background: var(--accent); color: #fff; margin-left: 6px; vertical-align: middle; }
.ep.unaired { opacity: .5; cursor: default; }
.ep.unaired .label { background: var(--text-3); }
@media (max-width: 600px) { .ep { grid-template-columns: 120px 1fr; } }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 6px; }
.ep-grid a, .ep-grid span { text-align: center; padding: 8px 0; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.ep-grid a.current { background: var(--accent); border-color: var(--accent); }
.ep-grid span { opacity: .4; }

/* ---------- Top 100 ---------- */
.top-list { display: flex; flex-direction: column; gap: 12px; }
.top-item { display: grid; grid-template-columns: 56px 80px 1fr; gap: 16px; align-items: center; padding: 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.top-item:hover { border-color: var(--text-3); }
.top-item .rank { font-size: 26px; font-weight: 800; text-align: center; color: var(--text-3); }
.top-item:nth-child(-n+3) .rank { color: var(--star); }
.top-item .p { aspect-ratio: 2/3; border-radius: 6px; overflow: hidden; background: var(--bg-3); }
.top-item .p img { width: 100%; height: 100%; object-fit: cover; }
.top-item .t { font-weight: 700; font-size: 16px; }
.top-item .m { font-size: 13px; color: var(--text-3); margin: 2px 0 4px; }
.top-item .ov { font-size: 13px; color: var(--text-2); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 600px) { .top-item { grid-template-columns: 36px 60px 1fr; gap: 10px; } .top-item .rank { font-size: 18px; } }

/* ---------- Countries ---------- */
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.country-card { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); }
.country-card:hover { border-color: var(--accent); }
.country-card .flag { font-size: 34px; line-height: 1; }
.country-card .n { font-weight: 700; }
.country-card .c { font-size: 13px; color: var(--text-3); }

/* ---------- Static pages ---------- */
.prose { max-width: 820px; color: var(--text-2); }
.prose h2 { color: var(--text); margin-top: 1.6em; }
.prose a { color: var(--accent); }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 60px; border-top: 1px solid var(--line); background: var(--bg-2); padding: 40px 0 24px; font-size: 14px; }
.footer-cols { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 28px; }
.footer-cols h4 { font-size: 14px; color: var(--text); margin-bottom: 10px; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; }
.footer-cols li { margin: 6px 0; }
.footer-cols a { color: var(--text-2); }
.footer-cols a:hover { color: #fff; }
.footer-bottom { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; color: var(--text-3); font-size: 13px; }
.tmdb-attr { display: flex; align-items: center; gap: 10px; }
.tmdb-logo { font-weight: 800; letter-spacing: .5px; background: linear-gradient(90deg, #90cea1, #01b4e4); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 16px; }
@media (max-width: 900px) { .footer-cols { grid-template-columns: 1fr 1fr; } }

/* ---------- Cookie banner ---------- */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; max-width: 720px; margin: 0 auto; background: var(--bg-3); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }

/* ---------- Notices / empty / error ---------- */
.notice { background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 16px; color: var(--text-2); }
.notice.error { border-color: #7f1d1d; background: #1c0f10; color: #fca5a5; }
.empty { padding: 60px 0; text-align: center; color: var(--text-3); }

/* ---------- 电影详情页头部（带播放按钮） ---------- */
.detail-hero { position: relative; margin: 0 calc(-1 * var(--gutter)); padding: 28px var(--gutter); background: var(--bg-2) center/cover no-repeat; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.detail-hero::before { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; background: linear-gradient(90deg, rgba(11,13,18,.97) 0%, rgba(11,13,18,.85) 45%, rgba(11,13,18,.55) 100%); }
.detail-hero > * { position: relative; }
.detail-hero .detail-top { margin: 0; }
.btn-watch { font-size: 17px; padding: 14px 26px; border-radius: 10px; }
.btn-watch svg { width: 22px; height: 22px; }
@media (min-width: 1352px) { .detail-hero { margin: 0; padding: 28px; } }

/* ---------- 播放页 ---------- */
.watch-head { display: flex; gap: 14px; align-items: center; margin: 14px 0 6px; }
.watch-head h1 { font-size: 22px; margin: 0; }
.watch-info { display: grid; grid-template-columns: 110px 1fr; gap: 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 16px 0; }
.watch-info img { width: 100%; height: auto; aspect-ratio: 2/3; object-fit: cover; border-radius: 6px; align-self: start; }
@media (max-width: 600px) { .watch-info { grid-template-columns: 80px 1fr; gap: 12px; } }
.watch-info p { font-size: 14px; color: var(--text-2); margin: 6px 0 10px; }

/* ---------- 集数分段 ---------- */
.range-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.range-row .chip { cursor: pointer; border: 1px solid var(--line); font-weight: 600; }
.range-major { gap: 0; border-bottom: 1px solid var(--line); }
.range-major .tab { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 16px; margin-bottom: -1px; }
.range-major .tab.active { background: transparent; color: #fff; border-bottom-color: var(--accent); }

/* ---------- 广告位（预留，默认关闭） ---------- */
.ad-slot { margin: 16px 0; text-align: center; overflow: hidden; }
.logo img { height: 60px; width: auto; }
.btn[aria-disabled="true"] { opacity: .6; cursor: default; }

/* ---------- 移动端（WAP）适配 ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a, button, .chip, .tab { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
@media (max-width: 600px) {
  /* 输入框和下拉框不小于 16px，iOS 点击时不会自动放大页面 */
  input, select, textarea, .select { font-size: 16px; }
  /* 手机上每行 3 张海报，减少滚动长度 */
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; }
  .rail { grid-auto-columns: 30%; gap: 10px; }
  .card .title { font-size: 13px; margin-top: 6px; }
  .card .sub { font-size: 12px; }
  .card .badge, .card .rating { font-size: 11px; padding: 1px 5px; }
  .card .badge { top: 6px; left: 6px; }
  .card .badge.type { right: 6px; }
  .card .rating { bottom: 6px; left: 6px; }
  /* 触控目标至少 36px 高 */
  .hot-words a, .chip, .tag-cloud a, .genre-links a { min-height: 36px; display: inline-flex; align-items: center; }
  .section-head a { padding: 8px 0 8px 12px; }
  .chips { gap: 8px; }
  /* 筛选标签在手机上单行横向滑动，不占太多高度 */
  .filters .chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-right: -12px; padding-right: 12px; }
  .filters .chips::-webkit-scrollbar { display: none; }
  .filters .filter-row > div:last-child { min-width: 0; max-width: 100%; }
  .server-bar button { min-height: 38px; }
  /* 上一集 / 下一集并排，各占一半 */
  .ep-nav { flex-wrap: nowrap; }
  .ep-nav > a, .ep-nav > span { flex: 1 1 0; min-width: 0; justify-content: center; padding-left: 10px; padding-right: 10px; font-size: 14px; }
  .ep-nav > a.js-next { text-align: right; }
  .next-countdown { left: 10px; right: 10px; bottom: 10px; max-width: none; }
  :root { --gutter: 12px; }
}
@media (max-width: 339px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail { grid-auto-columns: 44%; }
}

/* 旧版手机浏览器（不支持 aspect-ratio，例如老版本 UC、QQ 浏览器和 Android WebView）的回退写法 */
@supports not (aspect-ratio: 1 / 1) {
  .card .poster, .skel-card, .detail-top .poster, .top-item .p { height: 0; padding-top: 150%; position: relative; }
  .card .poster img, .detail-top .poster img, .top-item .p img, .card .poster .noimg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
  .player-box, .ep .still { height: 0; padding-top: 56.25%; }
  .ep .still img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
  .watch-info img { height: auto; }
}
