@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,300;0,500;0,700;1,300;1,500&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root {
  --red: #ff0000;
  --violet: #8b00ff;
  --ink: #261717;
  --text: #f6ece7;
  --dim: #c9b2aa;
  --line: rgba(255, 255, 255, 0.18);
  --glass: rgba(255, 255, 255, 0.07);
  --glass-2: rgba(255, 255, 255, 0.13);
  --serif: "Cormorant Garamond", "Crimson Pro", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --ui: "Crimson Pro", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --rail: 240px;
  --radius: 4px;
}

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

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

body {
  margin: 0;
  font-family: var(--ui);
  font-size: 17px;
  line-height: 1.78;
  color: var(--text);
  background-color: #140c0c;
  background-image:
    radial-gradient(58vw 58vw at 92% -8%, rgba(255, 0, 0, 0.28), transparent 62%),
    radial-gradient(52vw 52vw at 2% 30%, rgba(139, 0, 255, 0.26), transparent 66%),
    radial-gradient(70vw 48vw at 70% 108%, rgba(255, 0, 0, 0.14), transparent 70%),
    linear-gradient(180deg, #1c1111, #140c0c 45%, #100a0a);
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0.01em;
  margin: 0 0 0.55em;
}

p { margin: 0 0 1em; }
::selection { background: rgba(255, 0, 0, 0.4); }
:focus-visible { outline: 2px solid #ff9a92; outline-offset: 3px; }

/* ---------- 左侧固定竖栏 ---------- */
.rail {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--rail);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 16px 28px;
  background: rgba(38, 23, 23, 0.5);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.rail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 6px 4px;
  font-family: var(--serif);
  font-size: 26px;
  letter-spacing: 0.14em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  object-fit: cover;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--red), var(--violet));
  box-shadow: 0 0 14px rgba(255, 0, 0, 0.7);
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 16px;
  letter-spacing: 0.18em;
  background: var(--glass-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

/* ---------- 搜索 ---------- */
.rail-search { display: block; }

.search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.search-input::placeholder { color: var(--dim); }

/* ---------- 导航 ---------- */
.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.nav-lab {
  padding: 8px 12px 2px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.24em;
  color: var(--dim);
}

.nav-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 16px;
  color: var(--dim);
  border-left: 2px solid transparent;
  border-radius: var(--radius);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #fff;
  background: var(--glass-2);
  border-left-color: var(--red);
}

.nav-link[hidden] { display: none; }

/* ---------- 舞台 ---------- */
.stage {
  margin-left: var(--rail);
  min-width: 0;
}

/* ---------- 头屏 ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  overflow: hidden;
  padding: 90px 0 70px;
}

.hero-glow {
  position: absolute;
  top: -18%;
  right: -8%;
  width: 46vw;
  height: 46vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.5), rgba(139, 0, 255, 0.2) 55%, transparent 72%);
  filter: blur(28px);
  z-index: 0;
  pointer-events: none;
  will-change: transform;
}

.hero-slab {
  position: absolute;
  top: 0;
  right: 0;
  width: 44%;
  height: 100%;
  background: linear-gradient(150deg, rgba(255, 0, 0, 0.34), rgba(139, 0, 255, 0.3));
  clip-path: polygon(26% 0, 100% 0, 100% 100%, 0 100%);
  z-index: 0;
}

.hero-copy {
  position: relative;
  z-index: 2;
  padding: 0 28px 0 46px;
  text-align: center;
  animation: rise 0.9s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.hero-title {
  font-size: clamp(2rem, 3.4vw, 3.5rem);
  color: #fff;
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.55);
}

.hero-title::after {
  content: "";
  display: block;
  width: 76px;
  height: 3px;
  margin: 20px auto 0;
  background: linear-gradient(90deg, var(--red), var(--violet));
  transform: skewX(-24deg);
}

.hero-desc {
  max-width: 34ch;
  margin: 20px auto 0;
  color: #f1e2dc;
}

.hero-figure {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0 46px 0 20px;
}

.hero-frame {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.45);
}

.hero-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
}

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

/* ---------- 正文骨架 ---------- */
.shell {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  max-width: 1120px;
  padding: 24px 40px 80px;
}

.rail-aside {
  position: sticky;
  top: 24px;
  min-width: 0;
}

