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

:root {
  --bg: #1a1a1a;
  --bg-elevated: #2d2d2d;
  --bg-card: #2d2d2d;
  --bg-section-purple: #4a00e0;
  --bg-section-green: #0d3b1f;
  --bg-index: #1e1e1e;
  --primary: #ff6b00;
  --accent: #00d4ff;
  --status-new: #00e676;
  --status-live: #ffd600;
  --status-done: #ff5db1;
  --tag-lime: #c0ff00;
  --text: #ffffff;
  --text-dim: #b0b0b0;
  --border: #4a4a4a;
  --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Courier New", monospace;
  --header-h: 64px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --glow-primary: 0 8px 24px rgba(255,107,0,0.35);
  --glow-accent: 0 8px 24px rgba(0,212,255,0.25);
}

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg, video { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
input { border: none; outline: none; }
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

h1, h2, h3, h4 { line-height: 1.15; font-weight: 900; }
h3, h4 { font-weight: 800; }
::selection { background: var(--primary); color: #1a1a1a; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

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

/* ===== Utilities ===== */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 120;
  background: var(--primary);
  color: #1a1a1a;
  font-weight: 700;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  transform: translateY(-300%);
  transition: transform 0.2s ease;
}
.skip-link:focus-visible { transform: none; }

.site-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--status-live), var(--accent));
  z-index: 130;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 26, 26, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 0 rgba(255,107,0,0.45), 0 12px 32px rgba(0,0,0,0.35);
}
.site-header::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  height: 2px;
  width: 100%;
  pointer-events: none;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 55%, transparent 100%);
}

.site-header__bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: 1440px;
  margin: 0 auto;
  min-height: var(--header-h);
  padding: 0.4rem 2rem;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.site-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--primary);
  color: #1a1a1a;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  border-radius: 6px 2px 8px 2px;
  transform: skewX(-10deg);
  box-shadow: var(--glow-primary);
}
.site-brand__name {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  white-space: nowrap;
}

