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

:root {
  --ink: #26171a;
  --ink-2: #2f1d21;
  --ink-3: #3a2429;
  --rose: #eb879c;
  --pink: #ffb6c1;
  --txt: #f7ecee;
  --mut: #c9adb3;
  --line: rgba(255, 182, 193, 0.16);
  --line-2: rgba(255, 182, 193, 0.3);
  --sh-soft: 0 2px 4px rgba(10, 4, 6, 0.34), 0 16px 34px -22px rgba(10, 4, 6, 0.85);
  --sh-lift: 0 2px 4px rgba(10, 4, 6, 0.4), 0 22px 44px -22px rgba(10, 4, 6, 0.95);
  --r: 4px;
  --maxw: 1180px;
  --headh: 62px;
}

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

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

body {
  margin: 0;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  font-size: 16.5px;
  font-weight: 400;
  line-height: 1.72;
  color: var(--txt);
  background-color: var(--ink);
  background-image:
    radial-gradient(760px 420px at 88% -8%, rgba(235, 135, 156, 0.15), transparent 70%),
    radial-gradient(620px 460px at 4% 108%, rgba(255, 182, 193, 0.08), transparent 72%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

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

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
  border-radius: var(--r);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 顶栏 */

.top {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--headh);
  padding: 9px clamp(14px, 4vw, 30px);
  background: rgba(38, 23, 26, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--txt);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.05em;
  transition: background-color 200ms ease, border-color 200ms ease;
}

.brand:hover {
  background: var(--ink-2);
  border-color: var(--line-2);
}

.marktxt,
.markimg {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(140deg, var(--pink), var(--rose));
  color: #2a1216;
  font-size: 17px;
  line-height: 34px;
  font-weight: 700;
  text-align: center;
  box-shadow: 0 2px 4px rgba(10, 4, 6, 0.45);
}

.markimg {
  object-fit: cover;
}

.bname {
  font-size: 17px;
  white-space: nowrap;
}

.sbox {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.sbox input {
  width: clamp(92px, 20vw, 190px);
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--txt);
  font: inherit;
  font-size: 16px;
}

.sbox input::placeholder {
  color: #a98e94;
}

.sbox button {
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(150deg, var(--pink), var(--rose));
  color: #2a1216;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.sbox button:hover {
  transform: translateY(-1px);
  box-shadow: var(--sh-soft);
}

/* 胶囊锚点条 */

.pills {
  position: sticky;
  top: var(--headh);
  z-index: 30;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px clamp(14px, 4vw, 30px);
  background: rgba(38, 23, 26, 0.96);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.pills::-webkit-scrollbar {
  height: 0;
}

.pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--ink-2);
  color: var(--mut);
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(10, 4, 6, 0.28);
  transition: color 220ms ease, background-color 220ms ease, border-color 220ms ease, transform 220ms ease;
}

.pill:hover {
  color: #2a1216;
  background: linear-gradient(150deg, var(--pink), var(--rose));
  border-color: transparent;
  transform: translateY(-1px);
}

/* 版面 */

.stage {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px) clamp(14px, 4vw, 30px) 48px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) minmax(0, 268px);
  grid-template-areas:
    'mark hero hero'
    'prose prose rail';
  gap: 20px clamp(18px, 2.6vw, 34px);
  align-items: start;
}

.heroic {
  grid-area: mark;
  margin: 0;
  width: 88px;
  filter: drop-shadow(0 6px 14px rgba(10, 4, 6, 0.5));
}

.heroic svg {
  display: block;
  width: 100%;
  height: auto;
}

.hero {
  grid-area: hero;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  text-align: right;
  min-height: clamp(196px, 45vh, 360px);
  padding: 8px 2px 14px;
}

.ghost {
  position: absolute;
  right: -6px;
  top: 42%;
  transform: translateY(-50%);
  margin: 0;
  font-size: clamp(54px, 11vw, 128px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(255, 182, 193, 0.075);
  white-space: nowrap;
  pointer-events: none;
  z-index: 0;
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-shadow: 0 6px 22px rgba(10, 4, 6, 0.45);
}

.lede {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 46ch;
  color: var(--mut);
  font-size: 16.5px;
  font-weight: 300;
}

/* 正文 */

.prose {
  grid-area: prose;
  min-width: 0;
}

.prose div {
  margin: 0 0 20px;
  padding: clamp(18px, 2.4vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink-2);
  box-shadow: var(--sh-soft), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  scroll-margin-top: 136px;
  animation: rise 280ms ease both;
}

.prose div:nth-child(even) {
  background: #2b1a1e;
}

.prose div:nth-child(2) { animation-delay: 40ms; }
.prose div:nth-child(3) { animation-delay: 80ms; }
.prose div:nth-child(4) { animation-delay: 120ms; }
.prose div:nth-child(5) { animation-delay: 160ms; }
.prose div:nth-child(6) { animation-delay: 200ms; }
.prose div:nth-child(7) { animation-delay: 240ms; }

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

.prose h2 {
  margin: 0 0 14px;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--txt);
}

