/* ==========================================================================
   《星际游轮：漂流星海》静态站点样式（HUD / Sci-Fi FUI 风格）
   仅依赖系统字体，无外部资源，可离线打开。
   ========================================================================== */

:root {
  --bg: #04060d;
  --bg-2: #070d1a;
  --panel: rgba(14, 24, 42, 0.72);
  --panel-solid: #0d1626;
  --inset: rgba(6, 12, 24, 0.72);
  --line: rgba(90, 209, 255, 0.20);
  --line-strong: rgba(90, 209, 255, 0.42);
  --text: #dbe6f5;
  --text-dim: #a7b8d2;
  --muted: #7d90ad;
  --cyan: #5ad1ff;
  --blue: #4f9dff;
  --pink: #ff5d8f;
  --gold: #ffd479;
  --green: #5ee0a8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 14% -8%, rgba(79, 157, 255, 0.16), transparent 62%),
    radial-gradient(900px 560px at 92% 4%, rgba(255, 93, 143, 0.11), transparent 60%),
    radial-gradient(1200px 800px at 50% 110%, rgba(90, 209, 255, 0.09), transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 46%, var(--bg) 100%);
  line-height: 1.75;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* 星点背景（纯 CSS，无图片） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image:
    radial-gradient(1.4px 1.4px at 12% 22%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 68% 12%, #cfe6ff, transparent),
    radial-gradient(1.6px 1.6px at 34% 68%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 82% 58%, #bcd8ff, transparent),
    radial-gradient(1.3px 1.3px at 52% 88%, #fff, transparent),
    radial-gradient(1px 1px at 24% 46%, #9fc4ee, transparent);
  background-size: 520px 520px, 640px 640px, 780px 780px, 460px 460px, 700px 700px, 380px 380px;
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

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

code, kbd, samp, pre, .num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

code {
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.42em;
  font-size: 0.88em;
  color: #cfe9ff;
  word-break: break-word;
}

.wrap { width: min(1180px, 100% - 40px); margin: 0 auto; position: relative; z-index: 1; }

/* ---------------------------------------------------------------- 顶部导航 */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(5, 8, 16, 0.94), rgba(5, 8, 16, 0.72));
  border-bottom: 1px solid var(--line);
}

.site-nav .bar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 62px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 26px; height: 26px; flex: none;
  border: 1.6px solid var(--cyan);
  border-radius: 50%;
  position: relative;
  box-shadow: 0 0 14px rgba(90, 209, 255, 0.5) inset, 0 0 10px rgba(90, 209, 255, 0.3);
}
.brand .mark::after {
  content: ""; position: absolute; inset: 5px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #eaf7ff, var(--cyan) 62%, #1b6c95);
}
.brand .sub { color: var(--muted); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.16em; }

.nav-links { margin-left: auto; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav-links a {
  color: var(--text-dim);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px solid transparent;
}
.nav-links a:hover { color: var(--text); background: rgba(90, 209, 255, 0.08); text-decoration: none; }
.nav-links a.cta {
  color: #04121c;
  background: linear-gradient(180deg, #8fe4ff, var(--cyan));
  border-color: rgba(255, 255, 255, 0.35);
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(90, 209, 255, 0.28);
}
.nav-links a.cta:hover { filter: brightness(1.08); }
.nav-toggle { display: none; }

@media (max-width: 860px) {
  .site-nav .bar { flex-wrap: wrap; padding: 10px 0; min-height: 0; }
  .nav-toggle {
    display: inline-flex; margin-left: auto;
    background: rgba(90, 209, 255, 0.1); color: var(--cyan);
    border: 1px solid var(--line-strong); border-radius: 8px;
    padding: 6px 12px; font-size: 0.85rem; cursor: pointer;
  }
  .nav-links { display: none; width: 100%; margin-left: 0; padding: 8px 0 4px; gap: 6px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 9px 14px; }
}

/* --------------------------------------------------------------------- Hero */
.hero { padding: 68px 0 30px; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 1.28fr; gap: 40px; align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; gap: 26px; } .hero { padding-top: 40px; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.74rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--cyan);
  border: 1px solid var(--line-strong);
  background: rgba(90, 209, 255, 0.07);
  padding: 5px 12px; border-radius: 999px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }

h1.title {
  font-size: clamp(2.1rem, 4.6vw, 3.5rem);
  line-height: 1.14;
  margin: 18px 0 10px;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, #ffffff 8%, #bfe6ff 46%, var(--cyan) 78%, #9d7bff 105%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.title-sub { color: var(--text-dim); font-size: 1.04rem; max-width: 46ch; }
.tagline {
  margin: 18px 0 0; padding: 14px 16px;
  border-left: 3px solid var(--cyan);
  background: linear-gradient(90deg, rgba(90, 209, 255, 0.10), transparent 80%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #e8f4ff; font-size: 1rem;
}

.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 24px; }
.stat {
  flex: 1 1 118px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 14px;
}
.stat b { display: block; font-family: var(--mono); font-size: 1.35rem; color: var(--cyan); line-height: 1.25; }
.stat span { font-size: 0.76rem; color: var(--muted); letter-spacing: 0.08em; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 12px 22px; border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(90, 209, 255, 0.09);
  color: var(--text); font-weight: 600; font-size: 0.98rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.4); }
.btn.primary {
  background: linear-gradient(180deg, #8fe4ff, var(--cyan));
  color: #04121c; border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 10px 30px rgba(90, 209, 255, 0.3);
}
.btn.ghost { background: rgba(255, 255, 255, 0.03); color: var(--text-dim); }

.hero-shot {
  position: relative; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow), 0 0 0 1px rgba(90, 209, 255, 0.08);
  background: #04070f;
}
.hero-shot img { width: 100%; }
.hero-shot::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 62%, rgba(4, 7, 15, 0.55));
}

/* ----------------------------------------------------------------- Sections */
section.block { padding: 46px 0; }
section.block > .wrap > h2 {
  font-size: clamp(1.4rem, 2.6vw, 1.95rem);
  margin: 0 0 6px;
  letter-spacing: 0.02em;
}
.section-lead { color: var(--muted); margin: 0 0 26px; max-width: 74ch; font-size: 0.95rem; }

.divider {
  height: 1px; border: 0; margin: 0;
  background: linear-gradient(90deg, transparent, var(--line-strong) 22%, var(--line-strong) 78%, transparent);
}

/* ------------------------------------------------------------------ Feature 卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); gap: 16px; }
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  overflow: hidden;
  transition: border-color 0.2s ease, transform 0.16s ease;
}
.card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--cyan), transparent 92%);
  opacity: 0.65;
}
.card h3 { margin: 0 0 8px; font-size: 1.06rem; letter-spacing: 0.01em; }
.card p { margin: 0 0 10px; color: var(--text-dim); font-size: 0.92rem; }
.card ul { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 0.9rem; }
.card li { margin: 3px 0; }
.card .idx {
  font-family: var(--mono); font-size: 0.74rem; color: var(--cyan);
  letter-spacing: 0.18em; display: block; margin-bottom: 6px; opacity: 0.85;
}

/* ---------------------------------------------------------------- 截图画廊 */
.gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.shot {
  position: relative; margin: 0; cursor: zoom-in;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  overflow: hidden; background: #04070f;
}
.shot img { width: 100%; transition: transform 0.35s ease; }
.shot:hover img { transform: scale(1.03); }
.shot figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 14px 10px; font-size: 0.84rem; color: #eaf4ff;
  background: linear-gradient(180deg, transparent, rgba(4, 7, 15, 0.92));
}

