/*
Theme Name: SD Noir
Theme URI: https://example.com/
Author: SD Stack
Description: 短剧站主题 —— 适配 sd-core / sd-seo / sd-importer 数据模型，9:16 竖屏海报、深色流媒体风格、移动端底部导航。
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: sd-noir
Tags: video, dark, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   1. 变量与基础
   ========================================================================== */

:root {
  --sd-bg: #0f1115;
  --sd-bg-soft: #141822;
  --sd-surface: #1a1f2a;
  --sd-surface-2: #222936;
  --sd-line: rgba(255, 255, 255, 0.08);
  --sd-line-strong: rgba(255, 255, 255, 0.16);
  --sd-fg: #e9edf2;
  --sd-fg-dim: #a4adba;
  --sd-fg-mute: #6b7482;

  --sd-accent: #ff4d4f;
  --sd-accent-2: #ff8a3d;
  --sd-accent-soft: rgba(255, 77, 79, 0.14);

  --sd-radius: 14px;
  --sd-radius-sm: 10px;
  --sd-radius-xs: 6px;

  --sd-maxw: 1280px;
  --sd-gap: 18px;
  --sd-header-h: 64px;

  --sd-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --sd-shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.25);

  --sd-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sd-font-num: "Oswald", "Bebas Neue", "Arial Narrow", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sd-bg);
  color: var(--sd-fg);
  font-family: var(--sd-font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.sd-no-scroll {
  overflow: hidden;
}

img,
video,
iframe {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--sd-accent);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.3;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--sd-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.sd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sd-skip {
  position: absolute;
  left: -9999px;
  z-index: 999;
  padding: 12px 18px;
  background: var(--sd-accent);
  color: #fff;
  border-radius: 0 0 8px 0;
}

.sd-skip:focus {
  left: 0;
  top: 0;
}

/* ==========================================================================
   2. 布局
   ========================================================================== */

.sd-container {
  width: 100%;
  max-width: var(--sd-maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.sd-main {
  padding-bottom: 80px;
}

.sd-section {
  margin: 44px 0;
}

.sd-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.sd-section__title {
  position: relative;
  padding-left: 14px;
  font-size: 21px;
  letter-spacing: 0.5px;
}

.sd-section__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--sd-accent), var(--sd-accent-2));
}

.sd-section__more {
  font-size: 13px;
  color: var(--sd-fg-mute);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.sd-section__more:hover {
  color: var(--sd-accent);
}

.sd-section__more::after {
  content: "›";
  font-size: 18px;
  line-height: 1;
}

/* ==========================================================================
   3. 头部
   ========================================================================== */

.sd-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 17, 21, 0.72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, background 0.25s;
}

.sd-header.is-stuck {
  border-bottom-color: var(--sd-line);
  background: rgba(15, 17, 21, 0.92);
}

.sd-header__inner {
  display: flex;
  align-items: center;
  gap: 26px;
  height: var(--sd-header-h);
}

.sd-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
  white-space: nowrap;
}

.sd-logo__mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--sd-accent), var(--sd-accent-2));
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.sd-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.sd-nav a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--sd-fg-dim);
  transition: color 0.2s, background 0.2s;
}

.sd-nav a:hover,
.sd-nav .current-menu-item > a {
  color: var(--sd-fg);
  background: rgba(255, 255, 255, 0.06);
}

.sd-nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sd-nav__list li {
  list-style: none;
}

.sd-logo__img {
  max-height: 40px;
  width: auto;
}

.sd-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sd-search-btn,
.sd-menu-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--sd-line);
  border-radius: 10px;
  background: transparent;
  color: var(--sd-fg-dim);
  transition: color 0.2s, border-color 0.2s;
}

.sd-search-btn:hover,
.sd-menu-btn:hover {
  color: var(--sd-fg);
  border-color: var(--sd-line-strong);
}

.sd-menu-btn {
  display: none;
}

/* 搜索面板 */

.sd-searchpanel {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  padding: 80px 20px 20px;
  background: rgba(8, 10, 14, 0.88);
  backdrop-filter: blur(10px);
}

.sd-searchpanel.is-open {
  display: block;
}

