@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root{
  --ink:#1f1726;
  --plum:#56228b;
  --brown:#8b4513;
  --plum-soft:rgba(86,34,139,.12);
  --brown-soft:rgba(139,69,19,.12);
  --paper:#f6f1ea;
  --paper-deep:#eee4d7;
  --glass:rgba(255,255,255,.6);
  --glass-strong:rgba(255,255,255,.78);
  --line:rgba(31,23,38,.14);
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --sans:'IBM Plex Sans',-apple-system,BlinkMacSystemFont,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
}

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

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

body{
  margin:0;
  font-family:var(--sans);
  font-size:17px;
  line-height:1.75;
  color:var(--ink);
  background:
    radial-gradient(760px 520px at 6% -8%,rgba(86,34,139,.16),transparent 70%),
    radial-gradient(680px 560px at 98% 10%,rgba(139,69,19,.15),transparent 72%),
    radial-gradient(820px 760px at 58% 112%,rgba(86,34,139,.11),transparent 70%),
    linear-gradient(180deg,var(--paper),var(--paper-deep));
  background-attachment:fixed;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

img{max-width:100%;height:auto;display:block}
a{color:var(--plum)}

.site{padding-left:192px;min-height:100vh;display:flex;flex-direction:column}

/* ---------- 左侧固定竖排导航 ---------- */
.gnav{
  position:fixed;
  inset:0 auto 0 0;
  width:192px;
  z-index:40;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:22px 14px 30px;
  background:linear-gradient(180deg,rgba(255,255,255,.78),rgba(255,255,255,.42));
  border-right:1px solid var(--line);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  overflow-y:auto;
}

.gnav-mark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:48px;
  height:48px;
  border-radius:18px 14px 18px 12px;
  background:var(--glass-strong);
  border:1px solid var(--line);
  color:var(--plum);
  text-decoration:none;
  overflow:hidden;
  box-shadow:0 10px 22px -16px rgba(31,23,38,.65);
  margin-bottom:6px;
}

.gnav-mark .leaf{width:34px;height:34px}
.gnav-mark .mark-img{width:40px;height:40px;object-fit:contain}

.nav-group{border-top:1px solid var(--line);padding-top:10px}

.nav-group summary{
  list-style:none;
  cursor:pointer;
  min-height:44px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 8px;
  font-family:var(--mono);
  font-size:.9rem;
  letter-spacing:.18em;
  color:var(--brown);
  border-radius:12px;
  user-select:none;
}

.nav-group summary::-webkit-details-marker{display:none}

.nav-group summary::after{
  content:"";
  width:7px;height:7px;
  margin-left:auto;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transition:transform .2s ease;
}

.nav-group[open] summary::after{transform:rotate(-135deg) translateY(-2px)}

.nav-group summary:hover{background:var(--plum-soft)}

.nav-group menu{
  list-style:none;
  margin:4px 0 8px;
  padding:0;
  display:grid;
  gap:2px;
}

.gnav a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:6px 12px;
  border-radius:16px 12px 16px 12px;
  color:var(--ink);
  text-decoration:none;
  font-size:16px;
  line-height:1.4;
  transition:background .18s ease,color .18s ease,transform .18s ease;
}

.gnav a:hover,.gnav a:focus-visible{
  background:var(--plum-soft);
  color:var(--plum);
  transform:translateX(2px);
}

/* ---------- 版心：正文 + 右侧 aside ---------- */
.page{
  flex:1 0 auto;
  width:100%;
  max-width:1160px;
  margin:0 auto;
  padding:30px 26px 56px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 292px;
  gap:30px;
  align-items:start;
}

main{min-width:0}
section{min-width:0}

/* ---------- Hero ---------- */
.hero{
  position:relative;
  min-height:45vh;
  display:flex;
  align-items:center;
  gap:20px;
  padding:34px 28px;
  margin:0 0 26px;
  border-radius:26px 20px 26px 18px;
  border:1px solid rgba(255,255,255,.66);
  background:linear-gradient(150deg,rgba(255,255,255,.72),rgba(255,255,255,.4));
  backdrop-filter:blur(9px);
  -webkit-backdrop-filter:blur(9px);
  box-shadow:0 26px 46px -34px rgba(31,23,38,.6);
  overflow:hidden;
  scroll-margin-top:80px;
}

.hero::before{
  content:"";
  position:absolute;
  width:330px;height:330px;
  right:-120px;top:-130px;
  border-radius:58% 42% 46% 54%/48% 52% 48% 52%;
  background:radial-gradient(circle at 34% 34%,rgba(86,34,139,.22),rgba(139,69,19,.14) 62%,transparent 72%);
  pointer-events:none;
}