/* --------------------------------------------------------------- 时间线/路径 */
.timeline { display: grid; gap: 12px; }
.step {
  display: grid; grid-template-columns: 62px 1fr auto; gap: 16px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 18px;
}
.step .no {
  font-family: var(--mono); font-size: 1.3rem; color: var(--cyan);
  text-align: center; border-right: 1px solid var(--line); padding-right: 10px;
}
.step .what b { display: block; }
.step .what span { color: var(--muted); font-size: 0.88rem; }
.step .when { font-family: var(--mono); color: var(--gold); font-size: 0.86rem; white-space: nowrap; }
@media (max-width: 620px) {
  .step { grid-template-columns: 46px 1fr; }
  .step .when { grid-column: 2; justify-self: start; }
}

/* ------------------------------------------------------------------- FAQ */
.faq { display: grid; gap: 10px; max-width: 900px; }
.faq details {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 18px;
}
.faq summary { cursor: pointer; font-weight: 600; color: #e9f3ff; }
.faq summary::marker { color: var(--cyan); }
.faq details[open] { border-color: var(--line-strong); }
.faq p { margin: 10px 0 4px; color: var(--text-dim); font-size: 0.93rem; }

/* ------------------------------------------------------------------ CTA 底 */
.cta-box {
  margin: 30px 0 60px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 34px clamp(20px, 4vw, 44px);
  background:
    radial-gradient(600px 240px at 12% 0%, rgba(90, 209, 255, 0.16), transparent 70%),
    radial-gradient(560px 240px at 92% 100%, rgba(255, 93, 143, 0.13), transparent 70%),
    var(--panel-solid);
  display: flex; flex-wrap: wrap; gap: 22px; align-items: center; justify-content: space-between;
}
.cta-box h2 { margin: 0 0 6px; font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
.cta-box p { margin: 0; color: var(--text-dim); }

/* ------------------------------------------------------------------- Footer */
.site-foot {
  border-top: 1px solid var(--line);
  padding: 26px 0 40px;
  color: var(--muted); font-size: 0.86rem;
}
.site-foot .row { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; }
.site-foot a { color: var(--text-dim); }

/* =========================================================== Wiki 页面布局 */
.wiki-layout {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  padding: 26px 0 70px;
}
@media (max-width: 1040px) { .wiki-layout { grid-template-columns: 1fr; gap: 18px; } }

.toc-panel {
  position: sticky; top: 78px;
  max-height: calc(100vh - 100px);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 1040px) {
  .toc-panel { position: static; max-height: none; }
  .toc-panel.collapsed .toc-body { display: none; }
}
.toc-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  font-size: 0.78rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cyan);
}
.toc-head button {
  margin-left: auto; background: transparent; border: 1px solid var(--line-strong);
  color: var(--cyan); border-radius: 6px; font-size: 0.74rem; padding: 4px 9px; cursor: pointer;
}
.toc-search {
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.toc-search input {
  width: 100%; padding: 8px 11px; font-size: 0.86rem;
  background: var(--inset); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; outline: none;
}
.toc-search input:focus { border-color: var(--line-strong); }
.toc-body { overflow-y: auto; padding: 10px 8px 16px; }
.toc-body ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc-body a {
  display: block; padding: 6px 12px; border-radius: 8px;
  color: var(--text-dim); font-size: 0.88rem; border-left: 2px solid transparent;
}
.toc-body a:hover { background: rgba(90, 209, 255, 0.08); color: var(--text); text-decoration: none; }
.toc-body a.lv3 { padding-left: 26px; font-size: 0.83rem; color: var(--muted); }
.toc-body a.active { color: var(--cyan); background: rgba(90, 209, 255, 0.11); border-left-color: var(--cyan); }
.toc-body li.hide { display: none; }
.toc-empty { color: var(--muted); font-size: 0.84rem; padding: 8px 12px; }

/* 文档正文 */
.doc {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 3.4vw, 44px);
  min-width: 0;
}
.doc > *:first-child { margin-top: 0; }
.doc h1 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 0 0 14px; letter-spacing: 0.02em; }
.doc h2 {
  font-size: clamp(1.28rem, 2.4vw, 1.65rem);
  margin: 46px 0 12px; padding-top: 18px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 86px;
}
.doc h2:first-of-type { border-top: 0; padding-top: 0; margin-top: 22px; }
.doc h3 { font-size: 1.1rem; margin: 28px 0 10px; color: #e9f4ff; scroll-margin-top: 86px; }
.doc h4 { font-size: 1rem; margin: 20px 0 8px; color: var(--text-dim); }
.doc p { margin: 12px 0; color: var(--text-dim); }
.doc strong { color: #f2f8ff; }
.doc ul, .doc ol { color: var(--text-dim); padding-left: 24px; }
.doc li { margin: 5px 0; }
.doc hr { height: 1px; border: 0; margin: 30px 0; background: linear-gradient(90deg, transparent, var(--line-strong), transparent); }
.doc blockquote {
  margin: 16px 0; padding: 12px 16px;
  border-left: 3px solid var(--cyan);
  background: linear-gradient(90deg, rgba(90, 209, 255, 0.09), transparent 85%);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-dim);
}
.doc blockquote p { margin: 4px 0; }
.doc pre {
  background: #050a14; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; overflow-x: auto; font-size: 0.86rem; color: #cfe9ff;
}
.doc pre code { background: transparent; border: 0; padding: 0; }

.table-scroll { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.9rem; min-width: 520px; }
.doc thead th {
  background: rgba(90, 209, 255, 0.10);
  color: #eaf6ff; font-weight: 600; text-align: left; white-space: nowrap;
}
.doc th, .doc td { padding: 9px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.017); }
.doc tbody tr:hover { background: rgba(90, 209, 255, 0.055); }
.doc td:first-child { color: var(--text); }

