:root {
  --page-bg: #2A0A3A;
  --deep-purple: #3C1A5A;
  --deep-navy: #1A2A4A;
  --live-pink: #FF1E8E;
  --live-blue: #00CFFF;
  --replay-orange: #FF8A00;
  --replay-teal: #00E5A0;
  --accent-yellow: #FFD700;
  --hot-red: #FF3B3B;
  --update-green: #00FF66;
  --end-gray: #A0A0A0;
  --tag-red: #FF6B6B;
  --tag-teal: #4ECDC4;
  --tag-sky: #45B7D1;
  --tag-sage: #96CEB4;
  --tag-cream: #FFE194;
  --tag-lilac: #DDA0DD;
  --text-main: #F5F5F5;
  --text-dim: #CCCCCC;
  --line-color: #3A3F5A;
  --font-display: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Inter", "Roboto Condensed", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --header-h: 64px;
  --max-width: 1440px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --shadow-float: 0 6px 20px rgba(0, 0, 0, 0.35);
  --transition-fast: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--page-bg);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

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

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

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

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

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

/* ===== Skip Link ===== */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  z-index: 2000;
  background: var(--accent-yellow);
  color: #000;
  padding: 10px 16px;
  border-radius: 4px;
  font-weight: 700;
  transition: top var(--transition-fast);
}

.skip-link:focus-visible {
  top: 12px;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-scrolled {
  background: rgba(20, 10, 35, 0.92);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--line-color);
  backdrop-filter: blur(6px);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-mark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-shrink: 0;
}

.brand-mark__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--text-main);
  text-shadow: 2px 2px 0 var(--live-pink), -2px -2px 0 var(--live-blue);
  line-height: 1;
}

.brand-mark__name span {
  color: var(--accent-yellow);
}

.brand-mark__tag {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--line-color);
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1.4;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.site-nav a {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
  border-radius: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}

.site-nav a:hover {
  background: rgba(255, 215, 0, 0.12);
  color: var(--accent-yellow);
}

.site-nav a[aria-current="page"] {
  background: var(--accent-yellow);
  color: #1A0A2A;
  font-weight: 700;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--line-color);
  border-radius: 100px;
  color: var(--text-main);
  font-size: 14px;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.header-search:hover {
  border-color: var(--accent-yellow);
  color: var(--accent-yellow);
  background: rgba(255, 215, 0, 0.08);
}

.header-search__icon {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  position: relative;
}

.header-search__icon::after {
  content: "";
  position: absolute;
  width: 6px;
  height: 2px;
  background: currentColor;
  right: -5px;
  bottom: -2px;
  border-radius: 2px;
  transform: rotate(45deg);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 8px;
  border-radius: 8px;
  align-items: center;
}

.nav-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-main);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-toggle__label {
  font-size: 10px;
  color: var(--text-main);
  line-height: 1;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Footer ===== */
.site-footer {
  background: linear-gradient(135deg, var(--deep-purple) 0%, var(--deep-navy) 100%);
  border-top: 2px solid var(--accent-yellow);
  padding: 48px 24px 20px;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
  gap: 32px;
  padding-bottom: 32px;
}

.footer-brand__name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--text-main);
  text-shadow: 2px 2px 0 var(--live-pink), -2px -2px 0 var(--live-blue);
}

.footer-brand__name span {
  color: var(--accent-yellow);
}

.footer-brand__desc {
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 8px;
}

.footer-col__title,
.footer-contact__title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-yellow);
  margin-bottom: 14px;
  border-left: 3px solid var(--live-pink);
  padding-left: 10px;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 14px;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-yellow);
  padding-left: 4px;
}

.footer-contact__line {
  display: flex;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text-dim);
}

.footer-contact__line span {
  font-family: var(--font-mono);
  color: var(--text-main);
  flex-shrink: 0;
}

.footer-contact__line a {
  color: var(--live-blue);
}

.footer-contact__line a:hover {
  color: var(--accent-yellow);
  text-decoration: underline;
}

.footer-contact__icp a {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 12px;
}

.footer-bottom {
  border-top: 1px solid var(--line-color);
  padding-top: 20px;
  text-align: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ===== 通用容器与排版 ===== */
.main-content {
  min-height: 60vh;
}

.page-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: calc(var(--header-h) + 24px) 24px 48px;
}

.section-block {
  margin-bottom: 48px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  line-height: 1.3;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 var(--live-pink);
  margin-bottom: 16px;
}

.section-title--replay {
  text-shadow: 3px 3px 0 var(--replay-orange);
}

.section-desc {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 24px;
}

