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

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

img, svg, video, canvas { max-width: 100%; }

:root {
  --ink: #1f1726;
  --ink-deep: #171021;
  --plum: #56228b;
  --ochre: #8b4513;
  --cream: #f0e7dc;
  --soft: #b8a899;
  --line: rgba(242, 233, 221, 0.13);
  --r-xl: 28px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-xs: 4px;
}

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

body {
  margin: 0;
  width: 100%;
  min-height: 100vh;
  background:
    radial-gradient(58vw 40vw at 88% -8%, rgba(86, 34, 139, 0.32), transparent 62%),
    radial-gradient(52vw 38vw at 2% 26%, rgba(139, 69, 19, 0.24), transparent 64%),
    var(--ink);
  color: var(--cream);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.78;
  overflow-x: hidden;
  overflow-wrap: break-word;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.75;
  background-image: repeating-linear-gradient(112deg, rgba(255, 255, 255, 0.03) 0 1px, transparent 1px 7px);
}

body.menu-open { overflow: hidden; }

a { color: inherit; }

/* ---------- 顶栏 ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  max-width: 100%;
  background: rgba(23, 16, 33, 0.9);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.menu-open .top {
  background: var(--ink-deep);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px clamp(12px, 4vw, 44px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 48px;
  font-family: 'Syne', 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: var(--cream);
  text-decoration: none;
  border-radius: var(--r-md);
}

.brand-logo {
  height: 34px;
  width: auto;
  max-width: 100%;
  display: block;
  border-radius: 10px;
}

.tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
}

.cta {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--plum), var(--ochre));
  color: #fff;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 10px 22px -14px rgba(86, 34, 139, 0.9);
}

.cta:hover { filter: brightness(1.12); }

.burger {
  width: 46px;
  height: 46px;
  flex: none;
  padding: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  border: 1px solid rgba(242, 233, 221, 0.26);
  border-radius: 50% 50% 50% 6px;
  background: rgba(242, 233, 221, 0.06);
}

.burger span {
  display: block;
  width: 18px;
  height: 2px;
  max-width: none;
  border-radius: 2px;
  background: var(--cream);
  transition: transform 0.28s ease, opacity 0.2s ease;
}

.menu-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; }
.menu-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 菜单 ---------- */
.menu {
  padding: 0 clamp(12px, 4vw, 44px) 12px;
  max-width: 100%;
}

.menu p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  max-width: 100%;
  min-width: 0;
}

.menu a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 999px;
  background: rgba(242, 233, 221, 0.055);
  color: #e9dfd2;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.menu a:hover,
.menu a:focus-visible {
  background: rgba(139, 69, 19, 0.6);
  color: #fff;
}

.menu-open .menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 96px 20px 48px;
  background: linear-gradient(155deg, #2a1740, var(--ink) 56%, #3b2211);
}

.menu-open .menu p {
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 10px;
  width: min(440px, 100%);
}

.menu-open .menu a {
  justify-content: center;
  min-height: 58px;
  padding: 0 16px;
  font-family: 'Syne', 'Manrope', sans-serif;
  font-size: 19px;
  border-radius: var(--r-md);
  background: rgba(242, 233, 221, 0.08);
}

/* ---------- 容器 ---------- */
.wrap {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(12px, 3vw, 26px) 44px;
}

div[id] { scroll-margin-top: 172px; }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-width: 0;
  min-height: 45vh;
  margin: 14px clamp(0px, 1.6vw, 12px) 28px;
  padding: clamp(18px, 4vw, 46px);
  border-radius: var(--r-xl) var(--r-md) var(--r-xl) var(--r-lg) / var(--r-lg) var(--r-xl) var(--r-md) var(--r-xl);
  background: linear-gradient(150deg, var(--plum), var(--ochre) 135%);
  box-shadow: 0 30px 60px -40px rgba(0, 0, 0, 0.95);
}

.hero-fig {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: -2;
  overflow: hidden;
}

.hero-img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  display: block;
}

.veil {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top left, rgba(20, 13, 27, 0.93) 6%, rgba(20, 13, 27, 0.44) 62%, rgba(86, 34, 139, 0.4));
}

.blob {
  position: absolute;
  top: -34px;
  right: -20px;
  width: 230px;
  height: 230px;
  max-width: 60%;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}

.hero-in {
  position: relative;
  min-width: 0;
  max-width: 100%;
  text-align: right;
  animation: rise 0.85s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 15px;
  margin-bottom: 14px;
  border: 1px solid rgba(242, 233, 221, 0.34);
  border-radius: 999px;
  background: rgba(20, 13, 27, 0.52);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: #f3eadf;
}

.hero h1 {
  margin: 0;
  font-family: 'Syne', 'Manrope', sans-serif;
  font-weight: 700;
  font-size: clamp(28px, 5.4vw, 58px);
  line-height: 1.14;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

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

/* ---------- 内容区 ---------- */
.lead {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 40px);
  align-items: start;
  min-width: 0;
}

