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

:root {
  --paper: #ffffff;
  --mist: #f5f5f5;
  --ink: #1f1f1f;
  --ink-70: rgba(31, 31, 31, 0.7);
  --ink-55: rgba(31, 31, 31, 0.55);
  --line: rgba(31, 31, 31, 0.1);
  --rail: 252px;
  --radius: 28px;
  --serif: 'Cormorant Infant', 'Songti SC', 'STSong', 'Noto Serif SC', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --el1: 0 1px 2px rgba(31, 31, 31, 0.05), 0 3px 8px rgba(31, 31, 31, 0.05);
  --el2: 0 2px 6px rgba(31, 31, 31, 0.06), 0 12px 24px rgba(31, 31, 31, 0.07);
  --el3: 0 6px 16px rgba(31, 31, 31, 0.08), 0 24px 48px rgba(31, 31, 31, 0.1);
  --el4: 0 14px 30px rgba(31, 31, 31, 0.11), 0 46px 90px rgba(31, 31, 31, 0.15);
}

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

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.8;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

p {
  margin: 0;
}

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

/* ---------- 左侧固定竖排导航 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 60;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 34px 20px 28px;
  background: rgba(255, 255, 255, 0.88);
  border-right: 1px solid var(--line);
  box-shadow: var(--el2);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  overflow-y: auto;
}

.brand {
  position: relative;
  z-index: 2;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  min-height: 44px;
  text-decoration: none;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: var(--el2);
}

.brand-script {
  font-family: 'Great Vibes', var(--serif);
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0.06em;
  color: var(--ink);
}

.rail-nav {
  position: relative;
  z-index: 1;
}

.rail-nav p {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-70);
  text-decoration: none;
  box-shadow: 0 0 0 rgba(31, 31, 31, 0);
  transition: color 0.22s ease, background-color 0.22s ease, box-shadow 0.28s ease, transform 0.28s cubic-bezier(0.22, 0.68, 0.32, 1);
}

.rail-nav a:nth-child(2),
.rail-nav a:nth-child(5) {
  margin-top: 12px;
}

.rail-nav a:hover {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--el2);
  transform: translateX(5px);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  margin-left: var(--rail);
  height: 100vh;
  min-height: 580px;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
}

.hero-media.is-blank {
  background:
    radial-gradient(circle at 24% 22%, rgba(255, 255, 255, 0.22), transparent 58%),
    radial-gradient(circle at 78% 76%, rgba(255, 255, 255, 0.14), transparent 52%),
    linear-gradient(150deg, #3a3a3a, #1f1f1f 62%);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14);
  will-change: transform;
}

.hero-veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(118deg, rgba(31, 31, 31, 0.68), rgba(31, 31, 31, 0.28) 54%, rgba(31, 31, 31, 0.62));
}

.hero-frame {
  position: absolute;
  inset: 22px;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 5;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 26px 92px;
  text-align: center;
  color: var(--paper);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 20px;
  margin-bottom: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: var(--el3);
  font-family: 'Great Vibes', var(--serif);
  font-size: 21px;
  letter-spacing: 0.1em;
  transform: translateZ(0);
  animation: float 7s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -9px, 0); }
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.1rem, 5.6vw, 4.1rem);
  line-height: 1.16;
  letter-spacing: 0.035em;
  text-shadow: 0 20px 46px rgba(0, 0, 0, 0.4);
}

.hero-desc {
  max-width: 30em;
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.86);
}

.hero-slant {
  position: absolute;
  left: -2px;
  right: -2px;
  bottom: -1px;
  height: 118px;
  z-index: 4;
  background: var(--mist);
  clip-path: polygon(0 100%, 100% 12%, 100% 100%);
  box-shadow: 0 -22px 44px rgba(31, 31, 31, 0.16);
}

/* ---------- 主体：左目录 + 右正文 ---------- */
main {
  position: relative;
  z-index: 10;
  margin-left: var(--rail);
  max-width: 1200px;
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  gap: 0 34px;
  padding: 8px 40px 96px;
}

.toc {
  position: sticky;
  top: 26px;
  align-self: start;
  z-index: 4;
  margin-top: -46px;
  padding: 22px 16px 18px;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--el3);
  max-height: calc(100vh - 60px);
  overflow-y: auto;
}

.toc h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: 0.14em;
}

.toc hr {
  width: 44px;
  height: 2px;
  margin: 12px 0 14px;
  border: 0;
  background: var(--ink);
}

.toc p {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.toc a {
  display: block;
  padding: 9px 10px;
  min-height: 40px;
  border-radius: 12px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink-70);
  text-decoration: none;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.toc a:hover {
  color: var(--ink);
  background: var(--mist);
}

.prose {
  position: relative;
  z-index: 2;
  max-width: 780px;
  padding-top: 8px;
}

.prose > div {
  position: relative;
  z-index: 1;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 36px 34px 32px;
  margin-bottom: 22px;
  box-shadow: var(--el1);
  transition: box-shadow 0.32s ease, transform 0.32s cubic-bezier(0.22, 0.68, 0.32, 1);
}

.prose > div:nth-child(odd) {
  margin-right: 30px;
}

.prose > div:nth-child(even) {
  margin-left: 30px;
  box-shadow: var(--el2);
}

.js-ready .prose > div {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
}

.js-ready .prose > div.seen {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 0.68, 0.32, 1), box-shadow 0.32s ease;
}

