/* ==========================================================================
   拾光影院 — Apple TV 玻璃拟态风格
   纯黑底 + 毛玻璃卡片 + 16:9 横版 + 大圆角 + 弹簧动效
   纯 HTML/CSS/JS，无框架
   ========================================================================== */

/* ===== 设计令牌 ===== */
:root {
  /* 颜色 — Apple TV 暗色系 */
  --bg: #000000;
  --bg-raised: #1C1C1E;
  --bg-elevated: #1C1C1E; /* 别名兼容 author-byline */
  --glass: rgba(28, 28, 30, 0.72);
  --glass-hover: rgba(44, 44, 46, 0.82);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.14);
  --border: var(--glass-border); /* 别名兼容 author-byline */
  --text: #FFFFFF;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.45);
  --accent: #EBB400;
  --accent-strong: #FFD84D;
  --accent-glow: rgba(235, 180, 0, 0.2);
  --accent-soft: rgba(235, 180, 0, 0.12);
  --on-accent: #000000;
  --danger: #e05c5c;
  --ok: #5fbf8f;
  --line: rgba(255, 255, 255, 0.06);

  /* 圆角 — Apple 风格大圆角 */
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --radius-lg: 24px;
  --radius-full: 9999px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;

  /* 缓动曲线 */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  /* 动画时长 */
  --dur-fast: 150ms;
  --dur-normal: 300ms;
  --dur-slow: 500ms;

  /* 阴影 */
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px var(--accent-glow);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;

  /* 字号 */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 22px;
  --text-2xl: 28px;
  --text-3xl: 36px;
  --text-4xl: 48px;
}

/* ===== 重置 & 基础 ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--dur-normal) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  a:hover { color: var(--accent); }
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

/* ===== 可访问性 ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  z-index: 10000;
  font-weight: 600;
}
.skip-link:focus { top: 16px; }

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

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

/* ===== 顶栏 — 透明 → 毛玻璃（滚动时 JS 加 .scrolled） ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: var(--sp-4) 0;
  padding-top: max(var(--sp-4), env(safe-area-inset-top));
  transition: background var(--dur-normal) var(--ease-out),
              backdrop-filter var(--dur-normal) var(--ease-out),
              box-shadow var(--dur-normal) var(--ease-out);
}

.site-header.scrolled {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--glass-border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--sp-6);
}

.logo {
  font-size: var(--text-xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.logo em {
  font-style: normal;
  color: var(--accent);
  margin: 0 2px;
}

.main-nav {
  display: flex;
  gap: var(--sp-1);
  flex: 1;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
  background: rgba(255,255,255,0.1);
}

.search-form {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid transparent;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.search-form:focus-within {
  border-color: var(--glass-border-hover);
  background: rgba(255,255,255,0.12);
}
.search-form input {
  background: none;
  border: none;
  color: var(--text);
  padding: 10px 16px;
  font-size: var(--text-sm);
  width: 180px;
  outline: none;
  font-family: var(--font);
}
.search-form input::placeholder { color: var(--text-tertiary); }
.search-form button {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 14px;
  cursor: pointer;
  font-size: var(--text-base);
  transition: color var(--dur-fast) var(--ease-out);
}
.search-form button:hover { color: var(--accent); }

.search-toggle,
.nav-toggle {
  display: none;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 20px;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease-out);
}
.search-toggle:hover,
.nav-toggle:hover { background: rgba(255,255,255,0.15); }

/* ===== 全屏搜索层 ===== */
.search-layer {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-normal) var(--ease-out);
}
.search-layer.is-open {
  opacity: 1;
  pointer-events: auto;
}
.search-layer-close {
  position: absolute;
  top: max(var(--sp-6), env(safe-area-inset-top));
  right: max(var(--sp-6), env(safe-area-inset-right));
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--glass-border);
  color: var(--text);
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease-out);
}
.search-layer-close:hover { background: rgba(255,255,255,0.15); }

.search-layer-form {
  width: 100%;
  max-width: 600px;
  padding: 0 var(--sp-6);
}
.search-layer-form input {
  width: 100%;
  padding: 16px 24px;
  font-size: var(--text-2xl);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.search-layer-form input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.1);
}
.search-layer-form input::placeholder { color: var(--text-tertiary); }
.search-layer-form button {
  display: block;
  margin: var(--sp-4) auto 0;
  padding: 12px 32px;
}

