@import url('https://fonts.googleapis.com/css2?family=Lexend+Mega:wght@100..900&family=Public+Sans:wght@100..900&display=swap');

:root {
  --ink: #000000;
  --panel: #121212;
  --panel-2: #0a0a0a;
  --line: #1c2330;
  --mid: #1b2a4a;
  --text: #e9ecf3;
  --dim: #8b93a7;
  --neon: #8ef0c0;
  --blue: #9db8ff;
  --r: 18px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Public Sans', system-ui, -apple-system, 'Noto Sans SC', 'PingFang SC', sans-serif;
  font-size: 16.5px;
  line-height: 1.72;
  letter-spacing: 0.01em;
}

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

a { color: var(--neon); text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 9px clamp(14px, 4vw, 38px);
  background: rgba(0, 0, 0, 0.94);
  border-bottom: 1px solid var(--mid);
  backdrop-filter: blur(10px);
}

.mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--mid);
  border-radius: var(--r);
  color: #ffffff;
  font-family: 'Lexend Mega', system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.mark:hover { border-color: var(--neon); color: var(--neon); }
.mark img { width: 24px; height: 24px; }

.ticker {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--dim);
  font-size: 0.8rem;
  letter-spacing: 0.24em;
  transition: opacity 0.24s ease;
}

.ticker.swap { opacity: 0; }

.mainnav ul,
.railnav ul,
.footnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mainnav > ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 2px;
}

.mainnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 11px;
  color: var(--text);
  font-size: 0.9rem;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.mainnav a:hover { color: var(--neon); border-bottom-color: var(--neon); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  align-content: end;
  min-height: 70vh;
  padding: 96px clamp(16px, 4vw, 38px) 54px;
  border-bottom: 1px solid var(--mid);
  overflow: hidden;
}

.hero-txt {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

h1 {
  margin: 0 0 0.42em;
  max-width: 22ch;
  color: #ffffff;
  font-family: 'Lexend Mega', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 7.2vw, 4.3rem);
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-shadow: 0 0 28px rgba(142, 240, 192, 0.16);
}

.lede {
  margin: 0;
  max-width: 54ch;
  color: var(--dim);
  font-size: 1.02rem;
}

.hero-art {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(157, 184, 255, 0.26) 1px, transparent 1px);
  background-size: 20px 20px;
  -webkit-mask-image: radial-gradient(130% 95% at 80% 18%, #000 0%, rgba(0, 0, 0, 0.45) 46%, transparent 80%);
  mask-image: radial-gradient(130% 95% at 80% 18%, #000 0%, rgba(0, 0, 0, 0.45) 46%, transparent 80%);
}

/* ---------- 主体骨架 ---------- */
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  align-items: start;
  gap: 44px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 38px) 76px;
}

.rail {
  position: sticky;
  top: 76px;
  padding: 20px 0 20px 18px;
  border-left: 2px solid var(--mid);
}

.rail small {
  display: block;
  color: var(--dim);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
}

.rail h2 {
  margin: 0.25em 0 0.95em;
  color: #ffffff;
  font-family: 'Lexend Mega', system-ui, sans-serif;
  font-size: 1.02rem;
  letter-spacing: 0.16em;
}

.railnav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 4px 9px;
  color: var(--dim);
  font-size: 0.88rem;
  border-radius: 10px;
  transition: color 0.16s ease, background 0.16s ease;
}

.railnav a:hover { color: #ffffff; background: var(--panel); }

/* ---------- 正文 ---------- */
.stream { min-width: 0; }

.stream section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 120px;
}

.stream section:first-child { border-top: 0; padding-top: 48px; }

.stream h2 {
  margin: 0 0 0.7em;
  color: #ffffff;
  font-family: 'Lexend Mega', system-ui, sans-serif;
  font-size: clamp(1.35rem, 3.2vw, 1.95rem);
  line-height: 1.22;
  letter-spacing: -0.005em;
  text-wrap: balance;
}

.stream h2::before {
  content: "";
  display: block;
  width: 34px;
  height: 3px;
  margin-bottom: 14px;
  background: var(--neon);
  border-radius: 2px;
}

.stream h3 {
  margin: 1.7em 0 0.5em;
  color: #ffffff;
  font-family: 'Lexend Mega', system-ui, sans-serif;
  font-size: 1.1rem;
  line-height: 1.35;
}

.stream p {
  margin: 0 0 1.1em;
  max-width: 68ch;
  color: var(--text);
}

