:root{
  --blue:#3bb1ff;
  --red:#ff5252;
  --ink:#000;
  --paper:#f7f3e7;
  --wash:#e8f6ff;
  --edge:3px solid #000;
  --drop:5px 5px 0 #000;
}

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

html{
  scroll-behavior:smooth;
}

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:'Space Grotesk','DM Sans',-apple-system,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',system-ui,sans-serif;
  font-size:17px;
  line-height:1.62;
  overflow-x:hidden;
  -webkit-text-size-adjust:100%;
}

h1,h2,h3,h4{
  margin:0;
  font-weight:700;
  letter-spacing:-0.015em;
}

p{margin:0 0 16px}

a{color:inherit}

img{max-width:100%}

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

/* ---------- 左侧固定导航 ---------- */
.rail{
  position:fixed;
  inset:0 auto 0 0;
  width:238px;
  z-index:30;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:18px 16px 22px;
  background:var(--blue);
  border-right:var(--edge);
  overflow-y:auto;
}

.rail-top{
  display:flex;
  align-items:center;
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:48px;
  text-decoration:none;
  font-weight:700;
}

.mark{
  width:54px;
  height:54px;
  flex:0 0 auto;
  object-fit:cover;
  border:var(--edge);
  border-radius:12px;
  box-shadow:3px 3px 0 #000;
  background:#fff;
}

.brand-word{
  font-size:19px;
  line-height:1.2;
  letter-spacing:-0.02em;
}

.rail-links{
  display:flex;
  flex-direction:column;
  gap:8px;
  flex:1 1 auto;
}

.rail-link{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:8px 12px;
  background:#fff;
  border:2px solid #000;
  border-radius:12px;
  font-weight:600;
  font-size:16px;
  text-decoration:none;
  box-shadow:3px 3px 0 #000;
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
}

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

.rail-link:active{
  transform:translate(1px,1px);
  box-shadow:1px 1px 0 #000;
}

/* ---------- 搜索 ---------- */
.search{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:6px;
  padding:8px;
  background:#fff;
  border:var(--edge);
  border-radius:14px;
  box-shadow:var(--drop);
}

.search-label{
  font-size:16px;
  font-weight:700;
  padding:0 2px;
}

.search-input{
  min-width:0;
  width:100%;
  min-height:40px;
  padding:6px 8px;
  font:inherit;
  font-size:16px;
  border:2px solid #000;
  border-radius:9px;
  background:#fff;
}

.search-input.miss{
  background:#ffe3e3;
  border-color:var(--red);
}

.search-btn{
  min-height:40px;
  padding:6px 10px;
  font:inherit;
  font-size:16px;
  font-weight:700;
  color:#fff;
  background:var(--ink);
  border:2px solid #000;
  border-radius:9px;
  cursor:pointer;
}

.search-btn:hover{background:var(--red)}

/* ---------- 主区 ---------- */
main{
  margin-left:238px;
  min-height:100vh;
}

.prose [id]{
  scroll-margin-top:28px;
}

/* ---------- 首屏 ---------- */
.stage{
  position:relative;
  min-height:45vh;
  display:grid;
  place-items:center;
  padding:52px 22px;
  background:var(--blue);
  border-bottom:var(--edge);
  overflow:hidden;
}

.stage-copy{
  position:relative;
  z-index:2;
  max-width:720px;
  text-align:center;
}

.stage h1{
  display:inline-block;
  padding:10px 20px;
  background:#fff;
  border:var(--edge);
  border-radius:16px;
  box-shadow:7px 7px 0 #000;
  font-size:clamp(30px,4.4vw,58px);
  line-height:1.12;
  transform:rotate(-1.2deg);
}

.lede{
  display:inline-block;
  margin:20px 0 0;
  padding:8px 14px;
  background:var(--ink);
  color:#fff;
  border-radius:10px;
  font-size:16px;
  font-weight:600;
  line-height:1.5;
}

.collage{
  position:absolute;
  inset:0;
  margin:0;
  pointer-events:none;
}

.shard{
  position:absolute;
  display:block;
  width:clamp(92px,14vw,178px);
  aspect-ratio:3/4;
  background:#fff;
  border:var(--edge);
  box-shadow:7px 7px 0 #000;
  overflow:hidden;
}

