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

/* ── 变量 ── */
:root {
  --c-primary: #56228b;
  --c-secondary: #8b4513;
  --c-ink: #1f1726;
  --c-primary-light: #7a3db8;
  --c-primary-dim: #3d1866;
  --c-secondary-light: #b05a1e;
  --c-secondary-pale: #c8844a;
  --c-bg: #f5f0f8;
  --c-bg-card: #fdfbff;
  --c-bg-dark: #1f1726;
  --c-text: #2a1e35;
  --c-text-muted: #6b5a7a;
  --c-border: #ddd3e8;
  --c-earthy: #f2ece3;
  --c-earthy-dark: #e8dccf;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-soft: 0 4px 24px rgba(86,34,139,0.10);
  --shadow-card: 0 2px 16px rgba(86,34,139,0.08), 0 1px 4px rgba(31,23,38,0.06);
  --shadow-hover: 0 8px 32px rgba(86,34,139,0.18);
  --font: 'IBM Plex Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --nav-h: 64px;
  --anchor-h: 44px;
  --header-total: calc(var(--nav-h) + var(--anchor-h));
  --max-w: 1180px;
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

/* ── 重置 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  font-size: 17px;
  background: var(--c-bg);
  color: var(--c-text);
}
body {
  font-family: var(--font);
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--c-bg);
  position: relative;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-light); }
ul, menu { list-style: none; }
dl, dt, dd { margin: 0; padding: 0; }

/* ── 无障碍 ── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── 装饰 blob 背景 ── */
.blob-bg {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.blob {
  position: absolute; width: 60vw; height: 60vw;
}
.blob-1 { top: -15vw; right: -10vw; }
.blob-2 { bottom: 10vh; left: -15vw; }
.blob-3 { top: 40vh; right: 20vw; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(31,23,38,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(86,34,139,0.3);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand-link {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0; color: #fff; font-weight: 700; font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.brand-link:hover { color: var(--c-secondary-pale); }
.brand-logo { height: 38px; width: auto; border-radius: 8px; }
.brand-text {
  font-size: 1.1rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #c084fc, var(--c-secondary-pale));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── 导航 details/summary/menu ── */
.primary-nav { margin-left: auto; }
.nav-details { position: relative; }
.nav-details[open] .nav-menu { display: block; }
summary.nav-toggle {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; color: #e2d8f0; font-size: 0.92rem; font-weight: 500;
  padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid rgba(86,34,139,0.4);
  background: rgba(86,34,139,0.18);
  list-style: none; user-select: none;
  transition: background var(--transition), border-color var(--transition);
  min-height: 44px;
}
summary.nav-toggle::-webkit-details-marker { display: none; }
summary.nav-toggle:hover {
  background: rgba(86,34,139,0.35);
  border-color: rgba(86,34,139,0.7);
}
.nav-toggle-label { white-space: nowrap; }
.nav-menu {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0;
  background: rgba(31,23,38,0.98);
  border: 1px solid rgba(86,34,139,0.4);
  border-radius: var(--radius-md);
  padding: 10px 0;
  min-width: 200px;
  box-shadow: var(--shadow-hover);
  backdrop-filter: blur(16px);
  z-index: 200;
}
.nav-menu li a {
  display: flex; align-items: center;
  padding: 11px 22px;
  color: #e2d8f0; font-size: 0.95rem; font-weight: 400;
  transition: background var(--transition), color var(--transition), padding-left var(--transition);
  min-height: 44px;
}
.nav-menu li a:hover {
  background: rgba(86,34,139,0.3);
  color: #fff;
  padding-left: 30px;
}

/* ── 搜索框 ── */
.header-search {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(86,34,139,0.35);
  border-radius: var(--radius-xl);
  overflow: hidden;
  flex-shrink: 0;
}
.search-input {
  background: transparent; border: none; outline: none;
  color: #e2d8f0; font-size: 0.88rem; font-family: var(--font);
  padding: 10px 14px; width: 150px; min-height: 44px;
}
.search-input::placeholder { color: #9980b0; }
.search-btn {
  background: var(--c-primary); border: none; cursor: pointer;
  color: #fff; padding: 0 14px; height: 44px;
  display: flex; align-items: center;
  transition: background var(--transition);
  min-height: 44px;
}
.search-btn:hover { background: var(--c-primary-light); }

/* ── 锚点导航条 ── */
.sticky-anchor-bar {
  background: rgba(31,23,38,0.92);
  border-top: 1px solid rgba(86,34,139,0.18);
  overflow-x: auto;
  scrollbar-width: none;
}
.sticky-anchor-bar::-webkit-scrollbar { display: none; }
.anchor-list {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  padding: 0 16px;
  height: var(--anchor-h);
  align-items: center;
  gap: 4px;
}
.anchor-link {
  color: #c4b0d8; font-size: 0.82rem; font-weight: 500;
  padding: 8px 13px; border-radius: var(--radius-xl);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  min-height: 40px; display: flex; align-items: center;
}
.anchor-link:hover {
  background: rgba(86,34,139,0.35);
  color: #fff;
}

/* ── section scroll margin ── */
section[id] { scroll-margin-top: calc(var(--header-total) + 12px); }

/* ── Hero ── */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  background: var(--c-bg-dark);
}
.hero-media {
  position: absolute; inset: 0; z-index: 0;
}
.hero-visual { width: 100%; height: 100%; }
.hero-blob { width: 100%; height: 100%; object-fit: cover; }
.hero-content {
  position: relative; z-index: 2;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px 24px 60px;
  text-align: right;
  display: flex; flex-direction: column; align-items: flex-end;
  width: 100%;
}
.hero-badges {
  display: flex; gap: 10px; margin-bottom: 28px; flex-wrap: wrap;
  justify-content: flex-end;
}
.badge {
  display: inline-flex; align-items: center;
  padding: 5px 16px; border-radius: var(--radius-xl);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em;
}
.badge-primary {
  background: rgba(86,34,139,0.6);
  border: 1px solid rgba(192,132,252,0.4);
  color: #e9d8ff;
}
.badge-secondary {
  background: rgba(139,69,19,0.5);
  border: 1px solid rgba(200,132,74,0.4);
  color: #f5dcc0;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.18;
  margin-bottom: 22px;
  max-width: 700px;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 32px rgba(0,0,0,0.5);
}
.hero-lead {
  font-size: 1.05rem;
  color: #c9b8df;
  max-width: 480px;
  line-height: 1.75;
  margin-bottom: 36px;
}
.hero-cta {
  display: inline-flex; align-items: center;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-light));
  color: #fff; font-weight: 600; font-size: 1rem;
  padding: 14px 32px; border-radius: var(--radius-xl);
  box-shadow: 0 4px 20px rgba(86,34,139,0.4);
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 48px;
}
.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(86,34,139,0.55);
  color: #fff;
}

/* ── 主体布局 ── */
.page-wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 60px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
  position: relative; z-index: 1;
}
.content-main { min-width: 0; }
.content-article { }
.article-body { }

/* ── 正文 section 样式（page.content 里的各节） ── */
.article-body > section,
.article-body section {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  padding: 40px 44px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-card);
  border-bottom: 4px solid var(--c-primary);
  transition: box-shadow var(--transition), transform var(--transition);
  opacity: 0;
  transform: translateY(28px);
}
.article-body > section.revealed,
.article-body section.revealed {
  opacity: 1; transform: translateY(0);
}
.article-body > section:hover,
.article-body section:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.article-body > section:nth-child(even),
.article-body section:nth-child(even) {
  border-bottom-color: var(--c-secondary);
  background: var(--c-earthy);
}
.article-body h2 {
  font-size: 1.55rem; font-weight: 700;
  color: var(--c-primary); margin-bottom: 10px;
  line-height: 1.3; letter-spacing: -0.01em;
}
.article-body .subtitle,
.article-body h2 + p:first-of-type {
  color: var(--c-text-muted); font-size: 0.95rem;
  margin-bottom: 18px; line-height: 1.6;
}
.article-body h3 {
  font-size: 1.15rem; font-weight: 600;
  color: var(--c-secondary); margin: 22px 0 10px;
}
.article-body p {
  color: var(--c-text); font-size: 1rem; line-height: 1.8;
  margin-bottom: 14px;
}
.article-body ul, .article-body ol {
  padding-left: 1.4em; margin-bottom: 14px;
}
.article-body li { margin-bottom: 6px; line-height: 1.7; }
.article-body a {
  color: var(--c-primary); border-bottom: 1px solid rgba(86,34,139,0.25);
  transition: border-color var(--transition), color var(--transition);
}
.article-body a:hover {
  color: var(--c-primary-light);
  border-bottom-color: var(--c-primary-light);
}
.article-body time { color: var(--c-text-muted); font-size: 0.88rem; }

/* ── Aside ── */
.content-aside {
  display: flex; flex-direction: column; gap: 24px;
  position: sticky; top: calc(var(--header-total) + 20px);
}
.aside-card {
  background: var(--c-bg-card);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  border-bottom: 3px solid var(--c-primary);
}
.aside-card--earthy {
  background: var(--c-earthy);
  border-bottom-color: var(--c-secondary);
}
.aside-title {
  font-size: 1.05rem; font-weight: 700;
  color: var(--c-primary); margin-bottom: 6px;
}
.subtitle.aside-about,
.aside-card .subtitle {
  color: var(--c-text-muted); font-size: 0.85rem;
  margin-bottom: 16px; line-height: 1.6;
}
.aside-links { display: flex; flex-direction: column; gap: 4px; }
.aside-links li a {
  display: flex; align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--c-text); font-size: 0.9rem; font-weight: 500;
  transition: background var(--transition), color var(--transition);
  min-height: 44px;
}
.aside-links li a::before {
  content: '›'; margin-right: 8px;
  color: var(--c-primary); font-size: 1.2rem; line-height: 1;
}
.aside-links li a:hover {
  background: rgba(86,34,139,0.08);
  color: var(--c-primary);
}

