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

:root{
  --vio:#6514ff;
  --neon:#bf00ff;
  --ink:#120e1a;
  --bg:#1c1726;
  --surf:#251d36;
  --paper:#f4f0ff;
  --dim:#a99fc4;
  --line:rgba(244,240,255,.16);
  --rail:240px;
  --ease:cubic-bezier(.2,.7,.2,1);
}

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

html{
  background:var(--bg);
  scroll-behavior:smooth;
  scroll-snap-type:y proximity;
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  font-family:'Fira Sans',system-ui,-apple-system,'Segoe UI','Noto Sans SC',sans-serif;
  font-size:17px;
  line-height:1.72;
  color:var(--paper);
  background:transparent;
  overflow-x:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:-120px;
  z-index:-1;
  background:
    radial-gradient(circle at 82% 8%,rgba(191,0,255,.20),transparent 55%),
    radial-gradient(circle at 8% 92%,rgba(101,20,255,.22),transparent 55%),
    repeating-linear-gradient(45deg,rgba(101,20,255,.10) 0 2px,transparent 2px 20px);
  animation:drift 22s linear infinite;
  pointer-events:none;
}

@keyframes drift{
  to{transform:translate3d(-20px,-20px,0)}
}

a{color:var(--neon)}
img{max-width:100%;height:auto;display:block}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- 左侧竖排导航 ---------- */
.rail{
  position:fixed;
  left:0;top:0;bottom:0;
  width:var(--rail);
  z-index:40;
  display:flex;
  flex-direction:column;
  padding:20px 0 18px;
  background:linear-gradient(180deg,#150f20,#100b19);
  border-right:4px solid var(--vio);
}

.rail-brand{padding:0 20px 20px}

.mark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;height:44px;
  border-radius:4px;
  background:var(--vio);
  text-decoration:none;
  border-bottom:4px solid var(--neon);
  transition:background .22s var(--ease),transform .22s var(--ease);
}
.mark:hover{background:var(--neon);transform:translateY(-2px)}
.mark-i{width:26px;height:26px;object-fit:contain}
.mark-t{
  font-family:'Fira Code',monospace;
  font-weight:700;
  font-size:20px;
  color:#fff;
  line-height:1;
}

.rail nav{flex:1 1 auto;overflow-y:auto;overflow-x:hidden}

.rail nav > ol{
  list-style:none;
  margin:0;
  padding:0 0 12px;
  display:flex;
  flex-direction:column;
}

.rail nav > ol > li:nth-child(3),
.rail nav > ol > li:nth-child(5){
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--line);
}

.rail nav > ol > li > a{
  display:flex;
  align-items:center;
  min-height:46px;
  padding:10px 20px;
  color:var(--paper);
  text-decoration:none;
  font-size:16px;
  font-weight:500;
  line-height:1.4;
  border-left:4px solid transparent;
  transition:background .22s var(--ease),border-color .22s var(--ease),color .22s var(--ease);
}

.rail nav > ol > li > a:hover,
.rail nav > ol > li > a:focus-visible{
  background:var(--vio);
  border-left-color:var(--neon);
  color:#fff;
  outline:none;
}

.rail-contact{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  margin:12px 20px 0;
  padding:10px 14px;
  border:2px solid var(--neon);
  border-radius:4px;
  color:#fff;
  text-decoration:none;
  font-size:16px;
  font-weight:600;
  transition:background .22s var(--ease);
}
.rail-contact:hover{background:var(--neon)}

/* ---------- 主区 ---------- */
main{margin-left:var(--rail)}

.hero{
  position:relative;
  min-height:100vh;
  display:grid;
  grid-template-columns:1fr 1fr;
  align-items:stretch;
  overflow:hidden;
}

