@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700&family=Syne:wght@400;500;600;700&display=swap');

/* ---------- 基础 ---------- */
:root {
  --ink: #141414;
  --ink-2: #1c1c1c;
  --ink-3: #2b2b2b;
  --pink: #ff3b5c;
  --yellow: #ffd23f;
  --paper: #f4f1ea;
  --muted: #b8b3a9;
  --fw: 1240px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: Manrope, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: Syne, Manrope, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0;
  overflow-wrap: anywhere;
}

p { margin: 0 0 16px; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

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

::selection {
  background: var(--yellow);
  color: var(--ink);
}

.skip {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 80;
  background: var(--yellow);
  color: var(--ink);
  font-weight: 800;
  padding: 12px 18px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.16s ease;
}
.skip:focus { top: 10px; }

/* ---------- 品牌行 ---------- */
.mast {
  background: var(--ink);
  border-bottom: 6px solid var(--pink);
  padding: 20px clamp(16px, 4vw, 44px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 48px;
  text-decoration: none;
  color: #fff;
  font-family: Syne, Manrope, "PingFang SC", system-ui, sans-serif;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-size: clamp(22px, 4.2vw, 40px);
  line-height: 1.05;
  transition: color 0.16s ease;
}
.brand:hover { color: var(--yellow); }

.brand-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: none;
}

/* ---------- 菜单行 ---------- */
.nav {
  background: var(--ink);
  border-bottom: 3px solid var(--ink-3);
  padding: 12px clamp(14px, 4vw, 44px) 16px;
}

.nav-groups {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.ng { position: relative; }

.ng-btn {
  display: none;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--pink);
  border-radius: 4px;
  padding: 11px 20px;
  min-height: 44px;
  cursor: pointer;
  align-items: center;
  gap: 10px;
  transition: background 0.16s ease, color 0.16s ease;
}
.ng-btn::after {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--pink);
  transform: rotate(45deg);
  transition: background 0.16s ease;
}
.ng-btn:hover,
.ng.is-open .ng-btn {
  background: var(--pink);
  color: var(--ink);
}
.ng-btn:hover::after,
.ng.is-open .ng-btn::after { background: var(--ink); }

.ng-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.ng-panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 13px;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  border: 2px solid var(--ink-3);
  border-radius: 4px;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.ng-panel a:hover {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  background: var(--ink);
  border-bottom: 3px solid var(--ink-3);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 20px;
  padding: clamp(34px, 7vw, 64px) clamp(20px, 5vw, 56px);
}

.hero-copy h1 {
  position: relative;
  font-size: clamp(2rem, 6.4vw, 4.6rem);
  color: #fff;
  padding-bottom: 20px;
}
.hero-copy h1::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 90px;
  height: 8px;
  background: var(--yellow);
}

.hero-lead {
  margin: 0;
  max-width: 40ch;
  color: var(--muted);
  font-size: clamp(16px, 1.9vw, 19px);
}

.hero-art {
  position: relative;
  background: var(--pink);
  border-top: 3px solid var(--ink-3);
  min-height: 220px;
}
.hero-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 12px;
  background: var(--yellow);
}
.hero-img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
}

/* ---------- 主体骨架 ---------- */
main { padding: clamp(26px, 4vw, 52px) 0 clamp(36px, 6vw, 76px); }

.wrap {
  max-width: var(--fw);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 40px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(22px, 4vw, 48px);
  align-items: start;
}

/* ---------- 侧栏 ---------- */
.side {
  background: var(--ink-2);
  border: 2px solid var(--ink-3);
  border-left: 6px solid var(--pink);
  border-radius: 4px;
  padding: 18px 16px 20px;
}

.eyebrow {
  display: block;
  font-family: Syne, Manrope, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--yellow);
  margin-bottom: 8px;
}

.side-h {
  font-size: 20px;
  color: #fff;
  margin: 0 0 14px;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
}

.side-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 9px;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  border-radius: 2px;
  border-bottom: 1px solid var(--ink-3);
  transition: background 0.16s ease, color 0.16s ease;
}
.side-list a:hover {
  background: var(--pink);
  color: var(--ink);
}

.sn {
  font-family: Syne, Manrope, system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--pink);
  letter-spacing: 0.06em;
}
.side-list a:hover .sn { color: var(--ink); }

/* ---------- 正文 ---------- */
.body { min-width: 0; }