.doc figure { margin: 20px 0; }
.doc figure img {
  width: 100%; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); cursor: zoom-in;
  box-shadow: var(--shadow);
}
.doc figcaption { margin-top: 8px; font-size: 0.84rem; color: var(--muted); text-align: center; }

/* 页面级链接 */
.pager { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 34px; }
.pager a {
  flex: 1 1 220px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02); color: var(--text-dim);
}
.pager a:hover { border-color: var(--line-strong); color: var(--text); text-decoration: none; }
.pager b { display: block; color: var(--text); }

/* --------------------------------------------------------------- 图片灯箱 */
.lightbox {
  position: fixed; inset: 0; z-index: 90;
  display: none; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(2, 5, 11, 0.93);
  backdrop-filter: blur(6px);
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(1500px, 96vw); max-height: 88vh;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
}
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next {
  position: absolute; background: rgba(90, 209, 255, 0.12);
  border: 1px solid var(--line-strong); color: var(--cyan);
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
}
.lightbox .lb-close { top: 18px; right: 18px; }
.lightbox .lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-cap {
  position: absolute; bottom: 18px; left: 0; right: 0; text-align: center;
  color: var(--text-dim); font-size: 0.88rem; padding: 0 20px;
}

/* ------------------------------------------------------------------ 小工具 */
.to-top {
  position: fixed; right: 20px; bottom: 22px; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(9, 18, 32, 0.9);
  color: var(--cyan); cursor: pointer; display: none;
  align-items: center; justify-content: center; font-size: 1.1rem;
  backdrop-filter: blur(8px);
}
.to-top.show { display: flex; }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.center { text-align: center; }

@media print {
  .site-nav, .toc-panel, .to-top, .lightbox, .cta-box, .site-foot { display: none !important; }
  body { background: #fff; color: #111; }
  .doc { border: 0; background: #fff; }
}
