@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Crimson+Pro:wght@400;500;600;700&display=swap');

:root{
  --deep:#170c10;
  --ink:#261717;
  --red:#ff0000;
  --rose:#ff1493;
  --text:#f7e9ee;
  --muted:#c8adb6;
  --line:rgba(255,255,255,.13);
  --glass:rgba(255,255,255,.065);
  --r:10px;
  --serif:"Crimson Pro",Georgia,"Songti SC","Noto Serif SC",serif;
  --sans:"Atkinson Hyperlegible",-apple-system,BlinkMacSystemFont,"PingFang SC","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(--text);
  background:var(--deep);
  overflow-x:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:-25vh -20vw;
  z-index:-2;
  background:
    radial-gradient(38% 46% at 22% 28%,rgba(255,0,0,.55),transparent 62%),
    radial-gradient(42% 40% at 78% 18%,rgba(255,20,147,.5),transparent 64%),
    radial-gradient(46% 52% at 62% 82%,rgba(255,20,147,.3),transparent 66%),
    radial-gradient(34% 40% at 12% 78%,rgba(255,0,0,.34),transparent 62%),
    conic-gradient(from 200deg at 50% 50%,#261717,#4a1524,#2b1218,#261717);
  filter:saturate(1.25) blur(30px);
  animation:drift 11s ease-in-out infinite alternate;
}

@keyframes drift{
  0%{transform:translate3d(0,0,0) scale(1)}
  50%{transform:translate3d(-3%,2%,0) scale(1.08)}
  100%{transform:translate3d(3%,-2%,0) scale(1.04)}
}

a{color:inherit}

.skip{
  position:absolute;
  left:12px;
  top:-64px;
  z-index:80;
  padding:.6rem 1rem;
  border-radius:var(--r);
  background:#fff;
  color:var(--ink);
  text-decoration:none;
  transition:top .2s ease;
}
.skip:focus{top:12px}

/* 顶栏 */
.dock{
  position:sticky;
  top:0;
  z-index:40;
  border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,rgba(23,12,16,.9),rgba(23,12,16,.55));
  backdrop-filter:blur(16px);
  transition:box-shadow .3s ease,background .3s ease;
}
.dock.scrolled{box-shadow:0 14px 34px rgba(0,0,0,.45)}