.shard .shot,
.shard .ph{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}

.shard .ph{background:var(--red)}

.shard.a{
  left:2.5%;
  top:9%;
  transform:rotate(-5deg);
}

.shard.b{
  right:2.5%;
  bottom:9%;
  transform:rotate(4deg);
}

.shard.b .ph{background:#fff}

.floats{
  position:absolute;
  z-index:3;
  right:14px;
  top:14px;
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:flex-end;
}

.chip{
  padding:6px 12px;
  font-size:16px;
  font-weight:700;
  background:#fff;
  border:2px solid #000;
  border-radius:999px;
  box-shadow:3px 3px 0 #000;
}

.chip2{
  background:var(--red);
  color:#fff;
}

/* ---------- 内容栅格 ---------- */
.grid{
  display:grid;
  grid-template-columns:218px minmax(0,1fr);
  gap:26px;
  max-width:1180px;
  margin:0 auto;
  padding:34px 24px 56px;
}

.side{
  align-self:start;
  position:sticky;
  top:22px;
  padding:16px;
  background:rgba(255,255,255,.62);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
  border:var(--edge);
  border-radius:18px;
  box-shadow:var(--drop);
}

.side small{
  display:inline-block;
  padding:3px 10px;
  font-size:16px;
  font-weight:700;
  background:var(--red);
  color:#fff;
  border:2px solid #000;
  border-radius:8px;
}

.side h2{
  font-size:20px;
  margin:8px 0 12px;
}

.side ul{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:7px;
}

.side a{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:6px 10px;
  font-size:16px;
  font-weight:600;
  text-decoration:none;
  background:#fff;
  border:2px solid #000;
  border-radius:10px;
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
}

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

/* ---------- 正文 ---------- */
.prose{
  max-width:748px;
  min-width:0;
}

.prose div{
  margin-top:34px;
  padding-top:26px;
  border-top:var(--edge);
}

.prose div:first-child{
  margin-top:0;
  padding-top:0;
  border-top:0;
}

.prose div.hit{
  outline:4px solid var(--red);
  outline-offset:10px;
}

.prose small{
  display:inline-block;
  margin-bottom:8px;
  padding:2px 10px;
  font-size:16px;
  font-weight:700;
  background:var(--blue);
  border:2px solid #000;
  border-radius:8px;
}

.prose h2{
  font-size:clamp(23px,3vw,33px);
  line-height:1.25;
  margin:0 0 14px;
}

.prose h3{
  font-size:21px;
  line-height:1.35;
  margin:24px 0 10px;
}

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

.prose li{margin-bottom:8px}

.prose a{
  color:#000;
  font-weight:600;
  text-decoration:underline;
  text-decoration-thickness:3px;
  text-decoration-color:var(--red);
  text-underline-offset:3px;
}

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

.prose img{
  display:block;
  height:auto;
  margin:0 0 16px;
  border:var(--edge);
  border-radius:14px;
  box-shadow:var(--drop);
}

.prose blockquote{
  margin:0 0 16px;
  padding:12px 16px;
  background:var(--wash);
  border:var(--edge);
  border-radius:14px;
}

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

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

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

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

.prose code{
  font-size:16px;
  background:#fff;
  border:2px solid #000;
  border-radius:6px;
  padding:1px 5px;
}

/* ---------- 页脚 ---------- */
.foot{
  margin-left:0;
  padding:34px 24px 26px;
  background:var(--ink);
  color:#fff;
  border-top:6px solid var(--red);
}

.foot-hero{
  margin:0 0 26px;
  font-size:clamp(34px,8vw,104px);
  font-weight:700;
  line-height:1;
  letter-spacing:-0.03em;
  color:#fff;
  text-shadow:6px 6px 0 var(--blue);
  word-break:break-word;
}

.foot-cols{
  display:grid;
  grid-template-columns:1fr 1fr 1.3fr 1fr;
  gap:26px;
  max-width:1180px;
}

.foot-nav dl{
  margin:0;
  display:grid;
  grid-template-columns:auto auto;
  gap:6px 8px;
  align-items:center;
  justify-content:start;
}

.foot-nav dt,
.foot-nav dd{
  margin:0;
  font-size:16px;
}

.foot-nav dd{
  color:var(--blue);
  font-weight:700;
}

.foot a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  color:#fff;
  font-size:16px;
  font-weight:600;
  text-decoration:none;
  border-bottom:2px solid transparent;
}

