@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: #ff0000;
  --violet: #8b00ff;
  --ink: #261717;
  --txt: #f8f1f3;
  --dim: rgba(248, 241, 243, 0.72);
  --glass: rgba(255, 255, 255, 0.1);
  --glass-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.19);
  --line-soft: rgba(255, 255, 255, 0.1);
  --serif: 'Noto Naskh Arabic', 'Noto Sans Arabic', 'Songti SC', 'Source Han Serif SC',
    'Noto Serif CJK SC', Georgia, serif;
  --sans: 'Noto Sans Arabic', -apple-system, BlinkMacSystemFont, 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
  color: var(--txt);
  background: #170d11;
  min-height: 100vh;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-underline-offset: 3px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.22;
  margin: 0 0 0.5em;
  letter-spacing: 0.008em;
}

/* ---------- 底光 ---------- */
.ambience {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(58vw 46vh at 6% -8%, rgba(255, 0, 0, 0.42), transparent 64%),
    radial-gradient(52vw 50vh at 98% 10%, rgba(139, 0, 255, 0.38), transparent 62%),
    radial-gradient(76vw 60vh at 46% 112%, rgba(139, 0, 255, 0.3), transparent 68%),
    linear-gradient(168deg, #2c1519 0%, #1b0f15 46%, #140a13 100%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.6;
  animation: drift 22s ease-in-out infinite alternate;
}

.orb-a {
  width: 38vw;
  height: 38vw;
  left: -8vw;
  top: 22vh;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.7), transparent 70%);
}

.orb-b {
  width: 42vw;
  height: 42vw;
  right: -12vw;
  top: 46vh;
  background: radial-gradient(circle, rgba(139, 0, 255, 0.65), transparent 70%);
  animation-delay: -7s;
}

.orb-c {
  width: 30vw;
  height: 30vw;
  left: 38vw;
  top: -12vh;
  background: radial-gradient(circle, rgba(255, 0, 0, 0.35), transparent 72%);
  animation-delay: -13s;
}

@keyframes drift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(3vw, -4vh, 0) scale(1.12);
  }
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px clamp(14px, 4vw, 36px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: var(--serif);
  font-size: 19px;
  letter-spacing: 0.03em;
}

.brand .mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  text-decoration: none;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.36);
  background: linear-gradient(152deg, var(--red), var(--violet));
  box-shadow: 0 10px 26px -14px rgba(255, 0, 0, 0.95);
}

.mark-img {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.brand-name {
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.pill-cta {
  color: #fff;
  background: linear-gradient(100deg, var(--red), var(--violet));
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow: 0 14px 32px -16px rgba(255, 0, 0, 0.95);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pill-cta:hover,
.pill-cta:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -14px rgba(139, 0, 255, 0.95);
}

/* ---------- 锚点条 ---------- */
.anchors {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 8px clamp(12px, 3vw, 32px);
  background: rgba(24, 13, 18, 0.58);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.anchors nav {
  max-width: 1180px;
  margin: 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.anchors nav::-webkit-scrollbar {
  display: none;
}

.anchors ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.anchors a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  color: var(--txt);
  background: var(--glass-soft);
  border: 1px solid var(--line-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.18s ease, border-color 0.18s ease;
}

.anchors a:hover,
.anchors a:focus-visible,
.anchors a.is-active {
  background: rgba(255, 0, 0, 0.2);
  border-color: rgba(255, 0, 0, 0.55);
}

/* ---------- 外壳 ---------- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 282px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 32px) clamp(14px, 4vw, 36px) 0;
}

main {
  min-width: 0;
}

/* ---------- 侧栏 ---------- */
.side {
  position: sticky;
  top: 84px;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 22px 46px -32px #000, inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.side h2 {
  font-size: 20px;
  margin-bottom: 0.35em;
}

.side .subtitle {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--dim);
}

.toc {
  list-style: none;
  counter-reset: toc;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.toc li {
  counter-increment: toc;
}

.toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.toc .num::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #ffb0b0;
}

.toc a:hover,
.toc a:focus-visible,
.toc a.is-active {
  background: rgba(255, 0, 0, 0.16);
  border-color: rgba(255, 0, 0, 0.42);
}

/* ---------- 英雄 ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  min-height: 45vh;
  padding: clamp(20px, 4vw, 44px);
  border-radius: 10px 10px 40% 40% / 10px 10px 15% 15%;
  border: 1px solid var(--line);
  background: linear-gradient(158deg, rgba(255, 0, 0, 0.4), rgba(139, 0, 255, 0.34) 70%, rgba(38, 23, 23, 0.6));
  box-shadow: 0 30px 60px -46px #000;
}

.hero-img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.52;
  filter: saturate(1.15);
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(0deg, rgba(19, 10, 14, 0.94), rgba(19, 10, 14, 0.2) 66%, rgba(255, 0, 0, 0.14));
}

.hero-text {
  max-width: 26ch;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 6.4vw, 60px);
  text-shadow: 0 14px 44px rgba(0, 0, 0, 0.72);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 14px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: 0.16em;
  color: #ffe3e3;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.32);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ---------- 正文 ---------- */
.prose {
  padding-top: clamp(20px, 3vw, 30px);
}

.prose > article {
  position: relative;
  margin: 0 0 20px;
  padding: clamp(18px, 3vw, 30px);
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.042));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 22px 48px -38px #000, inset 0 1px 0 rgba(255, 255, 255, 0.22);
  scroll-margin-top: 96px;
}

.prose > article:nth-child(even) {
  background: linear-gradient(150deg, rgba(139, 0, 255, 0.14), rgba(255, 255, 255, 0.04));
}

.prose h2 {
  position: relative;
  padding-bottom: 0.55em;
  font-size: clamp(22px, 3.4vw, 30px);
}

.prose h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 54px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--red), var(--violet));
}

