@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Space+Grotesk:wght@500;600;700&display=swap');

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0d0d0d;
  --panel: #14101c;
  --p: #8000ff;
  --a: #ff00ff;
  --ink: #ece7f7;
  --dim: #a89dbe;
  --line: rgba(128, 0, 255, 0.38);
  --line2: rgba(255, 0, 255, 0.28);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Space Grotesk", "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

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

body {
  margin: 0;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 10% -10%, rgba(128, 0, 255, 0.24), transparent 44%),
    radial-gradient(circle at 94% 2%, rgba(255, 0, 255, 0.14), transparent 48%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0 1px, rgba(0, 0, 0, 0) 1px 3px);
  opacity: 0.65;
}

::selection { background: rgba(255, 0, 255, 0.4); color: #fff; }

a { color: #c9a6ff; }

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

/* ---------- 顶部 HUD 条 ---------- */
.hud-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: rgba(10, 9, 14, 0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.hud-bar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--a), var(--p), transparent);
  opacity: 0.75;
}

.corner-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line2);
  border-radius: 12px;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.corner-mark:hover { border-color: var(--a); box-shadow: 0 0 18px rgba(255, 0, 255, 0.5); }

.mark-glyph {
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--a), var(--p));
  box-shadow: 0 0 12px rgba(255, 0, 255, 0.85);
}

.mark-img { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }

.hud-nav { flex: 1 1 auto; min-width: 0; }

.hud-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.hud-nav ul::-webkit-scrollbar { display: none; }

.hud-nav li { position: relative; flex: 0 0 auto; }

.hud-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  border-radius: 10px;
  transition: color 0.18s, background 0.18s, box-shadow 0.18s;
}

.hud-nav a:hover,
.hud-nav a:focus-visible {
  color: #fff;
  background: rgba(128, 0, 255, 0.22);
  box-shadow: inset 0 0 0 1px var(--line2);
}

.hud-nav .has-sub > a::after {
  content: "▾";
  margin-left: 8px;
  font-size: 12px;
  color: var(--a);
}

.sub { display: none; }

/* ---------- 主体 ---------- */
.hud-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 84px;
}

.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  grid-template-areas: "t a" "l a";
  align-content: center;
  gap: 20px 48px;
  padding: 112px 0 64px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(128, 0, 255, 0.55) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.4;
  -webkit-mask-image: radial-gradient(circle at 32% 42%, #000 18%, transparent 78%);
  mask-image: radial-gradient(circle at 32% 42%, #000 18%, transparent 78%);
}

.hero-title {
  grid-area: t;
  position: relative;
  margin: 0;
  font-weight: 700;
  font-size: clamp(38px, 5.6vw, 72px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 0 22px rgba(128, 0, 255, 0.7), 0 0 62px rgba(255, 0, 255, 0.32);
}

.hero-title::before,
.hero-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  opacity: 0.8;
  pointer-events: none;
}

.hero-title::before {
  color: #00f0ff;
  clip-path: inset(0 0 56% 0);
  transform: translate(-2px, -2px);
  animation: glitch-a 4.8s infinite steps(2, end);
}

.hero-title::after {
  color: var(--a);
  clip-path: inset(58% 0 0 0);
  transform: translate(2px, 2px);
  animation: glitch-b 5.6s infinite steps(2, end);
}

@keyframes glitch-a {
  0%, 86%, 100% { transform: translate(-2px, -2px); }
  90% { transform: translate(-8px, -1px); }
  94% { transform: translate(3px, -3px); }
}

@keyframes glitch-b {
  0%, 88%, 100% { transform: translate(2px, 2px); }
  92% { transform: translate(8px, 2px); }
  96% { transform: translate(-3px, 3px); }
}

.subtitle {
  margin: 0;
  color: var(--dim);
  font-size: 17px;
  max-width: 46ch;
}

.hero-lead {
  grid-area: l;
  align-self: start;
  padding-left: 16px;
  border-left: 2px solid var(--a);
}

.collage {
  grid-area: a;
  position: relative;
  margin: 0;
  min-height: min(62vh, 520px);
}

.collage::before {
  content: "";
  position: absolute;
  inset: 6% 4% 8% 6%;
  border: 1px dashed var(--line);
  border-radius: 28px;
  background-image: radial-gradient(rgba(255, 0, 255, 0.45) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.55;
}

.collage img {
  position: absolute;
  display: block;
  object-fit: cover;
  border-radius: 28px;
}

.ph-a {
  top: 0;
  right: 0;
  width: 72%;
  height: 74%;
  z-index: 2;
  border: 1px solid var(--p);
  box-shadow: 0 0 46px rgba(128, 0, 255, 0.45);
}

.ph-b {
  bottom: 0;
  left: 0;
  width: 54%;
  height: 52%;
  z-index: 1;
  border: 1px solid var(--a);
  box-shadow: 0 0 34px rgba(255, 0, 255, 0.35);
}

/* ---------- 正文区块 ---------- */
.hud-main > article:not(.hero) {
  position: relative;
  padding: 64px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 88px;
}

.hud-main > article:not(.hero)::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 74px;
  height: 1px;
  background: var(--a);
  box-shadow: 0 0 12px var(--a);
}

.hud-main h2 {
  position: relative;
  margin: 0 0 10px;
  padding-left: 16px;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 0, 255, 0.35);
}

