@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Merriweather:wght@300;400;700&display=swap');

:root{
  --ink:#1c1726;
  --ink-soft:#241d33;
  --violet:#6514ff;
  --magenta:#bf00ff;
  --paper:#f5eefc;
  --dim:#c5b6df;
  --line:rgba(191,0,255,.3);
  --glass:rgba(101,20,255,.14);
  --r:28px;
  --display:'Abril Fatface','Songti SC','Noto Serif SC',Georgia,serif;
  --body:'Merriweather','Songti SC','Noto Serif SC',Georgia,serif;
}

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

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

body{
  margin:0;
  background:var(--ink);
  color:var(--paper);
  font-family:var(--body);
  font-size:17px;
  line-height:1.78;
  overflow-x:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:-20% -20% -20% -20%;
  z-index:-2;
  pointer-events:none;
  background:
    repeating-linear-gradient(115deg, rgba(101,20,255,.22) 0 24px, rgba(101,20,255,0) 24px 104px),
    radial-gradient(58% 42% at 82% -4%, rgba(191,0,255,.36), transparent 70%),
    radial-gradient(52% 40% at -4% 104%, rgba(101,20,255,.32), transparent 70%);
  animation:drift 26s linear infinite alternate;
  will-change:transform;
}

@keyframes drift{
  from{transform:translate3d(0,0,0)}
  to{transform:translate3d(-64px,-48px,0)}
}

h1,h2,h3,h4{
  font-family:var(--display);
  font-weight:400;
  letter-spacing:.01em;
  line-height:1.22;
  color:#fff;
}