.prose h3 {
  font-size: 19px;
  color: #fff;
}

.prose p {
  margin: 0 0 1em;
}

.prose ul,
.prose ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

.prose li {
  margin: 0.32em 0;
}

.prose li::marker {
  color: #ffb0b0;
}

.prose a {
  color: #ffdcdc;
  text-decoration-color: rgba(255, 176, 176, 0.6);
}

.prose a:hover,
.prose a:focus-visible {
  color: #fff;
  text-decoration-color: var(--red);
}

.prose strong {
  color: #fff;
}

.prose blockquote {
  margin: 0 0 1em;
  padding: 14px 18px;
  border-left: 3px solid var(--violet);
  border-radius: 0 10px 10px 0;
  background: rgba(139, 0, 255, 0.13);
  color: #f3e9f8;
}

.prose img {
  width: 100%;
  height: auto;
  margin: 0 0 1em;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.prose hr {
  border: 0;
  height: 1px;
  margin: 1.6em 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.prose code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.94em;
  padding: 0.1em 0.4em;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
}

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

.prose th,
.prose td {
  padding: 8px 10px;
  border: 1px solid var(--line-soft);
  text-align: left;
}

/* ---------- 滚动出现 ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  transition-delay: calc(var(--i, 0) * 60ms);
}

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

/* ---------- 页脚 ---------- */
footer {
  margin-top: 56px;
  padding: clamp(22px, 4vw, 44px) clamp(14px, 4vw, 36px) 22px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.foot-inner {
  max-width: 1180px;
  margin: 0 auto;
}

.foot-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(20px, 3.4vw, 32px);
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(112deg, rgba(255, 0, 0, 0.24), rgba(139, 0, 255, 0.24) 58%, rgba(255, 255, 255, 0.06));
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.foot-cta h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 27px);
}

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 30px);
  margin-top: 28px;
}

.foot-cols dl {
  margin: 0;
}

.foot-cols dt {
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.08em;
  color: #ffc7c7;
}

.foot-cols dd {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--dim);
}

.foot-cols dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 2px;
  text-decoration: none;
  color: var(--dim);
}

.foot-cols dd a:hover,
.foot-cols dd a:focus-visible {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--red);
}

.base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 16px;
  color: var(--dim);
}

.base p {
  margin: 0;
}

.base a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
}

.base a:hover,
.base a:focus-visible {
  color: #fff;
  text-decoration: underline;
}

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: static;
    order: 2;
  }

  main {
    order: 1;
  }

  .hero {
    min-height: 42vh;
    border-radius: 10px 10px 34% 34% / 10px 10px 12% 12%;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }

  .brand-name {
    font-size: 17px;
  }

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

  .foot-cols dl:last-child {
    grid-column: 1 / -1;
  }

  .hero {
    min-height: 40vh;
  }

  .hero-text {
    max-width: none;
  }
}

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

  .orb {
    animation: none;
  }

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

  .pill-cta {
    transition: none;
  }
}

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