.foot a:hover{
  color:var(--blue);
  border-bottom-color:var(--blue);
}

.foot-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.foot-addr{
  font-style:normal;
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:16px;
}

.foot-addr strong{
  font-size:18px;
  border-bottom:2px solid var(--blue);
  padding-bottom:4px;
  align-self:start;
}

.addr-host{
  color:#b9d9ee;
  word-break:break-all;
}

.foot-kw{
  margin:0;
  padding:10px 12px;
  font-size:16px;
  font-weight:600;
  color:#fff;
  border:2px solid #fff;
  border-radius:12px;
}

.copy{
  margin:26px 0 0;
  padding-top:16px;
  border-top:2px solid #3a3a3a;
  font-size:16px;
  color:#cfcfcf;
}

/* ---------- 回顶 ---------- */
.totop{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:40;
  min-height:48px;
  min-width:64px;
  padding:10px 14px;
  font:inherit;
  font-size:16px;
  font-weight:700;
  color:#fff;
  background:var(--red);
  border:var(--edge);
  border-radius:14px;
  box-shadow:var(--drop);
  cursor:pointer;
  opacity:0;
  pointer-events:none;
  transform:translateY(10px);
  transition:opacity .18s ease,transform .18s ease;
}

.totop.on{
  opacity:1;
  pointer-events:auto;
  transform:none;
}

/* ---------- 滚动入场 ---------- */
.anim .reveal{
  opacity:0;
  transform:translateY(16px);
  transition:opacity .5s ease,transform .5s ease;
}

.anim .reveal.in{
  opacity:1;
  transform:none;
}

/* ---------- 窄屏 ---------- */
@media (max-width:900px){
  .rail{
    position:sticky;
    inset:0 auto auto 0;
    width:auto;
    flex-direction:row;
    align-items:center;
    gap:10px;
    padding:10px 12px;
    border-right:0;
    border-bottom:var(--edge);
    overflow:visible;
  }

  .rail-top{flex:0 0 auto}

  .brand-word{display:none}

  .mark{
    width:42px;
    height:42px;
    box-shadow:2px 2px 0 #000;
  }

  .rail-links{
    flex-direction:row;
    gap:7px;
    overflow-x:auto;
    padding:2px 2px 6px;
    scrollbar-width:thin;
  }

  .rail-link{
    flex:0 0 auto;
    min-height:42px;
    font-size:16px;
    box-shadow:2px 2px 0 #000;
    white-space:nowrap;
  }

  .search{
    flex:0 0 auto;
    grid-template-columns:1fr auto;
    gap:5px;
    padding:6px;
    box-shadow:2px 2px 0 #000;
  }

  .search-label{display:none}

  .search-input{
    width:88px;
    min-height:38px;
  }

  .search-btn{min-height:38px}

  main{margin-left:0}

  .prose [id]{scroll-margin-top:104px}

  .stage{
    min-height:48vh;
    padding:56px 16px 46px;
  }

  .shard{
    width:84px;
    box-shadow:4px 4px 0 #000;
  }

  .stage h1{
    padding:8px 14px;
    box-shadow:5px 5px 0 #000;
    font-size:clamp(26px,7vw,40px);
  }

  .lede{margin-top:16px}

  .floats{
    right:8px;
    top:8px;
    gap:6px;
  }

  .chip{
    font-size:16px;
    padding:4px 10px;
  }

  .grid{
    grid-template-columns:minmax(0,1fr);
    gap:18px;
    padding:22px 16px 44px;
  }

  .side{
    position:static;
    order:-1;
    padding:14px;
  }

  .side ul{
    flex-direction:row;
    overflow-x:auto;
    padding-bottom:4px;
  }

  .side li{flex:0 0 auto}

  .foot-cols{
    grid-template-columns:1fr;
    gap:18px;
  }

  .foot{
    padding:26px 16px 22px;
  }
}

@media (max-width:420px){
  .shard{
    width:72px;
  }

  .stage{
    padding-top:52px;
  }
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}

  .anim .reveal{
    opacity:1;
    transform:none;
    transition:none;
  }

  .rail-link,
  .side a,
  .totop{
    transition:none;
  }
}

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