.sd-searchpanel form {
  display: flex;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.sd-searchpanel input[type="search"] {
  flex: 1;
  height: 52px;
  padding: 0 18px;
  border: 1px solid var(--sd-line-strong);
  border-radius: 12px;
  background: var(--sd-surface);
  color: var(--sd-fg);
  font-size: 16px;
}

.sd-searchpanel input::placeholder {
  color: var(--sd-fg-mute);
}

.sd-searchpanel button {
  height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--sd-accent), var(--sd-accent-2));
  color: #fff;
  font-weight: 700;
}

.sd-searchpanel__hint {
  max-width: 720px;
  margin: 26px auto 0;
  color: var(--sd-fg-mute);
  font-size: 13px;
}

.sd-searchpanel__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* 移动端抽屉 */

.sd-drawer {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 210;
  width: min(320px, 84vw);
  padding: 26px 22px;
  background: var(--sd-bg-soft);
  border-left: 1px solid var(--sd-line);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  overflow-y: auto;
}

.sd-drawer.is-open {
  transform: translateX(0);
}

.sd-drawer a {
  display: block;
  padding: 13px 0;
  border-bottom: 1px solid var(--sd-line);
  font-size: 16px;
}

.sd-drawer__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--sd-line);
  border-radius: 8px;
  background: transparent;
  font-size: 18px;
}

.sd-overlay {
  position: fixed;
  inset: 0;
  z-index: 205;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

.sd-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   4. Hero
   ========================================================================== */

.sd-hero {
  position: relative;
  margin: 26px 0 40px;
  border-radius: 22px;
  overflow: hidden;
  background: var(--sd-surface);
  isolation: isolate;
}

.sd-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  filter: blur(34px) saturate(1.3);
  transform: scale(1.15);
  opacity: 0.42;
}

.sd-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 17, 21, 0.96) 0%, rgba(15, 17, 21, 0.75) 55%, rgba(15, 17, 21, 0.55) 100%);
}

.sd-hero__inner {
  display: grid;
  grid-template-columns: 236px 1fr;
  gap: 34px;
  align-items: center;
  padding: 38px;
}

.sd-hero__poster {
  position: relative;
  border-radius: var(--sd-radius);
  overflow: hidden;
  aspect-ratio: 2 / 3;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.55);
}

.sd-hero__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sd-hero__body {
  min-width: 0;
}

.sd-hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--sd-accent-soft);
  color: var(--sd-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
}

.sd-hero__title {
  font-size: clamp(26px, 3.4vw, 42px);
  line-height: 1.18;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}

.sd-hero__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 16px;
  color: var(--sd-fg-dim);
  font-size: 13.5px;
}

.sd-hero__desc {
  max-width: 640px;
  margin-bottom: 24px;
  color: var(--sd-fg-dim);
  font-size: 14.5px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sd-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   5. 按钮
   ========================================================================== */

.sd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
}

.sd-btn--primary {
  background: linear-gradient(135deg, var(--sd-accent), var(--sd-accent-2));
  color: #fff;
  box-shadow: 0 8px 24px var(--sd-accent-soft);
}

.sd-btn--primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(255, 77, 79, 0.3);
}

.sd-btn--ghost {
  border-color: var(--sd-line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--sd-fg);
}

.sd-btn--ghost:hover {
  border-color: var(--sd-accent);
  color: var(--sd-accent);
}

.sd-btn--sm {
  height: 36px;
  padding: 0 18px;
  font-size: 13.5px;
}

/* ==========================================================================
   6. 卡片与网格
   ========================================================================== */

.sd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: var(--sd-gap);
}

.sd-grid--tight {
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 14px;
}

.sd-card {
  position: relative;
  display: block;
  border-radius: var(--sd-radius-sm);
  transition: transform 0.22s ease;
}

.sd-card:hover {
  transform: translateY(-4px);
}

.sd-card__media {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--sd-radius-sm);
  overflow: hidden;
  background: var(--sd-surface);
  box-shadow: var(--sd-shadow-sm);
}

.sd-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.sd-card:hover .sd-card__media img {
  transform: scale(1.05);
}

.sd-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.72) 100%);
  pointer-events: none;
}

.sd-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 3px 8px;
  border-radius: var(--sd-radius-xs);
  background: var(--sd-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.sd-card__badge--done {
  background: #2f9e44;
}

.sd-card__score {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: var(--sd-radius-xs);
  background: rgba(0, 0, 0, 0.62);
  color: #ffd43b;
  font-family: var(--sd-font-num);
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(4px);
}

.sd-card__play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity 0.25s;
}

