@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@400;500;600;700&family=Quicksand:wght@300;400;500;600;700&display=swap');

:root{
  --violet:#6514ff;
  --magenta:#bf00ff;
  --ink:#1c1726;
  --paper:#f7f3ff;
  --card:#ffffff;
  --r:18px;
  --edge:3px solid var(--ink);
}

*{box-sizing:border-box}

html{scroll-behavior:smooth}

body{
  margin:0;
  padding-left:236px;
  min-height:100vh;
  color:var(--ink);
  background-color:var(--paper);
  background-image:
    radial-gradient(circle at 84% 10%, rgba(191,0,255,.17), transparent 46%),
    radial-gradient(circle at 8% 82%, rgba(101,20,255,.14), transparent 42%),
    repeating-linear-gradient(45deg, rgba(101,20,255,.055) 0 12px, transparent 12px 24px);
  background-size:auto, auto, 34px 34px;
  animation:drift 26s linear infinite;
  font-family:"Quicksand","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  font-size:17px;
  line-height:1.72;
  overflow-wrap:break-word;
}

@keyframes drift{
  to{background-position:0 0, 0 0, 34px 34px;}
}

[id]{scroll-margin-top:26px;}

/* ---------- 左侧固定导航 ---------- */

.masthead{
  position:fixed;
  inset:0 auto 0 0;
  width:236px;
  z-index:30;
  display:flex;
  flex-direction:column;
  gap:26px;
  padding:26px 18px 32px;
  background:var(--ink);
  border-right:4px solid var(--magenta);
  overflow-y:auto;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  text-decoration:none;
  color:var(--paper);
}

.brand-mark{
  flex:none;
  width:26px;
  height:26px;
  border-radius:9px;
  border:3px solid var(--paper);
  background:linear-gradient(135deg,var(--violet),var(--magenta));
  transition:transform .24s ease;
}

.brand:hover .brand-mark,
.brand:focus-visible .brand-mark{transform:rotate(18deg) scale(1.08);}

.brand-name{
  font-family:"Caveat","Quicksand",cursive;
  font-size:27px;
  line-height:1.1;
  letter-spacing:.4px;
}

.rail-line{
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.rail-line a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:10px 16px;
  border:2px solid rgba(247,243,255,.4);
  border-radius:999px;
  color:var(--paper);
  font-size:16px;
  line-height:1.3;
  text-decoration:none;
  transition:background .24s ease,color .24s ease,border-color .24s ease,transform .24s ease;
}

.rail-line a:hover,
.rail-line a:focus-visible{
  background:var(--magenta);
  border-color:var(--magenta);
  color:#fff;
  transform:translateX(5px);
}

/* ---------- 主栅格 ---------- */

main{
  display:grid;
  grid-template-columns:minmax(0,1fr) 292px;
  align-items:start;
  gap:48px;
  padding:40px 40px 72px 48px;
}

/* ---------- 首屏 ---------- */

