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

:root {
  --ink: #1f1726;
  --ink-2: #271d31;
  --plum: #56228b;
  --plum-lt: #a877d8;
  --clay: #8b4513;
  --clay-lt: #c8875a;
  --paper: #f4ece3;
  --dim: rgba(244, 236, 227, 0.66);
  --line: rgba(244, 236, 227, 0.11);
  --card: rgba(244, 236, 227, 0.05);
  --rail-w: 260px;
  --r-lg: 28px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding-left: var(--rail-w);
  background: var(--ink);
  color: var(--paper);
  font-family: 'Space Grotesk', 'Archivo', system-ui, -apple-system, 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(680px 460px at 88% 6%, rgba(86, 34, 139, 0.38), transparent 72%),
    radial-gradient(560px 520px at 14% 92%, rgba(139, 69, 19, 0.24), transparent 74%),
    radial-gradient(400px 300px at 46% 44%, rgba(86, 34, 139, 0.14), transparent 70%);
}

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

a { color: var(--plum-lt); }

/* ---------- 左侧固定竖排 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail-w);
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 26px 20px 22px;
  background: linear-gradient(180deg, #251b2e 0%, #1a1421 100%);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.rail-mark {
  width: 46px;
  height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px 26px 22px 24px;
  background: linear-gradient(140deg, var(--clay), var(--plum));
  color: var(--paper);
  text-decoration: none;
  box-shadow: 0 14px 28px -18px rgba(0, 0, 0, 0.95);
  overflow: hidden;
}

.rail-mark img { width: 40px; height: 40px; object-fit: contain; }
.mark-glyph { font-size: 20px; line-height: 1; }
.mark-blob { width: 26px; height: 26px; color: var(--paper); }

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

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 13px;
  border-radius: 15px 20px 18px 16px;
  border: 1px solid transparent;
  color: var(--dim);
  text-decoration: none;
  font-size: 16px;
  letter-spacing: 0.01em;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: rgba(86, 34, 139, 0.42);
  border-color: rgba(168, 119, 216, 0.4);
  color: var(--paper);
  transform: translateX(3px);
}

.rail-foot {
  margin: auto 0 0;
  font-size: 16px;
  letter-spacing: 0.14em;
  color: rgba(244, 236, 227, 0.4);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 44px 32px 30px;
}

.hero-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 4.2vw, 50px);
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 16em;
}

.blob {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
}

.b1 { color: var(--plum); animation: drift 11s ease-in-out infinite; }
.b2 { color: var(--clay-lt); width: 32px; height: 32px; animation: drift 9s ease-in-out infinite reverse; }

@keyframes drift {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-9px) rotate(7deg); }
}

.lede {
  margin: 18px auto 0;
  max-width: 34em;
  color: var(--dim);
  font-size: 17px;
}

/* ---------- 主体：aside 在左 ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 40px 76px;
  display: grid;
  grid-template-columns: 198px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

.side {
  position: sticky;
  top: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px 20px 26px 22px;
  padding: 18px 15px 16px;
}

.side-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--paper);
}

.side hr {
  border: 0;
  height: 2px;
  margin: 0 0 12px;
  background: linear-gradient(90deg, var(--clay), rgba(139, 69, 19, 0));
}

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

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 12px 16px 14px 12px;
  color: var(--dim);
  text-decoration: none;
  font-size: 16px;
}

.side-nav a:hover,
.side-nav a:focus-visible {
  background: rgba(139, 69, 19, 0.3);
  color: var(--paper);
}

.col { min-width: 0; }

/* ---------- 正文卡片 ---------- */
.body > article {
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom: 3px solid var(--clay);
  border-radius: var(--r-lg);
  padding: 30px 32px;
  margin-bottom: 26px;
  box-shadow: 0 22px 46px -34px rgba(0, 0, 0, 0.95);
  scroll-margin-top: 22px;
}

.body > article:nth-of-type(3n + 2) { border-radius: 20px 28px 22px var(--r-lg); }
.body > article:nth-of-type(3n + 3) { border-radius: var(--r-lg) 22px 28px 20px; border-bottom-color: var(--plum); }