.hero::after{
  content:"";
  position:absolute;
  left:-70px;bottom:-140px;
  width:260px;height:260px;
  border-radius:46% 54% 60% 40%/54% 44% 56% 46%;
  background:radial-gradient(circle at 60% 40%,rgba(139,69,19,.18),transparent 70%);
  pointer-events:none;
}

.hero-body{position:relative;z-index:2;min-width:0}

.badge{
  display:inline-block;
  margin:0 0 12px;
  padding:5px 14px;
  border-radius:999px;
  border:1px solid rgba(86,34,139,.28);
  background:rgba(255,255,255,.72);
  color:var(--plum);
  font-family:var(--mono);
  font-size:.86rem;
  letter-spacing:.14em;
  line-height:1.6;
  box-shadow:0 12px 20px -18px rgba(31,23,38,.9);
}

h1{
  margin:0;
  font-size:clamp(1.85rem,4.2vw,3rem);
  line-height:1.24;
  letter-spacing:-.02em;
  font-weight:600;
  color:var(--ink);
  text-wrap:balance;
}

.hero-mark{
  position:relative;
  z-index:1;
  flex:0 0 auto;
  width:112px;
  color:var(--brown);
  will-change:transform;
  transform:translate3d(0,var(--py,0px),0);
}

.hero-mark .leaf{width:100%;height:auto}
.hero-mark .mark-img{width:96px;height:96px;object-fit:contain;filter:drop-shadow(0 16px 22px rgba(31,23,38,.22))}

/* ---------- 正文分节卡（page.content 原样落在这里） ---------- */
section>div:not(.hero){
  position:relative;
  margin:0 0 22px;
  padding:26px 26px 22px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.7);
  background:var(--glass);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  box-shadow:0 20px 38px -32px rgba(31,23,38,.7);
  scroll-margin-top:80px;
  overflow-wrap:break-word;
}

section>div:not(.hero)::before{
  content:"";
  position:absolute;
  left:0;top:22px;
  width:5px;height:34px;
  border-radius:0 6px 6px 0;
  background:linear-gradient(180deg,var(--plum),var(--brown));
  opacity:.55;
}

section small{
  display:block;
  font-family:var(--mono);
  font-size:.95rem;
  line-height:1.6;
  letter-spacing:.2em;
  color:var(--brown);
  margin-bottom:6px;
}

section h2{
  margin:0 0 14px;
  font-size:clamp(1.32rem,2.4vw,1.72rem);
  line-height:1.35;
  font-weight:600;
  letter-spacing:-.01em;
  color:var(--plum);
}

section h3{
  margin:22px 0 10px;
  font-size:1.14rem;
  line-height:1.4;
  font-weight:600;
  color:var(--brown);
}

section p{margin:0 0 14px}
section p:last-child{margin-bottom:0}

section ul,section ol{margin:0 0 14px;padding-left:1.35em}
section li{margin:0 0 8px}
section li::marker{color:var(--brown)}

section a{
  color:var(--plum);
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
}

section a:hover{color:var(--brown)}

section blockquote{
  margin:0 0 14px;
  padding:12px 18px;
  border-left:3px solid var(--plum);
  border-radius:0 14px 14px 0;
  background:rgba(86,34,139,.07);
}

section strong{font-weight:600;color:var(--ink)}

section table{width:100%;border-collapse:collapse;font-size:16px;margin:0 0 14px}
section th,section td{border:1px solid var(--line);padding:8px 10px;text-align:left}
section th{background:rgba(86,34,139,.08)}

/* ---------- 右侧 aside ---------- */
.rail{
  position:sticky;
  top:26px;
  padding:20px 18px 22px;
  border-radius:18px 20px 18px 22px;
  border:1px solid rgba(255,255,255,.7);
  background:var(--glass-strong);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  box-shadow:0 22px 40px -34px rgba(31,23,38,.75);
  font-size:16px;
}

.rail small{
  display:block;
  font-family:var(--mono);
  font-size:.9rem;
  letter-spacing:.22em;
  color:var(--brown);
}

.rail h2{
  margin:2px 0 12px;
  font-size:1.1rem;
  font-weight:600;
  letter-spacing:.02em;
  color:var(--plum);
}

.rail-list{list-style:none;margin:0;padding:0;display:grid;gap:2px}