.hud-main h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  bottom: 0.28em;
  width: 3px;
  background: linear-gradient(180deg, var(--a), var(--p));
  box-shadow: 0 0 12px var(--a);
}

.hud-main h2 + p,
.hud-main p.subtitle { color: var(--dim); }

.hud-main h3 {
  margin: 30px 0 8px;
  font-size: 20px;
  line-height: 1.5;
  color: #f4eeff;
}

.hud-main p { margin: 0 0 18px; max-width: 72ch; }

.hud-main ul,
.hud-main ol { margin: 0 0 20px; padding: 0; list-style: none; }

.hud-main li { position: relative; margin-bottom: 10px; padding-left: 22px; max-width: 72ch; }

.hud-main ul > li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--a);
}

.hud-main ol { counter-reset: hud; }

.hud-main ol > li { counter-increment: hud; }

.hud-main ol > li::before {
  content: counter(hud, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.36em;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--p);
}

.hud-main a {
  color: #c9a6ff;
  text-decoration: none;
  border-bottom: 1px solid var(--line2);
}

.hud-main a:hover { color: var(--a); }

.hud-main blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  border-left: 2px solid var(--p);
  border-radius: 0 18px 18px 0;
  background: rgba(128, 0, 255, 0.1);
  color: #ded4f2;
}

.hud-main img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.hud-main figure { margin: 24px 0; }

.hud-main table {
  width: 100%;
  margin: 0 0 22px;
  border-collapse: collapse;
  font-size: 16px;
}

.hud-main th,
.hud-main td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }

.hud-main th { background: rgba(128, 0, 255, 0.16); color: #fff; }

.hud-main code {
  font-family: var(--mono);
  font-size: 0.94em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 0, 255, 0.12);
}

/* ---------- 页脚 ---------- */
.hud-foot {
  border-top: 1px solid var(--line);
  padding: 52px max(24px, calc((100% - 1180px) / 2)) 30px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px 24px;
  background: linear-gradient(180deg, rgba(13, 13, 13, 0.9), #130b20);
}

.hud-foot p { margin: 0; }

.fc-brand {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 0 18px rgba(255, 0, 255, 0.6);
}

.fc-key {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--dim);
  word-break: break-all;
}

.fc-input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: #17121f;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.fc-input::placeholder { color: #7b7191; }

.fc-btn {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(120deg, var(--p), var(--a));
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}

.fc-btn:hover { box-shadow: 0 0 22px rgba(255, 0, 255, 0.55); transform: translateY(-1px); }

.fc-top a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid var(--line2);
  border-radius: 999px;
  transition: color 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.fc-top a:hover { color: var(--a); border-color: var(--a); box-shadow: 0 0 18px rgba(255, 0, 255, 0.4); }

.fc-copy {
  grid-column: 1 / -1;
  padding-top: 16px;
  text-align: center;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--dim);
  border-top: 1px dashed var(--line);
}

/* ---------- 桌面子菜单 ---------- */
@media (min-width: 881px) {
  .sub {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 214px;
    flex-direction: column;
    gap: 2px;
    padding: 8px;
    background: #120e1b;
    border: 1px solid var(--line2);
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
    display: none;
  }

  .has-sub:hover .sub,
  .has-sub:focus-within .sub { display: flex; }

  .sub a { width: 100%; min-height: 42px; }
}

@media (max-width: 880px) {
  .sub { display: flex; flex-direction: row; gap: 2px; }
  .hud-nav > ul > li { display: flex; }
  .hud-nav a { padding: 0 11px; font-size: 16px; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 880px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "t" "l" "a";
    min-height: 0;
    padding: 96px 0 40px;
    gap: 16px;
  }

  .collage { min-height: 320px; }

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

  .fc-copy { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .hud-main { padding: 0 18px 64px; }
  .hud-foot { grid-template-columns: minmax(0, 1fr); padding: 44px 18px 24px; }
  .fc-sub, .fc-brand, .fc-key, .fc-top { grid-column: 1 / -1; }
}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hud-main > article:not(.hero) {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.55s ease var(--d, 0ms), transform 0.55s ease var(--d, 0ms);
  }

  .hud-main > article.in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { animation: none !important; transition: none !important; }
  .hud-main > article:not(.hero) { opacity: 1; transform: none; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