/* ===== Hero 全屏轮播 ===== */
.hero {
  position: relative;
  width: 100vw;
  height: 85vh;
  min-height: 500px;
  max-height: 900px;
  overflow: hidden;
  margin: 0;
  background: var(--bg);
}

.hero-track {
  width: 100%;
  height: 100%;
  display: flex;
  will-change: transform;
}

.hero-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  flex-shrink: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 40%, rgba(0,0,0,0.1) 70%, rgba(0,0,0,0.3) 100%),
    linear-gradient(to right, rgba(0,0,0,0.7) 0%, transparent 60%);
}

.hero-content {
  position: absolute;
  bottom: 12%;
  left: 5%;
  max-width: 520px;
  z-index: 10;
  padding: var(--sp-8);
  background: var(--glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.hero-tag {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: var(--sp-3);
  padding: 4px 10px;
  background: var(--accent-soft);
  border-radius: var(--radius-full);
}

.hero-title {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 var(--sp-3);
  line-height: 1.1;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}
.hero-title a { color: var(--text); }
.hero-title a:hover { color: var(--accent); }

.hero-meta {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--sp-3);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.hero-intro {
  font-size: var(--text-sm);
  color: var(--text);
  opacity: 0.92;
  margin: 0 0 var(--sp-5);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
}

.hero-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* Hero 进度条 */
.hero-progress {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.1);
  z-index: 10;
}
.hero-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 400ms var(--ease-out);
}

/* Hero 箭头 */
.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px; height: 48px;
  border-radius: var(--radius-full);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
  opacity: 0;
}
.hero:hover .hero-arrow { opacity: 1; }
.hero-arrow:hover {
  background: var(--glass-hover);
  transform: translateY(-50%) scale(1.1);
}
.hero-prev { left: var(--sp-6); }
.hero-next { right: var(--sp-6); }

/* Hero 圆点 */
.hero-dots {
  position: absolute;
  bottom: 16px;
  right: var(--sp-6);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.hero-dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
}
.hero-dot.is-active {
  background: var(--accent);
  transform: scale(1.5);
}

/* ===== 16:9 横版电影卡片 ===== */
.film-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  transition: transform var(--dur-normal) var(--ease-spring),
              box-shadow var(--dur-normal) var(--ease-out);
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  .film-card:hover {
    transform: scale(1.04);
    box-shadow: var(--shadow-glow), var(--shadow-card);
    z-index: 10;
  }
}

.card-poster {
  display: block;
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.card-poster .poster-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--dur-slow) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .film-card:hover .poster-img { transform: scale(1.08); }
}

.card-poster .poster-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-4xl);
  font-weight: 700;
  color: var(--text-tertiary);
  opacity: 0.3;
}

/* 毛玻璃信息叠加层 */
.card-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: var(--sp-5) var(--sp-4) var(--sp-4);
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.card-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title a { color: var(--text); }

.card-meta {
  display: flex;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  align-items: center;
}
.card-rating {
  color: var(--accent);
  font-weight: 600;
}

/* 徽章 */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1.5;
}
.badge-hot {
  background: var(--accent);
  color: var(--on-accent);
}
.badge-new {
  background: var(--ok);
  color: #000;
}

/* 海报上的徽章 */
.card-poster .badge {
  position: absolute;
  top: var(--sp-2);
  left: var(--sp-2);
  z-index: 5;
}

/* ===== 横滑片柜 ===== */
.section {
  margin: var(--sp-12) 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}
