@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Crimson+Pro:wght@400;500;600;700&display=swap');

:root {
  --ink: #261717;
  --red: #ff0000;
  --violet: #8b00ff;
  --text: #f8f0f1;
  --dim: #d6c4c9;
  --glass: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.19);
  --radius: 10px;
  --serif: "Crimson Pro", "Songti SC", "Noto Serif SC", Georgia, serif;
  --sans: "Atkinson Hyperlegible", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  background: #150c0e;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(52vw 52vw at 86% -8%, rgba(139, 0, 255, 0.55), rgba(139, 0, 255, 0) 62%),
    radial-gradient(44vw 44vw at 2% 6%, rgba(255, 0, 0, 0.38), rgba(255, 0, 0, 0) 58%),
    radial-gradient(66vw 46vw at 58% 108%, rgba(139, 0, 255, 0.3), rgba(139, 0, 255, 0) 66%),
    linear-gradient(180deg, #1e1214, #150c0e 58%, #1d1012);
}

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

/* ---------- 外层网格：侧栏在左，正文在右 ---------- */

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 34px);
  align-items: start;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 38px) clamp(14px, 2.4vw, 28px) 170px;
}

main { min-width: 0; }
div { min-width: 0; }

/* ---------- 左侧目录 ---------- */

.rail {
  position: sticky;
  top: 22px;
  padding: 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
}

.rail-h {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
}

.rail-h span {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255, 0, 0, 0.72);
}

.rail-h2 {
  margin: 16px 0 8px;
  font-size: 16px;
  font-weight: 500;
  color: var(--dim);
}

.rail-h2 span { border-bottom-color: rgba(139, 0, 255, 0.75); }

.rail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 8px;
  font-size: 16px;
  color: var(--dim);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.rail-list a:hover,
.rail-list a[aria-current] {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-left-color: var(--red);
}

.rail-top {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin-top: 4px;
  padding: 6px 10px;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.24s, transform 0.24s;
}

.rail-top:hover {
  background: linear-gradient(120deg, rgba(255, 0, 0, 0.35), rgba(139, 0, 255, 0.35));
  transform: translateY(-2px);
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(430px, 70vh, 760px);
  margin: 0 0 34px;
  padding: 64px 0 4px;
  overflow: hidden;
  text-align: right;
}

.hero-in {
  position: relative;
  z-index: 2;
  width: 100%;
}

.hero-h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.05rem, 5.4vw, 3.9rem);
  line-height: 1.16;
  letter-spacing: 0.005em;
  color: #fff;
  text-shadow: 0 0 60px rgba(255, 0, 0, 0.42);
}

.hero-sub {
  max-width: 46ch;
  margin: 0 0 22px;
  margin-inline-start: auto;
  font-size: 17px;
  color: var(--dim);
}

.hero-img {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.hero-ghost {
  position: absolute;
  right: -0.05em;
  bottom: 0.02em;
  z-index: 0;
  font-family: var(--serif);
  font-size: clamp(6rem, 20vw, 15rem);
  line-height: 0.78;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.085);
  pointer-events: none;
  user-select: none;
}

/* ---------- 正文区块 ---------- */

div > article {
  position: relative;
  margin: 0 0 26px;
  padding: clamp(20px, 3vw, 40px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  backdrop-filter: blur(16px) saturate(130%);
  scroll-margin-top: 24px;
  scroll-margin-bottom: 140px;
}

div > article::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.65), rgba(139, 0, 255, 0.65), transparent);
}

div > article.hero {
  padding: 64px 0 4px;
  border: 0;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

div > article.hero::after { display: none; }

div h2 {
  margin: 0 0 0.7em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.9vw, 2rem);
  line-height: 1.28;
  color: #fff;
}

div h2 span {
  display: inline;
  box-shadow: inset 0 -2px 0 rgba(255, 0, 0, 0.72);
}

div h3 {
  margin: 1.5em 0 0.5em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.18rem, 2.2vw, 1.48rem);
  color: #fff;
}

div h3 span {
  display: inline;
  border-bottom: 1px dashed rgba(139, 0, 255, 0.75);
}

