/* ==========================================================================
   星空体育服务中心 · /assets/site.css
   共享外壳：重置 / 令牌 / 中文排版 / 品牌轨道 / 检索胶囊 / 页脚 / 通用组件
   ========================================================================== */

/* ---------- 1. 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul, ol {
  padding: 0;
  list-style: none;
}

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

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

/* ---------- 2. 设计令牌 ---------- */
:root {
  --ink-900: #05070F;
  --ink-800: #0B1226;
  --ink-700: #151E3D;
  --violet: #7A4DFF;
  --violet-deep: #3B1E7A;
  --cyan: #22E0FF;
  --lime: #C8FF4D;
  --amber: #FFB43D;
  --paper: #F4F7FF;
  --muted: #97A3C4;
  --line: #2A3466;

  --bg: var(--ink-900);
  --surface: var(--ink-800);
  --panel: var(--ink-700);
  --text: var(--paper);
  --text-dim: var(--muted);
  --border: var(--line);
  --accent: var(--violet);
  --accent-key: var(--cyan);
  --accent-hit: var(--lime);

  --glass: rgba(11, 18, 38, 0.82);
  --glass-soft: rgba(21, 30, 61, 0.55);
  --star: rgba(244, 247, 255, 0.42);

  --rail-w: 88px;
  --search-h: 56px;
  --shell-max: 1180px;
  --gutter: clamp(18px, 3.4vw, 48px);

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-xl: 36px;
  --radius-pill: 999px;

  --font-display: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "Cascadia Mono", "Roboto Mono", Menlo, Consolas, "Noto Sans Mono CJK SC", monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.24s;
}

[data-theme="light"] {
  --bg: #EDF1FA;
  --surface: #FFFFFF;
  --panel: #E3E9F7;
  --text: #0A1024;
  --text-dim: #4B5878;
  --border: #C7D0E6;
  --accent-key: #0C7C98;
  --glass: rgba(255, 255, 255, 0.9);
  --glass-soft: rgba(227, 233, 247, 0.72);
  --star: rgba(11, 18, 38, 0.14);
}

/* ---------- 3. 基础与中文排版 ---------- */
body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(1.2px 1.2px at 18% 24%, var(--star), transparent 60%),
    radial-gradient(1.2px 1.2px at 72% 12%, rgba(34, 224, 255, 0.42), transparent 60%),
    radial-gradient(1px 1px at 44% 68%, var(--star), transparent 60%),
    radial-gradient(1.4px 1.4px at 88% 54%, rgba(122, 77, 255, 0.45), transparent 60%),
    radial-gradient(1px 1px at 8% 86%, var(--star), transparent 60%);
  background-size: 620px 620px, 780px 780px, 520px 520px, 900px 900px, 700px 700px;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: 0.02em;
  color: var(--text);
  text-wrap: balance;
}

h1 { font-size: clamp(32px, 4.6vw, 48px); }
h2 { font-size: clamp(24px, 3.2vw, 34px); }
h3 { font-size: clamp(19px, 2.2vw, 26px); }
h4 { font-size: 20px; }

.display {
  font-family: var(--font-display);
  font-size: clamp(44px, 7vw, 68px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.type-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.6;
  color: var(--text-dim);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.prose p {
  max-width: 42em;
}

.prose p + p {
  margin-top: 1em;
}

.prose strong {
  color: var(--accent-key);
  font-weight: 600;
}

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

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

#main-content {
  scroll-margin-top: 96px;
}

/* ---------- 4. 布局容器 ---------- */
.site-main {
  display: block;
  min-height: 60vh;
  padding-left: var(--rail-w);
  padding-top: clamp(72px, 7vw, 96px);
}

.container {
  width: 100%;
  max-width: var(--shell-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(48px, 7vw, 96px);
}

.section--tight {
  padding-block: clamp(28px, 4vw, 56px);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap, 16px);
}

.grid {
  display: grid;
  gap: clamp(16px, 2.2vw, 28px);
}

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

/* ---------- 5. 跳转与滚动指示 ---------- */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: var(--lime);
  color: #05070F;
  font-weight: 700;
  font-size: 14px;
  transform: translateY(-220%);
  transition: transform var(--dur) var(--ease);
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 120;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--violet), var(--cyan) 55%, var(--lime));
  pointer-events: none;
}