.prose > div:hover {
  z-index: 6;
  box-shadow: var(--el4);
}

.js-ready .prose > div.seen:hover {
  transform: translateY(-5px);
}

.prose h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.4vw, 1.7rem);
  line-height: 1.35;
  letter-spacing: 0.02em;
}

.prose h2 + hr {
  width: 62px;
  height: 2px;
  margin: 14px 0 20px;
  border: 0;
  background: var(--ink);
}

.prose h3 {
  margin: 26px 0 8px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 19px;
  letter-spacing: 0.02em;
}

.prose p {
  margin: 0 0 1em;
}

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

.prose a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 31, 31, 0.35);
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.prose a:hover {
  border-color: var(--ink);
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

.prose li {
  margin-bottom: 0.4em;
}

.prose strong {
  font-weight: 700;
}

.prose time {
  display: inline-block;
  font-size: 16px;
  color: var(--ink-55);
  letter-spacing: 0.04em;
}

.prose img {
  border-radius: 20px;
  box-shadow: var(--el2);
  margin: 1.1em 0;
  width: 100%;
  height: auto;
}

.prose blockquote {
  margin: 1.1em 0;
  padding: 14px 20px;
  background: var(--mist);
  border-radius: 16px;
  color: var(--ink-70);
}

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

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

.prose > div {
  scroll-margin-top: 92px;
}

/* ---------- 页脚 ---------- */
.site-foot {
  position: relative;
  z-index: 5;
  margin-left: var(--rail);
  padding: 46px 40px 24px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 -26px 60px rgba(31, 31, 31, 0.18);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  max-width: 980px;
}

.foot-cols dl {
  margin: 0;
}

.foot-cols dt {
  margin-bottom: 10px;
  font-size: 16px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.52);
}

.foot-cols dd {
  margin: 0;
}

.foot-cols dd a {
  display: inline-block;
  padding: 8px 0;
  min-height: 40px;
  line-height: 1.45;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.foot-cols dd a:hover {
  color: var(--paper);
  transform: translateX(3px);
}

.foot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.foot-bar p {
  font-size: 16px;
}

.copy {
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.06em;
}

.totop a {
  display: inline-block;
  padding: 8px 2px;
  min-height: 40px;
  color: rgba(255, 255, 255, 0.86);
  text-decoration: none;
}

.totop a:hover {
  color: var(--paper);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  :root {
    --rail: 216px;
  }

  main {
    grid-template-columns: 186px minmax(0, 1fr);
    gap: 0 24px;
    padding-right: 26px;
    padding-left: 26px;
  }

  .prose > div:nth-child(odd),
  .prose > div:nth-child(even) {
    margin-left: 0;
    margin-right: 0;
  }
}

@media (max-width: 860px) {
  .rail {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--el3);
  }

  .brand-link {
    padding: 4px;
  }

  .brand-script {
    font-size: 22px;
  }

  .rail-nav {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .rail-nav p {
    flex-direction: row;
    gap: 4px;
    width: max-content;
  }

  .rail-nav a {
    padding: 10px 13px;
    min-height: 44px;
    white-space: nowrap;
    font-size: 16px;
  }

  .rail-nav a:nth-child(2),
  .rail-nav a:nth-child(5) {
    margin-top: 0;
  }

  .rail-nav a:hover {
    transform: none;
  }

  .hero {
    margin-left: 0;
    height: 80vh;
    min-height: 480px;
  }

  .hero-copy {
    padding: 0 20px 108px;
  }

  .hero-frame {
    inset: 14px;
  }

  .hero-slant {
    height: 86px;
  }

  main {
    display: block;
    margin-left: 0;
    padding: 18px 16px 64px;
  }

  .toc {
    position: static;
    margin: 0 0 18px;
    padding: 16px 14px;
    max-height: none;
    overflow: visible;
  }

  .toc h2 {
    font-size: 18px;
  }

  .toc p {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .toc a {
    padding: 10px 12px;
    min-height: 44px;
    white-space: nowrap;
    background: var(--mist);
  }

  .prose {
    max-width: none;
    padding-top: 0;
  }

  .prose > div {
    padding: 26px 20px 24px;
    margin-bottom: 16px;
    scroll-margin-top: 86px;
  }

  .site-foot {
    margin-left: 0;
    padding: 34px 16px 20px;
  }

  .foot-cols {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 420px) {
  .brand-script {
    font-size: 20px;
  }

  .hero-copy h1 {
    font-size: 2rem;
  }

  .prose > div {
    padding: 22px 16px 20px;
    border-radius: 22px;
  }
}

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

  .hero-img {
    transform: none !important;
  }

  .hero-badge {
    animation: none;
  }

  .js-ready .prose > div {
    opacity: 1;
    transform: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}

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