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

/* ── 变量 ── */
:root {
  --c-primary: #F7536A;
  --c-secondary: #C0143C;
  --c-accent: #FF8C42;
  --c-dark: #1a0a0e;
  --c-dark2: #2d1219;
  --c-mid: #6b2236;
  --c-light: #fff5f7;
  --c-muted: #f0d8de;
  --c-text: #1a0a0e;
  --c-text2: #5a2233;
  --sidebar-w: 220px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 4px;
  --transition: 160ms ease;
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; line-height: 1.6; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--c-text); background: var(--c-light); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }

/* ── 整页骨架 ── */
.page-shell {
  display: flex;
  min-height: 100vh;
}

/* ── 侧边栏 ── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--c-dark);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-top {
  padding: 0 0 8px;
}

.sidebar-announce {
  background: var(--c-primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  padding: 6px 12px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  padding: 18px 20px 14px;
}

.brand-logo {
  width: auto;
  height: 36px;
  object-fit: contain;
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-primary);
  letter-spacing: -0.01em;
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
}

.sidebar-nav ul {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  color: #e8c5ce;
  font-size: 0.9rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}

.sidebar-nav li a:hover,
.sidebar-nav li a:focus-visible {
  color: #fff;
  background: var(--c-dark2);
  border-left-color: var(--c-primary);
}

.sidebar-footer-note {
  padding: 14px 20px;
  font-size: 0.72rem;
  color: var(--c-mid);
  border-top: 1px solid var(--c-dark2);
}

/* ── 主内容区 ── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ── Hero ── */
.hero-block {
  position: relative;
  background: var(--c-secondary);
  min-height: 45vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 56px 48px 96px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 560px;
}

.hero-badge {
  display: inline-block;
  background: var(--c-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 14px;
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.hero-h1 {
  font-size: clamp(1.7rem, 3.5vw, 2.8rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 16px;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 1rem;
  color: rgba(255,255,255,0.78);
  max-width: 420px;
  line-height: 1.65;
}

.hero-media {
  position: absolute;
  right: 0; top: 0;
  width: 42%;
  height: 100%;
  overflow: hidden;
  z-index: 1;
}

.hero-media .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
}

/* 斜切底边 */
.hero-clip {
  position: absolute;
  bottom: -2px; left: 0;
  width: 100%;
  height: 64px;
  background: var(--c-light);
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
  z-index: 3;
}

/* ── 正文区 ── */
.content-main {
  flex: 1;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 32px 64px;
}

.content-section {
  padding-top: 48px;
}

.content-article {
  color: var(--c-text);
}

/* ── 正文内容样式 ── */
.content-article h2 {
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--c-secondary);
  margin: 2.4em 0 0.6em;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.content-article h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-dark);
  margin: 1.8em 0 0.5em;
}

.content-article p {
  margin: 0 0 1.1em;
  line-height: 1.75;
  font-size: 1rem;
}

.content-article ul,
.content-article ol {
  margin: 0.8em 0 1.2em 1.4em;
  list-style: disc;
}

.content-article ol { list-style: decimal; }

.content-article li {
  margin-bottom: 0.45em;
  line-height: 1.7;
}

.content-article a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition);
}

.content-article a:hover { color: var(--c-secondary); }

.content-article strong { font-weight: 600; color: var(--c-dark); }

.content-article blockquote {
  border-left: 4px solid var(--c-primary);
  padding: 12px 20px;
  background: var(--c-muted);
  margin: 1.4em 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── section 区块分隔（page.content 内的 section） ── */
.content-article section {
  padding-top: 32px;
  margin-top: 32px;
  border-top: 2px solid var(--c-muted);
  scroll-margin-top: 80px;
}

.content-article section:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* ── small 眉题（契约：small 紧邻 h2 前） ── */
small + h2,
small + h3 {
  margin-top: 0.2em;
}

.content-article small,
small {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--c-primary);
  text-transform: uppercase;
  margin-bottom: 4px;
}

/* ── scroll-margin for sections ── */
section[id] {
  scroll-margin-top: 72px;
}

/* ── 页脚 ── */
.site-footer {
  background: var(--c-dark);
  color: #e0b8c2;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 32px;
  flex-wrap: wrap;
}

.footer-brand a {
  display: flex;
  align-items: center;
}

.footer-brand .brand-text {
  font-size: 1rem;
  color: var(--c-primary);
}

.footer-brand .brand-logo {
  height: 28px;
}

.footer-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 0.82rem;
  color: #c4909f;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
}

.footer-nav a:hover {
  color: #fff;
  background: var(--c-dark2);
}

.footer-copy {
  font-size: 0.78rem;
  color: var(--c-mid);
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

.footer-18 {
  color: var(--c-accent);
  font-weight: 600;
  font-size: 0.72rem;
}

/* ── 汉堡按钮（移动端） ── */
.nav-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 300;
  width: 44px; height: 44px;
  background: var(--c-primary);
  border-radius: var(--radius);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px;
}

.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── 动效 ── */
@media (prefers-reduced-motion: no-preference) {
  .content-article section {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 280ms ease, transform 280ms ease;
  }
  .content-article section.revealed {
    opacity: 1;
    transform: none;
  }
  .hero-badge {
    animation: badge-pop 0.5s ease 0.2s both;
  }
  @keyframes badge-pop {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
  }
}

/* ── 移动端 ── */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 220ms ease;
    width: 240px;
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-wrapper {
    margin-left: 0;
  }
  .nav-toggle {
    display: flex;
  }
  .hero-block {
    padding: 72px 20px 80px;
    min-height: 52vh;
  }
  .hero-h1 {
    font-size: 1.55rem;
  }
  .hero-media {
    width: 100%;
    opacity: 0.18;
  }
  .wrap {
    padding: 0 18px 48px;
  }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
  }
  .footer-copy {
    text-align: left;
  }
  .footer-nav {
    flex: none;
  }
}

@media (max-width: 480px) {
  .hero-block {
    padding: 68px 16px 72px;
  }
  .content-article h2 {
    font-size: 1.2rem;
  }
}

/* ── overlay（移动端侧边栏背景蒙层） ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,10,14,0.55);
  z-index: 190;
}
.sidebar-overlay.active {
  display: block;
}

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