.sd-card__play span {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #111;
  font-size: 17px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.sd-card:hover .sd-card__play {
  opacity: 1;
}

.sd-card__title {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

.sd-card:hover .sd-card__title {
  color: var(--sd-accent);
}

.sd-card__meta {
  margin-top: 5px;
  color: var(--sd-fg-mute);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 横向滚动轨 */

.sd-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 1fr);
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.sd-rail::-webkit-scrollbar {
  display: none;
}

.sd-rail .sd-card {
  scroll-snap-align: start;
}

/* 榜单 */

.sd-rank {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.sd-rank__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--sd-line);
  border-radius: var(--sd-radius-sm);
  background: var(--sd-surface);
  transition: border-color 0.2s, transform 0.2s;
}

.sd-rank__item:hover {
  border-color: var(--sd-line-strong);
  transform: translateX(3px);
}

.sd-rank__no {
  width: 34px;
  flex-shrink: 0;
  text-align: center;
  font-family: var(--sd-font-num);
  font-size: 22px;
  font-weight: 800;
  font-style: italic;
  color: var(--sd-fg-mute);
}

.sd-rank__item:nth-child(1) .sd-rank__no { color: #ffd43b; }
.sd-rank__item:nth-child(2) .sd-rank__no { color: #ced4da; }
.sd-rank__item:nth-child(3) .sd-rank__no { color: #e8915a; }

.sd-rank__thumb {
  width: 54px;
  height: 76px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--sd-surface-2);
}

.sd-rank__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sd-rank__body {
  min-width: 0;
  flex: 1;
}

.sd-rank__title {
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sd-rank__meta {
  margin-top: 3px;
  color: var(--sd-fg-mute);
  font-size: 12px;
}

/* ==========================================================================
   7. 筛选 chips
   ========================================================================== */

.sd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sd-chip {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border: 1px solid var(--sd-line);
  border-radius: 999px;
  background: var(--sd-surface);
  color: var(--sd-fg-dim);
  font-size: 13.5px;
  transition: all 0.18s;
}

.sd-chip:hover {
  border-color: var(--sd-line-strong);
  color: var(--sd-fg);
}

.sd-chip.is-active {
  border-color: var(--sd-accent);
  background: var(--sd-accent-soft);
  color: var(--sd-accent);
  font-weight: 600;
}

.sd-filterbar {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 26px;
  padding: 18px;
  border: 1px solid var(--sd-line);
  border-radius: var(--sd-radius);
  background: var(--sd-bg-soft);
}

.sd-filterbar__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sd-filterbar__label {
  flex-shrink: 0;
  width: 46px;
  padding-top: 8px;
  color: var(--sd-fg-mute);
  font-size: 13px;
}

/* ==========================================================================
   8. 面包屑 / 页面头
   ========================================================================== */

.sd-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 22px 0 18px;
  color: var(--sd-fg-mute);
  font-size: 13px;
}

.sd-crumbs a:hover {
  color: var(--sd-accent);
}

.sd-crumbs__sep {
  opacity: 0.45;
}

.sd-pagehead {
  margin-bottom: 26px;
}

.sd-pagehead__title {
  font-size: clamp(22px, 2.6vw, 30px);
  margin-bottom: 8px;
}

.sd-pagehead__desc {
  max-width: 760px;
  color: var(--sd-fg-dim);
  font-size: 14px;
}

.sd-pagehead__count {
  margin-top: 10px;
  color: var(--sd-fg-mute);
  font-size: 13px;
}

/* ==========================================================================
   9. 详情页
   ========================================================================== */

.sd-detail {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 38px;
  align-items: start;
  margin: 8px 0 44px;
}

.sd-detail__poster {
  position: sticky;
  top: calc(var(--sd-header-h) + 20px);
}

.sd-detail__poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: var(--sd-radius);
  box-shadow: var(--sd-shadow);
}

.sd-detail__title {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.22;
  margin-bottom: 10px;
}

.sd-detail__alt {
  margin-bottom: 14px;
  color: var(--sd-fg-mute);
  font-size: 14px;
}

.sd-detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-bottom: 18px;
}

.sd-tag {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--sd-line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--sd-fg-dim);
  font-size: 12.5px;
}