.section-head h2 {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.section-head h1 {
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.more-link {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 500;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.more-link:hover { opacity: 0.8; }

.section-count {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.shelf {
  position: relative;
}

.shelf-track {
  display: flex;
  gap: var(--sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--sp-2);
  scrollbar-width: none;
}
.shelf-track::-webkit-scrollbar { display: none; }

.shelf-track .film-card {
  flex: 0 0 calc((100% - 3 * 16px) / 4);
  min-width: 240px;
  scroll-snap-align: start;
}

.shelf-track .collection-card,
.shelf-track .article-card {
  flex: 0 0 calc((100% - 3 * 16px) / 4);
  min-width: 240px;
  scroll-snap-align: start;
}

.shelf-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
}
.shelf:hover .shelf-arrow { opacity: 1; }
.shelf-arrow:hover {
  background: var(--glass-hover);
  transform: translateY(-50%) scale(1.1);
}
.shelf-prev { left: -8px; }
.shelf-next { right: -8px; }

/* ===== 网格布局（列表页/搜索页） ===== */
.grid {
  display: grid;
  gap: var(--sp-5);
}
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== 搜索页：播放来源侧栏 ===== */
.search-source-layout {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: start;
}
.search-source-sidebar {
  position: sticky;
  top: 88px;
  padding: var(--sp-4) var(--sp-3) var(--sp-3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  background: rgba(28, 28, 30, 0.68);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.search-source-sidebar-label {
  padding: 0 var(--sp-3) var(--sp-3);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: .08em;
}
.search-source-nav {
  display: grid;
  gap: var(--sp-1);
}
.search-source-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: 0 var(--sp-3);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-spring);
}
.search-source-link b { font-weight: 550; }
.search-source-link span {
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}
.search-source-link.is-active {
  color: var(--on-accent);
  background: var(--accent);
}
.search-source-link.is-active span { color: rgba(0, 0, 0, .62); }
.search-source-link:hover:not(.is-active) {
  color: var(--text);
  background: rgba(255,255,255,.08);
}
.search-source-group {
  margin-bottom: var(--sp-10);
  scroll-margin-top: 96px;
}
.search-source-group-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.search-source-group-head h2 {
  margin: 0;
  font-size: var(--text-xl);
  letter-spacing: -0.02em;
}
.search-source-count {
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,.07);
  color: var(--text-tertiary);
  font-size: var(--text-xs);
}
.search-source-rule {
  height: 1px;
  flex: 1;
  background: var(--line);
}
.search-source-results { min-width: 0; }

@media (max-width: 900px) {
  .search-source-layout {
    grid-template-columns: 1fr;
    gap: var(--sp-5);
  }
  .search-source-sidebar {
    position: static;
    padding: var(--sp-2) var(--sp-3);
  }
  .search-source-sidebar-label { display: none; }
  .search-source-nav {
    display: flex;
    gap: var(--sp-2);
    overflow-x: auto;
    padding: 1px;
    scrollbar-width: none;
  }
  .search-source-nav::-webkit-scrollbar { display: none; }
  .search-source-link {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 0 var(--sp-4);
  }
}

/* ===== 专题卡片 ===== */
.collection-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  transition: transform var(--dur-normal) var(--ease-spring),
              box-shadow var(--dur-normal) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .collection-card:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-card);
  }
}
.collection-cover {
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.collection-count {
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 6px 16px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
}
.collection-body {
  padding: var(--sp-4);
}
.collection-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 4px;
}
.collection-subtitle {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
}

/* ===== 文章卡片 ===== */
.article-card {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  transition: transform var(--dur-normal) var(--ease-spring),
              box-shadow var(--dur-normal) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .article-card:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-card);
  }
}
.article-cover {
  aspect-ratio: 16 / 9;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: var(--sp-3);
}
.article-cat {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  align-self: flex-start;
}
.article-date {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
.article-body {
  padding: var(--sp-4);
}
.article-title {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-summary {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 详情页 ===== */
.detail-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  min-height: 500px;
  display: flex;
  align-items: center;
  overflow: hidden;
  margin-bottom: var(--sp-10);
}

.detail-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 20%;
  filter: blur(40px);
  transform: scale(1.1);
  opacity: 0.4;
}
.detail-hero-bg--gradient {
  filter: none;
  transform: none;
  opacity: 0.6;
}

.detail-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 50%);
}

.detail-hero-content {
  position: relative;
  z-index: 5;
  display: flex;
  gap: var(--sp-10);
  max-width: 1280px;
  margin: 0 auto;
  padding: var(--sp-16) var(--sp-6);
  align-items: flex-end;
  width: 100%;
}