.rail-list a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:4px 10px;
  border-radius:12px 16px 12px 16px;
  color:var(--ink);
  text-decoration:none;
  font-size:16px;
  line-height:1.4;
  border-left:2px solid transparent;
  transition:background .18s ease,color .18s ease,border-color .18s ease;
}

.rail-list a:hover,.rail-list a:focus-visible{
  background:var(--brown-soft);
  color:var(--brown);
  border-left-color:var(--brown);
}

.rail-art{margin-top:14px;color:var(--plum);opacity:.5}
.rail-art .leaf{width:62px;height:62px}
.rail-pic{margin-top:12px;border-radius:16px;width:100%;height:auto}

/* ---------- 页脚 ---------- */
.foot{
  flex:0 0 auto;
  border-top:1px solid var(--line);
  padding:34px 26px 30px;
  background:linear-gradient(180deg,rgba(255,255,255,.34),rgba(255,255,255,.7));
  text-align:center;
}

.giant{
  margin:0 0 22px;
  font-family:var(--mono);
  font-size:clamp(2.2rem,8vw,5.4rem);
  line-height:1;
  letter-spacing:-.04em;
  font-weight:600;
  color:var(--plum);
  opacity:.24;
  overflow-wrap:anywhere;
}

.foot-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  max-width:640px;
  margin:0 auto 20px;
  text-align:left;
}

.foot dl{margin:0}
.foot dt{
  font-family:var(--mono);
  font-size:.86rem;
  letter-spacing:.22em;
  color:var(--brown);
  margin-bottom:4px;
}
.foot dd{margin:0}

.foot dd a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:2px 0;
  color:var(--ink);
  text-decoration:none;
  font-size:16px;
  line-height:1.4;
}
.foot dd a:hover{color:var(--plum);text-decoration:underline;text-underline-offset:3px}

.copy{
  margin:0;
  font-family:var(--mono);
  font-size:.86rem;
  letter-spacing:.08em;
  color:rgba(31,23,38,.62);
  overflow-wrap:anywhere;
}

/* ---------- 入场动效 ---------- */
.js section>div:not(.hero){
  opacity:0;
  transform:translateY(16px);
  transition:opacity .55s ease,transform .55s ease;
}

.js section>div.is-in{opacity:1;transform:none}

/* ---------- 响应式 ---------- */
@media (min-width:901px){
  .nav-group menu{display:grid}
  .nav-group summary{cursor:default}
}

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

@media (max-width:900px){
  body{padding-left:0;font-size:17px}
  .site{padding-left:0}

  .gnav{
    position:sticky;
    inset:0 auto auto 0;
    width:100%;
    height:auto;
    flex-direction:row;
    align-items:center;
    gap:8px;
    padding:8px 12px;
    border-right:0;
    border-bottom:1px solid var(--line);
    overflow:visible;
    z-index:60;
  }

  .gnav-mark{width:44px;height:44px;margin-bottom:0}
  .gnav-mark .mark-img{width:34px;height:34px}

  .nav-group{
    position:relative;
    border-top:0;
    padding-top:0;
  }

  .nav-group summary{
    min-height:44px;
    padding:0 14px;
    border-radius:14px;
    border:1px solid var(--line);
    background:rgba(255,255,255,.6);
  }

  .nav-group menu{
    position:absolute;
    top:calc(100% + 6px);
    left:0;
    min-width:210px;
    margin:0;
    padding:8px;
    border-radius:18px;
    border:1px solid rgba(255,255,255,.8);
    background:rgba(255,255,255,.94);
    box-shadow:0 24px 40px -26px rgba(31,23,38,.8);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    z-index:70;
  }

  .nav-group:last-child menu{left:auto;right:0}

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

  .rail{position:static;order:2}
  main{order:1}

  .hero{min-height:38vh;padding:26px 20px;gap:12px;margin-bottom:20px;border-radius:22px 18px 22px 16px}
  .hero-mark{width:74px}
  .hero-mark .mark-img{width:64px;height:64px}

  section>div:not(.hero){padding:22px 18px 18px;scroll-margin-top:78px}
  .hero{scroll-margin-top:78px}

  .foot{padding:28px 16px 26px}
  .foot-grid{max-width:none;gap:8px}
}

@media (max-width:420px){
  .badge{font-size:.82rem;letter-spacing:.1em}
  .hero{flex-direction:column;align-items:flex-start}
  .hero-mark{width:62px}
  .foot-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .foot dd a{font-size:16px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .js section>div:not(.hero){opacity:1;transform:none;transition:none}
  .hero-mark{transform:none}
  .gnav a,.rail-list a,.nav-group summary::after{transition:none}
}

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