a.sd-tag:hover {
  border-color: var(--sd-accent);
  color: var(--sd-accent);
}

.sd-tag--accent {
  border-color: transparent;
  background: var(--sd-accent-soft);
  color: var(--sd-accent);
  font-weight: 600;
}

.sd-rating {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: #ffd43b;
  font-family: var(--sd-font-num);
  font-size: 24px;
  font-weight: 700;
}

.sd-rating small {
  color: var(--sd-fg-mute);
  font-family: var(--sd-font);
  font-size: 12px;
  font-weight: 400;
}

.sd-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 22px 0 26px;
}

.sd-block {
  margin-bottom: 34px;
}

.sd-block__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 18px;
}

.sd-block__title small {
  color: var(--sd-fg-mute);
  font-size: 12.5px;
  font-weight: 400;
}

.sd-prose {
  color: var(--sd-fg-dim);
  font-size: 15px;
  line-height: 1.85;
}

.sd-prose p:last-child {
  margin-bottom: 0;
}

/* 剧透折叠 */

.sd-spoiler {
  border: 1px dashed var(--sd-line-strong);
  border-radius: var(--sd-radius-sm);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.sd-spoiler summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
  font-size: 14.5px;
  font-weight: 600;
}

.sd-spoiler summary::-webkit-details-marker {
  display: none;
}

.sd-spoiler summary::after {
  content: "＋";
  margin-left: auto;
  color: var(--sd-fg-mute);
  font-size: 18px;
  transition: transform 0.2s;
}

.sd-spoiler[open] summary::after {
  content: "－";
}

.sd-spoiler__seal {
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(255, 212, 59, 0.14);
  color: #ffd43b;
  font-size: 11px;
  font-weight: 700;
}

.sd-spoiler__body {
  padding: 0 18px 18px;
}

.sd-spoiler__warn {
  margin-bottom: 12px;
  color: #ffa94d;
  font-size: 12.5px;
}

/* 信息表 */

.sd-facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--sd-line);
  border-radius: var(--sd-radius-sm);
  background: var(--sd-line);
}

.sd-facts__item {
  padding: 13px 16px;
  background: var(--sd-surface);
}

.sd-facts__k {
  color: var(--sd-fg-mute);
  font-size: 12px;
}

.sd-facts__v {
  margin-top: 3px;
  font-size: 14.5px;
  font-weight: 600;
}

/* 演员 */

.sd-cast {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 14px;
}

.sd-cast__item {
  text-align: center;
}

.sd-cast__avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--sd-surface-2);
  display: grid;
  place-items: center;
  color: var(--sd-fg-mute);
  font-size: 20px;
  font-weight: 700;
}

