@import url('https://fonts.googleapis.com/css2?family=Cormorant+Infant:wght@300;400;500;600;700&family=Great+Vibes&display=swap');

:root{
  --ink:#0d0d0d;
  --violet:#8000ff;
  --pink:#ff00ff;
  --line:rgba(128,0,255,.42);
  --line-soft:rgba(128,0,255,.2);
  --text:#e8ddf7;
  --dim:#b49ad8;
  --mono:ui-monospace,"SFMono-Regular","Cascadia Mono",Consolas,monospace;
}

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

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

body{
  margin:0;
  min-height:100vh;
  background-color:var(--ink);
  color:var(--text);
  font-family:"Cormorant Infant","Songti SC","Noto Serif SC",Georgia,serif;
  font-size:17px;
  line-height:1.85;
  letter-spacing:.015em;
  background-image:
    radial-gradient(58rem 42rem at 96% -8%, rgba(255,0,255,.12), transparent 68%),
    radial-gradient(52rem 40rem at -8% 108%, rgba(128,0,255,.16), transparent 70%),
    linear-gradient(rgba(128,0,255,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128,0,255,.07) 1px, transparent 1px);
  background-size:auto,auto,48px 48px,48px 48px;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:60;
  pointer-events:none;
  background:repeating-linear-gradient(180deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  mix-blend-mode:screen;
  opacity:.75;
}

a{color:var(--pink)}

img{max-width:100%}

.shell{display:flex;flex-direction:column;min-height:100vh}

/* ---------- 左侧固定栏 ---------- */
.rail{
  position:fixed;
  left:0;
  top:0;
  bottom:0;
  z-index:50;
  width:212px;
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:20px 18px 26px;
  border-right:1px solid var(--line);
  background:rgba(13,13,13,.92);
  overflow-y:auto;
}

.mark{
  flex:0 0 auto;
  width:52px;
  height:52px;
  display:grid;
  place-items:center;
  border:1px solid var(--pink);
  border-radius:4px;
  background:rgba(255,0,255,.08);
  color:var(--pink);
  text-decoration:none;
  transition:border-color .2s ease, background .2s ease;
}
.mark:hover,.mark:focus-visible{border-color:#fff;background:rgba(255,0,255,.2)}
.mark img{width:100%;height:100%;object-fit:contain;display:block}
.mark-txt{
  font-family:"Great Vibes","Songti SC",serif;
  font-size:26px;
  line-height:1;
  text-shadow:0 0 12px var(--pink);
}

.rail-nav{display:flex;flex-direction:column;gap:8px}

.pill{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:9px 15px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--text);
  font-size:16px;
  line-height:1.5;
  text-decoration:none;
  transition:border-color .18s ease, color .18s ease, transform .18s ease, text-shadow .18s ease;
}
.pill:hover,.pill:focus-visible{
  border-color:var(--pink);
  color:#fff;
  transform:translateX(3px);
  text-shadow:0 0 10px var(--pink);
}

.find{margin-top:auto;display:flex;flex-direction:column;gap:8px}
.find input{
  min-height:42px;
  width:100%;
  padding:8px 12px;
  font:inherit;
  font-size:16px;
  color:var(--text);
  background:#140a22;
  border:1px solid var(--line);
  border-radius:4px;
}
.find input::placeholder{color:#8f74b3}
.find input:focus{
  outline:none;
  border-color:var(--pink);
  box-shadow:0 0 0 1px rgba(255,0,255,.35);
}
.find button{
  min-height:42px;
  font:inherit;
  font-size:16px;
  color:#fff;
  background:rgba(128,0,255,.2);
  border:1px solid var(--violet);
  border-radius:4px;
  cursor:pointer;
  transition:background .18s ease, border-color .18s ease;
}
.find button:hover{background:rgba(255,0,255,.22);border-color:var(--pink)}

/* ---------- 舞台 ---------- */
.stage{
  margin-left:212px;
  display:flex;
  flex-direction:column;
  min-height:100vh;
  min-width:0;
}

.hero{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:clamp(16px,3vw,30px);
  min-height:45vh;
  padding:36px clamp(20px,5vw,64px) 28px;
  border-bottom:1px solid var(--line);
}

.hero-copy{text-align:right;max-width:24em}

h1{
  margin:0;
  font-size:clamp(1.9rem,4.4vw,3.2rem);
  font-weight:600;
  line-height:1.28;
  letter-spacing:.05em;
  color:#fff;
  text-shadow:2px 0 rgba(255,0,255,.8), -2px 0 rgba(128,0,255,.9), 0 0 22px rgba(255,0,255,.32);
  animation:hack 8s steps(1) infinite;
}

@keyframes hack{
  0%,90%,100%{transform:none}
  91%{transform:skewX(1.4deg) translateX(-3px)}
  92%{transform:skewX(-1.1deg) translateX(2px)}
  93%{transform:none}
}

.hero-art{
  flex:0 0 auto;
  width:clamp(62px,9vw,104px);
  aspect-ratio:1;
  display:grid;
  place-items:center;
  border:1px solid var(--pink);
  border-radius:4px;
  background:rgba(255,0,255,.07);
}
.hero-art img{width:84%;height:84%;object-fit:contain;display:block}

/* ---------- 内容区 ---------- */
.wrap{
  display:grid;
  grid-template-columns:minmax(0,1fr) 18rem;
  gap:clamp(24px,4vw,48px);
  align-items:start;
  width:100%;
  max-width:1180px;
  margin:0 auto;
  padding:34px clamp(20px,5vw,64px) 60px;
}

.prose{min-width:0}

.prose section{
  border:1px solid var(--line);
  border-radius:4px;
  padding:clamp(18px,3vw,30px);
  background:linear-gradient(180deg, rgba(128,0,255,.07), rgba(13,13,13,.25));
  scroll-margin-top:100px;
}
.prose section + section{margin-top:22px}

.prose h2{
  margin:0 0 14px;
  padding-left:14px;
  border-left:3px solid var(--pink);
  font-size:clamp(1.35rem,2.6vw,1.85rem);
  font-weight:600;
  line-height:1.45;
  letter-spacing:.03em;
  color:#fff;
  text-shadow:0 0 14px rgba(255,0,255,.3);
}

.prose h3{
  margin:22px 0 10px;
  font-size:18px;
  font-weight:600;
  color:#f3e6ff;
  letter-spacing:.02em;
}

.prose p{margin:0 0 14px}
.prose p:last-child{margin-bottom:0}
.prose ul,.prose ol{margin:0 0 14px;padding-left:1.35em}
.prose li{margin:.4em 0}
.prose li::marker{color:var(--violet)}
.prose strong{color:#fff}
.prose em{color:#e4c8ff}

.prose a{
  color:var(--pink);
  text-decoration:none;
  border-bottom:1px solid rgba(255,0,255,.4);
  word-break:break-word;
}
.prose a:hover,.prose a:focus-visible{
  color:#fff;
  border-bottom-color:#fff;
  text-shadow:0 0 10px var(--pink);
}

.prose img{
  display:block;
  margin:16px 0;
  height:auto;
  border:1px solid var(--line);
  border-radius:4px;
}

.prose blockquote{
  margin:16px 0;
  padding:10px 16px;
  border-left:3px solid var(--violet);
  background:rgba(128,0,255,.09);
  color:#dcc9ff;
}

.prose hr{border:0;border-top:1px dashed var(--line-soft);margin:22px 0}

.prose table{width:100%;border-collapse:collapse;font-size:16px;margin:0 0 14px}
.prose th,.prose td{border:1px solid var(--line);padding:9px 11px;text-align:left;vertical-align:top}
.prose th{background:rgba(128,0,255,.12);color:#fff;font-weight:600}

.prose code{
  font-family:var(--mono);
  font-size:15px;
  color:#ffb3ff;
  background:rgba(128,0,255,.14);
  padding:1px 5px;
  border-radius:3px;
}

/* ---------- 右侧栏 ---------- */
.side{
  border:1px solid var(--line);
  border-radius:4px;
  padding:20px;
  background:rgba(128,0,255,.05);
  min-width:0;
}
.side h2{
  margin:0 0 8px;
  font-size:1.25rem;
  font-weight:600;
  letter-spacing:.04em;
  color:#fff;
  text-shadow:0 0 12px rgba(255,0,255,.32);
}
.side .subtitle{
  margin:0 0 16px;
  font-size:16px;
  line-height:1.7;
  color:var(--dim);
}
.side-list{display:flex;flex-direction:column;gap:6px}
.side-list a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:6px 12px;
  border:1px solid var(--line-soft);
  border-radius:4px;
  color:#dcc9ff;
  font-size:16px;
  line-height:1.4;
  text-decoration:none;
  transition:border-color .18s ease, color .18s ease, background .18s ease;
}
.side-list a:hover,.side-list a:focus-visible{
  border-color:var(--pink);
  color:#fff;
  background:rgba(255,0,255,.1);
}

/* ---------- 页脚 ---------- */
.foot{
  margin-top:auto;
  border-top:1px solid var(--line);
  padding:38px clamp(20px,5vw,64px) 24px;
  background:rgba(13,13,13,.72);
}
.foot-grid{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,2.1fr);
  gap:clamp(24px,4vw,48px);
  align-items:start;
  max-width:1180px;
  margin:0 auto;
}
.foot-brand p{
  margin:0;
  font-family:"Cormorant Infant","Songti SC",serif;
  font-size:clamp(2rem,6.6vw,3.4rem);
  line-height:1.2;
  letter-spacing:.06em;
  background:linear-gradient(100deg,var(--violet),var(--pink));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  -webkit-text-fill-color:transparent;
  filter:drop-shadow(0 0 14px rgba(255,0,255,.28));
}
.foot-nav{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:20px;
  min-width:0;
}
.foot-nav dl{margin:0}
.foot-nav dt{
  font-family:var(--mono);
  font-size:16px;
  letter-spacing:.14em;
  color:var(--pink);
  margin-bottom:6px;
}
.foot-nav dd{margin:0}
.foot-nav a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:4px 0;
  color:#d3c0ee;
  font-size:16px;
  line-height:1.5;
  text-decoration:none;
  border-bottom:1px solid transparent;
  transition:color .18s ease, border-color .18s ease;
}
.foot-nav a:hover,.foot-nav a:focus-visible{color:#fff;border-bottom-color:var(--pink)}

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

:focus-visible{outline:2px solid var(--pink);outline-offset:2px}

/* ---------- 滚动显现 ---------- */
html.js .prose section{
  opacity:0;
  transform:translateY(16px);
  transition:opacity .5s ease, transform .5s ease;
}
html.js .prose section.in{opacity:1;transform:none}

/* ---------- 平板与手机 ---------- */
@media (max-width:1023px){
  .rail{
    position:sticky;
    top:0;
    bottom:auto;
    width:auto;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:center;
    gap:10px;
    padding:10px 14px;
    border-right:0;
    border-bottom:1px solid var(--line);
    overflow:visible;
  }
  .mark{order:1;width:42px;height:42px}
  .mark-txt{font-size:22px}
  .find{
    order:2;
    flex:1 1 140px;
    min-width:0;
    flex-direction:row;
    margin-top:0;
  }
  .find input{min-width:0;flex:1 1 auto;min-height:42px}
  .find button{flex:0 0 auto;padding:0 14px}
  .rail-nav{
    order:3;
    flex:1 0 100%;
    flex-direction:row;
    gap:8px;
    overflow-x:auto;
    padding-bottom:4px;
    scrollbar-width:thin;
  }
  .pill{flex:0 0 auto;white-space:nowrap}
  .pill:hover{transform:none}
  .stage{margin-left:0}
  .wrap{grid-template-columns:minmax(0,1fr);padding-top:22px}
  .prose section{scroll-margin-top:118px}
  .hero{min-height:40vh;padding:26px 20px 22px}
  .foot-grid{grid-template-columns:minmax(0,1fr)}
  .foot-nav{grid-template-columns:repeat(2,minmax(0,1fr))}
  .side{order:2}
}

@media (max-width:520px){
  body{font-size:16px}
  h1{font-size:clamp(1.7rem,7.6vw,2.2rem)}
  .wrap{padding:20px 16px 44px}
  .hero{padding:22px 16px 20px;gap:14px}
  .foot{padding:28px 16px 20px}
  .foot-nav{grid-template-columns:repeat(2,minmax(0,1fr))}
}

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

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