.detail-hero-poster {
  flex-shrink: 0;
  width: 260px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  background: var(--bg-raised);
}
.detail-hero-poster .poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.detail-hero-poster .poster-letter {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  font-weight: 700;
  color: var(--text-tertiary);
  opacity: 0.3;
}

.detail-hero-info {
  flex: 1;
  padding-bottom: var(--sp-2);
}

.detail-title {
  font-size: var(--text-4xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 var(--sp-2);
  line-height: 1.1;
}

.detail-original {
  font-size: var(--text-lg);
  color: var(--text-tertiary);
  margin: 0 0 var(--sp-4);
}

.detail-score {
  display: flex;
  align-items: baseline;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.score-num {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--accent);
}
.score-meta {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}

.detail-play-info {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--sp-4);
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--sp-5);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2) var(--sp-6);
}
.info-list li {
  font-size: var(--text-sm);
  display: flex;
  gap: var(--sp-2);
}
.info-label {
  color: var(--text-tertiary);
  flex-shrink: 0;
  min-width: 48px;
}
.info-value {
  color: var(--text-secondary);
}

.detail-actions {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.section-intro {
  max-width: 800px;
}
.intro-text {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.8;
}
.intro-text p {
  margin: 0 0 var(--sp-4);
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  transition: transform var(--dur-fast) var(--ease-spring),
              background var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
  min-height: 44px;
  text-decoration: none;
  line-height: 1;
}
.btn:active { transform: scale(0.96); }

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover {
  background: var(--accent-strong);
  box-shadow: 0 0 24px var(--accent-glow);
  color: var(--on-accent);
}

.btn-ghost {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-ghost:hover {
  background: rgba(255,255,255,0.15);
  border-color: var(--glass-border-hover);
  color: var(--text);
}

.btn-danger {
  background: rgba(224, 92, 92, 0.15);
  color: var(--danger);
  border: 1px solid rgba(224, 92, 92, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.btn-danger:hover {
  background: rgba(224, 92, 92, 0.25);
  border-color: var(--danger);
  color: var(--danger);
}

.btn-sm {
  padding: 8px 16px;
  font-size: var(--text-xs);
  min-height: 36px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: var(--text-base);
  min-height: 52px;
}

/* ===== 表单 ===== */
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 12px 16px;
  font-size: var(--text-base);
  font-family: var(--font);
  min-height: 44px;
  outline: none;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.1);
}
::placeholder { color: var(--text-tertiary); }

textarea {
  resize: vertical;
  min-height: 100px;
}

select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff80' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-10) 0 var(--sp-4);
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text-tertiary); }

/* ===== 筛选标签 ===== */
.filter-group {
  margin-bottom: var(--sp-6);
}
.filter-group-admin {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  margin-bottom: var(--sp-6);
}
.filter-row {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}
.filter-label {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  flex-shrink: 0;
  min-width: 48px;
  padding-top: 6px;
}
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.filter-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out);
}
.filter-chip:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text);
}
.filter-chip.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* ===== 热门榜 ===== */
.section-hot {
  margin-top: var(--sp-12);
}
.hot-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--sp-2) var(--sp-8);
}
.hot-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--line);
}
.hot-rank {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-tertiary);
  width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.hot-item:nth-child(1) .hot-rank { color: var(--accent); }
.hot-item:nth-child(2) .hot-rank { color: var(--accent-strong); }
.hot-item:nth-child(3) .hot-rank { color: var(--text-secondary); }

.hot-item a {
  flex: 1;
  font-size: var(--text-base);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hot-score {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-8) 0;
  flex-wrap: wrap;
}
.page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 var(--sp-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.page-item:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text);
}
.page-item.current {
  background: var(--accent);
  color: var(--on-accent);
}

/* ===== 播放页 ===== */
.player-section {
  margin: var(--sp-6) 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-raised);
  box-shadow: var(--shadow-card);
}

.player-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: block;
}

.player-frame-wrap {
  position: relative;
}

.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  gap: var(--sp-2);
}

.player-meta {
  padding: var(--sp-6) 0;
}
.player-meta h1 {
  font-size: var(--text-2xl);
  font-weight: 700;
  margin: 0 0 var(--sp-2);
}
.player-meta p {
  color: var(--text-secondary);
  margin: 0 0 var(--sp-4);
}