/* ===== 通用按钮 ===== */
.card-btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--accent-yellow);
  color: #1A0A2A;
  font-weight: 700;
  font-size: 14px;
  border-radius: 6px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 2px 0 var(--live-pink);
}

.card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--live-pink);
  filter: brightness(1.05);
}

.card-btn--ghost {
  background: transparent;
  border: 2px solid var(--accent-yellow);
  color: var(--accent-yellow);
  box-shadow: none;
}

.card-btn--ghost:hover {
  background: rgba(255, 215, 0, 0.1);
  box-shadow: none;
}

/* ===== 频道卡片网格 ===== */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.channel-card {
  background: var(--deep-purple);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 220px;
}

.channel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-float);
  border-color: var(--live-pink);
}

.channel-card__preview {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--deep-navy), var(--deep-purple));
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-color);
}

.channel-card__preview::after {
  content: "▶";
  font-size: 24px;
  color: var(--live-pink);
  text-shadow: 0 0 10px var(--live-pink);
}

.channel-card__title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

.channel-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.channel-card__desc {
  color: var(--text-dim);
  font-size: 13px;
}

.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.is-hot {
  background: var(--hot-red);
  color: #fff;
}

.status-badge.is-new {
  background: var(--update-green);
  color: #002100;
}

.status-badge.is-end {
  background: var(--end-gray);
  color: #1a1a1a;
}

.quality-badge {
  background: rgba(0, 207, 255, 0.2);
  color: var(--live-blue);
  border: 1px solid var(--live-blue);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* ===== 磁贴矩阵 ===== */
.magnet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.magnet-tile {
  background: var(--deep-navy);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.25s ease;
  min-height: 120px;
}

.magnet-tile:hover {
  transform: scale(1.03) rotate(-1deg);
  border-color: var(--accent-yellow);
  background: var(--deep-purple);
}

.magnet-tile__name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.magnet-tile__count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}

.magnet-tile[data-tone="pink"] {
  border-top: 4px solid var(--live-pink);
}

.magnet-tile[data-tone="blue"] {
  border-top: 4px solid var(--live-blue);
}

.magnet-tile[data-tone="orange"] {
  border-top: 4px solid var(--replay-orange);
}

.magnet-tile[data-tone="teal"] {
  border-top: 4px solid var(--replay-teal);
}

.magnet-tile[data-tone="yellow"] {
  border-top: 4px solid var(--accent-yellow);
}

.magnet-tile[data-tone="lilac"] {
  border-top: 4px solid var(--tag-lilac);
}

/* ===== 条目列表 ===== */
.entry-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line-color);
}

.entry-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 16px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line-color);
  align-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.entry-row:hover {
  background: rgba(255, 215, 0, 0.04);
  transform: translateX(4px);
}

.entry-row__time {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--live-blue);
}

.entry-row__name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
}

.entry-row__meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 13px;
  color: var(--text-dim);
}

/* ===== 标签云 ===== */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-item {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-color);
  color: var(--text-dim);
  transition: all 0.2s ease;
}

.tag-item:hover {
  background: var(--accent-yellow);
  color: #1A0A2A;
  border-color: var(--accent-yellow);
  transform: scale(1.05);
}

.tag-item[data-tag="red"] {
  background: rgba(255, 107, 107, 0.15);
  color: var(--tag-red);
}

.tag-item[data-tag="teal"] {
  background: rgba(78, 205, 196, 0.15);
  color: var(--tag-teal);
}

.tag-item[data-tag="sky"] {
  background: rgba(69, 183, 209, 0.15);
  color: var(--tag-sky);
}

.tag-item[data-tag="sage"] {
  background: rgba(150, 206, 180, 0.15);
  color: var(--tag-sage);
}

.tag-item[data-tag="cream"] {
  background: rgba(255, 225, 148, 0.15);
  color: var(--tag-cream);
}

.tag-item[data-tag="lilac"] {
  background: rgba(221, 160, 221, 0.15);
  color: var(--tag-lilac);
}

/* ===== 对照表 ===== */
.count-table {
  border-top: 2px solid var(--line-color);
}

.count-row {
  display: grid;
  grid-template-columns: 120px 1fr 180px 120px;
  gap: 16px;
  padding: 14px 8px;
  border-bottom: 1px solid var(--line-color);
  align-items: center;
  font-size: 14px;
}

.count-row:hover {
  background: rgba(255, 215, 0, 0.03);
}

.count-row__time {
  font-family: var(--font-mono);
  color: var(--live-blue);
}

.count-row__name {
  font-weight: 500;
}