.site-nav { margin-left: auto; }
.site-nav__search { display: none; }
.site-nav__list { display: flex; align-items: center; gap: 0.15rem; }
.site-nav__item { list-style: none; }
.site-nav__link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  border-radius: 7px;
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  position: relative;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.site-nav__link:hover { color: #fff; background: rgba(255,255,255,0.07); }
.site-nav__link[aria-current="page"] { color: #fff; background: rgba(255,107,0,0.16); box-shadow: inset 0 -2px 0 var(--primary); }

.site-header__tools { display: flex; align-items: center; gap: 0.75rem; }

.site-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-index);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  min-width: 190px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.site-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,212,255,0.22); }
.site-search__label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
}
.site-search__input {
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 0.88rem;
  width: 100%;
  min-width: 0;
}
.site-search__input::placeholder { color: #666; }

.site-fav {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.site-fav:hover { border-color: var(--status-live); color: var(--status-live); background: rgba(255,214,0,0.1); }
.site-fav__icon { font-size: 1rem; line-height: 1; color: var(--status-live); }
.site-fav__text { font-size: 0.85rem; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-index);
  transition: border-color 0.2s;
}
.nav-toggle:hover { border-color: var(--primary); }
.nav-toggle__line {
  display: block;
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 960px) {
  .site-header__bar { padding: 0.5rem 1rem; gap: 0.6rem; }
  .site-header__tools { margin-left: auto; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 90;
    margin-left: 0;
    background: var(--bg-index);
    border-bottom: 3px solid var(--primary);
    box-shadow: 0 24px 32px rgba(0,0,0,0.5);
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
  .site-nav[data-open] { opacity: 1; visibility: visible; transform: none; }
  .site-nav__list { flex-direction: column; align-items: stretch; gap: 0.3rem; }
  .site-nav__link { display: block; padding: 0.85rem 1rem; font-size: 1rem; border-radius: 10px; }
  .site-nav__link[aria-current="page"] { background: rgba(255,107,0,0.18); }
  .site-nav__search { display: block; margin-bottom: 0.75rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }
  .site-nav__search .site-search { min-width: 0; border-radius: 10px; }
  .nav-toggle { display: inline-flex; }
}

@media (max-width: 640px) {
  .site-header__tools .site-search { display: none; }
  .site-fav__text { display: none; }
  .site-fav { padding: 0.35rem 0.55rem; }
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  background: var(--bg-section-purple);
  color: #fff;
  overflow: hidden;
  padding: 3.5rem 2rem 2.5rem;
  isolation: isolate;
}
.site-footer::before,
.site-footer::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50% 42% 55% 45% / 45% 58% 42% 55%;
}
.site-footer::before {
  width: 420px;
  height: 420px;
  right: -120px;
  top: -140px;
  background: radial-gradient(circle at 40% 40%, rgba(255,107,0,0.35), transparent 70%);
}
.site-footer::after {
  width: 320px;
  height: 320px;
  left: -100px;
  bottom: -120px;
  background: radial-gradient(circle at 50% 50%, rgba(0,212,255,0.25), transparent 70%);
}

.site-footer__inner {
  max-width: 1440px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.3fr 1.6fr 1.1fr;
  gap: 2rem 3rem;
  align-items: start;
  position: relative;
}

.site-footer__brand { display: flex; flex-direction: column; gap: 0.4rem; }
.site-brand--footer { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.site-footer .site-brand__name { color: #fff; }
.site-footer .site-brand__mark { box-shadow: none; }
.site-footer__slogan {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.72);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}

.site-footer__groups { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.site-footer__group { min-width: 0; }
.site-footer__title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}
.site-footer__links { display: flex; flex-direction: column; gap: 0.45rem; }
.site-footer__links li { list-style: none; }
.site-footer__links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: color 0.15s, padding-left 0.15s;
}
.site-footer__links a:hover { color: #fff; padding-left: 0.35rem; }

.site-footer__meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.72);
}
.site-footer__icp a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
}
.site-footer__icp a:hover { color: #fff; }
.site-footer__contact { line-height: 1.7; }
.site-footer__contact a { color: rgba(255,255,255,0.85); }
.site-footer__contact a:hover { color: #fff; }
.site-footer__copyright {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-mono);
}

@media (max-width: 960px) {
  .site-footer__inner { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .site-footer__brand,
  .site-footer__groups,
  .site-footer__meta { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .site-footer { padding: 2.5rem 1.25rem 2rem; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .site-footer__groups { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
}

/* ===== Feedback float ===== */
.feedback-float {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.75rem;
  height: 3.75rem;
  border-radius: 50%;
  background: var(--status-live);
  color: #1a1a1a;
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  box-shadow: 0 8px 24px rgba(255,214,0,0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.feedback-float:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(255,214,0,0.5); }

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

.section { padding: clamp(2.5rem, 6vw, 5rem) 0; }
.section--purple { background: var(--bg-section-purple); color: #fff; }
.section--green { background: var(--bg-section-green); color: #fff; }
.section--gray { background: var(--bg-elevated); }
.section--inked { background: var(--bg); }
.section--border-top { border-top: 1px solid var(--border); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.section-title {
  font-size: clamp(1.9rem, 4vw, 3.2rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  transform: skewX(-6deg);
  transform-origin: left center;
}
.section-title--small { font-size: clamp(1.35rem, 2.6vw, 2rem); }
.section-title__index {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.5em;
  font-weight: 700;
  color: var(--primary);
  vertical-align: super;
  margin-right: 0.45em;
  transform: skewX(6deg);
}
.section--purple .section-title__index,
.section--green .section-title__index { color: #ffb380; }
.section-subtitle {
  max-width: 56ch;
  margin-top: 0.6rem;
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.7;
}
.section--purple .section-subtitle,
.section--green .section-subtitle { color: rgba(255,255,255,0.72); }

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  border-bottom: 1px solid rgba(0,212,255,0.6);
  padding-bottom: 0.15rem;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.link-more:hover { color: #fff; border-color: #fff; }
.link-more::after { content: "→"; font-family: var(--font-mono); }
.section--purple .link-more,
.section--green .link-more { color: #fff; border-color: rgba(255,255,255,0.6); }
.section--purple .link-more:hover,
.section--green .link-more:hover { color: var(--primary); border-color: var(--primary); }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  padding: 1.1rem 0 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.breadcrumb a,
.breadcrumb__link { color: var(--text-dim); transition: color 0.15s; }
.breadcrumb a:hover,
.breadcrumb__link:hover { color: var(--primary); }
.breadcrumb__sep { font-family: var(--font-mono); color: var(--border); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.btn--primary { background: var(--primary); border-color: var(--primary); color: #1a1a1a; }
.btn--primary:hover { background: #ff8a3d; color: #1a1a1a; border-color: #ff8a3d; }
.btn--ghost { background: transparent; }
.btn--small { padding: 0.45rem 0.9rem; font-size: 0.8rem; }

/* ===== Card grid & cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.card-grid--tiles { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }
.card-grid--rows { grid-template-columns: 1fr; gap: 0.5rem; }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent) 70%);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 28px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,212,255,0.25);
}
.card:hover::before { opacity: 1; }
.card__title { font-size: 1rem; font-weight: 800; line-height: 1.3; }
.card__meta { font-size: 0.78rem; color: var(--text-dim); font-family: var(--font-mono); }
.card__actions { margin-top: auto; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ===== Thumbs ===== */
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(0,212,255,0.16), rgba(255,107,0,0.12)),
    linear-gradient(145deg, #343434, #222);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  overflow: hidden;
  isolation: isolate;
}
.thumb::after {
  content: "";
  position: absolute;
  right: -20%;
  top: -30%;
  width: 70%;
  height: 90%;
  border-radius: 42% 58% 45% 55% / 55% 44% 56% 45%;
  background: linear-gradient(135deg, rgba(255,107,0,0.2), rgba(0,212,255,0.2));
  z-index: -1;
  transform: rotate(-12deg);
}
.thumb--wide { aspect-ratio: 21 / 9; }
.thumb--tall { aspect-ratio: 3 / 4; }
.thumb--square { aspect-ratio: 1 / 1; }

/* ===== Badges & tags ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.badge--new { background: rgba(0,230,118,0.16); color: var(--status-new); }
.badge--live { background: rgba(255,214,0,0.16); color: var(--status-live); }
.badge--done { background: rgba(255,93,177,0.16); color: var(--status-done); }
.badge--accent { background: rgba(0,212,255,0.16); color: var(--accent); }
.badge--primary { background: rgba(255,107,0,0.18); color: #ffa366; }
.badge--light { background: rgba(255,255,255,0.1); color: #fff; }

.tag-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.tag--orange { background: rgba(255,107,0,0.18); color: #ffa366; border-color: rgba(255,107,0,0.35); }
.tag--cyan { background: rgba(0,212,255,0.14); color: #66dfff; border-color: rgba(0,212,255,0.32); }
.tag--yellow { background: rgba(255,214,0,0.14); color: #ffe566; border-color: rgba(255,214,0,0.32); }
.tag--pink { background: rgba(255,93,177,0.14); color: #ff8ac5; border-color: rgba(255,93,177,0.32); }
.tag--lime { background: rgba(192,255,0,0.12); color: #d2ff66; border-color: rgba(192,255,0,0.32); }
.tag--neutral { background: #383838; color: #d0d0d0; border-color: var(--border); }

/* ===== Entry list ===== */
.entry-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.entry-row {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s ease, padding-left 0.15s ease;
}
.entry-row:hover { background: rgba(255,255,255,0.03); padding-left: 0.85rem; }
.entry-row__index { font-family: var(--font-mono); font-weight: 800; font-size: 1.1rem; color: var(--primary); line-height: 1; }
.entry-row__body { min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
.entry-row__title { font-size: 0.95rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-row__meta { font-size: 0.78rem; font-family: var(--font-mono); color: var(--text-dim); }
.entry-row__extra { display: flex; align-items: center; gap: 0.5rem; }

.section--purple .entry-row,
.section--green .entry-row { border-color: rgba(255,255,255,0.13); }
.section--purple .entry-row__meta,
.section--green .entry-row__meta { color: rgba(255,255,255,0.7); }
.section--purple .entry-row__index,
.section--green .entry-row__index { color: #ffb380; }

@media (max-width: 720px) {
  .entry-row { grid-template-columns: 2.5rem minmax(0, 1fr); }
  .entry-row__extra { grid-column: 2; }
}

/* ===== Index number & metric ===== */
.index-number {
  display: inline-flex;
  align-items: baseline;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--primary);
}
.index-number--dim { color: var(--border); }
.index-number--light { color: #ff8a3d; }

.metric-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}
.metric-bar {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #3a3a3a;
  overflow: hidden;
}
.metric-bar__fill {
  display: block;
  height: 100%;
  width: 0%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ===== Tile matrix ===== */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 130px;
  padding: 1.2rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255,255,255,0.08);
  overflow: hidden;
  color: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tile::after {
  content: "";
  position: absolute;
  right: -30%;
  bottom: -40%;
  width: 80%;
  height: 80%;
  border-radius: 55% 45% 60% 40% / 45% 55% 45% 55%;
  background: rgba(255,255,255,0.12);
  transform: rotate(-18deg);
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 14px 32px rgba(0,0,0,0.4); }
.tile__title { font-size: 1.15rem; font-weight: 900; letter-spacing: 0.01em; }
.tile__count { font-size: 0.8rem; font-family: var(--font-mono); color: rgba(255,255,255,0.82); }

.tile--purple { background: linear-gradient(135deg, #3a00c0, #6a1ff2); }
.tile--green { background: linear-gradient(135deg, #0d3b1f, #00a65a); }
.tile--orange { background: linear-gradient(135deg, #b34a00, #ff6b00); }
.tile--cyan { background: linear-gradient(135deg, #006b8f, #00b8d9); }
.tile--pink { background: linear-gradient(135deg, #a52a68, #ff5db1); }
.tile--yellow { background: linear-gradient(135deg, #8f6f00, #ffd600); color: #1a1a1a; }
.tile--yellow .tile__count { color: rgba(26,26,26,0.7); }
.tile--lime { background: linear-gradient(135deg, #4d8f00, #c0ff00); color: #1a1a1a; }
.tile--lime .tile__count { color: rgba(26,26,26,0.7); }

/* ===== Panels ===== */
.panel-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.panel {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}
.panel__badge { align-self: flex-start; }
.panel__title { font-size: 1.1rem; font-weight: 900; }
.panel__desc { font-size: 0.88rem; color: var(--text-dim); line-height: 1.7; }
.panel__foot { margin-top: auto; padding-top: 0.6rem; border-top: 1px solid var(--border); }

/* ===== Index bar ===== */
.index-bar {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  z-index: 80;
  display: flex;
  gap: 0.2rem;
  padding: 0.45rem 0.6rem;
  margin: 0 0 1.5rem;
  overflow-x: auto;
  background: var(--bg-index);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  scrollbar-width: thin;
}
.index-bar__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.35rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.index-bar__link:hover { color: #fff; background: rgba(255,255,255,0.1); }
.index-bar__link--active { background: var(--primary); color: #1a1a1a; }
.index-bar__link.is-spied { background: var(--primary); color: #1a1a1a; }

.back-to-index {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.8rem;
}
.back-to-index::before { content: "↑"; font-family: var(--font-mono); }
.back-to-index:hover { color: #fff; }

/* ===== Rail ===== */
.rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.3rem 0.25rem 1rem;
  scroll-snap-type: x mandatory;
}
.rail__item {
  flex: 0 0 270px;
  scroll-snap-align: start;
}
.rail__item--sm { flex-basis: 210px; }
@media (max-width: 640px) {
  .rail__item { flex-basis: 230px; }
}

/* ===== Tables ===== */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: 0.9rem;
}
.compare-table th,
.compare-table td {
  border: 1px solid var(--border);
  padding: 0.75rem 1rem;
  text-align: left;
  vertical-align: top;
}
.compare-table th {
  background: var(--bg-elevated);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}
.compare-table td { color: var(--text-dim); }

.schedule-grid {
  display: grid;
  grid-template-columns: 6rem repeat(6, minmax(150px, 1fr));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  background: var(--bg-card);
}
.schedule-grid__cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0.8rem;
  font-size: 0.82rem;
  min-height: 3.5rem;
}
.schedule-grid__cell--head {
  background: var(--bg-elevated);
  font-weight: 800;
  font-size: 0.8rem;
}
.schedule-grid__cell--live { background: rgba(255,214,0,0.1); }
.schedule-grid__cell--done { background: rgba(255,93,177,0.08); }

/* ===== Filter ===== */
.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-dim);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.filter-tag:hover { border-color: var(--accent); color: var(--accent); }
.filter-tag[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #1a1a1a; }

[data-filter-item].is-filtered { display: none; }
.filter-empty {
  display: none;
  padding: 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.95rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}
.filter-empty.is-visible { display: block; }

/* ===== Responsive base ===== */
@media (max-width: 960px) {
  .container { padding: 0 1.25rem; }
}
@media (max-width: 720px) {
  .site-header__bar { padding: 0.5rem 1rem; }
  .container { padding: 0 1rem; }
  .section { padding: 2.5rem 0; }
  .card-grid--tiles { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .schedule-grid { grid-template-columns: 4rem repeat(6, minmax(120px, 1fr)); }
}

/* ===== 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;
  }
}