.prose h2::after {
  content: '';
  display: block;
  width: 46px;
  height: 2px;
  margin-top: 12px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--rose), transparent);
}

.prose h3 {
  margin: 24px 0 10px;
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.38;
  color: var(--pink);
}

.prose p {
  margin: 0 0 14px;
  color: #ecdcdf;
}

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

.prose ul,
.prose ol {
  margin: 0 0 14px;
  padding-left: 1.35em;
  color: #ecdcdf;
}

.prose li {
  margin-bottom: 8px;
}

.prose li::marker {
  color: var(--rose);
}

.prose strong {
  color: var(--pink);
  font-weight: 700;
}

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

.prose a:hover {
  color: #ffd3da;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r);
  box-shadow: var(--sh-soft);
}

.prose blockquote {
  margin: 0 0 14px;
  padding: 10px 0 10px 16px;
  border-left: 3px solid var(--rose);
  color: var(--mut);
}

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

.prose code {
  padding: 2px 6px;
  border-radius: var(--r);
  background: var(--ink-3);
  font-size: 15px;
}

/* 侧栏 */

.rail {
  grid-area: rail;
  position: sticky;
  top: 124px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink-2);
  box-shadow: var(--sh-soft), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.rail small {
  display: block;
  font-size: 12.5px;
  letter-spacing: 0.24em;
  color: var(--rose);
}

.rail h2 {
  margin: 6px 0 12px;
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--txt);
}

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

.toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 4px 8px;
  border-left: 2px solid transparent;
  border-radius: var(--r);
  color: var(--txt);
  font-size: 16px;
  text-decoration: none;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}

.toc a:hover {
  background: var(--ink-3);
  border-left-color: var(--rose);
  color: var(--pink);
}

.num {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--rose);
  font-variant-numeric: tabular-nums;
}

/* 页脚 */

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px clamp(20px, 4vw, 54px);
  padding: 30px clamp(14px, 4vw, 30px) 40px;
  border-top: 1px solid var(--line);
  background: rgba(24, 14, 16, 0.72);
}

.fcol {
  min-width: 0;
}

.fmark {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--pink);
}

.sub {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.sub input {
  width: 148px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--ink-2);
  color: var(--txt);
  font: inherit;
  font-size: 16px;
}

.sub input::placeholder {
  color: #a98e94;
}

.sub button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--r);
  background: linear-gradient(150deg, var(--pink), var(--rose));
  color: #2a1216;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.sub button:hover {
  transform: translateY(-1px);
  box-shadow: var(--sh-soft);
}

.fnav dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0;
}

.fnav dt {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.fnav dt a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 12.5px;
  letter-spacing: 0.24em;
  color: var(--rose);
  text-decoration: none;
}

.fnav dd {
  margin: 0;
}

.fnav dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--mut);
  font-size: 16px;
  text-decoration: none;
  transition: color 200ms ease, transform 200ms ease;
}

.fnav dd a:hover {
  color: var(--pink);
  transform: translateX(2px);
}

.fcol-end {
  text-align: right;
  margin-left: auto;
}

.copy {
  margin: 0 0 6px;
  color: var(--mut);
  font-size: 15px;
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--txt);
  font-size: 15px;
  text-decoration: none;
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}

.totop:hover {
  background: var(--ink-2);
  border-color: var(--line-2);
  color: var(--pink);
}

/* 断点 */

@media (max-width: 960px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'mark'
      'hero'
      'prose'
      'rail';
    gap: 14px;
  }

  .hero {
    align-items: flex-start;
    text-align: left;
    min-height: 0;
    padding: 4px 0 10px;
  }

  .ghost {
    right: auto;
    left: -4px;
    top: 46%;
    font-size: clamp(48px, 15vw, 96px);
  }

  .rail {
    position: static;
  }

  .fcol-end {
    text-align: left;
    margin-left: 0;
  }
}

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

  .stage {
    grid-template-columns: 64px minmax(0, 1fr);
    grid-template-areas:
      'mark hero'
      'prose prose'
      'rail rail';
  }

  .heroic {
    width: 64px;
  }

  .hero h1 {
    font-size: clamp(26px, 8vw, 34px);
  }

  .sbox input {
    width: 84px;
    padding: 0 8px;
  }

  .pills {
    top: var(--headh);
  }

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

  .prose div {
    scroll-margin-top: 124px;
  }
}

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

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

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