:root {
  --page-bg: #1A1A1A;
  --section-dark: #2A2A2A;
  --section-ink: #1E3A5F;
  --card-bg: #1F1F1F;
  --primary: #FF6B35;
  --accent: #39FF14;
  --status-new: #9B59B6;
  --status-live: #FFD700;
  --status-done: #2ECC71;
  --tag-blue: #3498DB;
  --tag-orange: #E67E22;
  --tag-green: #2ECC71;
  --text-main: #FFFFFF;
  --text-sub: #B0B0B0;
  --border: #3A3A3A;
  --font-head: "Arial Black", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  --font-mono: Consolas, Monaco, "Courier New", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--page-bg);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font-family: inherit;
  font-size: inherit;
}

[hidden] {
  display: none !important;
}

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

#main-content {
  min-height: 60vh;
  scroll-margin-top: 16px;
}

/* ===== Header ===== */
.site-header {
  background: var(--section-ink);
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 1000;
  background: var(--accent);
  color: #000;
  padding: 8px 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  text-decoration: none;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 8px;
}

.hdr-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hdr-brand-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.hdr-brand {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: 0.02em;
  line-height: 1.1;
  display: inline-block;
}

.hdr-brand::after {
  content: "";
  display: block;
  width: 100%;
  height: 4px;
  background: var(--primary);
  margin-top: 2px;
}

.hdr-tagline {
  font-size: 12px;
  color: var(--text-sub);
  letter-spacing: 0.22em;
  font-weight: 600;
  white-space: nowrap;
}

.hdr-search-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  background: var(--page-bg);
}

.hdr-search {
  background: transparent;
  border: none;
  padding: 8px 12px;
  color: #ffffff;
  font-size: 14px;
  width: 260px;
  outline: none;
  font-family: var(--font-body);
}

.hdr-search::placeholder {
  color: var(--text-sub);
}

.hdr-search:focus {
  background: rgba(255, 255, 255, 0.04);
}

.hdr-search-btn {
  background: var(--accent);
  color: #000000;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
}

.hdr-search-btn:hover {
  background: #ffffff;
  color: #000000;
}

.hdr-bottom {
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.hdr-nav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 4px;
}

.hdr-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 16px;
  display: block;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

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

.hdr-nav a[aria-current="page"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.hdr-nav-toggle {
  display: none;
  background: var(--card-bg);
  border: 1px solid var(--border);
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}

.hdr-nav-toggle:hover {
  border-color: var(--accent);
}

.hdr-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-main);
  pointer-events: none;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--section-dark);
  border-top: 4px solid var(--primary);
  margin-top: 80px;
}

.ftr-top {
  max-width: 1280px;
  margin: 0 auto;
  padding: 48px 24px 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.ftr-brand-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ftr-brand {
  font-family: var(--font-head);
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
  text-decoration: none;
  line-height: 1.1;
}

.ftr-brand::after {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  background: var(--accent);
  margin-top: 4px;
}

.ftr-tagline {
  font-size: 13px;
  color: var(--text-sub);
  letter-spacing: 0.14em;
  font-weight: 600;
}

.ftr-desc {
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-sub);
  max-width: 380px;
}

.ftr-link-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ftr-heading {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin: 0 0 10px;
}

.ftr-link-group a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 14px;
  padding: 2px 0;
  transition: color 0.2s;
}

.ftr-link-group a:hover {
  color: var(--accent);
}

.ftr-bottom {
  border-top: 1px solid var(--border);
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.ftr-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-sub);
}

.ftr-legal {
  display: flex;
  gap: 20px;
  font-size: 13px;
  color: var(--text-sub);
}

/* ===== Layout ===== */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 64px 0;
}

.section-dark {
  background: var(--section-dark);
}

.section-ink {
  background: var(--section-ink);
}

.section-heading {
  font-family: var(--font-head);
  font-size: 32px;
  font-weight: 900;
  margin: 0 0 24px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  line-height: 1.2;
}

.section-heading::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 24px;
  background: var(--primary);
  flex: none;
}

.section-note {
  position: absolute;
  right: 8px;
  top: 0;
  writing-mode: vertical-rl;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-sub);
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.page-hero {
  padding: 40px 0 24px;
}

