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

:root {
  --ink: #261717;
  --red: #ff0000;
  --purple: #8b00ff;
  --fg: #f8f1ee;
  --body: #e9dcd8;
  --muted: #c9b6b1;
  --glass: rgba(255, 255, 255, 0.065);
  --glass-2: rgba(255, 255, 255, 0.04);
  --edge: rgba(255, 255, 255, 0.2);
  --edge-soft: rgba(255, 255, 255, 0.1);
  --rail: 96px;
  --radius: 28px;
  --serif: 'Playfair Display', 'Songti SC', 'Noto Serif SC', 'Source Han Serif SC', Georgia, serif;
  --sans: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ink);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: transparent;
  color: var(--fg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
  font-weight: 400;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -25% -15%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 44% at 12% 16%, rgba(255, 0, 0, 0.55), transparent 62%),
    radial-gradient(40% 42% at 88% 8%, rgba(139, 0, 255, 0.5), transparent 60%),
    radial-gradient(46% 46% at 64% 94%, rgba(255, 0, 0, 0.26), transparent 64%),
    radial-gradient(42% 42% at 22% 80%, rgba(139, 0, 255, 0.3), transparent 62%);
  filter: blur(70px);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(rgba(255, 255, 255, 0.6) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 22%, transparent 78%);
  mask-image: radial-gradient(120% 90% at 50% 30%, #000 22%, transparent 78%);
}

hr {
  border: 0;
  height: 1px;
  margin: 14px 0 22px;
  background: linear-gradient(90deg, rgba(255, 0, 0, 0.85), rgba(139, 0, 255, 0.6) 46%, rgba(255, 255, 255, 0.05));
}

a {
  color: #ff9a9a;
}

:focus-visible {
  outline: 2px solid #ffd0d0;
  outline-offset: 2px;
}

/* 左侧固定导航栏 */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 10px;
  background: rgba(38, 23, 23, 0.42);
  border-right: 1px solid var(--edge-soft);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.rail__brand {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--edge);
  background: linear-gradient(140deg, rgba(255, 0, 0, 0.7), rgba(139, 0, 255, 0.66));
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
  transition: transform 0.25s ease;
}

.rail__brand:hover {
  transform: translateY(-2px) scale(1.04);
}

.rail__mark {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.rail__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rail__links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  scrollbar-width: none;
}

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

.rail__link {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 9px 4px;
  font-size: 15px;
  line-height: 1.25;
  color: var(--muted);
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.rail__link:hover,
.rail__link[aria-current] {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--edge);
}

/* 内容网格：侧栏 + 正文 */
.canvas {
  margin-left: var(--rail);
}

