@import url('https://fonts.googleapis.com/css2?family=Newsreader:wght@400;500;600;700&family=Roboto:wght@300;400;500;700&display=swap');

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

:root {
  --green: #00ff80;
  --blue: #0000ff;
  --ink: #000000;
  --paper: #060607;
  --white: #ffffff;
  --line: rgba(255, 255, 255, 0.18);
  --glass: rgba(255, 255, 255, 0.05);
  --serif: "Newsreader", "Songti SC", "SimSun", Georgia, serif;
  --sans: "Roboto", system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

body {
  margin: 0;
  overflow-x: clip;
  background-color: var(--paper);
  background-image:
    radial-gradient(62vw 42vw at 10% 6%, rgba(0, 255, 128, 0.10), transparent 70%),
    radial-gradient(52vw 44vw at 94% 30%, rgba(0, 0, 255, 0.22), transparent 72%),
    radial-gradient(44vw 32vw at 58% 94%, rgba(0, 255, 128, 0.07), transparent 70%);
  background-attachment: fixed;
  color: var(--white);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.72;
  font-weight: 400;
}

::selection {
  background: var(--green);
  color: var(--ink);
}

a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover,
a:focus-visible {
  background: var(--green);
  color: var(--ink);
  text-decoration: none;
}

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

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

/* 顶部细条 */
.ticker {
  background: var(--blue);
  border-bottom: 2px solid var(--green);
  color: var(--white);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-align: center;
  padding: 0.25rem 0.8rem 0.3rem;
}

/* 页头：品牌居中，菜单两列 */
.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.4rem 0.8rem;
  padding: 0.65rem clamp(0.6rem, 3vw, 2rem);
  background: var(--ink);
  border-bottom: 4px solid var(--green);
}

.nav {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.nav p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.2rem;
}

.nav-l p { justify-content: flex-start; }
.nav-r p { justify-content: flex-end; }

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.5rem;
  color: var(--white);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a:focus-visible {
  background: var(--green);
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.15rem, 2.4vw, 1.6rem);
  line-height: 1.1;
  letter-spacing: 0.01em;
  color: var(--green);
  text-decoration: none;
  border: 3px solid var(--green);
  padding: 0.3rem 0.65rem;
  white-space: nowrap;
  text-align: center;
}

.brand:hover,
.brand:focus-visible {
  background: var(--green);
  color: var(--ink);
}

/* 粘性章节条 */
.rail {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.95);
  border-bottom: 2px solid var(--blue);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.rail p {
  margin: 0;
  display: flex;
  padding: 0 clamp(0.4rem, 3vw, 1.6rem);
  width: max-content;
  min-width: 100%;
}

.rail a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  white-space: nowrap;
  color: var(--green);
  text-decoration: none;
  font-weight: 500;
  border-right: 1px solid var(--line);
}

.rail a:hover,
.rail a:focus-visible {
  background: var(--blue);
  color: var(--white);
}

/* 首屏 */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 2.4rem 1.2rem;
  overflow: hidden;
  border-bottom: 5px solid var(--blue);
}

.ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  user-select: none;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(4.6rem, 20vw, 17rem);
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
  color: rgba(0, 255, 128, 0.07);
  -webkit-text-stroke: 1px rgba(0, 255, 128, 0.26);
}

.ghost::before { content: attr(data-text); }

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 62rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 8vw, 5.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 1.4rem;
  text-wrap: balance;
}

.hero-desc {
  max-width: 42rem;
  margin: 0 auto;
  padding-top: 1rem;
  border-top: 3px solid var(--green);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.84);
}

/* 主区 */
main {
  padding: clamp(1.4rem, 4vw, 3rem) clamp(0.7rem, 3vw, 2rem) 3rem;
}

div {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 1.6rem;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}

/* 左侧栏 */
.side {
  position: sticky;
  top: 56px;
  padding: 0.9rem 1rem 1.1rem;
  background: var(--glass);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 2px solid var(--line);
  border-left: 5px solid var(--blue);
  border-radius: 4px;
}

