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

:root{
  --green:#00ff80;
  --blue:#0000ff;
  --ink:#000000;
  --fg:#f2f2f2;
  --dim:#b8b8b8;
  --line:#242424;
  --mono:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  --sans:"Noto Sans Arabic",system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
}

*{box-sizing:border-box;}

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

body{
  margin:0;
  background-color:#000;
  background-image:radial-gradient(#151515 1px,transparent 1px);
  background-size:16px 16px;
  color:var(--fg);
  font-family:var(--sans);
  font-size:1rem;
  line-height:1.75;
  overflow-x:hidden;
}

a{color:var(--green);}
img{max-width:100%;}
hr{border:0;}

a:focus-visible,
button:focus-visible,
input:focus-visible{
  outline:3px solid var(--green);
  outline-offset:2px;
}

/* ---------- 左侧固定竖排导航 ---------- */
.side{
  position:fixed;
  inset:0 auto 0 0;
  width:224px;
  height:100vh;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  background:#000;
  border-right:3px solid var(--green);
  z-index:20;
}

.brand{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:58px;
  padding:12px 14px;
  background:var(--green);
  color:#000;
  font-weight:700;
  font-size:1.12rem;
  line-height:1.2;
  letter-spacing:.01em;
  text-decoration:none;
  border-bottom:3px solid var(--ink);
}

.brand:hover,
.brand:focus{
  background:#fff;
  color:#000;
}

.brand .mark{
  font-size:1.25rem;
  line-height:1;
}

.menu{
  list-style:none;
  margin:0;
  padding:0;
  border-top:0;
}

.menu li{border-bottom:2px solid var(--line);}

.menu a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:12px 15px;
  color:var(--fg);
  font-weight:700;
  font-size:1rem;
  text-decoration:none;
}

.menu a:hover,
.menu a:focus{
  background:var(--green);
  color:#000;
}

.search{
  margin-top:auto;
  padding:14px;
  display:grid;
  gap:8px;
  border-top:3px solid var(--blue);
}

.search-in{
  width:100%;
  min-height:44px;
  padding:10px;
  background:#000;
  color:var(--fg);
  border:2px solid var(--green);
  font:inherit;
}

.search-btn{
  min-height:44px;
  padding:10px;
  background:var(--blue);
  color:#fff;
  border:2px solid #fff;
  font:inherit;
  font-weight:700;
  cursor:pointer;
}

.search-btn:hover{background:var(--green);color:#000;border-color:#000;}

.stage{margin-left:224px;}

/* ---------- 首屏 ---------- */
.hero{
  min-height:70vh;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  overflow:hidden;
  background-color:#000;
  background-image:radial-gradient(rgba(0,255,128,.42) 1.4px,transparent 1.5px);
  background-size:20px 20px;
  border-bottom:4px solid var(--blue);
}

.hero-top{
  padding:clamp(28px,5vw,64px);
  text-align:right;
}

.hero-h1{
  margin:0;
  font-size:clamp(2.1rem,5.4vw,4.3rem);
  font-weight:700;
  line-height:1.06;
  letter-spacing:-.01em;
  color:#fff;
  text-shadow:5px 5px 0 var(--blue);
  word-break:break-word;
}

.hero-img{
  display:block;
  width:100%;
  height:auto;
  max-height:56vh;
  object-fit:cover;
  border-top:4px solid var(--green);
  transform-origin:center center;
  will-change:transform;
}

/* ---------- 正文骨架 ---------- */
.wrap{
  display:grid;
  grid-template-columns:minmax(0,1fr) 300px;
  align-items:start;
}

.doc{
  min-width:0;
  padding:0 clamp(18px,3.4vw,48px) 56px;
}

.prose{padding-top:10px;}

/* ---------- 侧栏 ---------- */
.rail{
  position:sticky;
  top:0;
  align-self:start;
  padding:22px 16px 40px;
  background:#050505;
  border-left:3px solid var(--blue);
}

.rail-h2{
  margin:0;
  font-size:1.05rem;
  font-weight:700;
  letter-spacing:.06em;
  color:var(--green);
}

.rail hr{
  border-top:3px solid var(--blue);
  margin:12px 0 14px;
}

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

.rail-list li{border-bottom:2px solid var(--line);}

.rail-list a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:11px 6px;
  color:var(--fg);
  font-weight:600;
  text-decoration:none;
}

.rail-list a:hover,
.rail-list a:focus{
  background:var(--green);
  color:#000;
}

/* ---------- 正文排版 ---------- */
.prose div{
  padding:30px 0 24px;
  border-bottom:2px solid var(--line);
  scroll-margin-top:14px;
}

.prose div:last-child{border-bottom:0;}

.prose h2{
  margin:0;
  padding-left:14px;
  border-left:10px solid var(--green);
  font-size:clamp(1.5rem,3vw,2.1rem);
  font-weight:700;
  line-height:1.22;
}