.sd-cast__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sd-cast__name {
  font-size: 13px;
  color: var(--sd-fg-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 分集 */

.sd-episodes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 9px;
}

.sd-episodes a {
  display: grid;
  place-items: center;
  height: 44px;
  border: 1px solid var(--sd-line);
  border-radius: 8px;
  background: var(--sd-surface);
  color: var(--sd-fg-dim);
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.18s;
}

.sd-episodes a:hover {
  border-color: var(--sd-accent);
  background: var(--sd-accent-soft);
  color: var(--sd-accent);
}

.sd-episodes a.is-current {
  border-color: var(--sd-accent);
  background: var(--sd-accent);
  color: #fff;
}

.sd-episodes a[hidden] {
  display: none;
}

.sd-episodes__more {
  margin-top: 14px;
  text-align: center;
}

/* 播放器 */

.sd-player {
  position: relative;
  margin-bottom: 26px;
  border-radius: var(--sd-radius);
  overflow: hidden;
  background: #000;
}

.sd-player video {
  width: 100%;
  max-height: 78vh;
  background: #000;
}

.sd-player--vertical {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

.sd-player--vertical video {
  aspect-ratio: 9 / 16;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.sd-player__fallback {
  padding: 40px 20px;
  text-align: center;
  color: var(--sd-fg-dim);
}

.sd-embed {
  position: relative;
  padding-top: 56.25%;
}

.sd-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.sd-player__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 30px;
}

.sd-player__nav .sd-btn {
  flex: 1;
  max-width: 220px;
}

.sd-player__nav .sd-btn[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
}

/* ==========================================================================
   10. 侧栏 / CTA
   ========================================================================== */

.sd-callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  border: 1px solid var(--sd-line);
  border-radius: var(--sd-radius);
  background: linear-gradient(135deg, rgba(255, 77, 79, 0.1), rgba(255, 138, 61, 0.06));
}

.sd-callout__body {
  flex: 1;
  min-width: 200px;
}

.sd-callout__title {
  font-size: 16px;
  margin-bottom: 4px;
}

.sd-callout__desc {
  color: var(--sd-fg-dim);
  font-size: 13.5px;
}

/* ==========================================================================
   11. FAQ
   ========================================================================== */

.sd-faq {
  border-top: 1px solid var(--sd-line);
}

.sd-faq details {
  border-bottom: 1px solid var(--sd-line);
}

.sd-faq summary {
  padding: 15px 0;
  cursor: pointer;
  list-style: none;
  font-size: 15px;
  font-weight: 600;
}

.sd-faq summary::-webkit-details-marker {
  display: none;
}

.sd-faq summary::before {
  content: "Q";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  border-radius: 6px;
  background: var(--sd-accent-soft);
  color: var(--sd-accent);
  font-size: 12px;
  font-weight: 800;
  vertical-align: 1px;
}

.sd-faq p {
  margin: 0 0 16px 32px;
  color: var(--sd-fg-dim);
  font-size: 14px;
}

/* ==========================================================================
   12. 分页
   ========================================================================== */

.sd-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 40px 0 10px;
}

.sd-pagination .page-numbers {
  display: grid;
  place-items: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--sd-line);
  border-radius: 9px;
  background: var(--sd-surface);
  color: var(--sd-fg-dim);
  font-size: 14px;
  transition: all 0.18s;
}

.sd-pagination .page-numbers:hover {
  border-color: var(--sd-line-strong);
  color: var(--sd-fg);
}

.sd-pagination .page-numbers.current {
  border-color: var(--sd-accent);
  background: var(--sd-accent);
  color: #fff;
  font-weight: 700;
}

.sd-pagination .dots {
  border: 0;
  background: transparent;
}

/* ==========================================================================
   13. 页脚
   ========================================================================== */

.sd-footer {
  margin-top: 60px;
  padding: 46px 0 28px;
  border-top: 1px solid var(--sd-line);
  background: var(--sd-bg-soft);
}

.sd-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 34px;
}

.sd-footer__brand {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 10px;
}

.sd-footer__desc {
  max-width: 320px;
  color: var(--sd-fg-mute);
  font-size: 13px;
  line-height: 1.7;
}

.sd-footer__h {
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--sd-fg);
}

.sd-footer__links li {
  margin-bottom: 9px;
}

.sd-footer__links a {
  color: var(--sd-fg-mute);
  font-size: 13px;
  transition: color 0.2s;
}

.sd-footer__links a:hover {
  color: var(--sd-fg);
}

.sd-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--sd-line);
  color: var(--sd-fg-mute);
  font-size: 12.5px;
}

.sd-footer__disclaimer {
  max-width: 680px;
  margin-top: 8px;
  color: var(--sd-fg-mute);
  font-size: 12px;
  line-height: 1.7;
  opacity: 0.8;
}

/* ==========================================================================
   14. 移动端底部导航
   ========================================================================== */

.sd-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: none;
  grid-template-columns: repeat(4, 1fr);
  height: 58px;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(20, 24, 34, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--sd-line);
}

.sd-tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--sd-fg-mute);
  font-size: 11px;
}

.sd-tabbar a.is-active,
.sd-tabbar a:hover {
  color: var(--sd-accent);
}

.sd-tabbar__icon {
  font-size: 17px;
  line-height: 1;
}

/* ==========================================================================
   15. 状态 / 空态
   ========================================================================== */

.sd-empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--sd-fg-mute);
}

.sd-empty__title {
  margin-bottom: 8px;
  font-size: 18px;
  color: var(--sd-fg);
}

.sd-notice {
  margin: 18px 0;
  padding: 14px 18px;
  border: 1px solid var(--sd-line);
  border-left: 3px solid var(--sd-accent);
  border-radius: var(--sd-radius-sm);
  background: var(--sd-surface);
  color: var(--sd-fg-dim);
  font-size: 13.5px;
}