div p { margin: 0 0 1.05em; color: var(--dim); }
div ul, div ol { margin: 0 0 1.1em; padding-left: 1.35em; color: var(--dim); }
div li { margin: 0.35em 0; }
div li::marker { color: rgba(255, 0, 0, 0.9); }
div strong { color: #fff; }

div a {
  color: #ffd2d6;
  text-decoration: underline;
  text-decoration-color: rgba(255, 0, 0, 0.55);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}

div a:hover { color: #fff; text-decoration-color: var(--violet); }

div blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 2px solid var(--violet);
  border-radius: 0 8px 8px 0;
  background: rgba(139, 0, 255, 0.12);
  color: var(--text);
}

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

div img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

div hr {
  height: 1px;
  margin: 2em 0;
  border: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.05));
}

div table {
  width: 100%;
  margin: 1.2em 0;
  border-collapse: collapse;
  font-size: 16px;
}

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

div th { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* ---------- 底部固定条 ---------- */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px clamp(10px, 2vw, 24px);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(26, 15, 17, 0.66);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.dock-nav { flex: 1 1 0; min-width: 0; }
.dock-nav dl { display: flex; align-items: center; gap: 2px; margin: 0; }
.dock-nav-r dl { justify-content: flex-end; }

.dock-nav dt {
  padding: 0 4px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
}

.dock-nav dd { margin: 0; }

.dock-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 16px;
  color: var(--text);
  text-decoration: none;
  border-radius: 9px;
  white-space: nowrap;
  transition: background 0.2s, transform 0.2s, color 0.2s;
}

.dock-nav a:hover { background: rgba(255, 255, 255, 0.13); transform: translateY(-2px); }

.dock-nav a[aria-current] {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 -2px 0 var(--red);
}

.dock-nav a.cta {
  padding: 0 16px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(115deg, var(--red), var(--violet));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3), 0 6px 20px rgba(255, 0, 0, 0.28);
}

.dock-nav a.cta:hover { transform: translateY(-2px) scale(1.02); }

.dock-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.dock-brand img { display: block; border-radius: 6px; }

.dock-copy {
  padding: 0 6px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

/* ---------- 进场 ---------- */

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

.js .hero-h1 { animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.js .hero-sub { animation: rise 0.8s 0.1s cubic-bezier(0.2, 0.7, 0.3, 1) both; }
.js .hero-img { animation: rise 0.9s 0.18s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

.js div > article:not(.hero) {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js div > article.in {
  opacity: 1;
  transform: none;
}

/* ---------- 窄屏 ---------- */

@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 218px;
  }

  .rail {
    position: static;
    order: 2;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 12px;
    scrollbar-width: none;
  }

  .rail::-webkit-scrollbar { display: none; }
  .rail-h { margin: 0; font-size: 16px; white-space: nowrap; }
  .rail-h span { padding-bottom: 2px; }
  .rail-h2 { display: none; }

  .rail-list { flex-direction: row; gap: 4px; }

  .rail-list a {
    min-height: 42px;
    padding: 6px 10px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }

  .rail-list a:hover,
  .rail-list a[aria-current] {
    border-left-color: transparent;
    border-bottom-color: var(--red);
  }

  .rail-top { flex: 0 0 auto; margin-top: 0; white-space: nowrap; }

  .hero { min-height: clamp(400px, 62vh, 560px); padding-top: 30px; margin-bottom: 22px; }
  .hero-ghost { font-size: clamp(5rem, 26vw, 9rem); opacity: 0.75; }

  .dock { flex-wrap: wrap; gap: 2px 6px; padding: 6px 10px 8px; }
  .dock-nav { flex: 1 1 100%; overflow-x: auto; scrollbar-width: none; }
  .dock-nav::-webkit-scrollbar { display: none; }
  .dock-nav dl { justify-content: flex-start; }
  .dock-nav-r { order: 3; }
  .dock-brand { order: 1; margin-right: auto; font-size: 18px; }
  .dock-copy { order: 2; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .js div > article,
  .js div > article.in,
  .js .hero-h1,
  .js .hero-sub,
  .js .hero-img {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }
}

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