/* ---------- 6. 头部：品牌轨道 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 70;
}

.rail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  height: 100%;
  padding: 20px 6px 16px;
  background-image: linear-gradient(180deg, var(--surface) 0%, var(--bg) 60%, var(--violet-deep) 100%);
  border-right: 1px solid var(--border);
  overflow: hidden;
}

.rail::before {
  content: "";
  position: absolute;
  left: -70%;
  right: -70%;
  top: -180px;
  height: 360px;
  background: radial-gradient(closest-side, rgba(122, 77, 255, 0.5), transparent 72%);
  pointer-events: none;
}

.rail__brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 2px 0 4px;
}

.rail__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
  color: #05070F;
  background-image: linear-gradient(140deg, var(--lime) 0%, var(--cyan) 52%, var(--violet) 100%);
  box-shadow: inset 0 0 0 1px rgba(244, 247, 255, 0.22), 0 12px 30px -14px rgba(34, 224, 255, 0.95);
  transition: transform var(--dur) var(--ease);
}

.rail__brand:hover .rail__mark {
  transform: translateY(-2px);
}

.rail__name {
  writing-mode: vertical-rl;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--text);
}

.rail__badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(200, 255, 77, 0.38);
  background: rgba(200, 255, 77, 0.1);
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1.6;
  white-space: nowrap;
}

.rail__badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px rgba(200, 255, 77, 0.9);
}

.rail__nav {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  padding: 4px 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}

.rail__nav::-webkit-scrollbar {
  display: none;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-link {
  display: block;
  padding: 9px 2px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 11px;
  line-height: 1.28;
  letter-spacing: 0.02em;
  color: var(--text-dim);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.nav-link:hover {
  color: var(--text);
  background-color: rgba(122, 77, 255, 0.18);
}

.nav-link[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
  background-image: linear-gradient(140deg, rgba(122, 77, 255, 0.62), rgba(34, 224, 255, 0.2));
  box-shadow: inset 0 0 0 1px rgba(34, 224, 255, 0.42);
}

.rail__foot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.theme-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 62px;
  padding: 7px 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--glass-soft);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  line-height: 1.4;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.theme-toggle:hover {
  color: var(--text);
  border-color: var(--accent-key);
}

.theme-toggle__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-image: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 10px rgba(34, 224, 255, 0.8);
}

.theme-toggle[aria-pressed="true"] .theme-toggle__dot {
  background-image: linear-gradient(135deg, var(--amber), #FFE6A8);
  box-shadow: 0 0 10px rgba(255, 180, 61, 0.85);
}

.rail__version {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  opacity: 0.75;
  white-space: nowrap;
}

/* ---------- 7. 移动导航按钮 ---------- */
.nav-toggle {
  display: none;
}

/* ---------- 8. 检索胶囊 ---------- */
.searchbar {
  position: fixed;
  top: 20px;
  right: clamp(16px, 3vw, 32px);
  z-index: 68;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, 36vw);
  height: var(--search-h);
  padding: 0 10px 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background-color: var(--glass);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 22px 48px -28px rgba(34, 224, 255, 0.85), inset 0 0 0 1px rgba(244, 247, 255, 0.04);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.searchbar:focus-within {
  border-color: rgba(34, 224, 255, 0.72);
  box-shadow: 0 0 0 4px rgba(34, 224, 255, 0.14), 0 22px 48px -28px rgba(34, 224, 255, 0.95);
}

.searchbar__dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 4px rgba(34, 224, 255, 0.16);
}

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

.searchbar__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.01em;
  -webkit-appearance: none;
  appearance: none;
}

.searchbar__input:focus {
  outline: none;
}

.searchbar__input::placeholder {
  color: var(--text-dim);
}

.searchbar__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.searchbar__hint {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* ---------- 9. 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: clamp(14px, 2.6vw, 30px);
  bottom: clamp(14px, 2.6vw, 30px);
  z-index: 85;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background-color: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur) var(--ease);
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  border-color: var(--accent-key);
}

