/* ============ RESET & BASE ============ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-dark);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1 0 auto;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition);
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  border: none;
  background: none;
  color: inherit;
}

button {
  cursor: pointer;
}

input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

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

/* ============ DESIGN TOKENS ============ */
:root {
  --bg-page: #F5F7FA;
  --bg-section-dark: #2C3E50;
  --bg-section-green: #1F3D2B;
  --bg-card: #FFFFFF;
  --bg-card-alt: #F0F2F5;
  --bg-input-dark: rgba(255, 255, 255, 0.12);

  --primary: #FFA500;
  --accent: #FFD700;
  --status-updating: #32CD32;
  --status-complete: #1E90FF;
  --status-new: #FF1493;
  --cache: #00CED1;

  --text-dark: #1A1A1A;
  --text-light: #FFFFFF;
  --text-muted-a: #6B7280;
  --text-muted-b: rgba(255, 255, 255, 0.62);

  --border: #D1D5DB;
  --border-light: rgba(255, 255, 255, 0.1);

  --tag-red: #FF6347;
  --tag-purple: #7B68EE;
  --tag-pink: #FF69B4;
  --tag-teal: #20B2AA;
  --tag-orange: #FF8C00;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --radius-pill: 999px;

  --container-max: 1200px;
  --container-narrow: 820px;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;

  --header-top-h: 72px;
  --header-nav-h: 50px;

  --font-label: "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --transition: 200ms ease;
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 {
  font-family: "Noto Sans CJK SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: 0.01em;
}

h1 { font-size: 48px; }
h2 { font-size: 32px; }
h3 { font-size: 24px; }

p { max-width: 70ch; }

.text-muted { color: var(--text-muted-a); }
.text-label {
  font-family: var(--font-label);
  font-size: 13px;
  letter-spacing: 0.04em;
}

/* ============ LAYOUT & SECTION ============ */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.section-light {
  background: var(--bg-page);
  padding: var(--space-6) 0;
}

.section-dark {
  background: var(--bg-section-dark);
  color: var(--text-light);
  padding: var(--space-6) 0;
}

.section-green {
  background: var(--bg-section-green);
  color: var(--text-light);
  padding: var(--space-6) 0;
}

.section-dark .section-title,
.section-green .section-title {
  color: var(--text-light);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.section-title {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.3;
}

.section-title .title-accent {
  color: var(--primary);
}

.section-dark .section-title .title-accent,
.section-green .section-title .title-accent {
  color: var(--accent);
}

.section-subtitle {
  font-size: 15px;
  color: var(--text-muted-a);
  margin-top: 4px;
}

.section-dark .section-subtitle,
.section-green .section-subtitle {
  color: var(--text-muted-b);
}

.section-annotate {
  writing-mode: vertical-rl;
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--text-muted-a);
  text-orientation: mixed;
}

.section-dark .section-annotate,
.section-green .section-annotate {
  color: rgba(255, 255, 255, 0.5);
}

/* ============ SKIP LINK ============ */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 999;
  background: var(--accent);
  color: var(--text-dark);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 0 0 var(--radius-sm) 0;
  transition: left var(--transition);
}

.skip-link:focus {
  left: 0;
}

/* ============ HEADER ============ */
.site-header {
  position: relative;
  background: var(--bg-section-dark);
  color: var(--text-light);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.18);
  z-index: 100;
}

.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--status-new), var(--cache), var(--primary));
  background-size: 200% 100%;
  animation: header-stripe 8s linear infinite alternate;
}

@keyframes header-stripe {
  from { background-position: 0% 0; }
  to { background-position: 100% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header::before {
    animation: none;
  }
}

@media (min-width: 768px) {
  .site-header {
    position: sticky;
    top: 0;
  }
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-top-h);
  gap: var(--space-2);
}

.header-brand {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

.logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 120%);
  color: var(--text-dark);
  font-size: 26px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(255, 165, 0, 0.35);
}

.logo-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.logo-name {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--text-light);
  line-height: 1.2;
}

