:root{
  --ink:#000;
  --blue:#3bb1ff;
  --red:#ff5252;
  --paper:#f2efe6;
  --line:3px solid #000;
  --sh:5px 5px 0 #000;
  --r:10px;
}

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

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

body{
  margin:0;
  overflow-x:clip;
  background:var(--paper);
  color:#111;
  font:400 17px/1.7 "IBM Plex Sans","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
}

img{max-width:100%}
a{color:inherit}
:focus-visible{outline:3px solid var(--red);outline-offset:3px}

h1,h2,h3,summary,.name,.fb,.mark,button,.toc i{
  font-family:"JetBrains Mono","IBM Plex Sans","PingFang SC","Microsoft YaHei",ui-monospace,monospace;
}

/* ---------- 顶部 ---------- */
.top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 16px;
  background:var(--blue);
  border-bottom:var(--line);
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  text-decoration:none;
}

.mark{
  display:grid;
  place-items:center;
  width:38px;
  height:38px;
  background:var(--ink);
  color:var(--blue);
  font-weight:700;
  font-size:19px;
  border-radius:8px;
}

.name{
  font-weight:700;
  font-size:19px;
  letter-spacing:.04em;
  color:var(--ink);
}

.pill{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:8px 16px;
  background:#fff;
  border:var(--line);
  border-radius:8px;
  box-shadow:4px 4px 0 var(--ink);
  font-weight:700;
  font-size:16px;
  text-decoration:none;
  color:var(--ink);
}