.page {
  display: grid;
  grid-template-columns: minmax(0, 232px) minmax(0, 1fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
  max-width: 1360px;
  padding: clamp(24px, 5vw, 62px) clamp(16px, 4vw, 56px) 36px clamp(16px, 2.5vw, 34px);
}

.side {
  position: sticky;
  top: clamp(24px, 4vw, 56px);
  padding: 22px 18px;
  border-radius: 24px;
  background: var(--glass-2);
  border: 1px solid var(--edge-soft);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.side__title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: #fff;
}

.side hr {
  margin: 0 0 12px;
}

.side__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.side__list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 10px 10px 0;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

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

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

.doc > section {
  background: var(--glass);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: clamp(22px, 2.6vw, 44px);
  margin-bottom: clamp(18px, 2.4vw, 30px);
  backdrop-filter: blur(16px) saturate(135%);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
}

.doc > section.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: clamp(14px, 2vw, 22px);
  padding: clamp(28px, 4vw, 56px) 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.doc > section.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.26;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(82% 72% at 32% 52%, #000, transparent 76%);
  mask-image: radial-gradient(82% 72% at 32% 52%, #000, transparent 76%);
}

.hero__brand {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.36em;
  color: rgba(255, 255, 255, 0.66);
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(42px, 9.5vw, 128px);
  line-height: 1.03;
  letter-spacing: 0.01em;
  background: linear-gradient(98deg, #ffffff 10%, #ffcfcf 38%, #e0bdff 72%, #ffffff 97%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__rule {
  max-width: 190px;
  margin: 0;
}

.hero__lead {
  margin: 0;
  max-width: 58ch;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.85;
  color: var(--muted);
}

.doc h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(26px, 3.3vw, 42px);
  line-height: 1.2;
  letter-spacing: 0.02em;
  color: #fff;
  margin: 0 0 10px;
}

.doc h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(21px, 2.2vw, 27px);
  line-height: 1.3;
  color: #ffe9e9;
  margin: 26px 0 8px;
}

.doc h4 {
  font-size: 18px;
  color: #ffe9e9;
  margin: 20px 0 6px;
}

.doc p {
  margin: 0 0 16px;
  color: var(--body);
}

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

.doc ul,
.doc ol {
  margin: 0 0 18px;
  padding-left: 1.25em;
  color: var(--body);
}

.doc li {
  margin: 7px 0;
}

.doc li::marker {
  color: #ff8a8a;
}

.doc a {
  color: #ff9a9a;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 154, 154, 0.4);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.doc a:hover {
  color: #fff;
  border-bottom-color: #fff;
}

.doc strong,
.doc b {
  color: #fff;
  font-weight: 600;
}

.doc blockquote {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 2px solid rgba(255, 0, 0, 0.7);
  border-radius: 0 16px 16px 0;
  background: rgba(255, 255, 255, 0.05);
  color: #f1e5e1;
}

.doc img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px 0;
  border-radius: 18px;
  border: 1px solid var(--edge-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.doc figure {
  margin: 18px 0;
}

.doc figcaption {
  font-size: 15px;
  color: var(--muted);
  margin-top: 8px;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 16px;
}

.doc th,
.doc td {
  border: 1px solid var(--edge-soft);
  padding: 9px 12px;
  text-align: left;
  color: var(--body);
}

.doc th {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.doc code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 6px;
}

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

/* 页脚 */
.foot {
  padding: clamp(34px, 5vw, 64px) clamp(16px, 4vw, 56px) 40px clamp(16px, 2.5vw, 34px);
  border-top: 1px solid var(--edge-soft);
  background: rgba(38, 23, 23, 0.3);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}

.foot__brand {
  margin: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(40px, 10.5vw, 118px);
  line-height: 0.98;
  letter-spacing: 0.05em;
  white-space: nowrap;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.94), rgba(255, 128, 128, 0.78) 42%, rgba(178, 122, 255, 0.85));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.foot__nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(12px, 3vw, 40px);
  max-width: 780px;
  margin: clamp(18px, 3vw, 30px) 0;
}

.foot__nav dl {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.foot__nav dt,
.foot__nav dd {
  margin: 0;
}

.foot__nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 0;
  font-size: 15px;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.foot__nav a:hover {
  color: #fff;
  transform: translateX(3px);
}

.foot__copy {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.48);
}

/* 滚动进场 */
.reveal {
  opacity: 0;
  transform: translateY(16px);
}

.reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal,
  .reveal.in {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .rail__brand,
  .foot__nav a,
  .rail__link,
  .side__list a {
    transition: none;
  }
}

@media (max-width: 1080px) {
  .page {
    grid-template-columns: minmax(0, 200px) minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .rail {
    right: 0;
    bottom: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--edge-soft);
  }

  .rail__brand {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }

  .rail__links {
    flex-direction: row;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }

  .rail__link {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 9px 11px;
  }

  .canvas {
    margin-left: 0;
    padding-top: 62px;
  }

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

  .side {
    display: none;
  }

  .doc > section {
    padding: 20px 18px;
    border-radius: 22px;
  }

  .doc > section.hero {
    min-height: 0;
    padding: 44px 0 34px;
  }

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

  .foot {
    padding: 30px 16px 34px;
  }

  .foot__nav {
    gap: 10px;
  }

  .foot__nav a {
    font-size: 15px;
  }
}

@media (max-width: 420px) {
  body {
    font-size: 16px;
  }

  .foot__brand {
    letter-spacing: 0.02em;
  }
}

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