:root{
  --plum:#56228b;
  --brown:#8b4513;
  --ink:#1f1726;
  --paper:#f7f1e9;
  --card:#fffcf7;
  --line:#e6d8c8;
  --muted:#5c5063;
}

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

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

body{
  margin:0;
  overflow-x:hidden;
  font-family:'Atkinson Hyperlegible',system-ui,-apple-system,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:17px;
  line-height:1.75;
  color:var(--ink);
  background:
    radial-gradient(circle at 10% 6%,rgba(86,34,139,.12),transparent 42%),
    radial-gradient(circle at 92% 18%,rgba(139,69,19,.13),transparent 44%),
    radial-gradient(circle at 70% 92%,rgba(86,34,139,.08),transparent 46%),
    var(--paper);
  background-attachment:scroll;
}

img{display:block;max-width:100%;height:auto}
a{color:var(--plum)}
a:focus-visible,summary:focus-visible{outline:3px solid var(--plum);outline-offset:3px;border-radius:8px}

main div[id]{scroll-margin-top:96px}

/* ---------- 顶栏 ---------- */
.top{
  max-width:1180px;
  margin:0 auto;
  padding:1rem 1.2rem .7rem;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
}

.mark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:48px;
  height:48px;
  overflow:hidden;
  color:#fff;
  text-decoration:none;
  border-radius:18px 24px 16px 26px;
  background:linear-gradient(150deg,var(--plum),var(--brown));
  box-shadow:0 8px 20px -10px rgba(86,34,139,.75);
}
.mark svg{width:24px;height:24px}
.mark-img{width:100%;height:100%;object-fit:cover}

.menu-wrap{position:relative;z-index:70}
.menu-wrap summary{
  display:inline-flex;
  align-items:center;
  gap:.55rem;
  min-height:46px;
  padding:.55rem 1.05rem;
  list-style:none;
  cursor:pointer;
  font-size:1rem;
  font-weight:700;
  letter-spacing:.12em;
  color:var(--plum);
  background:#fffdf9;
  border:1.5px solid var(--plum);
  border-radius:999px;
  box-shadow:0 6px 16px -12px rgba(31,23,38,.7);
}
.menu-wrap summary::-webkit-details-marker{display:none}
.bars{display:inline-flex;flex-direction:column;gap:4px}
.bars i{
  display:block;
  width:17px;
  height:2px;
  border-radius:2px;
  background:currentColor;
  transition:transform .25s ease,opacity .25s ease;
}
details[open] summary{
  position:fixed;
  top:1rem;
  right:1rem;
  z-index:90;
  background:#fdf8f1;
}
details[open] .bars i:nth-child(1){transform:translateY(6px) rotate(45deg)}
details[open] .bars i:nth-child(2){opacity:0}
details[open] .bars i:nth-child(3){transform:translateY(-6px) rotate(-45deg)}

menu{margin:0;padding:0;list-style:none}

details[open] menu{
  position:fixed;
  inset:0;
  z-index:80;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:.2rem;
  padding:5rem 1.4rem 2rem;
  overflow-y:auto;
  background:
    radial-gradient(circle at 82% 14%,rgba(139,69,19,.55),transparent 54%),
    radial-gradient(circle at 14% 86%,rgba(86,34,139,.65),transparent 58%),
    linear-gradient(160deg,#2a123f,#1f1726);
  animation:menuIn .28s ease both;
}
@keyframes menuIn{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:none}}