/* 网盘播放 */
.player-pan-bind {
  padding: var(--sp-8);
  background: var(--bg-raised);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
}

.pan-bind-box h3 {
  font-size: var(--text-xl);
  margin: 0 0 var(--sp-2);
}
.pan-bind-box > p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin: 0 0 var(--sp-6);
}

.pan-drive-select {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-6);
}
.pan-drive-btn {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.pan-drive-btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.pan-token-area {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  padding: var(--sp-5);
  border: 1px solid var(--glass-border);
}
.pan-step-title {
  font-weight: 600;
  margin: 0 0 var(--sp-2);
}
.pan-steps {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  padding-left: var(--sp-5);
  margin: 0 0 var(--sp-4);
}
.pan-steps li { margin-bottom: var(--sp-1); }
.pan-steps code {
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  font-size: var(--text-xs);
}
.pan-token-input-wrap {
  display: flex;
  gap: var(--sp-3);
}
.pan-token-input-wrap input {
  flex: 1;
}
.pan-hint {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: var(--sp-3) 0 0;
}

/* ---- 失效分享降级面板 ---- */
.pan-dead-panel {
  text-align: center;
  padding: var(--sp-8) var(--sp-6);
}
.pan-dead-icon {
  font-size: 48px;
  margin-bottom: var(--sp-3);
}
.pan-dead-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin: 0 0 var(--sp-2);
  color: var(--text-primary);
}
.pan-dead-reason {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin: 0 0 var(--sp-6);
}
.pan-dead-meta {
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  padding: var(--sp-4);
  margin-bottom: var(--sp-6);
  text-align: left;
}
.pan-dead-row {
  display: flex;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  padding: var(--sp-1) 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.pan-dead-row:last-child { border-bottom: none; }
.pan-dead-key {
  color: var(--text-tertiary);
  min-width: 56px;
  flex-shrink: 0;
}
.pan-dead-val {
  color: var(--text-secondary);
  word-break: break-all;
}
.pan-dead-link a {
  color: var(--accent);
  text-decoration: none;
}
.pan-dead-link a:hover { text-decoration: underline; }
.pan-dead-actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: var(--sp-5);
}
.pan-dead-actions .btn {
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.pan-dead-actions .btn:hover {
  background: rgba(255,255,255,0.1);
}
.pan-dead-actions .btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.pan-dead-actions .btn-primary:hover {
  opacity: 0.9;
}
.pan-dead-tip {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
}

/* TG 搜索面板 */
.tg-search-panel {
  background: var(--bg-raised);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.tg-search-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}
.tg-search-title {
  font-size: var(--text-base);
  color: var(--text-secondary);
}
.tg-search-loading,
.tg-search-empty {
  text-align: center;
  color: var(--text-tertiary);
  padding: var(--sp-8) 0;
}
.pan-res-card {
  padding: var(--sp-4);
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  margin-bottom: var(--sp-3);
}
.pan-res-main {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}
.pan-res-title {
  font-size: var(--text-base);
  font-weight: 500;
  flex: 1;
}
.pan-res-pwd {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
}
.pan-res-desc {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0 0 var(--sp-3);
}
.pan-res-actions {
  display: flex;
  gap: var(--sp-2);
}

/* 线路/集数选择 */
.ep-lines {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}
.ep-line-btn {
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.ep-line-btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.ep-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.ep-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  cursor: pointer;
  min-width: 48px;
  text-align: center;
  transition: all var(--dur-fast) var(--ease-out);
}
.ep-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text);
}
.ep-btn.is-active {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

/* ===== 页脚 ===== */
.site-footer {
  margin-top: var(--sp-16);
  padding: var(--sp-10) 0;
  border-top: 1px solid var(--glass-border);
  text-align: center;
}
.footer-brand {
  font-size: var(--text-base);
  font-weight: 600;
  margin: 0 0 var(--sp-2);
}
.footer-brand span {
  font-weight: 400;
  color: var(--text-tertiary);
  margin-left: var(--sp-2);
}
.footer-note {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0;
}
.footer-stats {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin: 0 0 var(--sp-2);
  opacity: 0.6;
}

/* ===== 广告位 ===== */
.ad-slot {
  margin: var(--sp-6) 0;
  text-align: center;
  overflow: hidden;
}

/* ===== 卡片入场动画（JS IntersectionObserver） ===== */
.animate-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--dur-slow) var(--ease-out),
              transform var(--dur-slow) var(--ease-out);
}
.animate-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 1020px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }

  .shelf-track .film-card,
  .shelf-track .collection-card,
  .shelf-track .article-card {
    flex: 0 0 calc((100% - 2 * 16px) / 3);
    min-width: 200px;
  }

  .hero-content {
    max-width: 420px;
    padding: var(--sp-6);
  }
  .hero-title { font-size: var(--text-3xl); }

  .detail-hero-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--sp-6);
  }
  .detail-hero-poster { width: 200px; }
  .detail-actions { justify-content: center; }
  .info-list { grid-template-columns: 1fr; }

  .detail {
    flex-direction: column;
    align-items: center;
  }
  .detail-poster { width: 200px; }
  .detail-info { text-align: center; }
  .detail-actions { justify-content: center; }

  .hot-list { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .container { padding: 0 var(--sp-4); }
  .header-inner { gap: var(--sp-4); }

  .logo {
    font-size: var(--text-base);
    max-width: 50vw;
  }

  .search-form { display: none; }
  .search-toggle { display: flex; }
  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--sp-4);
    gap: var(--sp-1);
    border-bottom: 1px solid var(--glass-border);
  }
  .main-nav.open { display: flex; }

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

  .shelf-track .film-card,
  .shelf-track .collection-card,
  .shelf-track .article-card {
    flex: 0 0 calc((100% - 16px) / 2);
    min-width: 160px;
  }

  .hero {
    height: 70vh;
    min-height: 400px;
  }
  .hero-content {
    left: 4%;
    right: 4%;
    bottom: 8%;
    max-width: none;
    padding: var(--sp-5);
  }
  .hero-title { font-size: var(--text-2xl); }
  .hero-arrow { display: none; }

  .section-head h2 { font-size: var(--text-xl); }
  .section-head h1 { font-size: var(--text-2xl); }

  .detail-hero {
    min-height: 350px;
  }
  .detail-hero-content {
    padding: var(--sp-10) var(--sp-4);
  }
  .detail-hero-poster { width: 150px; }
  .detail-title { font-size: var(--text-2xl); }

  .filter-row {
    flex-direction: column;
    gap: var(--sp-2);
  }

  .pan-token-input-wrap {
    flex-direction: column;
  }
}

