@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 {
  --red: #E8462D;
  --ink: #12131A;
  --gold: #F5C542;
  --paper: #FFF7EE;
  --dot: #E7D9C7;
  --muted: #4A4C57;
  --radius: 10px;
  --pad: clamp(16px, 3.4vw, 34px);
}

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

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

body {
  margin: 0;
  font-family: 'Noto Sans Arabic', 'Noto Naskh Arabic', system-ui, -apple-system, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.72;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.3px);
  background-size: 18px 18px;
}

a { color: var(--red); }

a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

hr {
  border: 0;
  border-top: 2px solid var(--ink);
  margin: 22px 0;
}

/* ---------- 顶部两行：品牌行 + 菜单行 ---------- */
.top {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 5px solid var(--red);
}

.brandrow {
  display: flex;
  align-items: center;
  padding: 12px var(--pad) 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  text-decoration: none;
  color: var(--gold);
  font-weight: 700;
  font-size: 23px;
  letter-spacing: 0.08em;
}

.brand::before {
  content: '';
  width: 18px;
  height: 18px;
  background: var(--red);
  border-radius: 2px;
  flex: 0 0 auto;
}

.brand:has(.mark-img)::before { display: none; }

.mark-img {
  height: 28px;
  width: auto;
  border-radius: 3px;
  display: block;
}

.navrow {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0 var(--pad) 14px;
  flex-wrap: wrap;
}

.navmenu {
  flex: 1 1 auto;
  min-width: 0;
}

summary {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 15px;
  min-width: 118px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 700;
  font-size: 17px;
  border-radius: 4px;
  cursor: pointer;
  list-style: none;
  transition: background-color 160ms ease, color 160ms ease;
}

summary::-webkit-details-marker { display: none; }

summary::after {
  content: '＋';
  font-size: 15px;
  line-height: 1;
}

.navmenu[open] summary::after { content: '－'; }

summary:hover { background: #fff; }

.navmenu menu {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
}

.navmenu menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 10px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(245, 197, 66, 0.28);
  transition: background-color 160ms ease, color 160ms ease;
}

.navmenu menu a:hover,
.navmenu menu a:focus-visible {
  background: var(--red);
  color: #fff;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  background: var(--red);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  border: 2px solid var(--red);
  transition: background-color 160ms ease, color 160ms ease;
}

.cta:hover {
  background: var(--ink);
  border-color: var(--gold);
  color: var(--gold);
}

/* ---------- 版心 ---------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--pad);
  padding: 8px 0 52px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 0 10px;
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -8px -6px 0 -6px;
  z-index: -1;
  background-image: radial-gradient(var(--red) 1.6px, transparent 1.7px);
  background-size: 14px 14px;
  opacity: 0.16;
  transform: translate3d(0, var(--py, 0px), 0);
  pointer-events: none;
}

h1 {
  margin: 0;
  font-size: clamp(30px, 6.4vw, 58px);
  line-height: 1.14;
  letter-spacing: -0.01em;
  font-weight: 700;
  text-wrap: balance;
}

h1::after {
  content: '';
  display: block;
  width: 76px;
  height: 10px;
  background: var(--gold);
  margin: 18px 0 0;
}

.lede {
  margin: 0;
  max-width: 54ch;
  font-size: 18px;
  color: var(--muted);
}

.hero-media { margin: 6px 0 0; }

.hero-media img,
.hero-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 2px solid var(--ink);
}

/* ---------- 正文 ---------- */
.doc > article {
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(6px);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: var(--pad);
  margin: 0 0 20px;
}

.doc article[id] { scroll-margin-top: 18px; }

.doc h2 {
  margin: 0 0 12px;
  font-size: clamp(22px, 3.6vw, 31px);
  line-height: 1.24;
  font-weight: 700;
  text-wrap: balance;
}

.doc h2 + hr {
  width: 68px;
  border-top: 4px solid var(--red);
  margin: 0 0 20px;
}

.doc h3 {
  margin: 26px 0 12px;
  font-size: 20px;
  line-height: 1.35;
  font-weight: 700;
  text-wrap: balance;
}

.doc h3 + hr {
  width: 48px;
  border-top: 3px solid var(--red);
  margin: 0 0 16px;
}

.doc p { margin: 0 0 15px; }
.doc p:last-child { margin-bottom: 0; }

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

.doc li { margin: 7px 0; }

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

.doc a:hover { background: var(--gold); color: var(--ink); }

.doc strong { font-weight: 700; }

.doc blockquote {
  margin: 0 0 16px;
  padding: 14px 18px;
  border-left: 7px solid var(--gold);
  background: rgba(245, 197, 66, 0.18);
  border-radius: 0 8px 8px 0;
}

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

.doc img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 2px solid var(--ink);
}

.doc figure { margin: 0 0 16px; }

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

.doc th, .doc td {
  border: 2px solid var(--ink);
  padding: 9px 12px;
  text-align: left;
}

.doc th { background: var(--gold); }

.doc code {
  font-family: ui-monospace, 'SFMono-Regular', Consolas, monospace;
  background: rgba(18, 19, 26, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 15px;
}

/* ---------- 右侧栏 ---------- */
.side {
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  background: rgba(245, 197, 66, 0.24);
  backdrop-filter: blur(6px);
  padding: 16px 18px 20px;
}

.side h2 {
  margin: 0 0 10px;
  font-size: 17px;
  letter-spacing: 0.16em;
  font-weight: 700;
}

.side hr {
  width: 42px;
  border-top: 4px solid var(--red);
  margin: 0 0 12px;
}

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

.side .toc li {
  counter-increment: toc;
  border-top: 1px dashed rgba(18, 19, 26, 0.28);
}

.side .toc li:first-child { border-top: 0; }

.side .toc a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 6px 2px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
}

.side .toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  letter-spacing: 0.06em;
}

.side .toc a:hover {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 页脚（仅 p / small）---------- */
.foot {
  background: var(--ink);
  color: var(--paper);
  border-top: 7px solid var(--gold);
  padding: clamp(24px, 4vw, 42px) var(--pad) 22px;
  display: grid;
  gap: 16px;
}

.foot-brand {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.1em;
}

.foot-links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 11px;
  font-size: 16px;
  color: var(--paper);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 4px;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.foot-links a:hover {
  background: var(--red);
  border-color: var(--red);
}

.foot-top { margin: 0; }

.foot-top a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  background: var(--gold);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 160ms ease;
}

.foot-top a:hover { background: var(--red); color: #fff; }

.foot-copy {
  grid-column: 1 / -1;
  display: block;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  text-align: center;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.78);
}

/* ---------- 动效 ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 320ms ease, transform 320ms ease;
}

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

/* ---------- 断点 ---------- */
@media (min-width: 820px) {
  .navrow { align-items: center; }
  summary { display: none; }
  .navmenu menu {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    gap: 4px;
  }
  .navmenu menu a {
    border-bottom: 0;
    border-radius: 4px;
    padding: 0 12px;
    min-height: 46px;
  }
  h1::after { margin-top: 22px; }
}

@media (min-width: 900px) {
  .stage {
    grid-template-columns: minmax(0, 1fr) 296px;
    align-items: start;
  }
  .hero {
    min-height: 62vh;
    padding-top: 30px;
  }
  .side {
    position: sticky;
    top: 16px;
  }
}

@media (min-width: 1180px) {
  .hero { min-height: 68vh; }
}

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

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