.pill:hover{background:var(--red);color:#fff}
.pill:active{transform:translate(2px,2px);box-shadow:2px 2px 0 var(--ink)}

/* ---------- 粘性锚点条 ---------- */
.anchorbar{
  position:sticky;
  top:0;
  z-index:50;
  padding:9px 16px;
  background:#fff;
  border-bottom:var(--line);
}

.menu{display:block}

.menu summary{
  list-style:none;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:6px 16px;
  background:var(--red);
  border:var(--line);
  border-radius:8px;
  box-shadow:4px 4px 0 var(--ink);
  color:#fff;
  font-weight:700;
  font-size:16px;
  letter-spacing:.06em;
}

.menu summary::-webkit-details-marker{display:none}
.menu summary::after{content:"＋";font-size:17px;line-height:1}
.menu[open] summary::after{content:"－"}

.menu menu{
  list-style:none;
  margin:10px 0 2px;
  padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.menu:not([open]) > menu{display:none}

.menu menu a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:6px 12px;
  background:#fff;
  border:var(--line);
  border-radius:8px;
  color:var(--ink);
  font-weight:600;
  font-size:16px;
  text-decoration:none;
  white-space:nowrap;
}

.menu menu a:hover{background:var(--blue)}
.menu menu a:active{background:var(--red);color:#fff}

@media (min-width:860px){
  .anchorbar{display:flex;align-items:center}
  .menu{display:flex;align-items:center;gap:12px;width:100%}
  .menu menu{margin:0;flex-wrap:nowrap;overflow-x:auto;padding-bottom:2px}
}

/* ---------- 首屏 ---------- */
.hero{
  position:relative;
  min-height:45vh;
  display:grid;
  align-content:end;
  overflow:hidden;
  background:var(--blue);
  clip-path:polygon(0 0,100% 0,100% 93%,0 100%);
}

.hero-fig{
  position:absolute;
  inset:0;
  margin:0;
  background:
    repeating-linear-gradient(45deg,rgba(0,0,0,.10) 0 10px,transparent 10px 20px),
    var(--blue);
}

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

.hero::after{
  content:"";
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.45);
  z-index:1;
}

.hero-txt{
  position:relative;
  z-index:2;
  padding:26px 18px 40px;
  max-width:1120px;
  width:100%;
  margin:0 auto;
  text-align:right;
  color:#fff;
}

.hero h1{
  margin:0 0 10px;
  font-size:clamp(28px,7.2vw,54px);
  line-height:1.14;
  font-weight:700;
  letter-spacing:.01em;
  text-shadow:4px 4px 0 var(--ink);
}

.lead{
  margin:0 0 0 auto;
  max-width:44ch;
  font-size:17px;
  line-height:1.65;
  text-shadow:2px 2px 0 rgba(0,0,0,.8);
}

.slash{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:16px;
  background:var(--red);
  border-top:var(--line);
  z-index:3;
}

/* ---------- 主体 ---------- */
.stage{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:24px;
  max-width:1120px;
  margin:0 auto;
  padding:32px 16px 48px;
}

@media (min-width:920px){
  .stage{grid-template-columns:minmax(0,1fr) 292px;align-items:start;gap:30px}
}

.prose{min-width:0}

.prose article{
  background:#fff;
  border:var(--line);
  border-radius:var(--r);
  box-shadow:6px 6px 0 var(--ink);
  padding:20px 16px 22px;
  scroll-margin-top:110px;
}

.prose article + article{margin-top:28px}

.prose h2{
  margin:0 0 12px;
  padding-bottom:8px;
  border-bottom:var(--line);
  font-size:clamp(20px,4.8vw,26px);
  line-height:1.3;
  font-weight:700;
}

.prose h3{
  margin:22px 0 8px;
  font-size:19px;
  line-height:1.4;
}

.prose p{margin:0 0 14px}
.prose p:last-child{margin-bottom:0}

.prose ul,.prose ol{margin:0 0 14px;padding-left:22px}
.prose li{margin:0 0 6px}
.prose li::marker{color:var(--red);font-weight:700}

.prose a{
  color:var(--ink);
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-decoration-color:var(--red);
  text-underline-offset:3px;
}

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

.prose figure{margin:0 0 16px}
.prose figure img{border:var(--line);box-shadow:var(--sh)}
.prose img{height:auto}

.prose blockquote{
  margin:0 0 16px;
  padding:8px 14px;
  border-left:7px solid var(--red);
  background:#faf7ee;
}

.prose code,.prose pre{
  font-family:"JetBrains Mono",ui-monospace,monospace;
  font-size:15px;
}

.prose code{background:#000;color:#fff;padding:2px 6px;border-radius:5px}
.prose pre{
  background:#000;
  color:#fff;
  padding:14px;
  overflow-x:auto;
  border:var(--line);
  border-radius:var(--r);
}
.prose pre code{background:none;padding:0}

.subtitle{
  margin:2px 0 12px;
  font-size:16px;
  line-height:1.6;
  color:#444;
}

/* ---------- 侧栏 ---------- */
.rail{
  order:-1;
  background:rgba(255,255,255,.78);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  border:var(--line);
  border-radius:var(--r);
  box-shadow:var(--sh);
  padding:16px 14px 18px;
  scroll-margin-top:110px;
}

@media (min-width:920px){
  .rail{order:0;position:sticky;top:96px}
}

.rail h2{
  margin:0;
  font-size:20px;
  line-height:1.3;
}

.toc{list-style:none;margin:0;padding:0}

.toc li + li{margin-top:8px}

.toc a{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:6px 10px;
  background:#fff;
  border:var(--line);
  border-radius:8px;
  color:var(--ink);
  font-weight:600;
  font-size:16px;
  text-decoration:none;
}

.toc a:hover{background:var(--blue)}
.toc a:active{background:var(--red);color:#fff}

.toc i{
  font-style:normal;
  font-weight:700;
  color:var(--red);
  font-size:15px;
}

/* ---------- 页脚 ---------- */
.foot{
  margin-top:10px;
  padding:28px 16px 16px;
  background:var(--ink);
  color:#fff;
  border-top:6px solid var(--blue);
}

.foot-grid{
  display:grid;
  gap:20px;
  max-width:1120px;
  margin:0 auto;
}

@media (min-width:760px){
  .foot-grid{grid-template-columns:1.1fr 1fr;align-items:start}
}

.fb{
  margin:0 0 8px;
  font-size:22px;
  font-weight:700;
  letter-spacing:.04em;
  color:var(--blue);
}

.foot address{
  font-style:normal;
  line-height:1.7;
  color:#c9c9c9;
  font-size:16px;
}

.fhost{color:#fff;font-family:"JetBrains Mono",ui-monospace,monospace}

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

.fl-col a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:6px 12px;
  border:3px solid #fff;
  border-radius:8px;
  color:#fff;
  font-weight:600;
  font-size:16px;
  text-decoration:none;
}

.fl-col a:hover{background:var(--blue);color:var(--ink);border-color:var(--blue)}

.sub{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  max-width:560px;
  margin:24px auto 0;
}

.sub input{
  flex:1 1 190px;
  min-height:48px;
  padding:0 14px;
  background:#141414;
  color:#fff;
  border:3px solid #fff;
  border-radius:8px;
  font:inherit;
  font-size:16px;
}

.sub input::placeholder{color:#8f8f8f}

.sub button{
  min-height:48px;
  padding:0 20px;
  background:var(--red);
  color:#fff;
  border:3px solid #fff;
  border-radius:8px;
  font-weight:700;
  font-size:16px;
  letter-spacing:.08em;
  cursor:pointer;
}

.sub button:hover{background:var(--blue);color:var(--ink);border-color:var(--blue)}

.copy{
  margin:22px 0 0;
  text-align:center;
  font-size:16px;
  color:#b6b6b6;
}

/* ---------- 回到顶部 ---------- */
.totop{
  position:fixed;
  right:14px;
  bottom:14px;
  z-index:70;
  display:none;
  align-items:center;
  min-height:46px;
  padding:0 16px;
  background:var(--blue);
  color:var(--ink);
  border:var(--line);
  border-radius:10px;
  box-shadow:var(--sh);
  font-weight:700;
  font-size:16px;
  cursor:pointer;
}

.totop.on{display:inline-flex}
.totop:active{transform:translate(2px,2px);box-shadow:2px 2px 0 var(--ink)}

/* ---------- 滚动出现 ---------- */
.js .rv{
  opacity:0;
  transform:translateY(16px);
  transition:opacity .45s ease,transform .45s ease;
}

.js .rv.in{opacity:1;transform:none}

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

/* ---------- 窄屏微调 ---------- */
@media (max-width:480px){
  .hero{clip-path:none;border-bottom:var(--line)}
  .slash{height:12px}
  .hero-txt{padding:22px 16px 32px;text-align:left}
  .lead{margin:0;max-width:none;font-size:16px}
  .prose article{padding:18px 13px 18px}
  .prose article{box-shadow:4px 4px 0 var(--ink)}
  .stage{padding:26px 14px 40px}
}

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