:root{
  --sky:#3bb1ff;
  --red:#ff5252;
  --ink:#000;
  --paper:#fdf4e3;
  --card:#ffffff;
  --bar:80px;
  --line:3px;
}
*,*::before,*::after{box-sizing:border-box}
html{
  scroll-behavior:smooth;
  scroll-padding-bottom:calc(var(--bar) + 20px);
  -webkit-text-size-adjust:100%;
}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:'Noto Sans Arabic','Noto Naskh Arabic','PingFang SC','Hiragino Sans GB','Microsoft YaHei',system-ui,sans-serif;
  font-size:17px;
  line-height:1.78;
  overflow-wrap:break-word;
  padding-bottom:calc(var(--bar) + 28px);
}
img{max-width:100%;height:auto;display:block}
a{color:inherit}
:focus-visible{outline:3px solid var(--red);outline-offset:3px}

/* 底栏与全屏菜单 */
.bar{
  position:fixed;
  left:0;right:0;bottom:0;
  z-index:70;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  background:var(--sky);
  border-top:var(--line) solid var(--ink);
}
.bar[data-open]{
  top:0;bottom:0;
  flex-wrap:wrap;
  align-content:flex-start;
  padding:16px 16px 34px;
  overflow-y:auto;
  border-top:0;
  border-bottom:6px solid var(--red);
}
.mark{
  width:46px;height:46px;
  flex:0 0 auto;
  display:grid;place-items:center;
  background:var(--ink);
  color:#fff;
  border:var(--line) solid var(--ink);
  box-shadow:4px 4px 0 var(--red);
  text-decoration:none;
  font-weight:900;
  font-size:22px;
  line-height:1;
}
.mark img{width:30px;height:30px;object-fit:contain}
.burger{
  font-family:inherit;
  font-size:17px;
  font-weight:900;
  letter-spacing:.06em;
  min-height:46px;
  padding:10px 20px;
  background:var(--red);
  color:var(--ink);
  border:var(--line) solid var(--ink);
  box-shadow:4px 4px 0 var(--ink);
  cursor:pointer;
}
.burger:active{transform:translate(2px,2px);box-shadow:2px 2px 0 var(--ink)}
.menu{display:none}
.bar[data-open] .menu{
  display:block;
  flex:1 1 100%;
  margin-top:20px;
}
.menu p{margin:0;display:flex;flex-direction:column;gap:12px}
.menu a{
  display:flex;
  align-items:center;
  min-height:52px;
  padding:12px 14px;
  background:var(--card);
  border:var(--line) solid var(--ink);
  box-shadow:5px 5px 0 var(--ink);
  text-decoration:none;
  font-size:20px;
  font-weight:900;
  line-height:1.2;
}
.menu a:nth-child(3n+2){background:#fff}
.menu a:nth-child(3n){background:#ffe3e3}

/* 版心 */
.stage{
  max-width:1180px;
  margin:0 auto;
  padding:18px 14px 34px;
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:22px;
}
.doc{min-width:0}
@media (min-width:920px){
  .stage{
    grid-template-columns:minmax(0,1fr) 296px;
    gap:30px;
    padding:28px 20px 54px;
    align-items:start;
  }
}

/* 大图首屏 */
.hero{
  position:relative;
  overflow:hidden;
  display:flex;
  align-items:flex-end;
  min-height:58vh;
  background:var(--sky);
  border:var(--line) solid var(--ink);
  border-radius:4px;
  box-shadow:7px 7px 0 var(--ink);
}
@media (min-width:920px){.hero{min-height:70vh}}
.hero-img{
  position:absolute;
  inset:0;
  width:100%;height:100%;
  object-fit:cover;
  z-index:0;
}
.ghost{
  position:absolute;
  z-index:1;
  left:-4px;top:-10px;
  font-size:clamp(54px,19vw,186px);
  font-weight:900;
  line-height:1;
  letter-spacing:.02em;
  white-space:nowrap;
  color:transparent;
  -webkit-text-stroke:3px var(--ink);
  pointer-events:none;
}
.hero-in{
  position:relative;
  z-index:2;
  width:100%;
  padding:18px 16px 24px;
  background:rgba(0,0,0,.68);
  border-top:var(--line) solid var(--ink);
}
.chip{
  display:inline-block;
  padding:3px 11px;
  background:var(--red);
  color:var(--ink);
  border:var(--line) solid var(--ink);
  box-shadow:3px 3px 0 var(--ink);
  font-size:16px;
  font-weight:900;
  line-height:1.5;
}
.hero h1{
  margin:12px 0 0;
  color:#fff;
  font-size:clamp(26px,6.4vw,50px);
  line-height:1.16;
  font-weight:900;
  letter-spacing:-.01em;
}

/* 正文 */
.content{
  margin-top:22px;
  background:var(--card);
  border:var(--line) solid var(--ink);
  border-radius:4px;
  box-shadow:7px 7px 0 var(--ink);
  padding:4px clamp(14px,3.2vw,30px) 30px;
}
.content > section{
  padding:26px 0;
  border-top:var(--line) dashed var(--ink);
  scroll-margin-top:20px;
}
.content > section:first-child{border-top:0;padding-top:10px}
.content h2{
  margin:0 0 14px;
  font-size:clamp(22px,4.2vw,31px);
  line-height:1.24;
  font-weight:900;
  letter-spacing:-.01em;
}
.content h3{
  margin:24px 0 10px;
  font-size:20px;
  line-height:1.35;
  font-weight:900;
}
small{
  display:inline-block;
  margin-bottom:9px;
  padding:2px 10px;
  background:var(--red);
  border:2px solid var(--ink);
  box-shadow:3px 3px 0 var(--ink);
  font-size:16px;
  font-weight:800;
  line-height:1.5;
}
.content p{margin:0 0 16px}
.content ul,.content ol{margin:0 0 18px;padding-left:24px}
.content li{margin-bottom:9px}
.content li::marker{color:var(--red);font-weight:900}
.content a{
  font-weight:800;
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-underline-offset:3px;
  background:rgba(59,177,255,.26);
  padding:0 2px;
}
.content blockquote{
  margin:20px 0;
  padding:12px 16px;
  background:#fff1f1;
  border:var(--line) solid var(--ink);
  border-left:8px solid var(--red);
  box-shadow:4px 4px 0 var(--ink);
}
.content blockquote p:last-child{margin-bottom:0}
.content img{
  border:var(--line) solid var(--ink);
  box-shadow:5px 5px 0 var(--ink);
  margin:14px 0;
  border-radius:4px;
}
.content hr{
  border:0;
  border-top:var(--line) solid var(--ink);
  margin:26px 0;
}
.content table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 18px;
  font-size:16px;
}
.content th,.content td{
  border:2px solid var(--ink);
  padding:8px 10px;
  text-align:left;
}
.content th{background:var(--sky);font-weight:900}
.content code{
  font-family:ui-monospace,monospace;
  background:#eee;
  border:2px solid var(--ink);
  padding:0 4px;
}

/* 侧栏 */
.rail{
  background:var(--card);
  border:var(--line) solid var(--ink);
  border-radius:4px;
  box-shadow:7px 7px 0 var(--ink);
  padding:16px;
}
@media (min-width:920px){
  .rail{position:sticky;top:24px}
}
.rail h2{
  margin:6px 0 14px;
  font-size:21px;
  font-weight:900;
  line-height:1.3;
}
.toc{list-style:none;margin:0;padding:0;display:grid;gap:9px}
.toc a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:8px 10px;
  background:var(--paper);
  border:var(--line) solid var(--ink);
  box-shadow:3px 3px 0 var(--ink);
  text-decoration:none;
  font-size:16px;
  font-weight:800;
  line-height:1.4;
}
.toc a:hover{background:var(--sky)}
.toc a:active{transform:translate(2px,2px);box-shadow:1px 1px 0 var(--ink)}