.logo-tagline {
  font-size: 12px;
  font-family: var(--font-label);
  color: var(--text-muted-b);
  letter-spacing: 0.08em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.header-links {
  display: flex;
  gap: 8px;
}

.header-links a {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 215, 0, 0.45);
  color: var(--accent);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.header-links a:hover {
  background: var(--accent);
  color: var(--text-dark);
  border-color: var(--accent);
}

.header-search {
  position: relative;
}

.header-search input {
  width: 220px;
  height: 40px;
  padding: 0 16px 0 42px;
  border-radius: var(--radius-pill);
  background: var(--bg-input-dark);
  color: var(--text-light);
  font-size: 14px;
  transition: background var(--transition), outline var(--transition);
}

.header-search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.header-search input:focus {
  background: rgba(255, 255, 255, 0.2);
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}

.search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  transform: translateY(-62%);
  pointer-events: none;
}

.search-icon::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(45deg);
  border-radius: 2px;
}

/* ============ NAVIGATION ============ */
.site-nav {
  border-top: 1px solid var(--border-light);
  background: rgba(0, 0, 0, 0.18);
}

.nav-list {
  display: flex;
  align-items: stretch;
  gap: var(--space-3);
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-list::-webkit-scrollbar {
  display: none;
}

.nav-list li {
  display: flex;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  position: relative;
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  padding: 14px 2px;
  white-space: nowrap;
  transition: color var(--transition);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
  border-radius: 3px 3px 0 0;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

.nav-link[aria-current="page"] {
  color: var(--accent);
}

/* ============ MOBILE NAV TOGGLE ============ */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
  gap: 5px;
  flex-shrink: 0;
  transition: background var(--transition);
}

.mobile-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
}

.toggle-line {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-light);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

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

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

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

/* ============ FOOTER ============ */
.site-footer {
  flex-shrink: 0;
  background: var(--bg-section-green);
  color: var(--text-light);
  border-top: 4px solid var(--accent);
}

.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-6) var(--space-3) 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: var(--space-5);
  padding-bottom: var(--space-5);
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-logo {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.06em;
  line-height: 1.3;
}

.footer-tagline {
  font-family: var(--font-label);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  letter-spacing: 0.06em;
}

.footer-desc {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.55);
  max-width: 32ch;
}

.footer-col h3,
.footer-contact h3 {
  font-size: 14px;
  font-family: var(--font-label);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 16px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
  transition: color var(--transition), padding-left var(--transition);
}

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

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.footer-contact p {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 8px;
  word-break: break-all;
}

.footer-contact .address {
  word-break: break-all;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-family: var(--font-label);
  color: rgba(255, 255, 255, 0.45);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 26px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), color var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: var(--text-dark);
}

.btn-primary:hover {
  background: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(255, 165, 0, 0.35);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-dark);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-light {
  background: #FFFFFF;
  color: var(--text-dark);
}

.btn-light:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.section-dark .btn-outline,
.section-green .btn-outline {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--text-light);
}

.section-dark .btn-outline:hover,
.section-green .btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============ BREADCRUMB ============ */
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted-a);
  padding: 16px 0;
}

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

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb .crumb-sep {
  color: var(--border);
  font-family: var(--font-label);
  font-size: 12px;
}

/* ============ CARD GRID ============ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-3);
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.card-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, var(--bg-section-dark) 0%, #3B5998 60%, var(--bg-section-green) 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.poster-card .card-image {
  aspect-ratio: 3 / 4;
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--text-muted-a);
}

/* ============ TILE GRID ============ */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--space-2);
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  min-height: 130px;
}

.tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: var(--primary);
}

.tile-tag {
  font-family: var(--font-label);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted-a);
}

.tile-name {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  margin-top: auto;
  padding-top: 8px;
}

.tile-count {
  font-family: var(--font-label);
  font-size: 13px;
  color: var(--text-muted-a);
}

.section-dark .tile,
.section-green .tile {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.section-dark .tile:hover,
.section-green .tile:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: var(--accent);
}

.section-dark .tile-tag,
.section-dark .tile-count,
.section-green .tile-tag,
.section-green .tile-count {
  color: rgba(255, 255, 255, 0.5);
}

.section-dark .tile-name,
.section-green .tile-name {
  color: var(--text-light);
}

/* ============ LIST BLOCK ============ */
.list-block {
  display: flex;
  flex-direction: column;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), transform var(--transition);
}

.list-row:nth-child(even) {
  background: var(--bg-card-alt);
}

.list-row:hover {
  background: rgba(255, 165, 0, 0.1);
  transform: translateX(4px);
}

.section-dark .list-row:nth-child(even),
.section-green .list-row:nth-child(even) {
  background: rgba(255, 255, 255, 0.06);
}

