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

:root{
  --ink:#000000;
  --blue:#3bb1ff;
  --red:#ff5252;
  --paper:#f5f1e9;
  --white:#ffffff;
  --edge:3px solid #000000;
  --pop:5px 5px 0 #000000;
}

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

html{scroll-behavior:smooth}

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:'IBM Plex Sans','PingFang SC','Hiragino Sans GB','Microsoft YaHei',system-ui,sans-serif;
  font-size:17px;
  line-height:1.75;
  font-weight:400;
  -webkit-font-smoothing:antialiased;
  -webkit-text-size-adjust:100%;
}

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

a{color:inherit}

::selection{background:var(--blue);color:#000}

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

.shell{min-height:100vh}

/* ---- 左侧竖排胶囊导航 ---- */
.rail{
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  z-index:40;
  width:236px;
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:20px 16px 24px;
  background:var(--blue);
  border-right:var(--edge);
  overflow-y:auto;
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  width:max-content;
  max-width:100%;
  min-height:46px;
  padding:8px 16px;
  background:var(--white);
  border:var(--edge);
  border-radius:999px;
  box-shadow:4px 4px 0 #000;
  text-decoration:none;
  font-weight:700;
  font-size:17px;
  letter-spacing:.01em;
  transition:transform .15s ease,box-shadow .15s ease;
}

.brand:hover{transform:translate(-2px,-2px);box-shadow:6px 6px 0 #000}

.brand-logo{width:26px;height:26px;border-radius:50%;border:2px solid #000;object-fit:cover;flex:0 0 auto}

.brand-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.rail ol{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.rail ol a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:10px 16px;
  background:var(--white);
  border:var(--edge);
  border-radius:999px;
  box-shadow:3px 3px 0 #000;
  text-decoration:none;
  font-weight:600;
  font-size:16px;
  line-height:1.35;
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease,color .15s ease;
}

.rail ol a:hover{background:var(--red);color:#fff;transform:translate(-2px,-2px);box-shadow:5px 5px 0 #000}

.contact{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:10px 16px;
  background:var(--ink);
  color:#fff;
  border:var(--edge);
  border-radius:999px;
  box-shadow:4px 4px 0 var(--red);
  text-decoration:none;
  font-weight:700;
  font-size:16px;
  transition:transform .15s ease,box-shadow .15s ease;
}

.contact:hover{transform:translate(-2px,-2px);box-shadow:6px 6px 0 var(--red)}

.stage{margin-left:236px;min-width:0}

/* ---- 首屏 ---- */
.hero{
  min-height:100vh;
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  text-align:right;
  padding:56px 40px 62px;
  border-bottom:var(--edge);
  background-color:var(--white);
  background-image:linear-gradient(#00000012 1px,transparent 1px),linear-gradient(90deg,#00000012 1px,transparent 1px);
  background-size:36px 36px;
}

.hero-inner{max-width:760px;min-width:0}

.hero h1{
  margin:0 0 26px;
  font-size:clamp(2.3rem,6.4vw,4.9rem);
  line-height:1.03;
  letter-spacing:-.03em;
  font-weight:700;
  overflow-wrap:break-word;
}

.hero-desc{
  display:inline-block;
  margin:0;
  max-width:40ch;
  padding:14px 20px;
  background:var(--white);
  border:var(--edge);
  box-shadow:6px 6px 0 var(--red);
  font-size:17px;
  line-height:1.65;
  text-align:right;
}

/* ---- 主体：正文 + 右侧栏 ---- */
main{
  display:grid;
  grid-template-columns:minmax(0,1fr) 280px;
  align-items:start;
}

.prose{
  min-width:0;
  max-width:920px;
  padding:36px 32px 64px;
}

.prose > article{
  margin:0 0 32px;
  padding:28px 26px 32px;
  background:var(--white);
  border:var(--edge);
  border-bottom:9px solid var(--red);
  border-radius:28px;
  box-shadow:var(--pop);
}

.prose h2{
  margin:0 0 18px;
  font-size:clamp(1.45rem,2.8vw,2rem);
  line-height:1.25;
  font-weight:700;
  letter-spacing:-.01em;
}

.prose h2 > span{
  display:inline-block;
  padding:4px 14px;
  background:var(--blue);
  border:var(--edge);
  border-radius:8px;
  box-shadow:4px 4px 0 #000;
}

.prose h3{
  margin:26px 0 12px;
  font-size:1.2rem;
  line-height:1.35;
  font-weight:700;
}

.prose h3 > span{display:inline-block;padding:2px 10px;border-bottom:4px solid var(--red)}

.prose p{margin:0 0 16px}

.prose ul,.prose ol{margin:0 0 16px;padding-left:1.4em}

.prose li{margin:0 0 8px}

.prose a{text-decoration:none;border-bottom:3px solid var(--blue);font-weight:600}

.prose a:hover{background:var(--blue)}

.prose img{margin:20px 0;border:var(--edge);border-radius:18px;box-shadow:var(--pop)}

.prose blockquote{
  margin:20px 0;
  padding:12px 18px;
  background:var(--paper);
  border-left:8px solid var(--red);
  border-radius:0 12px 12px 0;
}

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

.prose pre{
  overflow-x:auto;
  margin:18px 0;
  padding:16px;
  background:var(--ink);
  color:#fff;
  border-radius:12px;
  font-size:15px;
  line-height:1.6;
}

.prose code{font-size:.95em}

.prose table{width:100%;border-collapse:collapse;margin:18px 0;font-size:16px}

.prose th,.prose td{border:3px solid #000;padding:8px 10px;text-align:left}

.prose th{background:var(--blue)}

.prose hr{border:0;border-top:3px solid #000;margin:26px 0}

/* ---- 右侧栏 ---- */
.side{
  position:sticky;
  top:0;
  align-self:start;
  padding:28px 20px 40px;
  background:var(--white);
  border-left:var(--edge);
}

.side-block + .side-block{margin-top:26px}

.side-h{margin:0 0 12px;font-size:16px;font-weight:700;letter-spacing:.06em}

.side-h span{display:inline-block;padding:3px 12px;background:var(--ink);color:#fff;border-radius:999px}

.toc{list-style:none;margin:0;padding:0;display:grid;gap:8px}

.toc a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:8px 12px;
  background:var(--white);
  border:3px solid #000;
  border-radius:999px;
  box-shadow:3px 3px 0 #000;
  text-decoration:none;
  font-size:16px;
  font-weight:600;
  line-height:1.35;
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
}

.toc a:hover{background:var(--blue);transform:translate(-2px,-2px);box-shadow:5px 5px 0 #000}

.kw{margin:0;font-size:17px;font-weight:600;line-height:1.6;overflow-wrap:break-word}

/* ---- 页脚 ---- */
.foot{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  align-items:center;
  justify-content:space-between;
  padding:22px 32px;
  background:var(--ink);
  color:#fff;
  border-top:var(--edge);
}

.foot address{font-style:normal;font-weight:700;font-size:17px}

.copy{margin:4px 0 0;font-size:16px;color:#d8d8d8}

.foot ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}

.foot a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:6px 12px;
  color:#fff;
  text-decoration:none;
  font-size:16px;
  font-weight:600;
  border-bottom:3px solid var(--blue);
}

.foot a:hover{background:var(--blue);color:#000}

/* ---- 进入动效 ---- */
.js .reveal{opacity:0;transform:translateY(20px)}

.js .reveal.in{opacity:1;transform:none;transition:opacity .55s ease,transform .55s ease}

/* ---- 断点 ---- */
@media (min-width:901px){
  .prose > article{scroll-margin-top:28px}
}

@media (max-width:900px){
  .rail{
    position:sticky;
    top:0;
    left:auto;
    right:auto;
    bottom:auto;
    width:auto;
    flex-direction:row;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border-right:0;
    border-bottom:var(--edge);
    overflow-x:auto;
    overflow-y:hidden;
    scrollbar-width:none;
  }
  .rail::-webkit-scrollbar{display:none}
  .rail ol{flex-direction:row;gap:8px;flex:0 0 auto}
  .rail ol a{white-space:nowrap}
  .brand{flex:0 0 auto;min-height:44px;padding:7px 14px;font-size:16px}
  .contact{flex:0 0 auto;margin-top:0;box-shadow:3px 3px 0 var(--red)}
  .stage{margin-left:0}
  main{grid-template-columns:1fr}
  .side{position:static;border-left:0;border-top:var(--edge);order:2;padding:24px 16px 32px}
  .toc{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hero{min-height:82vh;padding:32px 18px 42px}
  .hero-desc{padding:12px 16px;box-shadow:5px 5px 0 var(--red)}
  .prose{max-width:none;padding:22px 16px 48px}
  .prose > article{padding:20px 16px 24px;border-radius:20px;box-shadow:4px 4px 0 #000;scroll-margin-top:150px}
  .foot{padding:18px 16px}
}

@media (max-width:380px){
  .toc{grid-template-columns:1fr}
  .prose > article{border-bottom-width:6px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .js .reveal{opacity:1;transform:none}
  *{transition-duration:.001ms!important;animation-duration:.001ms!important}
}

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