@import url('https://fonts.googleapis.com/css2?family=Calistoga:ital@0;1&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --ink: #1f1726;
  --ink-2: #2a1f34;
  --plum: #56228b;
  --clay: #8b4513;
  --clay-l: #c4793c;
  --paper: #f5edf3;
  --paper-dim: #c9b8ce;
  --line: rgba(201, 184, 206, .2);
  --headh: 116px;
  --r-big: 28px;
  --r-mid: 18px;
  --r-pill: 999px;
  --font-title: 'Calistoga', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--paper);
  overflow-wrap: break-word;
  background:
    radial-gradient(92% 62% at 88% -8%, rgba(86, 34, 139, .5), rgba(86, 34, 139, 0) 62%),
    radial-gradient(72% 52% at -10% 18%, rgba(139, 69, 19, .32), rgba(139, 69, 19, 0) 60%),
    var(--ink);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--clay-l); }

:focus-visible {
  outline: 2px solid var(--clay-l);
  outline-offset: 3px;
  border-radius: 6px;
}

hr {
  border: 0;
  height: 1px;
  margin: .8rem 0;
  background: linear-gradient(90deg, var(--clay), rgba(139, 69, 19, 0));
}

/* ---------- 头部：两行，品牌独占一行，汉堡全屏遮罩 ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(31, 23, 38, .88);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--line);
}

.brandrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .5rem clamp(1rem, 4vw, 2.4rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-title);
  font-size: 1.02rem;
  letter-spacing: .01em;
}

.mark { display: inline-flex; flex: none; }
.mark svg { display: block; }

.brand-name { display: inline-block; }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-height: 44px;
  padding: .35rem 1.05rem;
  border-radius: var(--r-pill);
  background: linear-gradient(120deg, var(--clay), var(--plum));
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 12px 26px -16px rgba(86, 34, 139, .95);
  transition: transform .28s ease, box-shadow .28s ease;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 30px -16px rgba(196, 121, 60, .8);
}

.menu-line {
  display: flex;
  justify-content: flex-end;
  padding: 0 clamp(1rem, 4vw, 2.4rem) .45rem;
}

.menu-wrap { position: relative; }

.menu-wrap summary {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .3rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  color: var(--paper);
  font-size: 1rem;
  list-style: none;
  cursor: pointer;
  transition: border-color .28s ease, background .28s ease;
}

.menu-wrap summary::-webkit-details-marker { display: none; }

.menu-wrap summary:hover {
  border-color: var(--clay-l);
  background: rgba(139, 69, 19, .16);
}

.burger {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: background .25s ease;
}

.burger::before,
.burger::after {
  content: '';
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .25s ease, top .25s ease;
}

.burger::before { top: -6px; }
.burger::after { top: 6px; }

.menu-wrap[open] .burger { background: transparent; }
.menu-wrap[open] .burger::before { top: 0; transform: rotate(45deg); }
.menu-wrap[open] .burger::after { top: 0; transform: rotate(-45deg); }

.menu-wrap[open] summary {
  position: fixed;
  top: calc(var(--headh) - 52px);
  right: clamp(1rem, 4vw, 2.4rem);
  z-index: 70;
  background: rgba(31, 23, 38, .92);
  border-color: var(--clay-l);
}

.menu-wrap menu {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: navi;
}

.menu-wrap:not([open]) menu { display: none; }

.menu-wrap[open] menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: .1rem;
  padding: calc(var(--headh) + 14px) clamp(1.1rem, 5vw, 2.4rem) 2rem;
  overflow-y: auto;
  background:
    radial-gradient(78% 58% at 88% 0%, rgba(86, 34, 139, .62), rgba(86, 34, 139, 0) 62%),
    radial-gradient(60% 46% at 4% 100%, rgba(139, 69, 19, .38), rgba(139, 69, 19, 0) 60%),
    var(--ink);
  animation: veil .28s ease both;
}

.menu-wrap[open] menu li { counter-increment: navi; animation: slide .4s ease backwards; }
.menu-wrap[open] menu li:nth-child(1) { animation-delay: .02s; }
.menu-wrap[open] menu li:nth-child(2) { animation-delay: .06s; }
.menu-wrap[open] menu li:nth-child(3) { animation-delay: .1s; }
.menu-wrap[open] menu li:nth-child(4) { animation-delay: .14s; }
.menu-wrap[open] menu li:nth-child(5) { animation-delay: .18s; }
.menu-wrap[open] menu li:nth-child(6) { animation-delay: .22s; }
.menu-wrap[open] menu li:nth-child(7) { animation-delay: .26s; }

.menu-wrap[open] menu li a {
  display: flex;
  align-items: center;
  gap: .8rem;
  min-height: 52px;
  padding: .3rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--paper);
  text-decoration: none;
  font-family: var(--font-title);
  font-size: clamp(1.15rem, 4.2vw, 1.6rem);
  transition: color .25s ease, padding-left .25s ease;
}

.menu-wrap[open] menu li a::before {
  content: counter(navi, decimal-leading-zero);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .8rem;
  letter-spacing: .12em;
  color: var(--clay-l);
}

.menu-wrap[open] menu li a:hover {
  color: var(--clay-l);
  padding-left: .45rem;
}

/* ---------- 英雄区：满屏、右对齐、斜切大图 ---------- */