.hero{
  grid-column:1 / -1;
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:30px;
  min-height:70vh;
  padding:60px 44px 48px;
  border:4px solid var(--ink);
  border-radius:28px;
  background:
    linear-gradient(118deg,#ece1ff 0%,#ffffff 48%,#f6dcff 100%);
}

.hero::after{
  content:"";
  position:absolute;
  right:-70px;
  bottom:-70px;
  width:230px;
  height:230px;
  border-radius:26px;
  background:linear-gradient(135deg,var(--magenta),var(--violet));
  opacity:.2;
  transform:rotate(18deg);
  pointer-events:none;
}

.hero-ghost{
  position:absolute;
  right:-.04em;
  top:-.06em;
  max-width:104%;
  font-family:"Caveat",cursive;
  font-size:clamp(74px,14vw,186px);
  line-height:.86;
  letter-spacing:-.01em;
  white-space:nowrap;
  color:transparent;
  -webkit-text-stroke:3px rgba(101,20,255,.3);
  user-select:none;
  pointer-events:none;
}

.hero-copy{
  position:relative;
  z-index:2;
  display:flex;
  flex-direction:column;
  gap:18px;
  max-width:44rem;
}

.hero-h1{
  margin:0;
  font-size:clamp(34px,5.2vw,62px);
  line-height:1.1;
  font-weight:700;
  letter-spacing:-.02em;
  max-width:16ch;
}

.hero-lead{
  margin:0;
  max-width:42ch;
  font-size:18px;
  color:#3b3348;
}

.hero-figure{
  position:relative;
  z-index:2;
  margin:0;
  border:3px solid var(--ink);
  border-radius:var(--r);
  overflow:hidden;
  background:#fff;
}

.hero-figure img{
  display:block;
  width:100%;
  height:auto;
  object-fit:cover;
}

/* ---------- 正文 ---------- */

.prose{min-width:0;}

.prose > article{
  position:relative;
  margin:0 0 48px;
  padding:34px 30px 28px;
  border:var(--edge);
  border-radius:var(--r);
  background:var(--card);
}

.prose > article:last-child{margin-bottom:0;}

.prose > article::before{
  content:"";
  position:absolute;
  left:-3px;
  top:-3px;
  width:72px;
  height:11px;
  background:var(--magenta);
  border-radius:18px 0 12px 0;
}

.prose h2,
.prose h3{
  font-weight:700;
  letter-spacing:-.01em;
}

.prose h2{
  margin:.15em 0 .55em;
  font-size:clamp(24px,3vw,34px);
  line-height:1.26;
}

.prose h2 > span{
  background:linear-gradient(180deg,transparent 62%,rgba(191,0,255,.26) 62%,rgba(191,0,255,.26) 93%,transparent 93%);
  padding:0 .08em;
}

.prose h3{
  margin:1.5em 0 .45em;
  font-size:22px;
  line-height:1.35;
}

.prose h3 > span{
  border-bottom:3px solid rgba(101,20,255,.45);
  padding-bottom:1px;
}

.prose p{margin:0 0 1.1em;}

.prose ul,
.prose ol{
  margin:0 0 1.2em;
  padding-left:1.35em;
}

.prose li{margin:.35em 0;}

.prose li::marker{color:var(--magenta);}

.prose a{
  color:var(--violet);
  text-underline-offset:3px;
}

.prose a:hover{color:var(--magenta);}

.prose strong{color:var(--ink);}

.prose img{
  max-width:100%;
  height:auto;
  border:2px solid var(--ink);
  border-radius:14px;
}

.prose blockquote{
  margin:0 0 1.2em;
  padding:14px 20px;
  border-left:7px solid var(--magenta);
  border-radius:0 14px 14px 0;
  background:#faf4ff;
}

.prose blockquote p:last-child{margin-bottom:0;}

.prose code{
  padding:2px 6px;
  border-radius:8px;
  background:#f0e7ff;
  font-size:16px;
}

.prose hr{
  border:0;
  height:3px;
  background:var(--ink);
  margin:2em 0;
}

/* ---------- 侧栏 ---------- */

.side{
  position:sticky;
  top:26px;
  padding:22px 18px 24px;
  border:var(--edge);
  border-radius:var(--r);
  background:var(--card);
}

.side-h{
  margin:0 0 16px;
  font-family:"Caveat","Quicksand",cursive;
  font-size:28px;
  line-height:1.2;
  font-weight:600;
}

.side-h span{
  display:inline-block;
  padding-bottom:2px;
  border-bottom:3px solid var(--magenta);
}

.side-line{
  margin:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.side-line a{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:8px 12px;
  border:2px solid rgba(28,23,38,.14);
  border-radius:12px;
  color:var(--ink);
  font-size:16px;
  line-height:1.3;
  text-decoration:none;
  transition:background .22s ease,color .22s ease,border-color .22s ease;
}

.side-line a:hover,
.side-line a:focus-visible{
  background:var(--violet);
  border-color:var(--violet);
  color:#fff;
}

/* ---------- 页脚 ---------- */

.foot{
  display:grid;
  grid-template-columns:1.35fr 1fr;
  gap:44px;
  padding:52px 40px 26px 48px;
  background:var(--ink);
  color:var(--paper);
  border-top:5px solid var(--magenta);
}

.foot article{min-width:0;}

.foot-h{
  margin:0 0 14px;
  font-family:"Caveat","Quicksand",cursive;
  font-size:29px;
  line-height:1.2;
  font-weight:600;
}

.foot-h span{
  display:inline-block;
  padding-bottom:2px;
  border-bottom:3px solid var(--magenta);
}

.foot-brand p{
  margin:0;
  max-width:40ch;
  color:rgba(247,243,255,.78);
}

.foot-line{
  margin:0;
  display:flex;
  flex-wrap:wrap;
  gap:8px 10px;
}

.foot-line a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:8px 15px;
  border:2px solid rgba(247,243,255,.34);
  border-radius:999px;
  color:var(--paper);
  font-size:16px;
  line-height:1.3;
  text-decoration:none;
  transition:background .22s ease,border-color .22s ease;
}

.foot-line a:hover,
.foot-line a:focus-visible{
  background:var(--violet);
  border-color:var(--violet);
}

.foot-bar{
  grid-column:1 / -1;
  padding-top:16px;
  margin-top:6px;
  border-top:2px solid rgba(247,243,255,.16);
  text-align:center;
}

.foot-bar p{
  margin:0;
  font-size:16px;
  color:rgba(247,243,255,.68);
}

/* ---------- 入场 ---------- */

.reveal{
  opacity:0;
  transform:translateY(18px);
  transition:opacity .5s ease,transform .5s ease;
}

.reveal.in{
  opacity:1;
  transform:none;
}

/* ---------- 窄屏 ---------- */

@media (max-width:900px){
  body{padding-left:0;}

  .masthead{
    position:sticky;
    inset:auto;
    top:0;
    width:auto;
    flex-direction:column;
    gap:10px;
    padding:12px 14px 10px;
    border-right:0;
    border-bottom:4px solid var(--magenta);
    overflow:visible;
  }

  .rail-line{
    flex-direction:row;
    gap:8px;
    padding-bottom:4px;
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .rail-line a{
    flex:none;
    white-space:nowrap;
    padding:10px 14px;
  }

  main{
    grid-template-columns:1fr;
    gap:30px;
    padding:24px 16px 52px;
  }

  .hero{
    min-height:0;
    padding:34px 20px 28px;
    border-radius:20px;
    gap:22px;
  }

  .hero-ghost{font-size:clamp(58px,20vw,110px);}

  .hero-lead{font-size:17px;}

  .prose > article{
    padding:24px 18px 20px;
    margin-bottom:30px;
  }

  .side{position:static;}

  .foot{
    grid-template-columns:1fr;
    gap:26px;
    padding:34px 16px 22px;
  }

  [id]{scroll-margin-top:120px;}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}

  body{animation:none;}

  .reveal{opacity:1;transform:none;transition:none;}

  .rail-line a,
  .side-line a,
  .foot-line a,
  .brand-mark{transition:none;}
}

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