/* ═══════════════════════════════════════════════════════════════
   Xonotic 游戏介绍 / 下载页 — 与 AI4U Classroom 门户共享设计语言
   变量与 app/globals.css 保持一致（oklch，亮/暗双主题）
   ═══════════════════════════════════════════════════════════════ */

:root {
  --background: oklch(0.99 0.003 90);
  --foreground: oklch(0.21 0.02 260);
  --card: oklch(1 0 0);
  --primary: oklch(0.45 0.18 260);
  --primary-foreground: oklch(0.99 0.003 90);
  --muted: oklch(0.96 0.005 90);
  --muted-foreground: oklch(0.50 0.02 260);
  --accent: oklch(0.95 0.02 85);
  --border: oklch(0.90 0.01 90);

  /* Xonotic 品牌色：游戏队服橙红 + 能量蓝 */
  --xon: oklch(0.62 0.19 40);
  --xon-soft: oklch(0.62 0.19 40 / 0.12);
  --xon-border: oklch(0.62 0.19 40 / 0.28);
  --cyan: oklch(0.62 0.13 220);

  --radius: 14px;
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

html[data-theme='dark'], html.dark {
  --background: oklch(0.15 0.015 260);
  --foreground: oklch(0.94 0.01 90);
  --card: oklch(0.19 0.018 260);
  --primary: oklch(0.55 0.20 260);
  --primary-foreground: oklch(0.10 0.015 260);
  --muted: oklch(0.22 0.02 260);
  --muted-foreground: oklch(0.65 0.015 90);
  --accent: oklch(0.30 0.06 75);
  --border: oklch(0.28 0.02 260);

  --xon: oklch(0.72 0.18 45);
  --xon-soft: oklch(0.72 0.18 45 / 0.14);
  --xon-border: oklch(0.72 0.18 45 / 0.32);
  --cyan: oklch(0.70 0.13 220);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* ── 顶部导航（与门户一致的 sticky 细导航） ── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 92%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav-brand svg { width: 26px; height: 26px; flex-shrink: 0; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  padding: 7px 11px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--muted-foreground);
  transition: background 0.16s, color 0.16s;
  white-space: nowrap;
}
.nav-links a:hover { background: var(--muted); color: var(--foreground); }
.nav-links a.active { background: var(--xon-soft); color: var(--xon); font-weight: 600; }
.nav-links a.cta {
  background: var(--xon);
  color: #fff;
  font-weight: 600;
}
.nav-links a.cta:hover { filter: brightness(1.08); color: #fff; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 35%;
  opacity: 0.30;
  filter: saturate(0.85);
}
html[data-theme='dark'] .hero-bg, html.dark .hero-bg { opacity: 0.42; }
.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in oklab, var(--background) 55%, transparent) 0%,
    color-mix(in oklab, var(--background) 82%, transparent) 55%,
    var(--background) 100%
  );
}
.hero-inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px 20px 60px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 40px;
  align-items: center;
}
.hero-copy { min-width: 0; }

/* 右侧主视觉：倾斜叠放的实机截图 */
.hero-visual {
  position: relative;
  min-width: 0;
}
.hero-visual .main-shot {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--xon-border);
  box-shadow:
    0 22px 50px oklch(0 0 0 / 0.42),
    0 0 0 1px oklch(1 0 0 / 0.05) inset;
  aspect-ratio: 16 / 10;
  background: #000;
}
.hero-visual .main-shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.hero-visual .main-shot::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, transparent 45%, oklch(0 0 0 / 0.55));
  pointer-events: none;
}
/* 角标：GPLv3 徽章 */
.hero-visual .visual-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: oklch(0 0 0 / 0.55);
  border: 1px solid oklch(1 0 0 / 0.18);
  backdrop-filter: blur(6px);
}
/* 右下漂浮的小截图，营造层次 */
.hero-visual .float-shot {
  position: absolute;
  right: -14px;
  bottom: -26px;
  width: 46%;
  border-radius: 11px;
  overflow: hidden;
  border: 1px solid var(--xon-border);
  box-shadow: 0 16px 34px oklch(0 0 0 / 0.48);
  aspect-ratio: 16 / 9;
  background: #000;
}
.hero-visual .float-shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* 左上角装饰性光晕 */
.hero-visual::before {
  content: '';
  position: absolute;
  left: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--xon-soft), transparent 68%);
  filter: blur(18px);
  pointer-events: none;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--xon);
  background: var(--xon-soft);
  border: 1px solid var(--xon-border);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 800;
}
.hero h1 .accent { color: var(--xon); }
.hero-sub {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-weight: 600;
}
.hero-desc {
  margin: 0 0 26px;
  max-width: 620px;
  font-size: 15px;
  color: var(--muted-foreground);
}