.page-hero h1 {
  font-family: var(--font-head);
  font-size: 48px;
  font-weight: 900;
  line-height: 1.12;
  margin-bottom: 10px;
}

.page-hero .lead {
  color: var(--text-sub);
  font-size: 16px;
  max-width: 720px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 14px;
  padding: 16px 0;
  color: var(--text-sub);
}

.breadcrumb a {
  color: var(--text-sub);
  text-decoration: none;
  transition: color 0.2s;
}

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

.breadcrumb-sep {
  color: var(--border);
  margin: 0 2px;
}

/* ===== Cards & Tiles ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

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

.tile {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  padding: 16px;
  color: #ffffff;
  text-decoration: none;
  background: var(--section-dark);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}

.tile:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tile-orange {
  background: var(--primary);
}

.tile-orange:hover {
  border-color: #ffffff;
}

.tile-blue {
  background: var(--tag-blue);
}

.tile-blue:hover {
  border-color: #ffffff;
}

.tile-green {
  background: var(--tag-green);
}

.tile-green:hover {
  border-color: #ffffff;
}

.tile-yellow {
  background: var(--status-live);
  color: #000000;
}

.tile-yellow:hover {
  border-color: #ffffff;
}

.tile-count {
  font-family: var(--font-mono);
  font-size: 14px;
  opacity: 0.85;
}

/* ===== Lists ===== */
.item-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.item-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text-main);
  transition: background 0.2s;
}

.item-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.item-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}

.seq-num {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-sub);
  min-width: 40px;
  text-align: right;
}

/* ===== Tags ===== */
.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: rgba(57, 255, 20, 0.1);
  border: 1px solid rgba(57, 255, 20, 0.35);
  padding: 2px 8px;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.tag:hover {
  background: var(--accent);
  color: #000000;
  border-color: var(--accent);
}

.tag-blue {
  color: var(--tag-blue);
  border-color: rgba(52, 152, 219, 0.4);
  background: rgba(52, 152, 219, 0.12);
}

.tag-blue:hover {
  background: var(--tag-blue);
  color: #ffffff;
  border-color: var(--tag-blue);
}

.tag-orange {
  color: var(--tag-orange);
  border-color: rgba(230, 126, 34, 0.4);
  background: rgba(230, 126, 34, 0.12);
}

.tag-orange:hover {
  background: var(--tag-orange);
  color: #ffffff;
  border-color: var(--tag-orange);
}

.tag-green {
  color: var(--tag-green);
  border-color: rgba(46, 204, 113, 0.4);
  background: rgba(46, 204, 113, 0.12);
}

.tag-green:hover {
  background: var(--tag-green);
  color: #000000;
  border-color: var(--tag-green);
}

/* ===== Filter Buttons ===== */
[data-filter] {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 6px 12px;
  background: var(--card-bg);
  color: var(--accent);
  border: 1px solid var(--border);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

[data-filter]:hover {
  border-color: var(--accent);
}

[data-filter].is-active {
  background: var(--accent);
  color: #000000;
  border-color: var(--accent);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid transparent;
  white-space: nowrap;
  line-height: 1.4;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  display: inline-block;
  flex: none;
}

.badge-new {
  background: rgba(155, 89, 182, 0.2);
  color: var(--status-new);
  border-color: var(--status-new);
}

.badge-live {
  background: rgba(255, 215, 0, 0.15);
  color: var(--status-live);
  border-color: var(--status-live);
}

.badge-done {
  background: rgba(46, 204, 113, 0.15);
  color: var(--status-done);
  border-color: var(--status-done);
}

.badge-hd {
  background: rgba(52, 152, 219, 0.15);
  color: var(--tag-blue);
  border-color: var(--tag-blue);
}

.badge-exclusive {
  background: rgba(255, 107, 53, 0.15);
  color: var(--primary);
  border-color: var(--primary);
}

/* ===== Metric Bar ===== */
.metric-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.metric-bar-label {
  min-width: 64px;
  font-family: var(--font-mono);
  color: var(--text-sub);
}

.metric-bar-track {
  flex: 1;
  height: 6px;
  background: var(--border);
}

.metric-bar-fill {
  display: block;
  height: 100%;
  background: var(--primary);
}

.metric-bar-fill.is-accent {
  background: var(--accent);
}

.metric-bar-fill.is-blue {
  background: var(--tag-blue);
}

/* ===== Index Bar ===== */
.index-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px;
  background: var(--card-bg);
  border: 1px solid var(--border);
}