.lead > * { min-width: 0; }

.rail {
  position: sticky;
  top: 172px;
  display: grid;
  gap: 14px;
  min-width: 0;
}

.rail-block {
  padding: 14px 14px 16px;
  border-radius: var(--r-xs);
  background: rgba(242, 233, 221, 0.055);
  min-width: 0;
}

.rail-t {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-family: 'Syne', 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.3;
  color: #dccdbb;
}

.rail-t::before {
  content: '';
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50% 50% 50% 1px;
  background: linear-gradient(140deg, var(--plum), var(--ochre));
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 3px;
  min-width: 0;
}

.rail-list a,
.top-link {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: var(--r-xs);
  color: #e6dbcd;
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: background 0.18s ease, color 0.18s ease;
}

.rail-list a:hover,
.top-link:hover,
.rail-list a:focus-visible,
.top-link:focus-visible {
  background: rgba(139, 69, 19, 0.5);
  color: #fff;
}

.top-link { min-height: 44px; }

.rail-list a { animation: rise 0.55s ease both; }
.rail-list li:nth-child(1) a { animation-delay: 0.05s; }
.rail-list li:nth-child(2) a { animation-delay: 0.1s; }
.rail-list li:nth-child(3) a { animation-delay: 0.15s; }
.rail-list li:nth-child(4) a { animation-delay: 0.2s; }
.rail-list li:nth-child(5) a { animation-delay: 0.25s; }
.rail-list li:nth-child(6) a { animation-delay: 0.3s; }
.rail-list li:nth-child(7) a { animation-delay: 0.35s; }

/* ---------- 正文 ---------- */
.prose {
  min-width: 0;
  max-width: 100%;
  font-size: 17px;
  overflow-wrap: break-word;
}

.prose > div {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  min-width: 0;
}

.prose > div:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h2 {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0.2em 0 0.62em;
  font-family: 'Syne', 'Manrope', sans-serif;
  font-size: clamp(22px, 3vw, 31px);
  line-height: 1.26;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
}

.prose h2::before {
  content: '';
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 50% 50% 50% 2px;
  background: linear-gradient(140deg, var(--plum), var(--ochre));
}

.prose h3 {
  margin: 1.4em 0 0.5em;
  font-family: 'Syne', 'Manrope', sans-serif;
  font-size: 20px;
  line-height: 1.35;
  color: #ecdfd0;
  overflow-wrap: break-word;
}

.prose p { margin: 0 0 1.05em; }
.prose strong { color: #fff; }

.prose a {
  color: #dda773;
  text-decoration: none;
  border-bottom: 1px solid rgba(221, 167, 115, 0.5);
  overflow-wrap: anywhere;
}

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

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.3em;
}

.prose li { margin: 0.36em 0; }

.prose blockquote {
  margin: 1.3em 0;
  padding: 14px 18px;
  border-left: 3px solid var(--ochre);
  border-radius: var(--r-xs) var(--r-md) var(--r-md) var(--r-xs);
  background: rgba(139, 69, 19, 0.16);
}

.prose figure {
  margin: 1.3em 0;
  max-width: 100%;
}

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

.prose figcaption {
  margin-top: 8px;
  font-size: 16px;
  color: var(--soft);
}

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: rgba(242, 233, 221, 0.07);
}

.prose code { overflow-wrap: anywhere; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 页脚 ---------- */
.foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 18px;
  max-width: 100%;
  padding: 20px clamp(12px, 4vw, 44px) 30px;
  border-top: 1px solid var(--line);
  color: var(--soft);
  font-size: 16px;
  line-height: 1.6;
}

.foot p { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.foot small { font-size: 16px; }

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 2px;
  color: #e3d8ca;
  text-decoration: none;
  border-bottom: 1px solid rgba(227, 216, 202, 0.4);
}

.foot a:hover { color: #fff; }

:focus-visible {
  outline: 2px solid #e0a870;
  outline-offset: 2px;
}

/* ---------- 窄屏 ---------- */
@media (max-width: 860px) {
  .lead { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: static;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .rail-block:last-child:not(:first-child) { align-self: start; }
  .hero { min-height: 42vh; }
  div[id] { scroll-margin-top: 196px; }
}

@media (max-width: 520px) {
  .cta { padding: 0 13px; font-size: 15px; }
  .menu a { padding: 0 11px; }
}

@media (max-width: 420px) {
  body { font-size: 17px; }
  .brand { font-size: 18px; }
  .prose h2 { gap: 9px; }
  .rail { grid-template-columns: minmax(0, 1fr); }
  .hero { margin-left: 0; margin-right: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-in,
  .rail-list a { animation: none; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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