.prose > article {
  background: var(--ink-2);
  border: 2px solid var(--ink-3);
  border-bottom: 6px solid var(--pink);
  border-radius: 4px;
  padding: clamp(26px, 3.6vw, 44px) clamp(18px, 3vw, 40px);
  margin: 0 0 clamp(20px, 3vw, 30px);
  scroll-margin-top: 24px;
}
.prose > article:nth-child(even) { border-bottom-color: var(--yellow); }
.prose > article:first-child { border-top: 6px solid var(--yellow); }
.prose > article:last-child { margin-bottom: 0; }

.prose h2 {
  font-size: clamp(1.45rem, 3.4vw, 2.2rem);
  color: var(--yellow);
  margin: 0 0 14px;
}
.prose h3 {
  font-size: clamp(1.12rem, 2.2vw, 1.35rem);
  color: #fff;
  margin: 26px 0 10px;
}
.prose h4 {
  font-size: 17px;
  color: var(--pink);
  margin: 20px 0 8px;
}
.prose p { color: #ddd9d1; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.35em; }
.prose li { margin: 0 0 8px; }
.prose li::marker { color: var(--pink); font-weight: 700; }
.prose a {
  color: var(--pink);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}
.prose a:hover { background: var(--pink); color: var(--ink); text-decoration: none; }
.prose strong { color: #fff; }
.prose blockquote {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 6px solid var(--pink);
  background: var(--ink);
  color: #fff;
  border-radius: 4px;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose hr {
  border: 0;
  border-top: 3px solid var(--ink-3);
  margin: 26px 0;
}
.prose figure { margin: 0 0 18px; }
.prose img {
  width: 100%;
  border: 2px solid var(--ink-3);
  border-radius: 4px;
}
.prose figcaption {
  font-size: 15px;
  color: var(--muted);
  margin-top: 8px;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 16px;
}
.prose th, .prose td {
  border: 2px solid var(--ink-3);
  padding: 9px 12px;
  text-align: left;
}
.prose th { background: var(--ink); color: var(--yellow); }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  background: var(--ink);
  border: 1px solid var(--ink-3);
  border-radius: 2px;
  padding: 1px 5px;
}

/* ---------- 页脚 ---------- */
.ft {
  background: var(--pink);
  color: var(--ink);
  border-top: 6px solid var(--yellow);
}

.ft-in {
  max-width: var(--fw);
  margin: 0 auto;
  padding: clamp(26px, 5vw, 48px) clamp(16px, 4vw, 40px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.ft-nav { display: contents; }

.ft dl { margin: 0; }

.ft dt {
  font-family: Syne, Manrope, system-ui, sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.16em;
  display: inline-block;
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 3px solid var(--ink);
}

.ft dd { margin: 0; }

.ft dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.16s ease;
}
.ft dd a:hover { border-bottom-color: var(--ink); }

.ft-logo {
  font-family: Syne, Manrope, "PingFang SC", system-ui, sans-serif;
  font-weight: 800;
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
  overflow-wrap: anywhere;
}

.ft-bar {
  border-top: 3px solid var(--ink);
  padding: 14px clamp(16px, 4vw, 40px);
  font-size: 15px;
}
.ft-bar p {
  margin: 0 auto;
  max-width: var(--fw);
  overflow-wrap: anywhere;
}

/* ---------- 回顶 ---------- */
.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  background: var(--yellow);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 11px 15px;
  min-height: 44px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.16s ease;
}
.totop.on { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover { background: var(--pink); color: #fff; }

/* ---------- 滚动出现 ---------- */
.rv {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.rv.in { opacity: 1; transform: none; }

/* ---------- 桌面 ---------- */
@media (min-width: 861px) {
  .nav-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .ng-btn { display: inline-flex; }

  .ng-panel {
    position: absolute;
    top: calc(100% + 7px);
    left: 0;
    z-index: 40;
    min-width: 196px;
    grid-template-columns: 1fr;
    gap: 3px;
    background: var(--ink);
    border: 2px solid var(--yellow);
    border-radius: 4px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
  }

  .ng-panel a { border-color: var(--ink-3); }

  .ng:hover .ng-panel,
  .ng:focus-within .ng-panel,
  .ng.is-open .ng-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    min-height: 70vh;
  }
  .hero-art {
    border-top: 0;
    border-left: 3px solid var(--ink-3);
    min-height: 100%;
  }

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

  .side {
    position: sticky;
    top: 22px;
  }
  .side-list { grid-template-columns: 1fr; }

  .prose > article { scroll-margin-top: 26px; }

  .ft-in { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- 极窄 ---------- */
@media (max-width: 520px) {
  .ft-in { grid-template-columns: 1fr; }
  .ng-panel { grid-template-columns: 1fr; }
  .side-list { grid-template-columns: 1fr; }
}

/* ---------- 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

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