@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,300;0,400;0,500;0,700;1,400&display=swap');

:root{
  --ink:#121212;
  --panel:#171717;
  --panel-2:#141414;
  --accent:#FF6B35;
  --paper:#EDEDED;
  --dim:#9a9a9a;
  --line:#2a2a2a;
  --rail:118px;
}

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

html{
  scroll-behavior:smooth;
  background:var(--ink);
  -webkit-text-size-adjust:100%;
}

body{
  margin:0;
  font-family:'Roboto',system-ui,-apple-system,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  font-size:17px;
  line-height:1.75;
  font-weight:400;
  color:var(--paper);
  background:var(--ink);
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

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

/* ---------- 左侧竖排导航 ---------- */

.rail{
  position:fixed;
  top:0;left:0;bottom:0;
  width:var(--rail);
  display:flex;
  flex-direction:column;
  gap:10px;
  padding:20px 10px 22px;
  background:var(--panel-2);
  border-right:1px solid var(--line);
  overflow-y:auto;
  z-index:60;
}

.mark{
  width:46px;height:46px;
  margin:0 auto 8px;
  flex:0 0 auto;
  border-radius:14px;
  background:var(--accent);
  color:#121212;
  display:grid;
  place-items:center;
  font-size:20px;
  font-weight:700;
  text-decoration:none;
  box-shadow:0 8px 22px rgba(255,107,53,.35);
  transition:transform .28s cubic-bezier(.2,.7,.2,1),box-shadow .28s;
}
.mark:hover{transform:translateY(-2px) rotate(-5deg);box-shadow:0 12px 26px rgba(255,107,53,.5)}
.mark img{width:100%;height:100%;object-fit:cover;border-radius:14px;display:block}

.drawer summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:44px;
  padding:0 6px;
  border:1px solid #2e2e2e;
  border-radius:10px;
  font-size:16px;
  color:var(--paper);
  user-select:none;
  transition:border-color .2s,color .2s;
}
.drawer summary::-webkit-details-marker{display:none}
.drawer summary:hover{border-color:var(--accent);color:var(--accent)}
.drawer[open] summary{border-color:var(--accent);color:var(--accent)}

.bars{
  display:block;
  width:15px;height:2px;
  position:relative;
  background:currentColor;
}
.bars::before,.bars::after{
  content:"";
  position:absolute;left:0;
  width:15px;height:2px;
  background:currentColor;
}
.bars::before{top:-5px}
.bars::after{top:5px}

.drawer > menu{
  list-style:none;
  margin:10px 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.drawer a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:2px 9px;
  border-radius:9px;
  font-size:16px;
  line-height:1.25;
  color:#d6d6d6;
  text-decoration:none;
  transition:background .2s,color .2s,transform .2s;
}
.drawer a:hover,.drawer a:focus-visible{
  background:#202020;
  color:var(--accent);
  transform:translateX(2px);
}

.totop{
  margin-top:auto;
  min-height:44px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:10px;
  font-size:16px;
  text-decoration:none;
  color:var(--dim);
  border:1px dashed #2b2b2b;
  transition:color .2s,border-color .2s;
}
.totop:hover{color:var(--accent);border-color:var(--accent)}

/* ---------- 主区 ---------- */

main{margin-left:var(--rail)}

/* hero */

.hero{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
  min-height:45vh;
  padding:72px 46px 74px;
  scroll-margin-top:20px;
  clip-path:polygon(0 0,100% 0,100% calc(100% - 46px),0 100%);
  background:
    radial-gradient(120% 130% at 92% -20%,rgba(255,107,53,.30) 0%,rgba(255,107,53,0) 58%),
    linear-gradient(180deg,#191919 0%,#121212 100%);
}

.hero::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  background:linear-gradient(112deg,rgba(18,18,18,.94) 0%,rgba(18,18,18,.6) 58%,rgba(18,18,18,.15) 100%);
  pointer-events:none;
}

.hero-media{
  position:absolute;
  inset:0;
  z-index:0;
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:.55;
  filter:grayscale(.22) contrast(1.06);
}

.hero > *{position:relative;z-index:2}

.badge{
  position:absolute;
  top:28px;right:34px;
  z-index:3;
  margin:0;
  padding:6px 14px;
  border:1px solid var(--accent);
  border-radius:999px;
  font-size:16px;
  letter-spacing:.04em;
  color:var(--accent);
  background:rgba(18,18,18,.6);
  transform:rotate(2.2deg);
  animation:badgeFloat 6s ease-in-out infinite;
}

@keyframes badgeFloat{
  0%,100%{transform:rotate(2.2deg) translateY(0)}
  50%{transform:rotate(-1.4deg) translateY(-7px)}
}

