@import url('https://fonts.googleapis.com/css2?family=Didact+Gothic&family=Poiret+One&display=swap');

:root{
  --ink:#000000;
  --panel:#0d0d0d;
  --panel-2:#101010;
  --line:#1c1c1c;
  --text:#e6e6e6;
  --dim:#8f8f8f;
  --gold:#d9c48f;
  --blue:#131a26;
  --r:28px;
  --bar-h:104px;
  --font-display:'Poiret One','Didact Gothic',"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  --font-body:'Didact Gothic',system-ui,-apple-system,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  color-scheme: dark;
}

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

html{
  scroll-behavior:smooth;
  scroll-padding-top:1rem;
  -webkit-text-size-adjust:100%;
  background:#000;
}

body{
  margin:0;
  background:var(--ink);
  color:var(--text);
  font-family:var(--font-body);
  font-size:16px;
  line-height:1.75;
  overflow-x:hidden;
  padding-bottom:calc(var(--bar-h) + 2rem);
}

a{color:var(--gold);text-decoration:none}

:focus-visible{
  outline:2px solid var(--gold);
  outline-offset:3px;
  border-radius:6px;
}

/* ---- 底部固定条 ---- */
.bar{
  position:fixed;
  left:0;right:0;bottom:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:.4rem;
  padding:.55rem clamp(.5rem,2vw,1.4rem) calc(.55rem + env(safe-area-inset-bottom));
  background:rgba(9,9,9,.94);
  border-top:1px solid var(--line);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}

.bar__nav{flex:1 1 0;min-width:0}
.bar__nav p{
  display:flex;
  flex-wrap:wrap;
  gap:.35rem;
  margin:0;
}
.bar__nav--l p{justify-content:flex-start}
.bar__nav--r p{justify-content:flex-end}

.bar__nav a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:.35rem .85rem;
  border-radius:999px;
  border:1px solid #202020;
  background:#0e0e0e;
  color:#cfcfcf;
  font-size:1rem;
  line-height:1.2;
  white-space:nowrap;
  transition:background .2s ease,color .2s ease,border-color .2s ease,transform .2s ease;
}
.bar__nav a:hover{
  background:var(--blue);
  border-color:#2c3a52;
  color:#fff;
  transform:translateY(-1px);
}

.brand{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:.3rem .5rem;
  flex:0 0 auto;
  font-family:var(--font-display);
  font-size:1rem;
  letter-spacing:.16em;
  color:#fff;
  white-space:nowrap;
  text-shadow:0 0 14px rgba(217,196,143,.4);
  transition:color .2s ease,text-shadow .2s ease;
}
.brand:hover{color:var(--gold);text-shadow:0 0 18px rgba(217,196,143,.65)}

/* ---- 版面骨架 ---- */
main{
  max-width:1140px;
  margin:0 auto;
  padding:0 clamp(1rem,4vw,2.5rem);
}

article{
  display:grid;
  grid-template-columns:minmax(0,1fr) 17rem;
  column-gap:clamp(1rem,3vw,2.5rem);
  align-items:start;
}

article > div:not(.hero){grid-column:1}
.rail{grid-column:2;grid-row:2 / span 40}

/* ---- 首屏 ---- */
.hero{
  grid-column:1 / -1;
  grid-row:1;
  min-height:45vh;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-end;
  text-align:right;
  gap:.9rem;
  padding:clamp(2rem,8vh,4rem) 0 clamp(1.4rem,5vh,2.6rem);
}

.badge{
  display:inline-flex;
  align-items:center;
  padding:.2rem .9rem;
  border-radius:999px;
  border:1px solid #2a2418;
  background:#0d0b07;
  color:var(--gold);
  font-size:1rem;
  letter-spacing:.16em;
  animation:float 7s ease-in-out infinite;
}

.hero h1{
  margin:0;
  font-family:var(--font-display);
  font-weight:400;
  font-size:clamp(2.3rem,8vw,5rem);
  line-height:1.06;
  letter-spacing:.02em;
  color:#fff;
  text-shadow:0 0 22px rgba(255,255,255,.16);
  animation:rise .6s ease both;
}

.hero__lede{
  margin:0;
  max-width:48ch;
  color:var(--dim);
  font-size:1rem;
  animation:rise .6s ease .08s both;
}

/* ---- 正文区块（纯色块、无边框、大圆角） ---- */
article > div:not(.hero){
  background:var(--panel);
  border-radius:var(--r);
  padding:clamp(1.3rem,3.5vw,2.5rem);
  margin-bottom:1rem;
  scroll-margin-top:1rem;
  animation:rise .5s ease both;
}

article h2{
  margin:0 0 .7rem;
  font-family:var(--font-display);
  font-weight:400;
  font-size:clamp(1.5rem,3.6vw,2.1rem);
  line-height:1.25;
  letter-spacing:.02em;
  color:#fff;
}