.section-dark .list-row:hover,
.section-green .list-row:hover {
  background: rgba(255, 215, 0, 0.12);
}

.list-row-index {
  font-family: var(--font-label);
  font-size: 18px;
  font-weight: 700;
  width: 40px;
  text-align: center;
  color: var(--primary);
  flex-shrink: 0;
}

.list-row-title {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--text-muted-a);
  flex-shrink: 0;
}

.section-dark .list-row-meta,
.section-green .list-row-meta {
  color: rgba(255, 255, 255, 0.5);
}

/* ============ TAG GROUP ============ */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}

.tag:hover {
  transform: rotate(-2deg) scale(1.04);
}

a.tag {
  cursor: pointer;
}

.tag-red {
  background: rgba(255, 99, 71, 0.14);
  color: #B03A2A;
}

.tag-purple {
  background: rgba(123, 104, 238, 0.14);
  color: #4B3CB0;
}

.tag-pink {
  background: rgba(255, 105, 180, 0.14);
  color: #B02365;
}

.tag-teal {
  background: rgba(32, 178, 170, 0.14);
  color: #07806C;
}

.tag-orange {
  background: rgba(255, 140, 0, 0.14);
  color: #A86000;
}

.tag-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted-a);
}

.section-dark .tag-outline,
.section-green .tag-outline {
  border-color: rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.7);
}

/* ============ BADGE ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.8;
  white-space: nowrap;
}

.badge-new {
  background: var(--status-new);
  color: var(--text-light);
}

.badge-updating {
  background: var(--status-updating);
  color: var(--text-dark);
}

.badge-complete {
  background: var(--status-complete);
  color: var(--text-light);
}

.badge-cache {
  background: var(--cache);
  color: var(--text-dark);
}

.badge-accent {
  background: var(--accent);
  color: var(--text-dark);
}

.badge-primary {
  background: var(--primary);
  color: var(--text-dark);
}

.section-dark .badge-outline,
.section-green .badge-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
  color: var(--text-light);
}

/* ============ NUMBER MARKER ============ */
.num-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 2px solid var(--border);
  font-family: var(--font-label);
  font-weight: 700;
  font-size: 14px;
  color: var(--text-dark);
  flex-shrink: 0;
}

.num-marker-gold {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-dark);
}

.num-marker-orange {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-dark);
}

/* ============ METRIC BAR ============ */
.metric-bar {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-card-alt);
  overflow: hidden;
}

.metric-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 600ms ease;
}

.metric-fill-green {
  background: linear-gradient(90deg, var(--bg-section-green), var(--status-updating));
}

.metric-fill-blue {
  background: linear-gradient(90deg, #1E3A5F, var(--status-complete));
}

.metric-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-label);
  font-size: 13px;
  color: var(--text-muted-a);
  margin-bottom: 6px;
}

/* ============ INDEX BAR ============ */
.index-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.index-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-dark);
  border: 1px solid transparent;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.index-link:hover {
  background: var(--primary);
  color: var(--text-dark);
}

.index-link[aria-current="true"] {
  background: var(--accent);
  color: var(--text-dark);
}

.section-dark .index-link,
.section-green .index-link {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
}

.section-dark .index-link:hover,
.section-green .index-link:hover {
  background: var(--primary);
  color: var(--text-dark);
}

/* ============ RAIL ============ */
.rail {
  overflow-x: auto;
  padding-bottom: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.rail::-webkit-scrollbar {
  height: 6px;
}

.rail::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-pill);
}

.rail::-webkit-scrollbar-track {
  background: transparent;
}

.rail-track {
  display: flex;
  gap: var(--space-3);
  min-width: max-content;
  padding: 4px 2px 8px;
}

.rail-card {
  width: 220px;
  flex-shrink: 0;
}

/* ============ DATA TABLE ============ */
.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.data-table th {
  background: var(--bg-section-dark);
  color: var(--text-light);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 16px;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  line-height: 1.6;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 165, 0, 0.07);
}

