@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700;1,400&family=Nunito:ital,wght@0,700;0,800;0,900;1,700&display=swap');

:root {
  --red: #FF5C6C;
  --red-d: #E04255;
  --ink: #2B1B33;
  --cream: #FFF3E9;
  --ink-70: #4A3A52;
  --line: rgba(43, 27, 51, .14);
  --cline: rgba(255, 243, 233, .22);
  --side: 232px;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Nunito', 'DM Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  font-weight: 400;
}

a { color: inherit; }

/* ---------- 品牌角标 ---------- */
.brand {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 30;
  width: var(--side);
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  border-bottom: 5px solid var(--red);
  transition: background .18s ease, color .18s ease;
}
.brand svg { display: block; }
.brand-name {
  font-weight: 900;
  font-size: 17px;
  letter-spacing: .02em;
}
.brand:hover,
.brand:focus-visible { background: var(--red); color: #fff; }

/* ---------- 左侧竖排导航 ---------- */
.sidenav {
  position: fixed;
  left: 0;
  top: 96px;
  bottom: 0;
  z-index: 25;
  width: var(--side);
  background: var(--ink);
  overflow-y: auto;
  padding: 8px 0 28px;
  border-right: 0;
}
.sidenav ol {
  list-style: none;
  margin: 0;
  padding: 0;
}
.sidenav li { border-bottom: 1px solid var(--cline); }
.sidenav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 12px 18px;
  color: var(--cream);
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.35;
  transition: background .16s ease, color .16s ease, padding-left .16s ease;
}
.sidenav a svg {
  flex: none;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.sidenav a:hover,
.sidenav a:focus-visible {
  background: var(--red);
  color: #fff;
  padding-left: 24px;
}

/* ---------- 主体 ---------- */
main { margin-left: var(--side); }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 34px 72px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 274px;
  gap: 46px;
  align-items: start;
}

.col { min-width: 0; }

/* ---------- 首屏 ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 30px;
  align-items: center;
  min-height: 45vh;
  padding: 34px 0 30px;
  border-bottom: 8px solid var(--red);
  text-align: right;
}
.hero.no-art { grid-template-columns: minmax(0, 1fr); }

.hero-art {
  align-self: stretch;
  overflow: hidden;
  background: var(--red);
  max-height: 380px;
}
.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  will-change: transform;
}

.hero h1 {
  margin: 0;
  font-size: clamp(29px, 4.2vw, 50px);
  line-height: 1.16;
  font-weight: 900;
  letter-spacing: -.015em;
}
.hero hr {
  margin: 14px 0 16px;
  margin-left: auto;
  width: 72px;
  height: 5px;
  border: 0;
  background: var(--red);
}
.lede {
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink-70);
  max-width: 46ch;
  margin-left: auto;
}

/* ---------- 正文 ---------- */
.prose {
  margin-top: 40px;
  max-width: 70ch;
  font-size: 17px;
  line-height: 1.8;
}
.prose > section {
  scroll-margin-top: 24px;
}
.prose > section + section {
  margin-top: 42px;
  padding-top: 34px;
  border-top: 2px solid var(--line);
}
.prose > section:first-child { margin-top: 0; padding-top: 0; }

.prose p { margin: 0 0 1.1em; }
.prose h2 {
  margin: 0 0 6px;
  font-size: clamp(22px, 2.7vw, 31px);
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: -.01em;
  scroll-margin-top: 24px;
}
.prose h3 {
  margin: 30px 0 8px;
  font-size: 19px;
  line-height: 1.4;
  font-weight: 900;
  scroll-margin-top: 24px;
}
.prose hr {
  border: 0;
  width: 56px;
  height: 4px;
  background: var(--ink);
  margin: 12px 0 20px;
}
.prose ul,
.prose ol { margin: 0 0 1.1em; padding-left: 1.35em; }
.prose li { margin: .32em 0; }
.prose a {
  color: var(--red-d);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--ink); }
.prose strong { font-weight: 900; }
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.3em 0;
  border-bottom: 6px solid var(--red);
}
.prose blockquote {
  margin: 1.4em 0;
  padding: 2px 0 2px 18px;
  border-left: 7px solid var(--red);
  color: var(--ink-70);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.3em 0;
  font-size: 16px;
}
.prose th,
.prose td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  vertical-align: top;
}
.prose th {
  background: var(--ink);
  color: var(--cream);
  font-weight: 800;
}
.prose code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  background: rgba(43, 27, 51, .08);
  padding: 1px 5px;
  font-size: 15px;
}