details[open] menu li{width:100%;max-width:460px}
details[open] menu li a{
  display:flex;
  align-items:center;
  min-height:54px;
  padding:.45rem .3rem;
  color:#f6ede2;
  font-size:1.12rem;
  text-decoration:none;
  border-bottom:1px solid rgba(246,237,226,.16);
}
details[open] menu li a:hover{color:#dcc0ff}

/* ---------- 锚点条 ---------- */
.rail{
  position:sticky;
  top:0;
  z-index:40;
  background:rgba(247,241,233,.94);
  border-bottom:1px solid var(--line);
  backdrop-filter:blur(6px);
}
.rail ul{
  display:flex;
  gap:.45rem;
  max-width:1180px;
  margin:0 auto;
  padding:.5rem 1.2rem;
  list-style:none;
  overflow-x:auto;
  scrollbar-width:none;
}
.rail ul::-webkit-scrollbar{display:none}
.rail a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:.2rem .9rem;
  font-size:1rem;
  white-space:nowrap;
  text-decoration:none;
  color:var(--ink);
  background:#fffdf9;
  border:1px solid var(--line);
  border-radius:999px;
  transition:background .2s ease,color .2s ease,border-color .2s ease;
}
.rail a:hover,.rail a.on{
  color:#fff;
  background:var(--plum);
  border-color:var(--plum);
}

/* ---------- 首屏 ---------- */
.hero{
  display:grid;
  grid-template-columns:minmax(0,42%) minmax(0,1fr);
  align-items:center;
  gap:2.2rem;
  min-height:100vh;
  max-width:1180px;
  margin:0 auto;
  padding:2rem 1.2rem 3.5rem;
}

.hero-art{
  position:relative;
  margin:0;
  min-height:48vh;
  overflow:hidden;
  border-radius:28px 68px 28px 68px;
  background:linear-gradient(150deg,rgba(86,34,139,.9),rgba(139,69,19,.85));
  box-shadow:0 30px 60px -32px rgba(31,23,38,.85);
  animation:morph 18s ease-in-out infinite alternate;
  will-change:transform;
}
.hero-img{width:100%;height:100%;min-height:48vh;object-fit:cover}
.blob{
  display:block;
  width:100%;
  height:100%;
  min-height:48vh;
  background:
    conic-gradient(from 35deg,#56228b,#8b4513,#3d155f,#b06a2c,#56228b);
}
@keyframes morph{
  0%{border-radius:52% 48% 40% 60% / 56% 44% 56% 44%}
  50%{border-radius:40% 60% 56% 44% / 46% 58% 42% 54%}
  100%{border-radius:56% 44% 46% 54% / 44% 52% 48% 56%}
}

.hero-copy{text-align:right}
.hero-copy h1{
  margin:0 0 .9rem;
  font-size:clamp(2rem,4.8vw,3.6rem);
  line-height:1.2;
  letter-spacing:-.015em;
}
.lede{
  max-width:32ch;
  margin:0 0 0 auto;
  color:var(--muted);
  font-size:1.05rem;
}

/* ---------- 正文区 ---------- */
.doc{
  display:grid;
  grid-template-columns:minmax(0,1fr) 258px;
  align-items:start;
  gap:2rem;
  max-width:1180px;
  margin:0 auto;
  padding:2.6rem 1.2rem 4rem;
  border-top:1px solid var(--line);
}

.doc-body{
  display:flex;
  flex-direction:column;
  gap:1.6rem;
  min-width:0;
}

.doc-body div{
  padding:1.6rem 1.5rem 1.7rem;
  background:var(--card);
  border:1px solid var(--line);
  border-bottom:4px solid var(--brown);
  border-radius:28px;
  box-shadow:0 18px 36px -30px rgba(31,23,38,.9);
}

.doc-body h2,
.doc-body h3{
  margin:0 0 .9rem;
  line-height:1.35;
  color:var(--plum);
}
.doc-body h2{font-size:1.34rem}
.doc-body h3{font-size:1.14rem;color:var(--brown)}
.doc-body h2 > span,
.doc-body h3 > span{
  position:relative;
  display:inline-block;
  padding-bottom:.32rem;
}
.doc-body h2 > span::after,
.doc-body h3 > span::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:3px;
  border-radius:3px;
  background:linear-gradient(90deg,var(--plum),var(--brown));
}

