/* ==========================================================================
   战斗吧精灵 · 复古-现代宝可梦图鉴风设计系统
   main.css —— 核心设计系统(CSS 变量 + reset + 通用组件类)
   ========================================================================== */

/* ---------- 字体引入(Bricolage Grotesque + Plus Jakarta Sans + JetBrains Mono) ---------- */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,700;12..96,800&family=Plus+Jakarta+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;700&display=swap');

/* ==========================================================================
   1. 设计令牌 (Design Tokens)
   ========================================================================== */
:root {
  /* --- 配色:深空 + 电光 + 战斗红 --- */
  --bg-deep: #0B1020;          /* 深夜墨蓝背景 */
  --bg-soft: #0F1530;          /* 次级背景 */
  --surface: #141B30;          /* 卡片 */
  --surface-hover: #1A2240;    /* 卡片 hover */
  --border: #2A3358;           /* 边框 */
  --border-strong: #3D4870;    /* 强边框 */
  --text: #F5F0E1;             /* 米白主文字,复古纸质感 */
  --text-muted: #9BA3C7;       /* 次级文字 */
  --text-dim: #6A739A;         /* 暗淡文字 */

  --electric: #FFD23F;         /* 皮卡丘黄,主色调 */
  --electric-soft: #FFE890;    /* 电光黄淡色 */
  --battle: #E63946;           /* 战斗红 */
  --pokeball: #EE1515;         /* 精灵球红 */

  /* --- 18 种宝可梦类型色 --- */
  --grass: #44CF85;
  --water: #2FA8E0;
  --fire: #FF8A3D;
  --electric-type: #FFD23F;
  --normal: #B7B7AA;
  --fighting: #E09C40;
  --flying: #90A8F0;
  --poison: #9A4DA0;
  --ground: #E0C068;
  --rock: #B8A038;
  --bug: #A8B820;
  --ghost: #705898;
  --steel: #B8B8D0;
  --psychic: #F85888;
  --ice: #98D8D8;
  --dragon: #7038F8;
  --dark: #5A4848;
  --fairy: #EE99AC;

  /* --- 字体 --- */
  --font-display: 'Bricolage Grotesque', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Plus Jakarta Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* --- 间距 (0.25rem 步进) --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-7: 2rem;
  --space-8: 2.5rem;
  --space-9: 3rem;
  --space-10: 4rem;
  --space-11: 5rem;
  --space-12: 6rem;
  --space-14: 7rem;

  /* --- 圆角 --- */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* --- 阴影 --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(255, 210, 63, 0.4), 0 0 8px rgba(255, 210, 63, 0.6);
  --shadow-inner-pokedex: inset 0 1px 0 rgba(255, 255, 255, 0.04), inset 0 0 0 1px rgba(255, 210, 63, 0.06);

  /* --- 噪点纹理路径(便于复用) --- */
  --noise-url: url('/assets/img/noise.svg');

  /* --- 过渡 --- */
  --transition-fast: 150ms ease-out;
  --transition-base: 250ms ease-out;
  --transition-slow: 400ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ==========================================================================
   2. 全局 Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 噪点纹理叠层 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: var(--noise-url);
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.04;
  pointer-events: none;
  z-index: 0;
}

/* 径向渐变 mesh(电光黄 + 战斗红微光) */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, rgba(255, 210, 63, 0.08), transparent 60%),
    radial-gradient(ellipse 60% 50% at 100% 30%, rgba(230, 57, 70, 0.06), transparent 60%),
    radial-gradient(ellipse 70% 60% at 50% 100%, rgba(47, 168, 224, 0.05), transparent 60%);
  mix-blend-mode: screen;
  opacity: 0.3;
  pointer-events: none;
  z-index: 0;
}

main, header, footer, section, nav {
  position: relative;
  z-index: 1;
}

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

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

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

ul, ol {
  list-style: none;
}

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

hr {
  border: none;
}

/* 选中高亮 */
::selection {
  background: var(--electric);
  color: var(--bg-deep);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-soft);
}
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--electric);
}

/* ==========================================================================
   3. 容器
   ========================================================================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-sm {
  max-width: 768px;
}

.container-lg {
  max-width: 1400px;
}

@media (min-width: 640px) {
  .container { padding: 0 1.5rem; }
}

@media (min-width: 1024px) {
  .container { padding: 0 2rem; }
}

/* ==========================================================================
   4. 排版工具类
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.h3 { font-size: clamp(1.25rem, 2vw, 1.75rem); font-weight: 700; line-height: 1.25; }
.h4 { font-size: clamp(1.1rem, 1.5vw, 1.35rem); font-weight: 700; line-height: 1.3; }
.h5 { font-size: 1.05rem; font-weight: 700; line-height: 1.35; }
.h6 { font-size: 0.95rem; font-weight: 700; line-height: 1.4; }

.text-display { font-family: var(--font-display); }
.text-mono    { font-family: var(--font-mono); }

.text-electric { color: var(--electric); }
.text-battle   { color: var(--battle); }
.text-muted    { color: var(--text-muted); }
.text-dim      { color: var(--text-dim); }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.font-bold     { font-weight: 700; }
.font-extrabold{ font-weight: 800; }

.lead {
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--electric);
}

/* ==========================================================================
   5. 通用组件类
   ========================================================================== */