/* ---------- 右侧栏 ---------- */
.side {
  position: sticky;
  top: 24px;
  margin-top: 34px;
  background: #fff;
  border-top: 8px solid var(--ink);
  padding: 20px 20px 24px;
}
.side h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .02em;
}
.side hr {
  border: 0;
  width: 44px;
  height: 4px;
  background: var(--red);
  margin: 0 0 14px;
}
.side-list {
  list-style: none;
  counter-reset: s;
  margin: 0;
  padding: 0;
}
.side-list li {
  counter-increment: s;
  border-bottom: 1px solid var(--line);
}
.side-list li:last-child { border-bottom: 0; }
.side-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 11px 0;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  font-weight: 700;
  transition: color .16s ease, padding-left .16s ease;
}
.side-list a::before {
  content: counter(s, decimal-leading-zero);
  font-size: 13px;
  font-weight: 800;
  color: var(--red);
  letter-spacing: .06em;
}
.side-list a:hover,
.side-list a:focus-visible {
  color: var(--red-d);
  padding-left: 6px;
}

/* ---------- 页脚 ---------- */
footer {
  margin-left: var(--side);
  background: var(--ink);
  color: var(--cream);
  padding: 52px 34px 26px;
}
.foot-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px;
}
footer dl { margin: 0; }
footer dt {
  font-size: 17px;
  font-weight: 900;
  color: #fff;
  padding-bottom: 9px;
  margin-bottom: 10px;
  border-bottom: 5px solid var(--red);
}
footer dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  color: #E7D9E5;
  word-break: break-word;
}
footer dd a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 4px 0;
  color: var(--cream);
  text-decoration: none;
  transition: color .16s ease, padding-left .16s ease;
}
footer dd a:hover,
footer dd a:focus-visible { color: var(--red); padding-left: 6px; }

.sub {
  display: flex;
  margin-top: 8px;
  border-bottom: 4px solid var(--red);
}
.sub input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 12px 6px;
  border: 0;
  background: transparent;
  color: var(--cream);
  font: inherit;
  font-size: 16px;
}
.sub input::placeholder { color: #A38FA6; }
.sub input:focus { outline: 2px solid var(--red); outline-offset: 2px; }
.sub button {
  flex: none;
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  transition: background .16s ease;
}
.sub button:hover,
.sub button:focus-visible { background: var(--red-d); }

.foot-base {
  max-width: 1200px;
  margin: 34px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--cline);
  text-align: center;
  font-size: 16px;
}
.foot-base p { margin: 0; }

/* ---------- 动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}
.hero-txt > h1,
.hero-txt > hr,
.hero-txt > .lede { transition: opacity .5s ease, transform .5s ease; }

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  .brand {
    position: sticky;
    top: 0;
    width: 100%;
    height: 58px;
    justify-content: flex-start;
    padding: 0 18px;
    gap: 8px;
  }
  .brand svg { width: 26px; height: 26px; }

  .sidenav {
    position: sticky;
    top: 58px;
    bottom: auto;
    width: 100%;
    padding: 0;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 4px solid var(--red);
    -webkit-overflow-scrolling: touch;
  }
  .sidenav ol {
    display: flex;
    min-width: max-content;
  }
  .sidenav li {
    border-bottom: 0;
    border-right: 1px solid var(--cline);
  }
  .sidenav a {
    min-height: 48px;
    padding: 12px 15px;
    white-space: nowrap;
    font-size: 16px;
  }
  .sidenav a:hover,
  .sidenav a:focus-visible { padding-left: 15px; }

  main,
  footer { margin-left: 0; }

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

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 22px 0 24px;
    text-align: left;
    gap: 18px;
    border-bottom-width: 6px;
  }
  .hero hr { margin-left: 0; }
  .lede { margin-left: 0; }
  .hero-txt { order: -1; }
  .hero-art { max-height: 200px; }
  .hero-img { height: 200px; min-height: 0; }

  .prose { margin-top: 28px; }
  .prose > section { scroll-margin-top: 124px; }
  .prose h2,
  .prose h3 { scroll-margin-top: 124px; }

  .side {
    position: static;
    margin-top: 0;
  }

  footer { padding: 34px 18px 22px; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .foot-base { margin-top: 26px; }
}

@media (max-width: 380px) {
  .brand-name { font-size: 16px; }
  .hero h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-img { transform: none !important; }
}

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