@media (max-width: 460px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

  .shelf-track .film-card,
  .shelf-track .collection-card,
  .shelf-track .article-card {
    flex: 0 0 75%;
    min-width: 0;
  }

  .hero {
    height: 60vh;
    min-height: 350px;
  }
  .hero-content {
    padding: var(--sp-4);
    bottom: 6%;
  }
  .hero-title { font-size: var(--text-xl); }
  .hero-intro { display: none; }

  .detail-hero-poster { width: 120px; }
  .detail-title { font-size: var(--text-xl); }
  .detail-hero { min-height: 280px; }
}

/* ===== 触屏设备：箭头常显（无 hover 设备） ===== */
@media (hover: none) {
  .hero-arrow,
  .shelf-arrow { opacity: 0.6; }
  .hero-arrow:active,
  .shelf-arrow:active { opacity: 1; transform: translateY(-50%) scale(0.92); }
  .shelf-arrow:active { transform: scale(0.92); }
}

/* ===== 文章内影片卡片 ===== */
.film-in-article {
  display: flex;
  gap: var(--sp-5);
  margin: var(--sp-6) 0;
  padding: var(--sp-4);
  background: var(--bg-raised);
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
}
.film-in-article-poster {
  flex-shrink: 0;
  width: 120px;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.film-in-article-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}
.film-in-article-info h3 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 600;
}
.film-in-article-info p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-tertiary);
}
.film-in-article-intro {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text-secondary);
}
.film-in-article .btn { margin-top: auto; align-self: flex-start; }
@media (max-width: 460px) {
  .film-in-article { flex-direction: column; }
  .film-in-article-poster { width: 80px; align-self: center; }
}