/* --- 按钮 --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: transform var(--transition-fast), box-shadow var(--transition-base),
              background var(--transition-base), border-color var(--transition-base);
  white-space: nowrap;
  user-select: none;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--electric);
  color: var(--bg-deep);
  box-shadow: 0 4px 16px rgba(255, 210, 63, 0.3);
}
.btn-primary:hover {
  background: var(--electric-soft);
  box-shadow: 0 6px 24px rgba(255, 210, 63, 0.5);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-secondary:hover {
  border-color: var(--electric);
  color: var(--electric);
  background: rgba(255, 210, 63, 0.06);
}

.btn-battle {
  background: var(--battle);
  color: #fff;
  box-shadow: 0 4px 16px rgba(230, 57, 70, 0.35);
}
.btn-battle:hover {
  background: #ff4757;
  box-shadow: 0 6px 24px rgba(230, 57, 70, 0.55);
}

.btn-download {
  padding: 1rem 2rem;
  font-size: 1.05rem;
  background: var(--electric);
  color: var(--bg-deep);
  box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.6);
  animation: pulse-glow 2.4s ease-in-out infinite;
}
.btn-download:hover {
  background: var(--electric-soft);
  transform: translateY(-2px);
}

/* --- 卡片 --- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md), var(--shadow-inner-pokedex);
  transition: transform var(--transition-base), border-color var(--transition-base),
              box-shadow var(--transition-base), background var(--transition-base);
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--electric);
  background: var(--surface-hover);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 210, 63, 0.4),
              0 0 32px rgba(255, 210, 63, 0.15);
}

.card-glow {
  border-color: rgba(255, 210, 63, 0.35);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  animation: pulse-glow 3.2s ease-in-out infinite;
}

/* --- 徽章 --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
}

/* 18 种类型徽章变体 */
.badge-type-grass     { background: rgba(68, 207, 133, 0.15); color: var(--grass);     border-color: rgba(68, 207, 133, 0.4); }
.badge-type-water     { background: rgba(47, 168, 224, 0.15); color: var(--water);     border-color: rgba(47, 168, 224, 0.4); }
.badge-type-fire      { background: rgba(255, 138, 61, 0.15); color: var(--fire);      border-color: rgba(255, 138, 61, 0.4); }
.badge-type-electric  { background: rgba(255, 210, 63, 0.15); color: var(--electric);  border-color: rgba(255, 210, 63, 0.4); }
.badge-type-normal    { background: rgba(183, 183, 170, 0.15); color: var(--normal);   border-color: rgba(183, 183, 170, 0.4); }
.badge-type-fighting  { background: rgba(224, 156, 64, 0.15); color: var(--fighting);  border-color: rgba(224, 156, 64, 0.4); }
.badge-type-flying    { background: rgba(144, 168, 240, 0.15); color: var(--flying);    border-color: rgba(144, 168, 240, 0.4); }
.badge-type-poison    { background: rgba(154, 77, 160, 0.18); color: var(--poison);    border-color: rgba(154, 77, 160, 0.45); }
.badge-type-ground    { background: rgba(224, 192, 104, 0.15); color: var(--ground);    border-color: rgba(224, 192, 104, 0.4); }
.badge-type-rock      { background: rgba(184, 160, 56, 0.15); color: var(--rock);      border-color: rgba(184, 160, 56, 0.4); }
.badge-type-bug       { background: rgba(168, 184, 32, 0.15); color: var(--bug);       border-color: rgba(168, 184, 32, 0.4); }
.badge-type-ghost     { background: rgba(112, 88, 152, 0.18); color: var(--ghost);     border-color: rgba(112, 88, 152, 0.45); }
.badge-type-steel     { background: rgba(184, 184, 208, 0.15); color: var(--steel);     border-color: rgba(184, 184, 208, 0.4); }
.badge-type-psychic   { background: rgba(248, 88, 136, 0.15); color: var(--psychic);   border-color: rgba(248, 88, 136, 0.4); }
.badge-type-ice       { background: rgba(152, 216, 216, 0.15); color: var(--ice);       border-color: rgba(152, 216, 216, 0.4); }
.badge-type-dragon    { background: rgba(112, 56, 248, 0.18); color: var(--dragon);    border-color: rgba(112, 56, 248, 0.45); }
.badge-type-dark      { background: rgba(90, 72, 72, 0.25); color: var(--dark);        border-color: rgba(90, 72, 72, 0.55); }
.badge-type-fairy     { background: rgba(238, 153, 172, 0.15); color: var(--fairy);     border-color: rgba(238, 153, 172, 0.4); }

/* --- 表单输入 --- */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-body);
  transition: border-color var(--transition-base), box-shadow var(--transition-base),
              background var(--transition-base);
}
.input::placeholder {
  color: var(--text-dim);
}
.input:hover {
  border-color: var(--border-strong);
}
.input:focus {
  outline: none;
  border-color: var(--electric);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(255, 210, 63, 0.15);
}