.index-bar a,
.index-bar span {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 4px 8px;
  color: var(--accent);
  text-decoration: none;
  min-width: 28px;
  text-align: center;
  display: inline-block;
}

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

.index-bar .is-muted {
  color: var(--text-sub);
  cursor: not-allowed;
}

/* ===== Rail ===== */
.rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.rail > * {
  flex: 0 0 auto;
  scroll-snap-align: start;
}

/* ===== Table ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  background: rgba(57, 255, 20, 0.06);
}

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

/* ===== Panels ===== */
.panel {
  border: 1px solid var(--border);
  background: var(--card-bg);
  margin-bottom: 12px;
}

.panel-toggle {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 14px 16px;
  color: var(--text-main);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel-toggle::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 20px;
  color: var(--accent);
  flex: none;
}

.panel-toggle[aria-expanded="true"]::after {
  content: "\2212";
}

.panel-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.2s ease;
}

.panel-body[data-open="true"] {
  grid-template-rows: 1fr;
}

.panel-inner {
  overflow: hidden;
  padding: 0 16px 16px;
  color: var(--text-sub);
  line-height: 1.7;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 20px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.2s, color 0.2s;
}

.btn:hover {
  background: var(--accent);
  color: #000000;
}

/* ===== Prose ===== */
.prose {
  max-width: 720px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-sub);
}

.prose h2 {
  font-family: var(--font-head);
  font-size: 24px;
  font-weight: 900;
  color: var(--text-main);
  margin: 32px 0 12px;
}

.prose p {
  margin-bottom: 16px;
}

.prose strong {
  color: var(--text-main);
}

/* ===== Image Placeholder ===== */
.img-placeholder {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--section-dark);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.img-placeholder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(57, 255, 20, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 20, 0.08) 1px, transparent 1px);
  background-size: 20px 20px;
}

.img-placeholder::after {
  content: "FIG";
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-sub);
  background: var(--card-bg);
  border: 1px solid var(--border);
  padding: 4px 8px;
}

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

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

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

/* ===== Backgrounds & Decor ===== */
.grid-bg {
  position: relative;
  background:
    linear-gradient(rgba(57, 255, 20, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(57, 255, 20, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
}

.corner-mark {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-top: 2px solid var(--primary);
  border-right: 2px solid var(--primary);
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

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

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .ftr-top {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }

  .ftr-brand-block {
    grid-column: 1 / -1;
  }

  .section-heading {
    font-size: 26px;
  }

  .page-hero h1 {
    font-size: 38px;
  }
}

@media (max-width: 760px) {
  .hdr-top {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .hdr-brand {
    font-size: 26px;
  }

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

  .hdr-search-wrap {
    width: 100%;
  }

  .hdr-search {
    flex: 1;
    width: auto;
  }

  .hdr-bottom {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px;
    padding: 8px 16px;
  }

  .hdr-nav {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    flex-direction: column;
    width: 100%;
    padding: 0;
    gap: 0;
  }

  .hdr-nav[data-open="true"] {
    display: flex;
  }

  .hdr-nav a {
    padding: 12px 0;
    border-bottom-color: var(--border);
  }

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

  .ftr-top {
    grid-template-columns: 1fr;
    padding: 32px 20px 20px;
  }

  .ftr-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px 20px;
  }

  .ftr-meta {
    flex-direction: column;
    gap: 4px;
  }

  .ftr-legal {
    gap: 12px;
  }

  .section {
    padding: 40px 0;
  }

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

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

  .tile-matrix {
    grid-template-columns: 1fr 1fr;
  }

  .page-hero h1 {
    font-size: 30px;
  }

  .container {
    padding: 0 16px;
  }
}