/* ==========================================================================
   16. 响应式
   ========================================================================== */

@media (max-width: 1024px) {
  .sd-hero__inner {
    grid-template-columns: 190px 1fr;
    gap: 26px;
    padding: 28px;
  }

  .sd-detail {
    grid-template-columns: 232px 1fr;
    gap: 28px;
  }

  .sd-footer__grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
}

@media (max-width: 820px) {
  .sd-nav {
    display: none;
  }

  .sd-menu-btn {
    display: grid;
  }

  .sd-hero__inner {
    grid-template-columns: 148px 1fr;
    gap: 20px;
    padding: 22px;
  }

  .sd-hero__desc {
    -webkit-line-clamp: 2;
    font-size: 13.5px;
  }

  .sd-detail {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .sd-detail__poster {
    position: static;
    display: block;
    max-width: 172px;
  }

  .sd-detail__poster img {
    aspect-ratio: 2 / 3;
  }

  .sd-tabbar {
    display: grid;
  }

  .sd-main {
    padding-bottom: 78px;
  }

  .sd-footer {
    padding-bottom: 78px;
  }
}

@media (max-width: 560px) {
  .sd-container {
    padding: 0 14px;
  }

  .sd-hero {
    border-radius: 16px;
    margin: 16px 0 30px;
  }

  .sd-hero__inner {
    grid-template-columns: 112px 1fr;
    gap: 14px;
    padding: 16px;
  }

  .sd-hero__title {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .sd-hero__kicker {
    margin-bottom: 8px;
    font-size: 11px;
  }

  .sd-hero__meta {
    gap: 6px 10px;
    font-size: 12px;
    margin-bottom: 10px;
  }

  .sd-hero__desc {
    display: none;
  }

  .sd-hero__actions {
    gap: 8px;
  }

  .sd-hero__actions .sd-btn {
    height: 38px;
    padding: 0 18px;
    font-size: 13.5px;
  }

  .sd-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }

  .sd-grid--tight {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .sd-card__title {
    font-size: 12.5px;
    -webkit-line-clamp: 2;
  }

  .sd-card__meta {
    font-size: 11px;
  }

  .sd-section {
    margin: 30px 0;
  }

  .sd-section__title {
    font-size: 17px;
  }

  .sd-rank {
    grid-template-columns: 1fr;
  }

  .sd-facts {
    grid-template-columns: repeat(2, 1fr);
  }

  .sd-episodes {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 7px;
  }

  .sd-episodes a {
    height: 40px;
    font-size: 12.5px;
  }

  .sd-footer__grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .sd-callout {
    flex-direction: column;
    align-items: flex-start;
  }

  .sd-player__nav .sd-btn {
    max-width: none;
  }
}

/* ==========================================================================
   17. 评论与表单
   ========================================================================== */

.sd-comments {
  margin: 44px 0 0;
}

.sd-comment-list {
  margin: 0 0 26px;
  padding: 0;
  list-style: none;
}

.sd-comment-list ol.children {
  margin: 12px 0 0;
  padding-left: 22px;
  list-style: none;
}

.sd-comment-list li.comment {
  margin-bottom: 12px;
  padding: 16px 18px;
  border: 1px solid var(--sd-line);
  border-radius: var(--sd-radius-sm);
  background: var(--sd-surface);
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.comment-author img {
  border-radius: 50%;
}

.comment-metadata {
  margin-bottom: 10px;
  color: var(--sd-fg-mute);
  font-size: 12px;
}

.comment-content {
  color: var(--sd-fg-dim);
  font-size: 14px;
  line-height: 1.75;
}

.comment-respond {
  margin-top: 26px;
}

.comment-form label {
  display: block;
  margin-bottom: 6px;
  color: var(--sd-fg-mute);
  font-size: 13px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form input[type="search"],
.comment-form textarea {
  width: 100%;
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid var(--sd-line);
  border-radius: 10px;
  background: var(--sd-surface);
  color: var(--sd-fg);
  font-family: inherit;
  font-size: 14px;
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--sd-accent);
  outline: none;
}

.comment-form .submit {
  border: 0;
}

/* ==========================================================================
   18. 打印 / 动效降级
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