textarea.input {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

/* --- 分割线(电光黄 + 精灵球装饰) --- */
.divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 3rem 0;
  position: relative;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
}
.divider-pokeball {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  background: url('/assets/img/pokeball.svg') center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(255, 210, 63, 0.4));
}

/* --- 区块 --- */
.section {
  padding: 5rem 0;
  position: relative;
}
@media (min-width: 1024px) {
  .section { padding: 7rem 0; }
}

.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.section-number {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--electric);
  letter-spacing: 0.05em;
  white-space: nowrap;
  position: relative;
  padding-left: 1.5rem;
}
.section-number::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--electric);
  box-shadow: 0 0 12px var(--electric);
}

/* --- 网格 --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* --- 标签 --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all var(--transition-base);
}
.tag:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.tag-electric {
  background: rgba(255, 210, 63, 0.1);
  border-color: rgba(255, 210, 63, 0.35);
  color: var(--electric);
}
.tag-battle {
  background: rgba(230, 57, 70, 0.1);
  border-color: rgba(230, 57, 70, 0.35);
  color: var(--battle);
}

/* --- 骨架屏 --- */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius-md);
}
.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.04) 50%,
    transparent 100%);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}
@keyframes skeleton-pulse {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   6. 动效工具类
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 210, 63, 0.6),
                       0 4px 16px rgba(255, 210, 63, 0.3); }
  50%      { box-shadow: 0 0 0 12px rgba(255, 210, 63, 0),
                       0 4px 24px rgba(255, 210, 63, 0.5); }
}
@keyframes bounce-soft {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.animate-fade-in    { animation: fadeIn 0.8s ease-out both; }
.animate-slide-up   { animation: slideUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) both; }
.animate-float      { animation: float 4s ease-in-out infinite; }
.animate-pulse      { animation: pulse-glow 2.4s ease-in-out infinite; }
.animate-spin-slow  { animation: spin-slow 12s linear infinite; }
.animate-bounce-soft{ animation: bounce-soft 2.6s ease-in-out infinite; }

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* IntersectionObserver 初始隐藏状态 */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ==========================================================================
   7. 焦点可见样式
   ========================================================================== */
:focus-visible {
  outline: 2px solid var(--electric);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.btn:focus-visible,
a:focus-visible,
.input:focus-visible,
.card:focus-visible,
button:focus-visible {
  outline: 2px solid var(--electric);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   8. 导航
   ========================================================================== */
.nav-link {
  position: relative;
  padding: 0.5rem 0.25rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition-base);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--electric);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--transition-base);
  border-radius: 2px;
}
.nav-link:hover,
.nav-link[aria-current="page"] {
  color: var(--electric);
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
}

/* --- 下拉菜单 --- */
.dropdown {
  position: relative;
}
.dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-base), transform var(--transition-base), visibility var(--transition-base);
  z-index: 50;
}
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu,
.dropdown[data-open="true"] .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-item {
  display: block;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.dropdown-item:hover {
  background: var(--surface-hover);
  color: var(--electric);
}

/* --- 移动端菜单 --- */
.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: min(85vw, 360px);
  height: 100vh;
  background: var(--bg-soft);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 5rem 1.5rem 2rem;
  transform: translateX(100%);
  transition: transform var(--transition-slow);
  z-index: 90;
  overflow-y: auto;
}
.mobile-menu[data-open="true"] {
  transform: translateX(0);
}
.mobile-menu .nav-link {
  display: block;
  padding: 0.85rem 0;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.mobile-menu .nav-link::after { display: none; }

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
  z-index: 80;
}
.menu-backdrop[data-open="true"] {
  opacity: 1;
  visibility: visible;
}

.hamburger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   9. 页脚
   ========================================================================== */
.footer {
  background: var(--bg-soft);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
  position: relative;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--electric), transparent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
}
.footer-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--electric);
  margin-bottom: 1rem;
}
.footer-link {
  display: block;
  padding: 0.35rem 0;
  color: var(--text-muted);
  font-size: 0.92rem;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}
.footer-link:hover {
  color: var(--electric);
  padding-left: 4px;
}
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.85rem;
}

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

.flex          { display: flex; }
.inline-flex   { display: inline-flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-center{ justify-content: center; }
.justify-between{ justify-content: space-between; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.hidden          { display: none !important; }
.block           { display: block; }
.rounded-sm      { border-radius: var(--radius-sm); }
.rounded-md      { border-radius: var(--radius-md); }
.rounded-lg      { border-radius: var(--radius-lg); }
.rounded-full    { border-radius: var(--radius-full); }
.shadow-sm       { box-shadow: var(--shadow-sm); }
.shadow-md       { box-shadow: var(--shadow-md); }
.shadow-lg       { box-shadow: var(--shadow-lg); }

/* 桌面/移动端显隐 */
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
}
@media (min-width: 768px) {
  .mobile-only { display: none !important; }
}