.body h2 {
  margin: 0;
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.35;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.body h2 + hr,
.body h3 + hr {
  border: 0;
  height: 2px;
  margin: 14px 0 18px;
  background: linear-gradient(90deg, rgba(200, 135, 90, 0.95), rgba(139, 69, 19, 0));
}

.body hr {
  border: 0;
  height: 2px;
  margin: 20px 0;
  background: var(--line);
}

.body h3 {
  margin: 26px 0 10px;
  font-size: 20px;
  font-weight: 600;
}

.body p { margin: 0 0 14px; color: rgba(244, 236, 227, 0.87); }
.body p:last-child { margin-bottom: 0; }

.body ul,
.body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.body li { margin-bottom: 8px; }

.body blockquote {
  margin: 18px 0;
  padding: 14px 20px;
  border-left: 3px solid var(--plum-lt);
  border-radius: 0 18px 18px 0;
  background: rgba(86, 34, 139, 0.16);
  color: var(--paper);
}

.body strong { color: var(--paper); font-weight: 600; }
.body a { text-decoration-color: rgba(168, 119, 216, 0.5); }
.body table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.body th, .body td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; }

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.9fr;
  gap: 36px;
  max-width: 1220px;
  margin: 0 auto;
  padding: 54px 40px 34px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(86, 34, 139, 0.16), rgba(26, 20, 33, 0.92));
}

.mega {
  margin: 0;
  font-size: clamp(40px, 6.6vw, 88px);
  line-height: 0.96;
  font-weight: 700;
  letter-spacing: -0.03em;
  word-break: break-word;
  background: linear-gradient(120deg, #c9a6ea 0%, var(--clay-lt) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.foot-nav dl {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  margin: 0;
}

.foot-nav dt { min-width: 0; }

.foot-nav dt a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 0;
  color: var(--dim);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px dashed rgba(244, 236, 227, 0.08);
}

.foot-nav dt a:hover,
.foot-nav dt a:focus-visible { color: var(--paper); }

.foot-nav dd {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 40px;
  color: var(--clay-lt);
  font-size: 16px;
}

.foot-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.copy {
  margin: 0;
  color: var(--dim);
  font-size: 16px;
}

.top {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 16px;
  border-radius: 16px 22px 18px 20px;
  border: 1px solid rgba(200, 135, 90, 0.45);
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
}

.top:hover,
.top:focus-visible { background: rgba(139, 69, 19, 0.4); }

/* ---------- 动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s ease, transform 0.6s cubic-bezier(0.22, 0.7, 0.3, 1);
}

.reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 断点 ---------- */
@media (max-width: 1080px) {
  body { padding-left: 0; }
  .rail {
    position: sticky;
    inset: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(26, 20, 33, 0.96);
    backdrop-filter: blur(9px);
    overflow: visible;
  }
  .rail-mark { width: 42px; height: 42px; border-radius: 18px 22px 20px 22px; }
  .rail-nav { flex: 1; flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .rail-nav a { min-height: 40px; padding: 8px 11px; border-radius: 999px; font-size: 16px; }
  .rail-foot { display: none; }
  .hero { min-height: 0; padding: 34px 20px 24px; }
  .wrap { grid-template-columns: 1fr; gap: 20px; padding: 0 16px 56px; }
  .side { position: static; }
  .side-nav ul { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .side-nav a { padding: 6px 12px; border-radius: 999px; background: rgba(244, 236, 227, 0.05); }
  .foot { grid-template-columns: 1fr; gap: 26px; padding: 40px 20px 28px; }
}

@media (max-width: 600px) {
  body { font-size: 17px; }
  .rail { position: static; flex-direction: column; align-items: stretch; gap: 10px; }
  .rail-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
  .rail-nav a { justify-content: center; border: 1px solid var(--line); }
  .body > article { padding: 22px 18px; margin-bottom: 18px; border-radius: 22px; }
  .body > article:nth-of-type(3n + 2),
  .body > article:nth-of-type(3n + 3) { border-radius: 22px; }
  .hero h1 { font-size: clamp(27px, 8vw, 36px); }
  .blob { width: 32px; height: 32px; }
  .b2 { width: 24px; height: 24px; }
}

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

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