.side small {
  display: block;
  letter-spacing: 0.2em;
  font-weight: 700;
  color: var(--green);
}

.side h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 0.15rem 0 0.7rem;
}

.side-links {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.side-links a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0.4rem 0.2rem;
  font-size: 1rem;
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.side-links a:last-child { border-bottom: 0; }

.side-links a:hover,
.side-links a:focus-visible {
  background: var(--green);
  color: var(--ink);
}

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

.stream > section {
  padding: clamp(1rem, 2.6vw, 2.2rem);
  margin-bottom: 1.6rem;
  background: var(--glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border: 2px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: 4px;
}

.stream > section:nth-child(even) { border-top-color: var(--blue); }
.stream > section:last-child { margin-bottom: 0; }

section[id] { scroll-margin-top: 120px; }

.stream h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  margin: 0.2rem 0 0.9rem;
}

.stream h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.3;
  margin: 1.5rem 0 0.5rem;
}

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

.stream ul,
.stream ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.stream li { margin-bottom: 0.4rem; }

.stream blockquote {
  margin: 0 0 1rem;
  padding: 0.4rem 0 0.4rem 1rem;
  border-left: 4px solid var(--blue);
  color: rgba(255, 255, 255, 0.86);
}

.stream code,
.stream pre {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 0.95rem;
}

.stream pre {
  overflow-x: auto;
  padding: 0.9rem;
  border: 2px solid var(--line);
}

.stream img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 0 1rem;
  border: 2px solid var(--line);
}

.stream table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

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

small {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--green);
}

/* 页脚 */
.foot {
  margin-top: 2.4rem;
  padding: 1.8rem max(1rem, calc((100% - 1180px) / 2)) 2.4rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas:
    "brand links"
    "note top";
  gap: 0.6rem 1.6rem;
  background: var(--ink);
  border-top: 5px solid var(--blue);
}

.foot-brand {
  grid-area: brand;
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1.1;
  color: var(--green);
}

.foot-links {
  grid-area: links;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 0.9rem;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.2rem 0.15rem;
  color: var(--white);
  text-decoration: none;
  border-bottom: 2px solid var(--blue);
  font-size: 1rem;
}

.foot-links a:hover,
.foot-links a:focus-visible { background: var(--green); color: var(--ink); }

.foot-note {
  grid-area: note;
  color: rgba(255, 255, 255, 0.68);
}

.foot-top {
  grid-area: top;
  margin: 0;
  text-align: right;
}

.foot-top a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.2rem 0.4rem;
  color: var(--green);
}

/* 出现动效（瞬时，无过渡） */
.js .reveal { opacity: 0; }

.js .reveal.in {
  opacity: 1;
  animation: snap 0.001s linear both;
  animation-delay: calc(var(--i, 0) * 0.07s);
}

@keyframes snap {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; animation: none; }
}

/* 移动端 */
@media (max-width: 760px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 0.3rem;
  }

  .brand { order: -1; }
  .nav-l p,
  .nav-r p { justify-content: center; }
  .nav a { padding: 0.3rem 0.4rem; }

  .hero {
    min-height: 78vh;
    min-height: 78svh;
    padding: 1.6rem 1rem;
  }

  .hero h1 { font-size: clamp(2.1rem, 11vw, 3rem); }
  .ghost { font-size: 26vw; }

  div {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .stream { order: 1; }

  .side {
    order: 2;
    position: static;
    margin-top: 1.6rem;
  }

  .side-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 0.5rem;
  }

  .side-links a {
    border-bottom: 0;
    border-left: 3px solid var(--blue);
    padding-left: 0.5rem;
    padding-right: 0.4rem;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "brand"
      "links"
      "note"
      "top";
    padding: 1.6rem 1rem 2.2rem;
  }

  .foot-links { justify-content: flex-start; }
  .foot-top { text-align: left; }
}

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