.hero {
  position: relative;
  margin: 0;
  height: calc(100svh - var(--headh));
  min-height: 440px;
  max-height: 880px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 0 0 52px 52px;
  background: linear-gradient(205deg, #3d2559, #1f1726 72%);
  isolation: isolate;
}

.hero-media {
  position: absolute;
  inset: 0;
  display: block;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 92px));
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(202deg, rgba(31, 23, 38, .04) 18%, rgba(31, 23, 38, .9) 76%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  margin-left: auto;
  max-width: min(760px, 94%);
  padding: 0 clamp(1.1rem, 5vw, 3.4rem) clamp(2.2rem, 7vw, 4.2rem);
  text-align: right;
}

.hero h1 {
  margin: 0 0 .6rem;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: clamp(2rem, 6.6vw, 4.3rem);
  line-height: 1.14;
  letter-spacing: .01em;
  color: #fff;
  text-shadow: 0 3px 34px rgba(0, 0, 0, .55);
}

.hero-lede {
  margin: 0 0 0 auto;
  max-width: 42ch;
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.7;
  color: var(--paper-dim);
}

/* ---------- 主体：左侧栏 + 正文 ---------- */

.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.4rem);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1.6rem, 4vw, 3rem) clamp(1rem, 4vw, 2.4rem) 2.4rem;
}

.side {
  position: sticky;
  top: calc(var(--headh) + 12px);
  padding: 1.1rem 1.1rem 1.3rem;
  border-radius: 26px 22px 30px 24px;
  background: linear-gradient(168deg, rgba(139, 69, 19, .22), rgba(42, 31, 52, .78) 62%);
  box-shadow: 0 20px 40px -32px rgba(0, 0, 0, .95);
}

.side-title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 400;
  font-size: 1.05rem;
  line-height: 1.4;
  color: var(--paper);
}

.side-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: sidei;
}

.side-list li { counter-increment: sidei; }

.side-list li + li { border-top: 1px solid var(--line); }

.side-list a {
  position: relative;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 42px;
  padding: .25rem 0 .25rem 1.35rem;
  color: var(--paper-dim);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1.45;
  transition: color .25s ease, padding-left .25s ease;
}

.side-list a::before {
  content: '';
  position: absolute;
  left: 0;
  width: 9px;
  height: 9px;
  border-radius: 60% 40% 55% 45%;
  background: var(--clay);
  transition: background .25s ease, border-radius .25s ease;
}

.side-list a:hover {
  color: var(--paper);
  padding-left: 1.55rem;
}

.side-list a:hover::before {
  background: var(--clay-l);
  border-radius: 45% 55% 40% 60%;
}

.piece {
  display: grid;
  gap: 1.15rem;
  align-content: start;
  min-width: 0;
}