article h3{
  margin:1.5rem 0 .4rem;
  font-weight:400;
  font-size:1.15rem;
  color:#fff;
}

article p{margin:0 0 .9rem;color:#d2d2d2}
article p:last-child{margin-bottom:0}
article ul,article ol{margin:0 0 1rem;padding-left:1.3rem}
article li{margin:.35rem 0}
article strong{color:#fff;font-weight:400}
article blockquote{
  margin:1rem 0;
  padding:.4rem 0 .4rem 1rem;
  border-left:2px solid #2a2a2a;
  color:#b9b9b9;
}
article img{
  display:block;
  max-width:100%;
  height:auto;
  margin:1rem 0;
  border-radius:18px;
}
article a{
  color:var(--gold);
  border-bottom:1px solid rgba(217,196,143,.35);
  transition:border-color .2s ease,color .2s ease;
}
article a:hover{border-bottom-color:var(--gold);color:#f0dcae}
article pre{
  overflow:auto;
  padding:1rem;
  border-radius:14px;
  background:#080808;
}
code,pre{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.95rem}
article table{width:100%;border-collapse:collapse;margin:1rem 0}
article th,article td{padding:.5rem .6rem;border-bottom:1px solid var(--line);text-align:left}

/* ---- 侧栏 ---- */
.rail{
  position:sticky;
  top:1.5rem;
  align-self:start;
  background:var(--panel-2);
  border-radius:var(--r);
  padding:1.2rem 1.1rem;
}

.rail h2{
  margin:0 0 .15rem;
  font-family:var(--font-display);
  font-weight:400;
  font-size:1.05rem;
  letter-spacing:.12em;
  color:#fff;
  line-height:1.3;
}

.rail .subtitle{
  margin:0 0 1rem;
  color:var(--dim);
  font-size:1rem;
  letter-spacing:.14em;
}

.rail__list{
  list-style:none;
  counter-reset:toc;
  margin:0;
  padding:0;
  display:grid;
  gap:.28rem;
}

.rail__list li{
  counter-increment:toc;
  animation:rise .5s ease both;
}
.rail__list li:nth-child(2){animation-delay:.05s}
.rail__list li:nth-child(3){animation-delay:.1s}
.rail__list li:nth-child(4){animation-delay:.15s}
.rail__list li:nth-child(5){animation-delay:.2s}
.rail__list li:nth-child(6){animation-delay:.25s}

.rail__list a{
  display:flex;
  align-items:center;
  gap:.55rem;
  min-height:44px;
  padding:.25rem .45rem;
  border:0;
  border-radius:14px;
  color:#c9c9c9;
  transition:background .2s ease,color .2s ease,transform .2s ease;
}
.rail__list a::before{
  content:counter(toc,decimal-leading-zero);
  font-family:var(--font-display);
  font-size:.95rem;
  color:#5d5d5d;
}
.rail__list a:hover{
  background:#181818;
  color:#fff;
  transform:translateX(3px);
}

/* ---- 页脚 ---- */
.foot{
  max-width:1140px;
  margin:2.5rem auto 0;
  padding:1.4rem 1rem;
  text-align:center;
  color:#7a7a7a;
  font-size:1rem;
}
.foot p{margin:0 0 .2rem;letter-spacing:.1em;color:#8e8e8e}
.foot small{display:block;font-size:1rem}
.foot a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:.3rem .8rem;
  color:#a9a9a9;
  border-radius:999px;
  transition:color .2s ease,background .2s ease;
}
.foot a:hover{color:#fff;background:#151515}

@keyframes rise{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:none}
}
@keyframes float{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-4px)}
}

/* ---- 移动端 ---- */
@media (max-width:700px){
  :root{--bar-h:200px}

  .bar{
    flex-direction:column;
    align-items:center;
    gap:.3rem;
    padding:.45rem .45rem calc(.45rem + env(safe-area-inset-bottom));
  }
  .brand{order:-1;font-size:1rem;padding:.25rem .5rem}
  .bar__nav{flex:0 0 auto;width:100%}
  .bar__nav p{justify-content:center;gap:.3rem}
  .bar__nav a{padding:.3rem .6rem;font-size:1rem}

  main{padding:0 1rem}
  article{display:block}

  .hero{
    min-height:38vh;
    padding:2rem 0 1.4rem;
    align-items:flex-end;
    text-align:right;
  }
  .hero h1{font-size:clamp(2rem,10.5vw,3rem)}

  .rail{position:static;margin:1rem 0 0}

  .foot{margin-top:1.8rem;padding:1.1rem .5rem}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{
    animation:none !important;
    transition:none !important;
  }
}

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