/* ── Footer ── */
.site-footer {
  background: var(--c-bg-dark);
  border-top: 2px solid rgba(86,34,139,0.3);
  padding: 0;
  position: relative; z-index: 1;
  overflow: hidden;
}
.footer-brand-bar {
  padding: 48px 24px 0;
  max-width: var(--max-w); margin: 0 auto;
  overflow: hidden;
}
.footer-brand-giant {
  display: block;
  font-size: clamp(3rem, 10vw, 8rem);
  font-weight: 700;
  color: rgba(86,34,139,0.18);
  letter-spacing: -0.04em;
  line-height: 1;
  user-select: none;
  white-space: nowrap;
}
.footer-body {
  max-width: var(--max-w); margin: 0 auto;
  padding: 40px 24px 32px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.footer-body dt {
  font-size: 0.78rem; font-weight: 700;
  color: var(--c-secondary-pale);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(139,69,19,0.3);
}
.footer-body dd { margin-bottom: 8px; }
.footer-body dd a {
  color: #c4b0d8; font-size: 0.88rem;
  transition: color var(--transition);
  display: inline-flex; align-items: center; min-height: 32px;
}
.footer-body dd a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(86,34,139,0.2);
  padding: 20px 24px;
  text-align: center;
}
.footer-copy {
  color: #7a6890; font-size: 0.8rem;
}