/* 页脚 */
.foot{
  margin-top:14px;
  padding:30px 16px 28px;
  background:var(--ink);
  color:#fff;
  border-top:8px solid var(--red);
}
.cols{
  max-width:1180px;
  margin:0 auto;
  display:grid;
  grid-template-columns:1fr;
  gap:24px;
}
@media (min-width:760px){
  .cols{grid-template-columns:repeat(3,minmax(0,1fr));gap:28px}
}
.foot dl{margin:0}
.foot dt{
  margin-bottom:10px;
  padding-bottom:8px;
  border-bottom:var(--line) solid var(--red);
  color:var(--sky);
  font-size:17px;
  font-weight:900;
  line-height:1.4;
}
.foot dd{margin:0 0 8px;font-size:16px;line-height:1.7}
.foot a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:2px 0;
  color:#fff;
  text-decoration:none;
  border-bottom:2px solid transparent;
}
.foot a:hover{border-bottom-color:var(--sky)}
.base{
  max-width:1180px;
  margin:28px auto 0;
  padding-top:16px;
  border-top:var(--line) solid #fff;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.copy{margin:0;font-weight:800;font-size:16px}
.up{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:10px 16px;
  background:var(--red);
  color:var(--ink);
  border:var(--line) solid #fff;
  box-shadow:4px 4px 0 var(--sky);
  font-weight:900;
  text-decoration:none;
}

/* 进场 */
.rev.in{animation:rise .5s cubic-bezier(.2,.7,.3,1) both}
@keyframes rise{
  from{opacity:0;transform:translateY(18px)}
  to{opacity:1;transform:none}
}
.rail.in li{animation:pop .44s ease both}
.rail.in li:nth-child(2){animation-delay:.06s}
.rail.in li:nth-child(3){animation-delay:.12s}
.rail.in li:nth-child(4){animation-delay:.18s}
.rail.in li:nth-child(5){animation-delay:.24s}
.rail.in li:nth-child(6){animation-delay:.3s}
@keyframes pop{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:none}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .rev.in,.rail.in li{animation:none}
}

@media (max-width:400px){
  body{font-size:16px}
  .hero{min-height:52vh}
  .content{padding-left:13px;padding-right:13px}
}

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