@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 {
  --rose: #eb879c;
  --pink: #ffb6c1;
  --ink: #26171a;
  --paper: #fdf4f5;
  --card: #ffffff;
  --muted: #6b5458;
  --line: #f2dde1;
  --r: 18px;
  --sh-s: 0 1px 2px rgba(38, 23, 26, .07), 0 3px 10px rgba(38, 23, 26, .05);
  --sh-m: 0 2px 4px rgba(38, 23, 26, .07), 0 12px 26px rgba(38, 23, 26, .08);
  --sh-deep: 0 6px 14px rgba(38, 23, 26, .10), 0 22px 44px rgba(38, 23, 26, .13);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(760px 420px at 92% -6%, #ffe4ea 0%, rgba(255, 228, 234, 0) 64%),
    radial-gradient(620px 380px at 4% 34%, #ffeef3 0%, rgba(255, 238, 243, 0) 60%),
    var(--paper);
  color: var(--ink);
  font-family: 'Noto Naskh Arabic', 'Noto Sans Arabic', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.78;
  letter-spacing: .006em;
}

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

:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ── 顶栏 ───────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 9px clamp(10px, 3vw, 34px);
  background: rgba(253, 244, 245, .9);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 rgba(38, 23, 26, .07), 0 10px 24px rgba(38, 23, 26, .05);
}

.mark {
  grid-column: 2;
  justify-self: center;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--sh-s);
  color: var(--ink);
  font-size: clamp(17px, 2.1vw, 20px);
  font-weight: 700;
  letter-spacing: .1em;
  text-decoration: none;
  white-space: nowrap;
  transition: box-shadow .22s ease, transform .22s ease;
}

.mark:hover { transform: translateY(-1px); box-shadow: var(--sh-m); }

.rail p {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin: 0;
}

.rail-l p { justify-content: flex-start; }
.rail-r p { justify-content: flex-end; }

.rail a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: background .22s ease, box-shadow .22s ease, transform .22s ease;
}

.rail a:hover {
  background: var(--pink);
  box-shadow: var(--sh-s);
  transform: translateY(-1px);
}

.ico {
  width: 12px;
  height: 12px;
  flex: none;
  fill: currentColor;
  opacity: .55;
}

/* ── 首屏 ───────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 2vw, 26px);
  min-height: 45vh;
  padding: clamp(22px, 4vw, 52px) clamp(16px, 4vw, 56px);
  background: linear-gradient(132deg, #fde7ec 0%, #ffffff 48%, #ffedf2 100%);
  border-radius: 0 0 36px 36px;
  box-shadow: var(--sh-m);
}

.ghost {
  position: absolute;
  left: -1%;
  bottom: -8%;
  font-size: clamp(58px, 13vw, 172px);
  font-weight: 700;
  line-height: .84;
  letter-spacing: -.02em;
  color: var(--rose);
  opacity: .15;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.hero-txt {
  grid-column: 2;
  grid-row: 1;
  z-index: 3;
  text-align: right;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(26px, 4.1vw, 43px);
  line-height: 1.32;
  letter-spacing: .01em;
}

.lede {
  margin: 0 0 0 auto;
  max-width: 42ch;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.shot {
  margin: 0;
  overflow: hidden;
  border: 5px solid #fff;
  border-radius: var(--r);
  background: linear-gradient(150deg, var(--pink), #fff4f6);
  box-shadow: var(--sh-deep);
  will-change: transform;
}

.shot.void { min-height: 170px; }

.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.shot-a {
  grid-column: 1;
  grid-row: 1;
  width: 79%;
  justify-self: start;
  transform: rotate(-4deg);
  transition: transform .26s ease;
}

.shot-b {
  grid-column: 1;
  grid-row: 1;
  width: 63%;
  justify-self: end;
  align-self: end;
  z-index: 2;
  transform: rotate(3.5deg);
  transition: transform .26s ease;
}

.hero:hover .shot-a { transform: rotate(-5.5deg) translateY(-4px); }
.hero:hover .shot-b { transform: rotate(5deg) translateY(3px); }

/* ── 正文区 ─────────────────────────────── */
.reader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 248px;
  align-items: start;
  gap: clamp(16px, 2.4vw, 28px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(20px, 3.5vw, 44px) clamp(14px, 4vw, 44px) 8px;
}

.reader div {
  grid-column: 1;
  margin: 0 0 18px;
  padding: clamp(18px, 3vw, 32px);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: var(--sh-s);
  scroll-margin-top: 98px;
  animation: rise .28s ease both;
}