.to-top__glyph {
  width: 8px;
  height: 8px;
  border-left: 2px solid var(--accent-key);
  border-top: 2px solid var(--accent-key);
  transform: rotate(45deg) translate(1px, 1px);
}

.to-top__text {
  line-height: 1;
}

/* ---------- 10. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-left: var(--rail-w);
  margin-top: clamp(64px, 9vw, 120px);
  padding: clamp(48px, 6vw, 84px) var(--gutter) 28px;
  background-image: linear-gradient(180deg, var(--bg) 0%, #100A2B 52%, #1B0D40 100%);
  border-top: 1px solid var(--border);
  overflow: hidden;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -160px;
  left: 50%;
  width: min(880px, 92%);
  height: 300px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(122, 77, 255, 0.42), transparent 72%);
  filter: blur(18px);
  pointer-events: none;
}

.footer__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(110px, 0.7fr)) minmax(230px, 1.3fr);
  gap: clamp(24px, 3.6vw, 48px);
  max-width: var(--shell-max);
  margin-inline: auto;
}

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

.footer__logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--text);
}

.footer__logo:hover {
  color: var(--accent-key);
}

.footer__claim {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent-key);
}

.footer__note {
  max-width: 26em;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}

.footer__col,
.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.footer__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  line-height: 1.6;
}

.footer__title::before {
  content: "";
  width: 14px;
  height: 1px;
  background: var(--accent-key);
}

.footer__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer__list a {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.footer__list a:hover {
  color: var(--accent-key);
  border-bottom-color: rgba(34, 224, 255, 0.5);
}

.footer__contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__contact-list li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.footer__key {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.9;
  letter-spacing: 0.08em;
  color: var(--accent-key);
}

.footer__val {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
  word-break: break-word;
}

.footer__legal {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  max-width: var(--shell-max);
  margin: clamp(32px, 4vw, 56px) auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(42, 52, 102, 0.9);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.03em;
  color: var(--text-dim);
}

.footer__copy,
.footer__meta {
  line-height: 1.8;
}

.footer__meta {
  opacity: 0.8;
}

/* ---------- 11. 通用组件 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent-key);
  line-height: 1.6;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  color: #05070F;
  background-image: linear-gradient(120deg, var(--cyan), var(--lime) 92%);
  box-shadow: 0 16px 36px -18px rgba(34, 224, 255, 0.9);
}

.btn--ghost {
  color: var(--text);
  background-color: rgba(122, 77, 255, 0.12);
  border-color: rgba(122, 77, 255, 0.55);
}

.btn--ghost:hover {
  border-color: var(--accent-key);
  color: var(--accent-key);
}

.btn--quiet {
  color: var(--text-dim);
  border-color: var(--border);
  background-color: transparent;
}

.btn--quiet:hover {
  color: var(--text);
  border-color: var(--accent-key);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background-color: var(--glass-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: var(--text-dim);
}

.tag--active {
  color: #05070F;
  font-weight: 600;
  background-color: var(--lime);
  border-color: transparent;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.8;
  color: var(--text-dim);
}

.breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb li::after {
  content: "/";
  color: var(--border);
}

.breadcrumb li:last-child::after {
  content: none;
}

.breadcrumb a {
  color: var(--text-dim);
  transition: color var(--dur) var(--ease);
}

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

.card {
  position: relative;
  padding: clamp(18px, 2vw, 26px);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--glass-soft);
}

.media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-md);
  background-color: var(--panel);
  background-image:
    radial-gradient(120% 100% at 15% 0%, rgba(122, 77, 255, 0.42), transparent 62%),
    radial-gradient(90% 80% at 85% 100%, rgba(34, 224, 255, 0.24), transparent 60%);
}

.media--tall { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }

.media__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(180deg, transparent 46%, rgba(5, 7, 15, 0.72));
  pointer-events: none;
}

.media__veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: linear-gradient(120deg, rgba(122, 77, 255, 0.28), transparent 55%);
  pointer-events: none;
}

/* ---------- 12. 检索命中与显入状态 ---------- */
.is-hit {
  background-image: linear-gradient(90deg, rgba(200, 255, 77, 0.52), rgba(200, 255, 77, 0.08));
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: inset 3px 0 0 var(--lime);
  border-radius: 6px;
  animation: hit-sweep var(--dur) var(--ease) both;
}