a{color:#e6bcff}

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

:focus-visible{outline:3px solid var(--magenta);outline-offset:3px}

.sr{
  position:absolute;width:1px;height:1px;
  padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0;
}

.skip{
  position:absolute;left:12px;top:-60px;z-index:99;
  background:var(--magenta);color:#fff;text-decoration:none;
  padding:12px 18px;border-radius:14px;transition:top .2s;
}
.skip:focus{top:10px}

/* ── 顶部 ───────────────────────────── */
.top{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(24,19,34,.9);
  backdrop-filter:blur(16px);
  border-bottom:1px solid var(--line);
}

.brandbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
  max-width:1180px;
  margin:0 auto;
  padding:12px 18px 8px;
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  text-decoration:none;
  color:#fff;
  font-family:var(--display);
  font-size:26px;
  line-height:1.1;
}
.brand:hover .brand-name{color:#f0d4ff}
.brand-name{transition:color .2s}

.logo{
  width:36px;height:36px;
  border-radius:12px;
  border:1px solid var(--line);
  object-fit:cover;
}

.search{
  display:flex;
  align-items:center;
  gap:8px;
  flex:1 1 220px;
  max-width:360px;
}

.search input{
  flex:1 1 auto;
  min-width:0;
  min-height:44px;
  padding:0 16px;
  font-family:inherit;
  font-size:16px;
  color:var(--paper);
  background:rgba(255,255,255,.07);
  border:1px solid var(--line);
  border-radius:999px;
}
.search input::placeholder{color:#a794c6}

.search button{
  min-height:44px;
  padding:0 18px;
  font-family:inherit;
  font-size:16px;
  color:#fff;
  border:0;
  border-radius:999px;
  cursor:pointer;
  background:linear-gradient(100deg,var(--violet),var(--magenta));
  transition:transform .25s,filter .25s;
}
.search button:hover{transform:translateY(-1px);filter:brightness(1.15)}

.menu{
  max-width:1180px;
  margin:0 auto;
  padding:0 12px 8px;
}
.menu p{
  display:flex;
  flex-wrap:wrap;
  gap:2px 4px;
  margin:0;
}
.menu a{
  display:inline-block;
  min-height:44px;
  padding:10px 12px;
  line-height:24px;
  font-size:16px;
  color:var(--paper);
  text-decoration:none;
  border:1px solid transparent;
  border-radius:14px;
  transition:background .25s,color .25s,border-color .25s;
}
.menu a:hover,.menu a:focus-visible{
  background:rgba(191,0,255,.2);
  border-color:var(--line);
  color:#fff;
}

/* ── 首屏 ───────────────────────────── */
.hero{
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:center;
  min-height:45vh;
  max-width:1180px;
  margin:0 auto;
  padding:40px 18px 54px;
  text-align:center;
}
.hero::before{
  content:"";
  position:absolute;
  left:-12%;
  right:-12%;
  top:52%;
  height:110px;
  background:linear-gradient(100deg,var(--violet),var(--magenta));
  transform:skewY(-3.5deg);
  z-index:0;
  opacity:.92;
}

.collage{
  position:absolute;
  inset:0;
  z-index:0;
  pointer-events:none;
}
.hero-img{
  position:absolute;
  object-fit:cover;
  border-radius:var(--r);
  border:2px solid rgba(245,238,252,.35);
  box-shadow:0 22px 44px rgba(0,0,0,.5);
  opacity:.5;
}
.hero-img.a{width:150px;height:112px;left:1%;top:6%;transform:rotate(-8deg)}
.hero-img.b{width:164px;height:122px;right:1%;bottom:4%;transform:rotate(7deg)}

.hero-body{position:relative;z-index:2;max-width:760px;margin:0 auto}

.kicker{
  display:inline-block;
  margin:0 0 14px;
  padding:7px 16px;
  font-size:16px;
  color:#fff;
  background:rgba(28,23,38,.72);
  border:1px solid rgba(245,238,252,.4);
  border-radius:999px;
  backdrop-filter:blur(6px);
}

.hero h1{
  margin:0 0 16px;
  font-size:clamp(32px,7.4vw,62px);
  text-shadow:0 4px 24px rgba(28,23,38,.75);
}

.lede{
  margin:0 auto;
  max-width:56ch;
  font-size:17px;
  color:#f0e6fb;
  text-shadow:0 2px 14px rgba(28,23,38,.9);
}

/* ── 主体骨架 ───────────────────────── */
.wrap{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:36px;
  max-width:1180px;
  margin:0 auto;
  padding:10px 18px 64px;
}

.content{min-width:0}

main,[id]{scroll-margin-top:150px}

/* ── 正文 ───────────────────────────── */
.prose > article{
  position:relative;
  margin:0 0 40px;
  padding:30px 22px;
  background:var(--glass);
  border:1px solid var(--line);
  border-radius:var(--r);
  backdrop-filter:blur(12px);
  transition:box-shadow .25s,transform .25s;
}
.prose > article:hover{
  box-shadow:0 22px 48px rgba(101,20,255,.28);
  transform:translateY(-2px);
}

.prose h2{
  margin:0 0 18px;
  font-size:clamp(25px,4.6vw,38px);
}
.prose h3{
  margin:30px 0 12px;
  font-size:clamp(20px,3.4vw,26px);
}

.prose h2 > span,.prose h3 > span{
  background-image:linear-gradient(transparent 64%,rgba(191,0,255,.6) 64%);
  background-repeat:no-repeat;
}

.prose p{
  margin:0 0 16px;
  max-width:70ch;
  color:#ece2fa;
}
.prose p:last-child{margin-bottom:0}

.prose strong{color:#fff}

.prose a{
  color:#f0c6ff;
  text-decoration:underline;
  text-decoration-color:rgba(191,0,255,.7);
  text-underline-offset:3px;
}
.prose a:hover{color:#fff;background:rgba(191,0,255,.2)}

.prose ul,.prose ol{
  margin:0 0 18px;
  padding-left:1.3em;
  color:#ece2fa;
}
.prose li{margin:.45em 0}
.prose li::marker{color:var(--magenta)}

.prose blockquote{
  margin:22px 0;
  padding:16px 20px;
  border-left:4px solid var(--magenta);
  border-radius:0 var(--r) var(--r) 0;
  background:rgba(191,0,255,.12);
  color:#f2e9fd;
}
.prose blockquote p:last-child{margin-bottom:0}

.prose figure{margin:22px 0}
.prose img{
  border-radius:20px;
  border:1px solid var(--line);
}
.prose figcaption{
  margin-top:10px;
  font-size:16px;
  color:var(--dim);
}

.prose table{
  width:100%;
  border-collapse:collapse;
  margin:20px 0;
  font-size:16px;
}
.prose th,.prose td{
  padding:10px 12px;
  border:1px solid var(--line);
  text-align:left;
}
.prose th{background:rgba(191,0,255,.16);color:#fff}

.prose hr{
  border:0;
  height:1px;
  background:var(--line);
  margin:28px 0;
}

/* ── 侧栏 ───────────────────────────── */
.side{
  display:grid;
  gap:22px;
  align-content:start;
}

.card{
  padding:22px;
  background:var(--glass);
  border:1px solid var(--line);
  border-radius:var(--r);
  backdrop-filter:blur(14px);
}
.card h2{
  margin:0 0 14px;
  font-size:22px;
}
.card h2 > span{
  display:inline-block;
  padding-bottom:3px;
  border-bottom:3px solid var(--magenta);
}

.toc{
  margin:0;
  padding:0;
  list-style:none;
  counter-reset:t;
}
.toc li{counter-increment:t}
.toc a{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:8px 10px;
  font-size:16px;
  color:var(--paper);
  text-decoration:none;
  border-radius:14px;
  transition:background .25s,color .25s;
}
.toc a::before{
  content:counter(t,decimal-leading-zero);
  font-family:var(--display);
  font-size:15px;
  color:var(--magenta);
}
.toc a:hover{background:rgba(191,0,255,.22);color:#fff}

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

.card-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:0 20px;
  font-size:16px;
  color:#fff;
  text-decoration:none;
  border-radius:999px;
  background:linear-gradient(100deg,var(--violet),var(--magenta));
  transition:filter .25s,transform .25s;
}
.card-btn:hover{filter:brightness(1.16);transform:translateY(-1px)}

/* ── 页脚 ───────────────────────────── */
.foot{
  margin-top:24px;
  padding:40px 18px 30px;
  border-top:1px solid var(--line);
  background:rgba(0,0,0,.3);
}

.foot-cols{
  display:grid;
  grid-template-columns:1fr;
  gap:26px;
  max-width:1180px;
  margin:0 auto;
}
.foot dl{margin:0}
.foot dt{
  margin-bottom:8px;
  font-family:var(--display);
  font-size:18px;
  color:#fff;
}
.foot dd{
  margin:0;
  font-size:16px;
  color:var(--dim);
}
.foot dd a{
  display:inline-block;
  min-height:44px;
  padding:10px 0;
  font-size:16px;
  color:var(--dim);
  text-decoration:none;
  transition:color .25s;
}
.foot dd a:hover{color:#fff}

.copy{
  max-width:1180px;
  margin:26px auto 0;
  padding-top:18px;
  border-top:1px solid var(--line);
  font-size:16px;
  color:var(--dim);
}

/* ── 断点 ───────────────────────────── */
@media (min-width:560px){
  .hero{padding:56px 24px 72px}
  .hero-img.a{width:190px;height:140px;top:9%}
  .hero-img.b{width:206px;height:152px}
}

@media (min-width:900px){
  .wrap{
    grid-template-columns:minmax(0,1fr) 302px;
    gap:48px;
    padding-bottom:80px;
  }
  .side{position:sticky;top:158px}
  .foot-cols{grid-template-columns:1.3fr 1fr 1fr}
  .prose > article{padding:36px 32px}
  .brandbar{padding:14px 24px 8px}
  .hero{padding:64px 24px 84px}
  .hero-img{opacity:.62}
  .hero-img.a{width:250px;height:180px;left:2%}
  .hero-img.b{width:270px;height:196px;right:2%}
  .menu{padding:0 16px 10px}
}

@media (min-width:1180px){
  .hero-img.a{width:290px;height:206px}
  .hero-img.b{width:310px;height:222px}
}

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

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