.stream a {
  border-bottom: 1px solid rgba(142, 240, 192, 0.45);
}

.stream a:hover { border-bottom-color: var(--neon); }

.stream ul,
.stream ol {
  margin: 0 0 1.2em;
  padding-left: 1.35em;
  max-width: 66ch;
}

.stream li { margin: 0.4em 0; }
.stream strong { color: #ffffff; }
.stream small { color: var(--dim); }

.stream code {
  padding: 2px 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.92em;
}

.stream figure {
  margin: 1.7em 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--mid);
  border-radius: var(--r);
}

.stream figure img { border-radius: 12px; }

.stream figcaption {
  margin-top: 10px;
  color: var(--dim);
  font-size: 0.86rem;
}

.stream blockquote {
  margin: 1.7em 0;
  padding: 16px 20px;
  background: var(--panel-2);
  border-left: 2px solid var(--neon);
  border-radius: 0 var(--r) var(--r) 0;
  color: #cfd6e4;
}

.stream blockquote p:last-child { margin-bottom: 0; }

.stream img {
  height: auto;
  border: 1px solid var(--mid);
  border-radius: var(--r);
}

.stream table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 0.94rem;
}

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

.stream th { background: var(--panel); color: #ffffff; }

.stream hr {
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 8px;
  background: var(--panel);
  border-top: 1px solid var(--mid);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 30px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px clamp(16px, 4vw, 38px) 38px;
}

.foot dl { margin: 0; }

.foot dt {
  margin-bottom: 0.85em;
  color: var(--dim);
  font-family: 'Lexend Mega', system-ui, sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
}

.foot dd {
  margin: 0 0 0.35em;
  color: var(--text);
  font-size: 0.9rem;
}

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--text);
}

.foot dd a:hover { color: var(--neon); }

.foot-sub small {
  display: block;
  margin-bottom: 0.85em;
  color: var(--dim);
  font-family: 'Lexend Mega', system-ui, sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.22em;
}

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

.sub input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  background: var(--ink);
  border: 1px solid var(--mid);
  border-radius: 12px;
  color: var(--text);
  font: inherit;
  font-size: 0.94rem;
}

.sub input::placeholder { color: #5e6678; }

.sub button {
  min-height: 46px;
  border: 1px solid var(--neon);
  border-radius: 12px;
  background: var(--neon);
  color: #04140d;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.18s ease;
}

.sub button:hover { filter: brightness(1.08); }

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 38px) 42px;
  border-top: 1px solid var(--line);
}

.foot-bar p { margin: 0; color: var(--dim); font-size: 0.84rem; }

.footnav > ul { display: flex; flex-wrap: wrap; gap: 0 16px; }

.footnav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  color: var(--dim);
  font-size: 0.84rem;
}

.footnav a:hover { color: var(--neon); }

/* ---------- 回顶 ---------- */
.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 70;
  min-height: 44px;
  padding: 0 16px;
  background: rgba(18, 18, 18, 0.94);
  border: 1px solid var(--mid);
  border-radius: 999px;
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.totop.on { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- 入场 ---------- */
.fade {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade { opacity: 1; transform: none; transition: none; }
  .totop { transition: none; }
  .ticker { transition: none; }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 780px) {
  body { font-size: 16px; }

  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 8px 14px;
  }

  .mainnav { display: none; }
  .ticker { letter-spacing: 0.16em; }

  .hero {
    min-height: 62vh;
    padding: 64px 16px 38px;
  }

  h1 { font-size: clamp(1.85rem, 8.2vw, 2.6rem); }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 16px 58px;
  }

  .rail {
    position: sticky;
    top: 60px;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    background: var(--ink);
    border-left: 0;
    border-bottom: 1px solid var(--mid);
  }

  .rail small { display: none; }

  .rail h2 {
    margin: 0;
    color: var(--dim);
    font-size: 0.76rem;
    letter-spacing: 0.18em;
    white-space: nowrap;
  }

  .railnav {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .railnav > ul {
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .railnav a {
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid var(--mid);
    border-radius: 999px;
    white-space: nowrap;
    font-size: 0.84rem;
  }

  .stream section {
    padding: 42px 0;
    scroll-margin-top: 118px;
  }

  .stream section:first-child { padding-top: 34px; }

  .foot-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
    padding: 40px 16px 24px;
  }

  .foot-bar { padding: 12px 16px 30px; }
}

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