@keyframes hit-sweep {
  from { background-size: 0% 100%; }
  to { background-size: 100% 100%; }
}

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.is-active {
  color: var(--accent-key);
}

body.nav-open {
  overflow: hidden;
}

/* ---------- 13. 平板 ---------- */
@media (max-width: 1100px) {
  .footer__inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer__brand {
    grid-column: 1 / -1;
  }

  .footer__contact {
    grid-column: 1 / -1;
  }

  .searchbar {
    width: min(360px, 40vw);
  }
}

@media (max-width: 899px) {
  .site-header {
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;
    width: 100%;
    height: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background-color: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 80;
  }

  .rail {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 60;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 78px 20px 32px;
    border-right: 0;
    border-bottom: 0;
    overflow-y: auto;
    background-image:
      radial-gradient(90% 55% at 50% 0%, rgba(122, 77, 255, 0.4), transparent 72%),
      radial-gradient(70% 45% at 8% 100%, rgba(34, 224, 255, 0.16), transparent 72%),
      linear-gradient(180deg, var(--surface), var(--bg));
    opacity: 0;
    visibility: hidden;
    transform: translateY(-12px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility var(--dur) var(--ease);
  }

  .site-header[data-open] .rail {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .rail::before {
    display: none;
  }

  .rail__brand {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
  }

  .rail__name {
    writing-mode: horizontal-tb;
    font-size: 17px;
    letter-spacing: 0.1em;
  }

  .rail__badge {
    align-self: flex-start;
    font-size: 11px;
    padding: 4px 11px;
  }

  .rail__nav {
    flex: 0 0 auto;
    overflow: visible;
    padding: 0;
  }

  .nav-list {
    gap: 8px;
  }

  .nav-link {
    padding: 14px 18px;
    font-size: 16px;
    text-align: left;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background-color: var(--glass-soft);
  }

  .rail__foot {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 18px;
    margin-top: auto;
  }

  .theme-toggle {
    flex-direction: row;
    width: auto;
    padding: 8px 16px;
    font-size: 12px;
  }

  .rail__version {
    font-size: 11px;
  }

  .nav-toggle {
    position: relative;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 16px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    background-color: var(--glass-soft);
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .nav-toggle__text {
    line-height: 1;
  }

  .nav-toggle__bars {
    position: relative;
    display: block;
    width: 16px;
    height: 10px;
  }

  .nav-toggle__bars::before,
  .nav-toggle__bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent-key);
    transition: transform var(--dur) var(--ease), top var(--dur) var(--ease);
  }

  .nav-toggle__bars::before { top: 0; }
  .nav-toggle__bars::after { top: 8px; }

  .site-header[data-open] .nav-toggle__bars::before {
    top: 4px;
    transform: rotate(45deg);
  }

  .site-header[data-open] .nav-toggle__bars::after {
    top: 4px;
    transform: rotate(-45deg);
  }

  .searchbar {
    position: static;
    top: auto;
    right: auto;
    width: auto;
    height: 44px;
    padding: 0 8px 0 14px;
    gap: 8px;
  }

  .searchbar__input {
    font-size: 14px;
  }

  .searchbar__hint {
    display: none;
  }

  .to-top {
    height: 42px;
    padding: 0 15px;
  }

  .site-main {
    padding-left: 0;
    padding-top: 84px;
  }

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

  .site-footer {
    margin-left: 0;
  }

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

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

  #main-content {
    scroll-margin-top: 80px;
  }
}

/* ---------- 14. 手机 ---------- */
@media (max-width: 599px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: 1fr;
  }

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

  .footer__brand,
  .footer__contact {
    grid-column: auto;
  }

  .nav-toggle {
    padding: 0 13px;
  }

  .searchbar {
    height: 42px;
  }

  .rail {
    padding: 72px 16px 28px;
  }

  .nav-link {
    padding: 13px 15px;
    font-size: 15px;
  }

  .to-top__text {
    display: none;
  }

  .to-top {
    width: 44px;
    justify-content: center;
    padding: 0;
  }
}

/* ---------- 15. 减少动效 ---------- */
@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;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }

  .is-hit {
    animation: none;
    background-size: 100% 100%;
  }
}