/* ===== prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .animate-in { opacity: 1; transform: none; }
}

/* ==========================================================================
   管理后台样式
   ========================================================================== */

.admin-body {
  background: var(--bg);
  min-height: 100vh;
}

.admin-shell {
  display: flex;
  min-height: 100vh;
}

.admin-side {
  width: 210px;
  flex: none;
  background: var(--bg-raised);
  border-right: 1px solid var(--line);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.admin-brand {
  font-size: 18px;
  font-weight: 800;
  padding: 0 10px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.admin-brand em {
  font-style: normal;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  margin-left: 8px;
}

.admin-nav {
  display: grid;
  gap: 4px;
}

.admin-nav-link {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  transition: color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .admin-nav-link:hover {
    color: var(--text);
    background: var(--bg-raised);
  }
}

.admin-nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.admin-back {
  margin-top: auto;
  padding: 10px 12px;
  color: var(--text-tertiary);
  font-size: 13px;
}

@media (hover: hover) and (pointer: fine) {
  .admin-back:hover { color: var(--accent); }
}

.admin-main {
  flex: 1;
  min-width: 0;
  padding: 26px 34px 60px;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-top h1 { margin: 0; font-size: 24px; font-weight: 800; }

.admin-user { color: var(--text-secondary); font-size: 14px; margin-right: 16px; }

.admin-logout {
  color: var(--text-tertiary);
  font-size: 13px;
  border: 1px solid var(--line);
  padding: 6px 13px;
  border-radius: 999px;
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .admin-logout:hover { border-color: var(--danger); color: var(--danger); }
}

.admin-content {
  /* 内容容器 */
}

.admin-panel {
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.admin-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.admin-panel-head h2 { margin: 0; font-size: 16px; font-weight: 700; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.admin-table th {
  text-align: left;
  color: var(--text-tertiary);
  font-weight: 600;
  font-size: 12.5px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table td {
  padding: 11px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.admin-table tr:last-child td { border-bottom: 0; }

.admin-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.admin-table a {
  color: var(--accent);
  font-weight: 500;
}

.admin-table a:hover { color: var(--accent-strong); }

.cell-title { font-weight: 600; }

.muted { color: var(--text-tertiary); }

.ok { color: var(--ok); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.stat-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 30px;
  font-weight: 800;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat-label { color: var(--text-tertiary); font-size: 13px; }

.flash {
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 18px;
}

.flash-ok { background: rgba(95, 191, 143, 0.1); color: var(--ok); border: 1px solid rgba(95, 191, 143, 0.3); }
.flash-err { background: rgba(224, 92, 92, 0.1); color: var(--danger); border: 1px solid rgba(224, 92, 92, 0.3); }

/* ---------- 表单 ---------- */
.admin-form { max-width: 860px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 18px;
}

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

.field {
  display: block;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.field input[type="text"],
.field input[type="password"],
.field input[type="number"],
.field input[type="url"],
.field input[type="search"],
.field input[type="color"],
.field textarea,
.field select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  min-height: 44px;
  font-size: 16px;
  font-family: var(--font);
  outline: none;
  font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}

.field input[type="color"] {
  padding: 4px;
  height: 38px;
  min-height: 0;
  cursor: pointer;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(235, 180, 0, 0.15);
}

.field textarea { resize: vertical; line-height: 1.7; }

.field-help {
  margin: 5px 0 0;
  font-size: 12px;
  color: var(--text-tertiary);
}

.field-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 22px;
  cursor: pointer;
}

.field-check input { accent-color: var(--accent); width: 16px; height: 16px; }

.form-checks {
  display: flex;
  margin-top: 14px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 6px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-check {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.chip-check input { accent-color: var(--accent); }

.chip-check:has(input:checked) {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 22px;
  align-items: start;
}

.login-card {
  max-width: 360px;
  margin: 9vh auto 0;
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 34px;
}

.login-card h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
}

.login-sub {
  margin: 0 0 22px;
  color: var(--text-tertiary);
  font-size: 13.5px;
}

.login-note { text-align: center; margin: 18px 0 0; font-size: 13px; }
.login-note a { color: var(--text-tertiary); }

@media (hover: hover) and (pointer: fine) {
  .login-note a:hover { color: var(--accent); }
}

/* 后台 inline 编辑 */
.inline-edit {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}
.inline-edit input {
  width: 60px;
  text-align: center;
  min-height: 32px;
  padding: 4px 8px;
  font-size: var(--text-sm);
}
.inline-edit button {
  padding: 4px 12px;
  font-size: var(--text-xs);
  min-height: 32px;
}

/* 后台搜索 */
.admin-search {
  display: flex;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
  align-items: center;
}
.admin-search input {
  flex: 1;
  max-width: 360px;
}

/* 后台标签 */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.tag-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 4px 12px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  color: var(--text-secondary);
}
.tag-item .tag-remove {
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1;
}
.tag-item .tag-remove:hover { color: var(--danger); }

/* 后台分页 */
.admin-pagination {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  padding: var(--sp-6) 0;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 70px 20px;
}

/* 提示框 */
.alert {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-sm);
  margin-bottom: var(--sp-5);
  font-size: var(--text-sm);
  font-weight: 500;
}
.alert-success {
  background: rgba(95, 191, 143, 0.15);
  color: var(--ok);
  border: 1px solid rgba(95, 191, 143, 0.3);
}
.alert-error {
  background: rgba(224, 92, 92, 0.15);
  color: var(--danger);
  border: 1px solid rgba(224, 92, 92, 0.3);
}
.alert-info {
  background: rgba(235, 180, 0, 0.1);
  color: var(--accent);
  border: 1px solid rgba(235, 180, 0, 0.2);
}

/* 保留兼容 .form-group / .form-row */
.form-group {
  margin-bottom: var(--sp-4);
}
.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: var(--sp-1);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
}
.form-group .help-text {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  margin-top: var(--sp-1);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-4);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .admin-shell { flex-direction: column; }
  .admin-side {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
  }
  .admin-brand { border-bottom: 0; padding: 0 10px 0 0; margin: 0; }
  .admin-nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .admin-back { margin: 0; }
  .admin-main { padding: 20px 16px 50px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; }
  .form-row { grid-template-columns: 1fr; }
}

/* ===== 影君作者页 ===== */
.author-hero {
  border-radius: var(--radius-lg);
  padding: var(--sp-8) var(--sp-6);
  margin-bottom: var(--sp-6);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.author-hero-inner {
  display: flex;
  gap: var(--sp-6);
  align-items: flex-start;
  max-width: 900px;
  margin: 0 auto;
}
.author-avatar {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C9A85A 0%, #8C6F2E 100%);
  color: #12172C;
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(201, 168, 90, 0.3);
}
.author-hero-info { flex: 1; min-width: 0; }
.author-hero-info h1 {
  margin: 0 0 var(--sp-2);
  font-size: 32px;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
.author-job {
  color: var(--accent);
  font-size: 14px;
  margin: 0 0 var(--sp-3);
  font-weight: 500;
}
.author-bio {
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.8;
  font-size: 15px;
  margin: 0;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
}

/* ===== 文章页底部作者署名卡 ===== */
.author-byline {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  margin: var(--sp-6) 0 0;
  padding: var(--sp-4) var(--sp-5);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
}
.author-byline-avatar {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #C9A85A 0%, #8C6F2E 100%);
  color: #12172C;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.author-byline-body { flex: 1; min-width: 0; }
.author-byline-label {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.author-byline-name {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}
.author-byline-name a { color: var(--text); }
.author-byline-name a:hover { color: var(--accent); }
.author-byline-name span { color: var(--text-tertiary); font-weight: 400; }
.author-byline-bio {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.author-byline-bio a { color: var(--accent); margin-left: 4px; }
@media (max-width: 640px) {
  .author-hero-inner { flex-direction: column; align-items: center; text-align: center; }
  .author-byline { flex-direction: column; align-items: flex-start; }
}

/* ===== 打印样式 ===== */
@media print {
  .site-header,
  .site-footer,
  .search-layer,
  .hero-arrow,
  .shelf-arrow,
  .ad-slot { display: none !important; }
  body { background: #fff; color: #000; }
}