/* ── 服务器连接卡片 ── */
.connect-card {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--xon-border);
  background: var(--card);
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.04);
}
.connect-item { display: flex; flex-direction: column; gap: 3px; }
.connect-label {
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  font-weight: 600;
}
.connect-value {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--foreground);
}
.connect-value.hl { color: var(--xon); }
.copy-btn {
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--foreground);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 9px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.copy-btn:hover { background: var(--accent); border-color: var(--xon-border); }
.copy-btn.done { background: var(--xon); color: #fff; border-color: var(--xon); }

/* ── 状态徽章 ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--muted);
  color: var(--muted-foreground);
}
.badge.ok { border-color: oklch(0.60 0.15 155 / 0.35); background: oklch(0.60 0.15 155 / 0.13); color: oklch(0.50 0.14 155); }
html[data-theme='dark'] .badge.ok, html.dark .badge.ok { color: oklch(0.78 0.15 155); }
.badge.warn { border-color: var(--xon-border); background: var(--xon-soft); color: var(--xon); }
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in oklab, currentColor 22%, transparent);
}
.dot.pulse { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ── Section ── */
.section { padding: 56px 0; border-bottom: 1px solid var(--border); }
.section:last-of-type { border-bottom: none; }
.section-head { margin-bottom: 28px; }
.section-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--xon);
  margin-bottom: 7px;
}
.section h2 {
  margin: 0 0 8px;
  font-size: clamp(20px, 3vw, 27px);
  letter-spacing: -0.02em;
  font-weight: 700;
}
.section-intro { margin: 0; color: var(--muted-foreground); font-size: 14px; max-width: 640px; }

/* ── 网格 ── */
.grid { display: grid; gap: 16px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ── 特性卡 ── */
.feat {
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  transition: border-color 0.18s, transform 0.18s, box-shadow 0.18s;
}
.feat:hover {
  border-color: var(--xon-border);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px oklch(0 0 0 / 0.06);
}
.feat-ico {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: var(--xon-soft);
  border: 1px solid var(--xon-border);
  font-size: 18px;
  margin-bottom: 13px;
}
.feat h3 { margin: 0 0 6px; font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.feat p { margin: 0; font-size: 12.5px; color: var(--muted-foreground); line-height: 1.6; }

/* ── 截图瀑布 ── */
.shots { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.shot {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
  aspect-ratio: 16 / 9;
  cursor: zoom-in;
}
.shot img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease, opacity 0.3s;
}
.shot:hover img { transform: scale(1.045); }
.shot .cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 12px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, oklch(0 0 0 / 0.75));
  opacity: 0;
  transition: opacity 0.25s;
}
.shot:hover .cap { opacity: 1; }

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  background: oklch(0 0 0 / 0.88);
  padding: 24px;
  cursor: zoom-out;
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 24px 60px oklch(0 0 0 / 0.6);
}

/* ── 表格 / 规格 ── */
.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.spec tr { border-bottom: 1px solid var(--border); }
.spec tr:last-child { border-bottom: none; }
.spec th {
  text-align: left;
  padding: 11px 16px;
  width: 38%;
  font-weight: 600;
  color: var(--muted-foreground);
  background: var(--muted);
  font-size: 12.5px;
  vertical-align: top;
}
.spec td { padding: 11px 16px; vertical-align: top; }
.spec code, code.inline {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--muted);
  border: 1px solid var(--border);
  padding: 1.5px 5px;
  border-radius: 5px;
}