.doc-body p{margin:0 0 .95rem}
.doc-body p:last-child{margin-bottom:0}
.doc-body ul,.doc-body ol{margin:0 0 1rem;padding-left:1.3rem}
.doc-body li{margin:.25rem 0}
.doc-body li::marker{color:var(--brown)}
.doc-body a{text-decoration-thickness:1px;text-underline-offset:3px}
.doc-body blockquote{
  margin:0 0 1rem;
  padding:.9rem 1.1rem;
  border-left:5px solid var(--plum);
  border-radius:6px 22px 22px 6px;
  background:#f4ece2;
  color:#40354a;
}
.doc-body figure{margin:0 0 1rem}
.doc-body figcaption{font-size:1rem;color:var(--muted);margin-top:.4rem}
.doc-body img{border-radius:24px}

/* ---------- 侧栏 ---------- */
.doc-side{
  position:sticky;
  top:84px;
  margin:0;
  padding:1.15rem 1rem 1.3rem;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:24px;
  box-shadow:0 16px 32px -30px rgba(31,23,38,.9);
}
.doc-side h2{
  margin:0 0 .7rem;
  font-size:1.02rem;
  color:var(--brown);
  letter-spacing:.08em;
}
.doc-side h2 > span{
  display:inline-block;
  border-bottom:2px solid currentColor;
  padding-bottom:.2rem;
}
.doc-side ul{margin:0;padding:0;list-style:none}
.doc-side a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:.2rem .55rem;
  font-size:1rem;
  color:var(--ink);
  text-decoration:none;
  border-radius:14px;
}
.doc-side a:hover{background:#f2e8db;color:var(--plum)}

/* ---------- 页脚 ---------- */
footer{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:1.1rem 1.5rem;
  margin-top:1rem;
  padding:3rem 1.2rem 2.2rem;
  background:var(--ink);
  color:#efe6dc;
}
.foot-brand{
  grid-column:1/-1;
  margin:0;
  font-size:clamp(2.1rem,9vw,4.6rem);
  font-weight:700;
  line-height:1.05;
  letter-spacing:-.02em;
  color:#c9a6f2;
  word-break:break-word;
}
.foot-nav{
  grid-column:1/-1;
  margin:0;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.1rem .8rem;
  font-size:1rem;
}
.foot-nav a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  color:#efe6dc;
  text-decoration:none;
  border-bottom:1px solid rgba(239,230,220,.28);
}
.foot-nav a:hover{color:#c9a6f2;border-color:#c9a6f2}
.foot-copy{
  grid-column:1/3;
  align-self:center;
  font-size:1rem;
  color:#a99d93;
}
.foot-top{
  grid-column:3/5;
  margin:0;
  text-align:right;
}
.foot-top a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 .3rem;
  font-size:1rem;
  color:#c9a6f2;
  text-decoration:none;
}

/* ---------- 移动端 ---------- */
@media (max-width:820px){
  .hero{
    grid-template-columns:minmax(0,1fr);
    min-height:100svh;
    gap:1.1rem;
    padding:1rem 1.2rem 2.4rem;
  }
  .hero-copy{order:1}
  .hero-art{order:2;min-height:32vh;border-radius:24px 46px 24px 46px}
  .hero-img,.blob{min-height:32vh}
  .hero-copy h1{margin-bottom:.6rem}
  .lede{max-width:38ch}

  .doc{grid-template-columns:minmax(0,1fr);gap:1.4rem;padding:1.8rem 1.2rem 3rem}
  .doc-side{position:static}
  .doc-body div{padding:1.3rem 1.15rem 1.4rem;border-radius:24px}
  main div[id]{scroll-margin-top:78px}
}

@media (max-width:420px){
  body{font-size:16px}
  .rail ul{padding:.5rem .8rem}
  .top{padding:.9rem .9rem .6rem}
  footer{padding:2.4rem .9rem 1.8rem}
  .foot-copy{grid-column:1/-1}
  .foot-top{grid-column:1/-1;text-align:left}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
}

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