.aside-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.aside-title {
  margin-bottom: 10px;
  font-size: 17px;
  letter-spacing: 0.2em;
  color: var(--dim);
}

.aside-title > span {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(255, 0, 0, 0.5);
}

.toc {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc;
}

.toc li { counter-increment: toc; }

.toc a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 0;
  font-size: 16px;
  color: var(--dim);
  border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.06em;
  color: rgba(255, 0, 0, 0.85);
}

.toc a:hover { color: #fff; }

.to-top {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  padding: 10px;
  font-size: 16px;
  letter-spacing: 0.16em;
  color: var(--dim);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.to-top:hover { color: #fff; background: var(--glass-2); }

/* ---------- 正文 ---------- */
.prose {
  min-width: 0;
  max-width: 74ch;
}

.prose > div {
  padding: 36px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  scroll-margin-top: 88px;
}

.prose > div:first-child {
  padding-top: 10px;
  border-top: 0;
}

.prose h2 {
  margin-top: 0.2em;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  color: #fff;
}

.prose h2 > span {
  position: relative;
  display: inline-block;
  padding-left: 20px;
}

.prose h2 > span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.22em;
  width: 7px;
  height: 0.86em;
  background: linear-gradient(180deg, var(--red), var(--violet));
  transform: skewY(-14deg);
}

.prose h3 {
  font-size: 1.22rem;
  color: #ffe4dd;
}

.prose h3 > span { display: inline-block; }

.prose a {
  color: #ffbcb4;
  border-bottom: 1px solid rgba(255, 0, 0, 0.45);
}

.prose a:hover { color: #fff; }

.prose ul,
.prose ol { margin: 0 0 1.1em; padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose strong { color: #fff; }

.prose blockquote {
  margin: 1.2em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--violet);
  border-radius: var(--radius);
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.prose img { margin: 1em 0; border-radius: var(--radius); }

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 9px 11px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

/* ---------- 页脚 ---------- */
.foot {
  padding: 36px 40px 26px;
  border-top: 1px solid var(--line);
  background: rgba(38, 23, 23, 0.4);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  max-width: 1120px;
}

.foot-addr { font-style: normal; }

.foot-brand {
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 0.14em;
}

.foot-title {
  font-size: 17px;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.foot-title > span {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 0, 0, 0.5);
}

.foot-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--dim);
}

.foot-links a:hover { color: #fff; }

.foot-copy {
  margin: 22px 0 0;
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--dim);
}

/* ---------- 动效开关 ---------- */
html.anim .reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.65s cubic-bezier(0.2, 0.7, 0.3, 1), transform 0.65s cubic-bezier(0.2, 0.7, 0.3, 1);
}

html.anim .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 959px) {
  .rail {
    position: sticky;
    inset: auto;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .rail.is-open { background: rgba(22, 13, 13, 0.96); }
  .menu-btn { display: inline-flex; }
  .brand { font-size: 22px; }

  .rail-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 70;
    display: none;
    flex-direction: column;
    gap: 12px;
    max-height: 100vh;
    padding: 74px 16px 22px;
    overflow-y: auto;
    background: rgba(22, 13, 13, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--line);
  }

  .rail.is-open .rail-nav { display: flex; }

  .stage { margin-left: 0; }

  .hero {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 66px);
    gap: 26px;
    padding: 52px 0 44px;
  }

  .hero-copy { padding: 0 20px; }
  .hero-figure { padding: 0 20px; }
  .hero-img { aspect-ratio: 16 / 10; }
  .hero-glow { top: -10%; right: -20%; width: 80vw; height: 80vw; }

  .hero-slab {
    top: auto;
    bottom: 0;
    width: 100%;
    height: 54%;
    opacity: 0.65;
    clip-path: polygon(0 24%, 100% 0, 100% 100%, 0 100%);
  }

  .shell {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 16px 20px 60px;
  }

  .rail-aside { position: static; }
  .prose { max-width: none; }
  .prose > div { scroll-margin-top: 74px; }

  .foot { padding: 28px 20px 20px; }
  .foot-grid { grid-template-columns: 1fr; gap: 18px; }
}

@media (max-width: 640px) {
  .prose table { display: block; overflow-x: auto; }
  .hero-title { font-size: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-copy { animation: none; }
  html.anim .reveal { opacity: 1; transform: none; transition: none; }
}

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