.hero-art{
  position:relative;
  overflow:hidden;
  min-height:52vh;
  border-right:4px solid var(--neon);
  background:
    radial-gradient(circle at 32% 28%,rgba(191,0,255,.55),transparent 62%),
    radial-gradient(circle at 78% 76%,rgba(101,20,255,.60),transparent 60%),
    repeating-linear-gradient(-45deg,rgba(101,20,255,.45) 0 16px,#1a1326 16px 32px);
}

.hero-art .pend{
  position:absolute;
  right:-8%;
  bottom:-8%;
  width:62%;
  aspect-ratio:1;
  background:linear-gradient(135deg,var(--neon),var(--vio));
  clip-path:polygon(0 100%,100% 0,100% 100%);
  border-radius:4px;
}

.hero-art .pend.b{
  right:auto;left:12%;bottom:auto;top:14%;
  width:26%;
  background:var(--paper);
  opacity:.14;
  clip-path:none;
  transform:rotate(12deg);
}

.hero-img{
  width:100%;
  height:100%;
  object-fit:cover;
  filter:grayscale(.25) contrast(1.12);
  mix-blend-mode:luminosity;
}

.hero::after{
  content:"";
  position:absolute;
  left:0;right:0;bottom:0;
  height:16px;
  background:linear-gradient(90deg,var(--vio),var(--neon),var(--vio));
}

.hero-copy{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:flex-end;
  gap:24px;
  text-align:right;
  padding:clamp(28px,5vw,72px) clamp(24px,5vw,64px);
}

.hero-copy h1{
  margin:0;
  font-size:clamp(2.3rem,4.8vw,3.9rem);
  line-height:1.08;
  font-weight:700;
  letter-spacing:-.01em;
  color:#fff;
}

.hero-copy h1::after{
  content:"";
  display:block;
  width:104px;
  height:8px;
  margin:26px 0 0 auto;
  background:linear-gradient(90deg,var(--neon),var(--vio));
  border-radius:4px;
}

/* ---------- 正文与侧栏 ---------- */
.wrap{
  max-width:1200px;
  margin:0 auto;
  padding:0 clamp(16px,4vw,48px);
  display:grid;
  grid-template-columns:minmax(0,1fr) 220px;
  gap:clamp(32px,4vw,56px);
  align-items:start;
}

.body{min-width:0;padding:clamp(40px,6vw,72px) 0 8px}

.body div{display:flex;flex-direction:column;gap:32px}

.body div > article{
  scroll-margin-top:16px;
  scroll-snap-align:start;
  background:var(--surf);
  border:1px solid rgba(244,240,255,.07);
  border-bottom:4px solid var(--vio);
  border-radius:4px;
  padding:clamp(24px,3.4vw,40px) clamp(20px,3vw,34px);
}

.body div > article:nth-child(3n+2){border-bottom-color:var(--neon)}
.body div > article:nth-child(3n){border-bottom-color:#3c2f57}

.body div small,
.side small,
footer small{
  display:block;
  font-family:'Fira Code',monospace;
  font-size:15px;
  letter-spacing:.2em;
  color:var(--neon);
  margin:0 0 .5em;
}

.body div h2{
  margin:0 0 .6em;
  font-size:clamp(1.5rem,2.8vw,2.1rem);
  line-height:1.24;
  letter-spacing:-.01em;
  color:#fff;
}

.body div h2::before{
  content:"";
  display:inline-block;
  width:12px;height:12px;
  margin-right:10px;
  background:var(--neon);
  border-radius:2px;
  transform:translateY(-2px);
}

.body div h3{
  margin:1.5em 0 .5em;
  font-size:1.2rem;
  line-height:1.4;
  color:#fff;
}

.body div p{margin:0 0 1.05em}
.body div > article > :last-child{margin-bottom:0}

.body div ul,
.body div ol{margin:0 0 1.1em;padding-left:1.3em}

.body div li{margin:.35em 0}
.body div a{color:#d9a6ff;text-underline-offset:3px}
.body div a:hover{color:#fff}

.body div blockquote{
  margin:0 0 1.1em;
  padding:14px 18px;
  border-left:4px solid var(--neon);
  background:rgba(101,20,255,.16);
  border-radius:4px;
}

.body div code{
  font-family:'Fira Code',monospace;
  font-size:.92em;
  background:rgba(0,0,0,.4);
  padding:.12em .4em;
  border-radius:4px;
}

.body div img{border-radius:4px;margin:0 0 1em}

.body div table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 1.1em;
  font-size:16px;
}

.body div th,
.body div td{
  border-bottom:1px solid var(--line);
  padding:10px 12px;
  text-align:left;
}

.side{
  position:sticky;
  top:24px;
  align-self:start;
  max-height:calc(100vh - 48px);
  overflow:auto;
  margin:0;
  padding:clamp(40px,6vw,72px) 0 24px 18px;
  border-left:4px solid var(--vio);
}

.side h3{margin:0 0 .9em;font-size:20px;color:#fff}
.side ol{list-style:none;margin:0;padding:0}

.side ol a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:8px 0;
  color:var(--dim);
  text-decoration:none;
  font-size:16px;
  border-bottom:1px dashed var(--line);
  transition:color .2s var(--ease),padding-left .2s var(--ease);
}

.side ol a:hover{color:#fff;padding-left:6px}

/* ---------- 页脚 ---------- */
footer{
  margin-left:var(--rail);
  margin-top:56px;
  padding:clamp(40px,5vw,64px) clamp(16px,4vw,48px) 28px;
  background:linear-gradient(180deg,#140e1f,#0d0916);
  border-top:4px solid var(--neon);
  display:grid;
  grid-template-columns:1.4fr 1fr 1.3fr;
  gap:clamp(28px,4vw,56px);
  align-items:start;
}

footer h2{margin:0 0 .5em;font-size:1.32rem;line-height:1.3;color:#fff}

.f-k{margin:0;color:var(--dim);font-size:16px}

.f-nav ol{list-style:none;margin:0;padding:0}

.f-nav ol a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:6px 0;
  color:var(--paper);
  text-decoration:none;
  font-size:16px;
  border-bottom:1px solid rgba(244,240,255,.1);
}
.f-nav ol a:hover{color:var(--neon)}

.sub{display:grid;grid-template-columns:1fr auto;gap:8px;margin-top:6px}

.sub input{
  min-height:46px;
  padding:10px 12px;
  font-size:16px;
  font-family:inherit;
  color:var(--paper);
  background:rgba(255,255,255,.06);
  border:2px solid var(--line);
  border-radius:4px;
}
.sub input:focus{outline:none;border-color:var(--neon)}

.sub button{
  min-height:46px;
  padding:10px 18px;
  font-size:16px;
  font-family:inherit;
  font-weight:700;
  color:#fff;
  background:var(--vio);
  border:0;
  border-radius:4px;
  cursor:pointer;
  transition:background .22s var(--ease);
}
.sub button:hover{background:var(--neon)}

.f-bottom{
  grid-column:1/-1;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  flex-wrap:wrap;
  margin-top:12px;
  padding-top:20px;
  border-top:1px solid var(--line);
}

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

.to-top{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:8px 18px;
  border:2px solid var(--vio);
  border-radius:4px;
  color:var(--paper);
  text-decoration:none;
  font-size:16px;
  transition:background .22s var(--ease),border-color .22s var(--ease);
}
.to-top:hover{background:var(--neon);border-color:var(--neon)}

/* ---------- 滚动显影 ---------- */
.rv{opacity:0;transform:translateY(22px);transition:opacity .3s var(--ease),transform .3s var(--ease)}
.rv.in{opacity:1;transform:none}

/* ---------- 窄屏 ---------- */
@media (max-width:900px){
  .rail{
    flex-direction:row;
    align-items:center;
    gap:10px;
    right:0;
    bottom:auto;
    width:auto;
    height:auto;
    padding:8px 12px;
    border-right:0;
    border-bottom:4px solid var(--neon);
    overflow-x:auto;
    overflow-y:hidden;
  }

  .rail-brand{padding:0;flex:0 0 auto}
  .mark{width:40px;height:40px}

  .rail nav{flex:1 1 auto;overflow:visible}
  .rail nav > ol{flex-direction:row;gap:4px;padding:0}
  .rail nav > ol > li:nth-child(3),
  .rail nav > ol > li:nth-child(5){
    margin:0 0 0 6px;
    padding:0 0 0 6px;
    border-top:0;
    border-left:1px solid var(--line);
  }
  .rail nav > ol > li > a{
    min-height:44px;
    padding:10px 12px;
    white-space:nowrap;
    border-left:0;
    border-bottom:4px solid transparent;
    border-radius:4px;
  }
  .rail nav > ol > li > a:hover,
  .rail nav > ol > li > a:focus-visible{border-bottom-color:var(--neon)}

  .rail-contact{flex:0 0 auto;margin:0;padding:10px 14px}

  main{margin-left:0;padding-top:64px}

  .hero{grid-template-columns:1fr;min-height:0}
  .hero-art{min-height:34vh;border-right:0;border-bottom:4px solid var(--neon)}
  .hero-copy{padding:32px 20px 46px}

  .wrap{grid-template-columns:1fr;gap:8px}
  .body{padding-top:36px}
  .body div > article{scroll-margin-top:84px}

  .side{
    position:static;
    max-height:none;
    margin-top:8px;
    padding:8px 0 24px 16px;
  }

  footer{margin-left:0;grid-template-columns:1fr;gap:30px}
  .f-bottom{grid-column:auto;flex-direction:column;align-items:flex-start}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  body::before{animation:none}
  .rv{opacity:1;transform:none;transition:none}
}

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