@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 {
  --ink: #000000;
  --paper: #ffffff;
  --rule: #000000;
  --soft: #d9d9d9;
  --muted: #444444;
  --sans: 'Noto Sans Arabic', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --serif: 'Noto Naskh Arabic', Georgia, 'Songti SC', serif;
  --max: 1200px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 0.005em;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
}

p {
  margin: 0 0 18px;
}

.wrap {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px;
}

.skip {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 90;
  padding: 10px 18px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  transform: translateY(-220%);
  transition: transform 0.2s ease;
}

.skip:focus {
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- 页头 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 2px solid var(--rule);
}

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 28px;
}

.bar > * {
  min-width: 0;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.pill:hover,
.pill:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.brand {
  margin: 0;
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-align: center;
  white-space: nowrap;
}

.brand a {
  text-decoration: none;
}

.right-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.search {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search input {
  width: 132px;
  min-height: 42px;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.2;
}

.search input::placeholder {
  color: var(--muted);
}

.search-btn {
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.search-btn:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 70vh;
  padding: 108px 0 44px;
  border-bottom: 2px solid var(--rule);
}

.hero-mark {
  position: absolute;
  top: 6px;
  left: 12px;
  z-index: 0;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(4rem, 16vw, 12rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
  opacity: 0.07;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(2.3rem, 8vw, 6.2rem);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.04em;
  max-width: 20ch;
}

.hero-rule {
  width: 76px;
  margin: 0 0 20px;
  border: 0;
  border-top: 3px solid var(--rule);
}

.hero-lead {
  margin: 0;
  max-width: 52ch;
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
}

/* ---------- 主体骨架 ---------- */

.layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  align-items: start;
  gap: 56px;
  padding: 56px 0 24px;
}

.side {
  position: sticky;
  top: 108px;
  border-top: 3px solid var(--rule);
  padding-top: 16px;
}

.side-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.3em;
}

.side hr {
  margin: 10px 0 16px;
  border: 0;
  border-top: 1px solid var(--rule);
}

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

.toc li {
  counter-increment: toc;
  border-bottom: 1px solid var(--soft);
  transition: border-color 0.2s ease;
}

.toc li:hover {
  border-color: var(--ink);
}

.toc a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 11px 0;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  opacity: 0.55;
}

.toc a:hover {
  transform: translateX(4px);
}

.body {
  min-width: 0;
}

.body > section {
  padding: 44px 0;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 112px;
}

.body > section:last-child {
  padding-bottom: 8px;
}

.body h2 {
  margin: 0 0 6px;
  font-size: clamp(1.5rem, 3.4vw, 2.2rem);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.body h2 + hr {
  margin: 0 0 22px;
  border: 0;
  border-top: 1px solid var(--rule);
}

.body h3 {
  margin: 30px 0 6px;
  font-size: 1.22rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.body h3 + hr {
  margin: 0 0 16px;
  border: 0;
  border-top: 1px solid var(--soft);
}

.body p {
  max-width: 70ch;
}

.body ul,
.body ol {
  margin: 0 0 18px;
  padding-left: 1.25em;
}

.body li {
  margin: 0.35em 0;
}

.body li::marker {
  color: var(--ink);
}

.body a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.body a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.body blockquote {
  margin: 26px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--rule);
  font-family: var(--serif);
  font-size: 1.06rem;
  line-height: 1.7;
}

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

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

.body th,
.body td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.body th {
  font-weight: 700;
}

.body img {
  margin: 0 0 20px;
  border: 1px solid var(--rule);
}

.body hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.body strong {
  font-weight: 700;
}

/* ---------- 页脚 ---------- */

.site-foot {
  margin-top: 72px;
  padding: 64px 0 28px;
  background: var(--ink);
  color: var(--paper);
}

.cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4);
}

.cta-title {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}

.cta-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 26px;
  border: 1px solid var(--paper);
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.22s ease, color 0.22s ease;
}

.cta-link:hover,
.cta-link:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

.foot-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  padding: 40px 0;
}

.foot-nav dl {
  margin: 0;
}

.foot-nav dt {
  margin-bottom: 10px;
  font-size: 15px;
  letter-spacing: 0.24em;
  opacity: 0.7;
}

.foot-nav dd {
  margin: 0;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

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

.foot-bar {
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  text-align: center;
  font-size: 15px;
}

.foot-bar p {
  margin: 0;
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 34px;
    padding: 40px 0 20px;
  }

  .side {
    position: static;
  }

  .toc {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 18px;
  }

  .body > section {
    scroll-margin-top: 24px;
  }
}

@media (max-width: 760px) {
  .masthead {
    position: static;
  }

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

  .brand {
    order: -1;
    font-size: 19px;
  }

  .pills,
  .right-group {
    justify-content: center;
  }

  .search {
    width: 100%;
    justify-content: center;
  }

  .search input {
    width: min(220px, 60%);
  }

  .wrap {
    padding: 0 18px;
  }

  .hero {
    min-height: 0;
    padding: 52px 0 36px;
  }

  .hero-title {
    font-size: clamp(2rem, 11vw, 3.2rem);
  }

  .cta {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .foot-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .site-foot {
    margin-top: 48px;
    padding: 44px 0 24px;
  }
}

@media (max-width: 380px) {
  .pill {
    padding: 9px 12px;
    font-size: 16px;
  }

  .toc {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

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