.headline{
  margin:0;
  max-width:19ch;
  font-size:clamp(31px,6.6vw,66px);
  line-height:1.1;
  font-weight:700;
  letter-spacing:-.022em;
  text-wrap:balance;
  background-image:linear-gradient(96deg,var(--paper) 0%,var(--paper) 40%,var(--accent) 98%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  -webkit-text-fill-color:transparent;
}

.headline .ch{
  display:inline-block;
  will-change:transform,opacity;
  animation:chRise .82s cubic-bezier(.2,.72,.2,1) both;
  animation-delay:calc(var(--i,0) * 42ms);
}

@keyframes chRise{
  from{opacity:0;transform:translateY(.6em) rotate(7deg)}
  to{opacity:1;transform:none}
}

.lede{
  max-width:48ch;
  margin:20px 0 0;
  font-size:17px;
  line-height:1.72;
  color:#c9c9c9;
}

/* 内容分栏：aside 在左 */

.body{
  display:grid;
  grid-template-columns:196px minmax(0,1fr);
  gap:34px;
  max-width:1100px;
  margin:0 auto;
  padding:44px 34px 70px;
}

.side{
  position:sticky;
  top:24px;
  align-self:start;
  max-height:calc(100vh - 48px);
  overflow:auto;
  padding:20px 15px 14px;
  background:var(--panel-2);
  border:1px solid var(--line);
  border-radius:10px;
  box-shadow:0 16px 34px rgba(0,0,0,.45);
}

.side small{
  display:block;
  font-size:16px;
  letter-spacing:.2em;
  color:var(--accent);
  font-weight:500;
}

.side h2{
  margin:2px 0 12px;
  font-size:19px;
  line-height:1.35;
  font-weight:600;
  letter-spacing:-.01em;
}

.side ul{list-style:none;margin:0;padding:0}
.side li{border-bottom:1px dashed #272727}
.side li:last-child{border-bottom:0}

.side a{
  display:flex;
  align-items:center;
  min-height:44px;
  font-size:16px;
  line-height:1.3;
  color:#cfcfcf;
  text-decoration:none;
  transition:color .2s,padding-left .2s;
}
.side a:hover{color:var(--accent);padding-left:6px}

/* 正文 */

.prose{min-width:0}

.prose > article{
  background:var(--panel);
  border-radius:10px;
  box-shadow:0 18px 40px rgba(0,0,0,.45);
  padding:34px 30px;
  margin-top:26px;
  scroll-margin-top:78px;
}
.prose > article:first-child{margin-top:0}

.prose h2{
  margin:.1em 0 .75em;
  font-size:clamp(23px,3.2vw,31px);
  line-height:1.3;
  font-weight:600;
  letter-spacing:-.018em;
}

.prose h2 + p,.prose h3 + p{margin-top:0}

.prose small{
  display:block;
  font-size:16px;
  letter-spacing:.18em;
  font-weight:500;
  color:var(--accent);
  margin-bottom:2px;
}

.prose h3{
  margin:1.5em 0 .55em;
  font-size:20px;
  line-height:1.4;
  font-weight:600;
  color:#f2f2f2;
}

.prose p{margin:0 0 1.05em;max-width:66ch}
.prose ul,.prose ol{margin:0 0 1.05em;padding-left:1.35em;max-width:66ch}
.prose li{margin:.35em 0}
.prose a{color:var(--accent);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.prose a:hover{color:#ff8a5e}

.prose blockquote{
  margin:1.4em 0;
  padding:4px 0 4px 18px;
  border-left:3px solid var(--accent);
  color:#c6c6c6;
}

.prose img{border-radius:10px;display:block;margin:1.2em 0}
.prose figure{margin:1.2em 0}

.prose table{
  display:block;
  width:100%;
  overflow-x:auto;
  border-collapse:collapse;
  font-size:16px;
  margin:1.2em 0;
}
.prose th,.prose td{
  border:1px solid #2e2e2e;
  padding:9px 12px;
  text-align:left;
  vertical-align:top;
}
.prose th{background:#1f1f1f;font-weight:600}

.prose code{
  font-family:ui-monospace,'SFMono-Regular',Menlo,Consolas,monospace;
  font-size:16px;
  background:#232323;
  border-radius:5px;
  padding:1px 5px;
}

/* 滚动浮现 */

.motion .rv{opacity:.002;transform:translateY(20px)}
.motion .rv.in{opacity:1;transform:none;transition:opacity .7s ease,transform .7s cubic-bezier(.2,.72,.2,1)}

/* 页脚 */

footer{
  margin-left:var(--rail);
  padding:28px 20px 56px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:5px;
  border-top:1px solid var(--line);
  color:#8b8b8b;
  font-size:16px;
  text-align:center;
}
footer p{margin:0;letter-spacing:.03em}
footer small{font-size:16px;color:#6f6f6f}

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

@media (max-width:899px){
  .rail{
    position:sticky;
    top:0;
    width:100%;
    height:auto;
    bottom:auto;
    flex-direction:row;
    align-items:center;
    gap:12px;
    padding:9px 14px;
    overflow:visible;
    border-right:0;
    border-bottom:1px solid var(--line);
  }

  .mark{width:42px;height:42px;margin:0;flex:0 0 auto;border-radius:12px}

  .drawer{flex:1 1 auto}
  .drawer summary{justify-content:flex-start;padding:0 14px}

  .drawer > menu{
    position:absolute;
    left:0;right:0;top:100%;
    margin:0;
    padding:10px 14px 16px;
    background:#161616;
    border-bottom:1px solid var(--line);
    box-shadow:0 26px 44px rgba(0,0,0,.6);
  }

  .totop{display:none}

  main,footer{margin-left:0}

  .hero{
    min-height:0;
    padding:34px 18px 56px;
    clip-path:polygon(0 0,100% 0,100% calc(100% - 26px),0 100%);
  }
  .hero > .badge{position:static;align-self:flex-start;margin:0 0 14px}
  .headline{max-width:none;font-size:clamp(28px,8.5vw,42px)}

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

  .side{position:static;max-height:none}

  .prose > article{padding:24px 18px;scroll-margin-top:76px}
  footer{padding-bottom:44px}
}

@media (max-width:420px){
  .prose > article{padding:22px 15px}
  .headline{font-size:clamp(26px,9vw,34px)}
}

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

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