/* ============ PANEL ============ */
.panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.panel-dark {
  background: var(--bg-section-dark);
  color: var(--text-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.panel-green {
  background: var(--bg-section-green);
  color: var(--text-light);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.panel-dark .panel-title,
.panel-green .panel-title {
  color: var(--text-light);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
}

.panel-title {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 14px;
}

/* ============ MEDIA PLACEHOLDER ============ */
.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(255, 165, 0, 0.12) 0%, transparent 55%),
    linear-gradient(135deg, var(--bg-section-dark) 0%, #3B5998 55%, var(--bg-section-green) 100%);
  position: relative;
  overflow: hidden;
}

.poster-card .media-placeholder {
  aspect-ratio: 3 / 4;
}

.media-placeholder::before {
  content: attr(data-label);
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding: 6px 14px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  border-radius: var(--radius-sm);
  text-align: center;
  max-width: 90%;
}

.media-placeholder::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -25%;
  width: 70%;
  height: 180%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.08) 50%, transparent 65%);
  transform: rotate(18deg);
  pointer-events: none;
}

/* ============ VERTICAL TEXT ============ */
.v-text {
  writing-mode: vertical-rl;
  font-family: var(--font-label);
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--text-muted-a);
  text-orientation: mixed;
}

.section-dark .v-text,
.section-green .v-text {
  color: rgba(255, 255, 255, 0.5);
}

/* ============ TOOLBAR ============ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.toolbar-label {
  font-family: var(--font-label);
  font-size: 12px;
  color: var(--text-muted-a);
  margin-right: 4px;
}

.toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-label);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-dark);
  border: 1px solid var(--border);
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.toolbar-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.toolbar-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-dark);
}

.section-dark .toolbar-btn,
.section-green .toolbar-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--text-light);
}

.section-dark .toolbar-btn:hover,
.section-green .toolbar-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.section-dark .toolbar-btn[aria-pressed="true"],
.section-green .toolbar-btn[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-dark);
}

/* ============ BACK TO TOP ============ */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--bg-section-dark);
  color: var(--text-light);
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(0.9);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition), background var(--transition);
  z-index: 50;
}

.back-to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.back-to-top:hover {
  background: var(--primary);
  color: var(--text-dark);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 991px) {
  .header-links {
    display: none;
  }

  .header-search input {
    width: 200px;
  }

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

  .footer-contact {
    grid-column: span 3;
  }

  h1 { font-size: 36px; }
  h2 { font-size: 28px; }
  h3 { font-size: 22px; }
}

@media (max-width: 767px) {
  .site-header {
    box-shadow: none;
  }

  .header-top {
    flex-wrap: wrap;
    min-height: 64px;
    padding: 10px 0;
    gap: 10px;
  }

  .header-brand {
    flex: 1 1 auto;
  }

  .header-actions {
    flex: 1 1 100%;
    order: 3;
    width: 100%;
  }

  .header-search {
    flex: 1;
    width: 100%;
  }

  .header-search input {
    width: 100%;
  }

  .mobile-nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
  }

  .site-nav[data-open] {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 0 16px;
  }

  .nav-list li {
    flex: 1;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 13px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 16px;
  }

  .nav-link::after {
    left: 0;
    top: 0;
    bottom: auto;
    width: 3px;
    height: 100%;
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transform-origin: top;
  }

  .nav-link:hover::after,
  .nav-link[aria-current="page"]::after {
    transform: scaleY(1);
  }

  .logo-name {
    font-size: 20px;
  }

  .logo-mark {
    width: 40px;
    height: 40px;
    font-size: 22px;
    border-radius: var(--radius-sm);
  }

  .logo-tagline {
    font-size: 11px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .footer-contact {
    grid-column: auto;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

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

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

  .tile {
    padding: 16px;
    min-height: 110px;
  }

  .list-row {
    flex-wrap: wrap;
    gap: 8px;
  }

  .list-row-index {
    width: 32px;
    font-size: 16px;
  }

  .list-row-title {
    flex: 1 1 calc(100% - 48px);
    white-space: normal;
  }

  .list-row-meta {
    flex: 1 1 100%;
    padding-left: 48px;
  }

  .rail-card {
    width: 180px;
  }

  .section-light,
  .section-dark,
  .section-green {
    padding: var(--space-4) 0;
  }

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

  .panel,
  .panel-dark,
  .panel-green {
    padding: var(--space-3);
    border-radius: var(--radius-md);
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .card-body {
    padding: 10px 12px 12px;
  }

  .card-title {
    font-size: 14px;
  }

  .tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .header-actions {
    gap: 8px;
  }

  .header-search input {
    padding-left: 38px;
  }

  .data-table {
    font-size: 13px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }
}

/* ============ PREFERS REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