/* ── 代码块 ── */
.code {
  position: relative;
  background: oklch(0.18 0.015 260);
  color: oklch(0.92 0.01 90);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 15px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  overflow-x: auto;
  line-height: 1.75;
  margin: 0;
}
.code .cmt { color: oklch(0.62 0.02 260); }

/* ── 步骤列表 ── */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.steps > li {
  position: relative;
  padding: 0 0 22px 44px;
  counter-increment: s;
  border-left: 1px solid var(--border);
  margin-left: 13px;
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(s);
  position: absolute;
  left: -13px; top: 0;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--xon);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.steps h4 { margin: 2px 0 5px; font-size: 14px; font-weight: 700; }
.steps p { margin: 0 0 8px; font-size: 13px; color: var(--muted-foreground); }
.steps p:last-child { margin-bottom: 0; }

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.17s;
  font-family: inherit;
}
.btn:hover { border-color: var(--xon-border); background: var(--muted); }
.btn-primary {
  background: var(--xon);
  border-color: var(--xon);
  color: #fff;
}
.btn-primary:hover { filter: brightness(1.09); background: var(--xon); color: #fff; }
.btn-lg { padding: 14px 24px; font-size: 15px; }

/* ── 下载平台卡 ── */
.dl-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  transition: border-color 0.18s, box-shadow 0.18s;
}
.dl-card.primary { border-color: var(--xon-border); box-shadow: 0 0 0 3px var(--xon-soft); }
.dl-os {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 700; margin-bottom: 4px;
}
.dl-meta { font-size: 12px; color: var(--muted-foreground); margin-bottom: 15px; }
.dl-card .btn { margin-top: auto; }

/* ── 提示框 ── */
.note {
  display: flex;
  gap: 11px;
  padding: 14px 16px;
  border-radius: 11px;
  border: 1px solid var(--xon-border);
  background: var(--xon-soft);
  font-size: 13px;
  line-height: 1.65;
}
.note.info {
  border-color: color-mix(in oklab, var(--cyan) 32%, transparent);
  background: color-mix(in oklab, var(--cyan) 11%, transparent);
}
.note-ico { flex-shrink: 0; font-size: 15px; line-height: 1.5; }
.note strong { font-weight: 700; }
.note p { margin: 0; }
.note p + p { margin-top: 6px; }

/* ── FAQ ── */
.faq { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.faq + .faq { margin-top: 10px; }
.faq summary {
  padding: 14px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.15s;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { background: var(--muted); }
.faq summary::after {
  content: '+';
  font-size: 17px;
  font-weight: 400;
  color: var(--muted-foreground);
  flex-shrink: 0;
  transition: transform 0.2s;
}
.faq[open] summary::after { transform: rotate(45deg); }
.faq-body {
  padding: 0 18px 15px;
  font-size: 13px;
  color: var(--muted-foreground);
  line-height: 1.75;
}
.faq-body p { margin: 0 0 8px; }
.faq-body p:last-child { margin-bottom: 0; }

/* ── 页脚 ── */
.foot {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  font-size: 11.5px;
  color: var(--muted-foreground);
}
.foot-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  /* Hero 改单列：视觉图放到文案下方 */
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 44px 20px 46px;
  }
  .hero-visual { max-width: 560px; }
  .hero-visual .float-shot { right: 0; bottom: -18px; width: 40%; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .shots { grid-template-columns: 1fr; }
  .section { padding: 40px 0; }
  .nav-links a:not(.cta):not(.active) { display: none; }
  .nav-links a { padding: 6px 9px; font-size: 12px; }
  .connect-card { width: 100%; }
  /* 手机上隐藏漂浮小图，避免遮挡 */
  .hero-visual .float-shot { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