.piece > section {
  padding: clamp(1.15rem, 3vw, 2rem);
  border-radius: var(--r-big);
  background: linear-gradient(158deg, rgba(86, 34, 139, .34), rgba(31, 23, 38, .62) 78%);
  box-shadow: 0 26px 50px -36px rgba(0, 0, 0, .95);
  scroll-margin-top: calc(var(--headh) + 16px);
  animation: rise .55s ease backwards;
  transition: background .35s ease, transform .35s ease;
}

.piece > section:nth-child(3n) { border-radius: 40px 24px 34px 30px; }
.piece > section:nth-child(3n + 2) { border-radius: 26px 38px 24px 42px; }

.piece > section:nth-child(1) { animation-delay: .04s; }
.piece > section:nth-child(2) { animation-delay: .09s; }
.piece > section:nth-child(3) { animation-delay: .14s; }
.piece > section:nth-child(4) { animation-delay: .19s; }
.piece > section:nth-child(5) { animation-delay: .24s; }
.piece > section:nth-child(6) { animation-delay: .29s; }
.piece > section:nth-child(7) { animation-delay: .34s; }

.piece > section:hover {
  background: linear-gradient(158deg, rgba(97, 43, 152, .42), rgba(31, 23, 38, .6) 78%);
  transform: translateY(-2px);
}

.piece > section > :last-child { margin-bottom: 0; }

.piece :is(h2, h3, h4) {
  font-family: var(--font-title);
  font-weight: 400;
  line-height: 1.35;
  margin: .15em 0 .55em;
}

.piece h2 { font-size: clamp(1.4rem, 2.8vw, 1.9rem); }
.piece h3 { font-size: clamp(1.2rem, 2.2vw, 1.45rem); }
.piece h4 { font-size: 1.1rem; }

.piece p { margin: 0 0 1em; }

.piece :is(ul, ol) { margin: 0 0 1em; padding-left: 1.3em; }
.piece li { margin: .25em 0; }

.piece :is(img, video) {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-mid);
}

.piece :is(table, pre) {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 1em;
}

.piece table { border-collapse: collapse; font-size: .98rem; }
.piece :is(th, td) {
  padding: .5em .7em;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.piece blockquote {
  margin: 0 0 1em;
  padding: .75em 1em;
  border-left: 3px solid var(--clay);
  border-radius: 0 var(--r-mid) var(--r-mid) 0;
  background: rgba(139, 69, 19, .14);
}

.piece code, .piece pre {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: .95rem;
}

.piece a { text-underline-offset: 3px; }

/* ---------- 页脚：单行极简 ---------- */

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.3rem clamp(1rem, 4vw, 2.4rem) 2.6rem;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  color: var(--paper-dim);
}

.foot p, .foot small { margin: 0; }

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--clay-l);
  text-decoration: none;
}

.foot a:hover { text-decoration: underline; }

/* ---------- 动效 ---------- */

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

@keyframes slide {
  from { opacity: 0; transform: translateY(14px); }
}

@keyframes veil {
  from { opacity: 0; }
}

/* ---------- 断点 ---------- */

@media (max-width: 920px) {
  :root { --headh: 112px; }

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

  .side {
    position: static;
    border-radius: 24px;
  }

  .side-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 .8rem;
  }

  .side-list li + li { border-top: 0; }
  .side-list li:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .side-list li:nth-child(2n) { border-top: 0; }

  .hero { border-radius: 0 0 36px 36px; }
  .hero-img { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 56px)); }
}

@media (max-width: 560px) {
  body { font-size: 16px; }

  .brand { font-size: .95rem; gap: .4rem; }
  .mark svg { width: 22px; height: 22px; }

  .cta { padding: .3rem .8rem; font-size: .95rem; }

  .hero { max-height: none; }

  .hero-copy { padding-bottom: 2.2rem; }

  .hero-lede { max-width: 100%; }

  .side-list { grid-template-columns: minmax(0, 1fr); }
  .side-list li:nth-child(2n) { border-top: 1px solid var(--line); }
  .side-list li:first-child { border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

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