/* ── Scroll Reveal 动效 ── */
@media (prefers-reduced-motion: no-preference) {
  .article-body > section,
  .article-body section {
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow var(--transition);
  }
}
@media (prefers-reduced-motion: reduce) {
  .article-body > section,
  .article-body section {
    opacity: 1 !important; transform: none !important;
    transition: box-shadow var(--transition);
  }
  html { scroll-behavior: auto; }
}

/* ── 响应式 ── */
@media (max-width: 900px) {
  .page-wrap {
    grid-template-columns: 1fr;
    padding: 40px 16px;
  }
  .content-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .aside-card { flex: 1 1 260px; }
  .footer-body { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .header-inner { padding: 0 14px; gap: 10px; }
  .header-search { display: none; }
  .hero-content { padding: 60px 18px 48px; text-align: right; }
  .hero-title { font-size: clamp(1.8rem, 8vw, 2.6rem); }
  .article-body > section, .article-body section { padding: 26px 20px; }
  .footer-body { grid-template-columns: 1fr; }
  .footer-brand-giant { font-size: 3rem; }
  .anchor-list { gap: 2px; }
  .anchor-link { font-size: 0.75rem; padding: 8px 9px; min-height: 40px; }
  .nav-toggle-label { display: none; }
  .page-wrap { padding: 28px 14px; gap: 24px; }
  summary.nav-toggle { min-height: 44px; padding: 10px 12px; }
}