.announce{
  display:flex;
  align-items:center;
  gap:.55rem;
  padding:.42rem clamp(1rem,4vw,2.5rem);
  font-size:.82rem;
  color:var(--muted);
  border-bottom:1px solid rgba(255,255,255,.07);
}
.announce p{margin:0;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.announce-dot{
  flex:0 0 7px;
  width:7px;height:7px;
  border-radius:50%;
  background:var(--rose);
  box-shadow:0 0 10px var(--rose);
  animation:pulse 2.4s ease-in-out infinite;
}
@keyframes pulse{50%{opacity:.3}}

.masthead{padding:.45rem clamp(1rem,4vw,2.5rem) .6rem}

.brandline{display:flex;align-items:center;justify-content:space-between;gap:1rem}

.brand{
  display:inline-flex;
  align-items:center;
  gap:.55rem;
  min-height:44px;
  text-decoration:none;
  font-family:var(--serif);
  font-size:1.3rem;
  font-weight:600;
  letter-spacing:.04em;
}
.brand .mark{width:30px;height:30px;border-radius:8px;object-fit:cover}
.brand span{
  background:linear-gradient(92deg,#fff,#ffd0e4 42%,var(--rose));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.menu{
  display:flex;
  gap:.12rem;
  margin-top:.25rem;
  overflow-x:auto;
  scrollbar-width:none;
  -ms-overflow-style:none;
}
.menu::-webkit-scrollbar{display:none}
.menu a{
  display:inline-flex;
  align-items:center;
  gap:.42rem;
  min-height:44px;
  padding:.3rem .72rem;
  border:1px solid transparent;
  border-radius:var(--r);
  font-size:.95rem;
  color:var(--muted);
  text-decoration:none;
  white-space:nowrap;
  transition:color .25s ease,background .25s ease,border-color .25s ease,transform .25s ease;
}
.menu a:hover,.menu a:focus-visible{
  color:#fff;
  background:rgba(255,255,255,.09);
  border-color:var(--line);
  transform:translateY(-2px);
}
.pip{
  flex:0 0 6px;
  width:6px;height:6px;
  border-radius:2px;
  background:linear-gradient(135deg,var(--red),var(--rose));
}

/* 首屏 */
.hero{
  position:relative;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:1.2rem;
  min-height:100vh;
  min-height:100svh;
  padding:clamp(2rem,8vw,5rem) clamp(1rem,5vw,3rem);
  text-align:center;
  overflow:hidden;
}

.badge{
  display:inline-flex;
  align-items:center;
  padding:.45rem 1.05rem;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--glass);
  backdrop-filter:blur(10px);
  font-size:.85rem;
  letter-spacing:.2em;
  color:#ffd7e7;
  animation:float 9s ease-in-out infinite;
}
@keyframes float{50%{transform:translateY(-9px)}}

.hero h1{
  margin:0;
  max-width:16ch;
  font-family:var(--serif);
  font-weight:600;
  font-size:clamp(2.4rem,9vw,5.6rem);
  line-height:1.08;
  letter-spacing:.01em;
  background:linear-gradient(180deg,#fff,#ffd9e7 55%,#ff9ec6);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  text-wrap:balance;
}

.aurora{position:absolute;inset:auto 0 -6% 0;height:48%;z-index:-1;pointer-events:none;opacity:.8}
.aurora i{
  position:absolute;
  inset:0;
  background:conic-gradient(from 90deg at 30% 70%,rgba(255,0,0,.62),rgba(255,20,147,.16),rgba(255,0,0,.5),transparent 76%);
  filter:blur(38px) saturate(1.3);
  animation:drift 10s ease-in-out infinite alternate;
}
.aurora i:nth-child(2){animation-duration:12s;opacity:.65;transform:scaleX(-1)}
.aurora i:nth-child(3){animation-duration:9s;opacity:.5;filter:blur(52px)}

/* 正文区 */
.reader{
  display:grid;
  gap:1.5rem;
  max-width:1160px;
  margin:0 auto;
  padding:0 clamp(1rem,4vw,2.5rem) clamp(2rem,6vw,4rem);
}

.ribbon{
  position:relative;
  isolation:isolate;
  height:66px;
  margin:0;
  overflow:hidden;
  border:1px solid var(--line);
  border-radius:var(--r);
  background:linear-gradient(90deg,rgba(255,0,0,.34),rgba(255,20,147,.24),rgba(255,255,255,.05));
}
.ribbon i{
  position:absolute;
  inset:-70% -12%;
  background:conic-gradient(from 0deg,rgba(255,255,255,.5),transparent 40%,rgba(255,0,0,.55),transparent 78%);
  filter:blur(18px);
  mix-blend-mode:screen;
  animation:drift 9s ease-in-out infinite alternate;
}
.ribbon i:nth-child(2){animation-duration:12s;opacity:.7}

.body{
  counter-reset:sec;
  min-width:0;
}
.body div{
  counter-increment:sec;
  position:relative;
  padding:clamp(1.6rem,3.2vw,2.6rem) 0;
  border-top:1px solid rgba(255,255,255,.11);
  scroll-margin-top:152px;
}
.body div:first-child{border-top:0;padding-top:0}
.body div::before{
  content:counter(sec,decimal-leading-zero);
  position:absolute;
  top:clamp(1.6rem,3.2vw,2.6rem);
  right:0;
  font-family:var(--serif);
  font-size:.95rem;
  letter-spacing:.16em;
  color:rgba(255,214,232,.4);
}
.body div:first-child::before{top:0}

.body h2,.body h3{
  font-family:var(--serif);
  font-weight:600;
  line-height:1.25;
  margin:0 0 .8rem;
}
.body h2{font-size:clamp(1.5rem,4vw,2.1rem)}
.body h3{font-size:clamp(1.2rem,3vw,1.5rem);margin-top:1.4rem}
.body small,.f-note small,.side small{
  display:block;
  font-size:.76rem;
  font-weight:700;
  letter-spacing:.26em;
  color:var(--rose);
  margin-bottom:.45rem;
}
.body p{margin:0 0 1.05rem;font-size:1.05rem;line-height:1.92;color:#f1e3e8}
.body ul,.body ol{margin:0 0 1.1rem;padding-left:1.35rem;line-height:1.9}
.body li{margin-bottom:.45rem}
.body a{color:#ffc2da;text-decoration:underline;text-underline-offset:3px}
.body a:hover{color:#fff}
.body img{display:block;max-width:100%;height:auto;margin:1.2rem 0;border-radius:var(--r)}
.body figure{margin:1.2rem 0}
.body blockquote{
  margin:1.2rem 0;
  padding:.9rem 1.1rem;
  border-left:3px solid var(--rose);
  border-radius:0 var(--r) var(--r) 0;
  background:rgba(255,255,255,.05);
  color:#ffe4ee;
}
.body blockquote p:last-child{margin-bottom:0}
.body strong{color:#fff}

/* 侧栏 */
.side{
  padding:1.1rem;
  border:1px solid var(--line);
  border-radius:var(--r);
  background:var(--glass);
  backdrop-filter:blur(14px);
  box-shadow:0 18px 40px rgba(0,0,0,.28);
  align-self:start;
}
.side h2{
  margin:0 0 .8rem;
  font-family:var(--serif);
  font-size:1.24rem;
  font-weight:600;
  letter-spacing:.06em;
}
.toc{list-style:none;margin:0;padding:0;counter-reset:t}
.toc li{counter-increment:t}
.toc a{
  display:flex;
  align-items:center;
  gap:.55rem;
  min-height:42px;
  padding:.3rem .35rem;
  border-bottom:1px solid rgba(255,255,255,.07);
  font-size:.95rem;
  color:var(--muted);
  text-decoration:none;
  transition:color .2s ease,background .2s ease;
}
.toc a::before{
  content:counter(t,decimal-leading-zero);
  font-family:var(--serif);
  font-size:.82rem;
  color:var(--rose);
}
.toc a:hover,.toc a:focus-visible{color:#fff;background:rgba(255,255,255,.08)}
.totop{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  margin-top:.8rem;
  font-size:.9rem;
  color:#ffd0e2;
  text-decoration:none;
}
.totop:hover{color:#fff}

/* 页脚 */
.foot{
  display:grid;
  grid-template-columns:1.5fr 1fr 1fr 1.25fr;
  gap:1.6rem;
  margin-top:clamp(2rem,7vw,4rem);
  padding:clamp(2rem,6vw,3.4rem) clamp(1rem,4vw,2.5rem) 1.2rem;
  border-top:1px solid var(--line);
  background:linear-gradient(180deg,rgba(23,12,16,.35),rgba(15,7,10,.94));
}
.mega{
  margin:0 0 .8rem;
  font-family:var(--serif);
  font-size:clamp(2.1rem,6vw,3.3rem);
  line-height:1.05;
  font-weight:600;
  background:linear-gradient(120deg,#fff,var(--rose) 60%,var(--red));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
.foot .mark{width:46px;height:46px;border-radius:var(--r);object-fit:cover}
.foot dl{margin:0}
.foot dt{margin:0}
.foot dt a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  font-size:.96rem;
  color:var(--muted);
  text-decoration:none;
  border-bottom:1px solid transparent;
  transition:color .2s ease,border-color .2s ease;
}
.foot dt a:hover,.foot dt a:focus-visible{color:#fff;border-color:var(--rose)}
.foot dd{margin:.05rem 0 .5rem;font-size:.78rem;letter-spacing:.16em;color:rgba(255,214,232,.55)}
.f-note p{margin:0;font-size:.9rem;line-height:1.7;color:var(--muted)}
.f-base{
  grid-column:1/-1;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.6rem;
  padding-top:1rem;
  border-top:1px solid rgba(255,255,255,.1);
  font-size:.82rem;
  color:rgba(255,214,232,.62);
}

/* 动效 */
.reveal{opacity:0;transform:translateY(18px)}
.reveal.in{
  opacity:1;
  transform:none;
  transition:opacity .6s ease var(--d,0s),transform .6s ease var(--d,0s);
}

@media (min-width:960px){
  .reader{
    grid-template-columns:minmax(0,1fr) 272px;
    grid-template-areas:
      "fig fig"
      "body side";
    gap:2rem 2.4rem;
  }
  .ribbon{grid-area:fig}
  .body{grid-area:body}
  .side{grid-area:side;position:sticky;top:158px}
}

@media (max-width:860px){
  .foot{grid-template-columns:1fr 1fr}
  .f-brand,.f-base{grid-column:1/-1}
  .f-note{grid-column:1/-1}
}

@media (max-width:560px){
  body{font-size:16px}
  .hero{min-height:88svh}
  .reader{padding-bottom:2rem}
  .foot{grid-template-columns:1fr;gap:1.2rem}
  .f-col,.f-note{grid-column:1/-1}
  .foot dd{display:inline-block;margin:0 0 .7rem .5rem}
  .foot dt{display:inline-block}
}

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

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