.reader div + div { margin-top: 2px; }
.reader div:nth-of-type(1) { animation-delay: .02s; }
.reader div:nth-of-type(2) { animation-delay: .05s; }
.reader div:nth-of-type(3) { animation-delay: .08s; }
.reader div:nth-of-type(4) { animation-delay: .11s; }
.reader div:nth-of-type(5) { animation-delay: .14s; }
.reader div:nth-of-type(6) { animation-delay: .17s; }
.reader div:nth-of-type(7) { animation-delay: .2s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.reader h2 {
  margin: 0 0 14px;
  font-size: clamp(21px, 2.5vw, 27px);
  line-height: 1.36;
  letter-spacing: .012em;
}

.reader h3 {
  margin: 24px 0 8px;
  font-size: 19px;
  line-height: 1.45;
}

.reader p { margin: 0 0 14px; }
.reader p:last-child { margin-bottom: 0; }

.reader small {
  display: block;
  margin-bottom: 6px;
  color: var(--rose);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .26em;
}

.reader ul,
.reader ol { margin: 0 0 16px; padding-left: 1.35em; }
.reader li { margin-bottom: 8px; }

.reader a {
  color: #c0536b;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.reader a:hover { color: var(--ink); background: #ffe9ee; }

.reader img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 18px 0;
  border-radius: 14px;
  box-shadow: var(--sh-s);
}

.reader figure { margin: 18px 0; }
.reader figure img { margin: 0; }

.reader blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-radius: 14px;
  background: #fff1f4;
  color: var(--muted);
}

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

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

.reader th,
.reader td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.reader th { background: #fff4f6; font-weight: 700; }

.reader code {
  padding: 1px 6px;
  border-radius: 8px;
  background: #fbeaee;
  font-size: 15px;
}

.reader hr {
  margin: 24px 0;
  border: 0;
  height: 1px;
  background: var(--line);
}

/* ── 右侧索引 ───────────────────────────── */
.side {
  grid-column: 2;
  grid-row: 1 / span 40;
  position: sticky;
  top: 92px;
  padding: 20px 16px;
  border-radius: var(--r);
  background: linear-gradient(158deg, #ffffff 0%, #ffeef3 100%);
  box-shadow: var(--sh-m);
}

.side small {
  margin: 0 0 2px;
  font-size: 13px;
  letter-spacing: .26em;
}

.side h2 {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.4;
}

.side ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.side a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 11px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 16px;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.side a:hover {
  background: var(--pink);
  transform: translateX(3px);
}

/* ── 页脚 ───────────────────────────────── */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 22px;
  margin-top: 22px;
  padding: 20px clamp(16px, 4vw, 48px) 36px;
  border-top: 1px solid var(--line);
}

.foot address {
  font-style: normal;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .05em;
}

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

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 16px;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}

.foot a:hover { background: var(--pink); color: var(--ink); }

/* ── 断点 ───────────────────────────────── */
@media (max-width: 900px) {
  .reader { grid-template-columns: minmax(0, 1fr); }
  .side {
    grid-column: 1;
    grid-row: auto;
    position: static;
    margin-top: 4px;
  }
  .side ul { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (max-width: 820px) {
  .top {
    position: static;
    grid-template-columns: 1fr;
    padding: 8px 12px 10px;
  }
  .mark {
    grid-column: 1;
    order: -1;
    justify-self: center;
  }
  .rail p { justify-content: center; }
  .rail a { padding: 8px 10px; }

  .hero {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    min-height: 0;
    padding: 20px 16px 26px;
    border-radius: 0 0 26px 26px;
  }
  .hero-txt {
    grid-column: 1 / -1;
    grid-row: 1;
    margin-bottom: 16px;
  }
  .shot-a {
    grid-column: 1;
    grid-row: 2;
    width: 94%;
    align-self: start;
  }
  .shot-b {
    grid-column: 2;
    grid-row: 2;
    width: 88%;
    align-self: end;
    margin-bottom: 6px;
  }
  .shot img { aspect-ratio: 3 / 4; }
  .ghost { opacity: .12; }

  .foot { justify-content: center; text-align: center; }
  .foot ul { justify-content: center; }
  .reader div { scroll-margin-top: 16px; }
}

@media (max-width: 420px) {
  body { font-size: 16.5px; }
  .rail a span { font-size: 15px; }
  .ico { display: none; }
  .rail a { min-height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reader div { opacity: 1; transform: none; }
}

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