.count-row__tag {
  color: var(--text-dim);
}

.count-row__status {
  text-align: right;
}

/* ===== 索引条 ===== */
.index-bar {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  background: rgba(20, 15, 35, 0.85);
  backdrop-filter: blur(4px);
  padding: 8px;
  border-radius: 8px;
  border: 1px solid var(--line-color);
  margin-bottom: 24px;
}

.index-bar a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
  padding: 3px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.index-bar a:hover {
  background: var(--accent-yellow);
  color: #1A0A2A;
}

.index-bar a[aria-current="true"] {
  background: var(--live-blue);
  color: #002033;
  font-weight: 700;
}

/* ===== 横向滑轨 ===== */
.scroll-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  scrollbar-width: thin;
}

.scroll-track::-webkit-scrollbar {
  height: 6px;
}

.scroll-track::-webkit-scrollbar-thumb {
  background: var(--line-color);
  border-radius: 3px;
}

.scroll-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 260px;
  padding: 16px;
  background: var(--deep-purple);
  border: 1px solid var(--line-color);
  border-radius: var(--radius-lg);
}

/* ===== 指标条 ===== */
.metric-bar {
  background: rgba(255, 255, 255, 0.08);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.metric-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--live-pink), var(--accent-yellow));
  border-radius: 3px;
  width: 0;
  transition: width 0.6s ease;
}

.metric-bar__fill[data-fill="25"] { width: 25%; }
.metric-bar__fill[data-fill="40"] { width: 40%; }
.metric-bar__fill[data-fill="55"] { width: 55%; }
.metric-bar__fill[data-fill="70"] { width: 70%; }
.metric-bar__fill[data-fill="85"] { width: 85%; }
.metric-bar__fill[data-fill="100"] { width: 100%; }

/* ===== 时段表首屏 ===== */
.hero-timetable {
  background: linear-gradient(160deg, var(--deep-purple) 0%, var(--deep-navy) 100%);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--line-color);
  box-shadow: var(--shadow-float);
}

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

.slot-card {
  background: var(--live-blue);
  color: #00303a;
  border-radius: var(--radius-md);
  padding: 12px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.slot-card:hover {
  transform: translateY(-3px) rotate(0.5deg);
  filter: brightness(1.05);
}

.slot-card--pink {
  background: var(--live-pink);
  color: #fff;
}

.slot-card--orange {
  background: var(--replay-orange);
  color: #3a2000;
}

.slot-card--teal {
  background: var(--replay-teal);
  color: #00352a;
}

.slot-card__time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.slot-card__name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

/* ===== 图片容器占位规则 ===== */
.img-placeholder {
  background: linear-gradient(135deg, var(--deep-purple), var(--deep-navy));
  border: 1px dashed var(--line-color);
  border-radius: var(--radius-md);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 12px;
  position: relative;
  overflow: hidden;
}

.img-placeholder::before {
  content: "IMG";
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--live-pink);
  opacity: 0.6;
}

.img-placeholder--wide {
  aspect-ratio: 16 / 9;
}

.img-placeholder--tall {
  aspect-ratio: 3 / 4;
}

.img-placeholder--square {
  aspect-ratio: 1 / 1;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .header-inner {
    gap: 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .count-row {
    grid-template-columns: 100px 1fr 140px;
  }

  .count-row__status {
    grid-column: 1 / -1;
    text-align: left;
  }
}

@media (max-width: 768px) {
  :root {
    --header-h: 56px;
  }

  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }

  .brand-mark__tag {
    display: none;
  }

  .brand-mark__name {
    font-size: 20px;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .header-search {
    display: none;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(20, 10, 35, 0.98);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 16px 20px;
    border-bottom: 2px solid var(--accent-yellow);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .site-nav[data-open] {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .site-nav a {
    padding: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0;
    font-size: 16px;
  }

  .site-nav a:hover {
    background: rgba(255, 215, 0, 0.1);
  }

  .site-nav a[aria-current="page"] {
    background: var(--accent-yellow);
    color: #1A0A2A;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .entry-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .entry-row__time {
    font-size: 12px;
  }

  .entry-row__meta {
    font-size: 12px;
    flex-wrap: wrap;
  }

  .count-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .hero-timetable {
    padding: 16px;
  }

  .section-title {
    font-size: 22px;
  }

  .page-wrap {
    padding: calc(var(--header-h) + 16px) 16px 32px;
  }
}

@media (max-width: 480px) {
  .header-search {
    display: none;
  }

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

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

  .channel-grid {
    grid-template-columns: 1fr;
  }
}