.prose h2 + hr{
  border-top:3px solid var(--blue);
  margin:14px 0 20px;
}

.prose h3{
  margin:26px 0 8px;
  font-size:1.2rem;
  font-weight:700;
  color:var(--green);
}

.prose h3 + hr{
  border-top:2px dashed var(--blue);
  margin:10px 0 16px;
}

.prose p{
  max-width:66ch;
  margin:0 0 1.05em;
}

.prose ul,
.prose ol{
  max-width:66ch;
  padding-left:1.3em;
}

.prose li{margin-bottom:.5em;}

.prose li::marker{
  color:var(--green);
  font-weight:700;
}

.prose a{
  color:var(--green);
  text-underline-offset:3px;
}

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

.prose strong{
  color:#fff;
  background:linear-gradient(transparent 62%,rgba(0,255,128,.4) 62%);
}

.prose blockquote{
  max-width:66ch;
  margin:18px 0;
  padding:12px 16px;
  background:#0a0a0a;
  border-left:6px solid var(--blue);
}

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

.prose img{
  display:block;
  margin:18px 0;
  border:3px solid var(--green);
}

.prose code{
  font-family:var(--mono);
  font-size:.95em;
  background:#111;
  border:1px solid var(--line);
  padding:1px 5px;
}

.prose pre{
  overflow-x:auto;
  padding:14px;
  background:#0b0b0b;
  border:2px solid var(--line);
}

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

.prose th,
.prose td{
  padding:10px;
  text-align:left;
  border:2px solid var(--line);
  vertical-align:top;
}

.prose th{
  background:var(--blue);
  color:#fff;
}

.prose hr{
  border-top:2px solid var(--line);
  margin:20px 0;
}

/* ---------- 页脚 ---------- */
.foot{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:16px 24px;
  padding:clamp(22px,4vw,40px);
  background:#000;
  border-top:4px solid var(--green);
}

.foot-cta{
  flex:1 1 100%;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:14px 24px;
  padding-bottom:20px;
  border-bottom:3px solid var(--blue);
}

.cta-big{
  margin:0;
  font-size:clamp(1.7rem,5.6vw,3.2rem);
  font-weight:700;
  line-height:1.1;
  color:var(--green);
  text-shadow:4px 4px 0 var(--blue);
}

.cta-btn{
  display:inline-flex;
  align-items:center;
  min-height:48px;
  padding:12px 22px;
  background:var(--blue);
  color:#fff;
  font-weight:700;
  text-decoration:none;
  border:3px solid #fff;
}

.cta-btn:hover,
.cta-btn:focus{
  background:var(--green);
  color:#000;
  border-color:#000;
}

.foot-id{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:700;
  color:#fff;
}

.foot-mark .mark{color:var(--green);}

.foot-nav ol{
  display:flex;
  flex-wrap:wrap;
  gap:2px 14px;
  list-style:none;
  margin:0;
  padding:0;
}

.foot-nav a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 2px;
  color:var(--fg);
  text-decoration:none;
  border-bottom:2px solid transparent;
}

.foot-nav a:hover,
.foot-nav a:focus{
  color:var(--green);
  border-bottom-color:var(--green);
}

.foot-copy{
  font-size:1rem;
  color:var(--dim);
}

/* ---------- 移动端 ---------- */
@media (max-width:900px){
  .side{
    position:static;
    width:auto;
    height:auto;
    overflow:visible;
    border-right:0;
    border-bottom:3px solid var(--green);
  }

  .stage{margin-left:0;}

  .menu{
    display:flex;
    overflow-x:auto;
    border-top:2px solid var(--line);
  }

  .menu li{
    flex:0 0 auto;
    border-bottom:0;
    border-right:2px solid var(--line);
  }

  .menu a{
    padding:12px 14px;
    white-space:nowrap;
  }

  .search{
    margin-top:0;
    display:flex;
    gap:8px;
    border-top:2px solid var(--blue);
  }

  .search-in{flex:1 1 auto;min-width:0;}
  .search-btn{flex:0 0 auto;padding:10px 16px;}

  .hero{min-height:0;}
  .hero-h1{text-shadow:3px 3px 0 var(--blue);}
  .hero-img{max-height:none;}

  .wrap{grid-template-columns:1fr;}

  .rail{
    position:static;
    border-left:0;
    border-top:3px solid var(--blue);
    padding:20px 16px 32px;
  }

  .doc{padding-bottom:36px;}

  .foot{padding:18px;}

  .prose h2{border-left-width:8px;padding-left:12px;}
}

@media (max-width:420px){
  .foot-nav ol{gap:0 10px;}
  .cta-btn{width:100%;justify-content:center;}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  *{transition:none!important;animation:none!important;}
}

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