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

:root {
  --purple: #56228b;
  --brown: #8b4513;
  --ink: #1f1726;
  --paper: #f3ebe0;
  --paper-2: #faf5ee;
  --card: #fffdfa;
  --mist: #e7dbcb;
  --line: #dccdb9;
  --wrap: 1120px;
  --serif-ish: 'Lexend', 'Source Sans 3', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --body-ish: 'Source Sans 3', 'Lexend', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--body-ish);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(139, 69, 19, 0.07) 0, transparent 26%),
    radial-gradient(circle at 88% 6%, rgba(86, 34, 139, 0.08) 0, transparent 24%),
    radial-gradient(rgba(31, 23, 38, 0.05) 1px, transparent 1px);
  background-size: auto, auto, 6px 6px;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--purple); }

h1, h2, h3, h4 {
  font-family: var(--serif-ish);
  font-weight: 600;
  line-height: 1.24;
}

small {
  display: block;
  font-family: var(--serif-ish);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--brown);
  margin: 0 0 8px;
}

.jump {
  position: fixed;
  left: 16px;
  top: -72px;
  z-index: 90;
  padding: 12px 20px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--purple);
  color: #fdf8f1;
  text-decoration: none;
  border-radius: 0 0 16px 16px;
  transition: top 0.25s ease;
}

.jump:focus { top: 0; }

/* 页头 */
.site-head {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}

.head-top {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 26px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  padding: 4px 0;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif-ish);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.brand-name { font-size: 18px; }

.logo, .brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 16px 22px 14px 24px;
  background: var(--purple);
  color: #fdf8f1;
  display: grid;
  place-items: center;
  font-family: var(--serif-ish);
  font-size: 19px;
  object-fit: cover;
}

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

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 15px 20px 14px 22px;
  text-decoration: none;
  color: var(--brown);
  font-size: 16px;
  font-weight: 500;
  transition: background 0.25s ease, color 0.25s ease;
}

.main-nav a:hover { background: var(--mist); color: var(--purple); }

.chip-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 5px 18px;
  background: rgba(31, 23, 38, 0.97);
  scrollbar-width: thin;
}

.chip-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 14px;
  white-space: nowrap;
  text-decoration: none;
  color: #ede0cf;
  font-size: 15px;
  border-radius: 14px 18px 12px 20px;
  transition: background 0.25s ease, color 0.25s ease;
}

.chip-nav a:hover { background: rgba(86, 34, 139, 0.55); color: #fff; }

/* 首屏 */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(155deg, #241a2e 0%, #1f1726 52%, #2b1a18 100%);
  color: #f6ecdf;
}

.hero::before,
.hero::after {
  content: '';
  position: absolute;
  pointer-events: none;
  border-radius: 46% 54% 62% 38%;
  filter: blur(2px);
}

.hero::before {
  width: 440px;
  height: 440px;
  right: -130px;
  top: -170px;
  background: radial-gradient(circle at 42% 42%, rgba(86, 34, 139, 0.6), transparent 68%);
}

.hero::after {
  width: 360px;
  height: 360px;
  left: -140px;
  bottom: -160px;
  background: radial-gradient(circle at 55% 45%, rgba(139, 69, 19, 0.55), transparent 70%);
}

.hero-frame {
  position: relative;
  z-index: 2;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 56px 22px 64px;
  min-height: calc(100vh - 118px);
  display: grid;
  grid-template-columns: 1.06fr 1fr;
  align-items: center;
  gap: 44px;
}

.hero-figure { position: relative; }

.hero-img {
  width: 100%;
  height: clamp(300px, 52vh, 540px);
  object-fit: cover;
  border-radius: 30px 96px 30px 112px;
  box-shadow: 0 34px 60px -34px rgba(0, 0, 0, 0.8);
}

.hero-figure.is-empty {
  min-height: 280px;
  border-radius: 30px 96px 30px 112px;
  background: linear-gradient(140deg, rgba(86, 34, 139, 0.55), rgba(139, 69, 19, 0.5));
}

.badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 8px 18px;
  background: var(--paper-2);
  color: var(--purple);
  font-family: var(--serif-ish);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 20px 26px 18px 24px;
  box-shadow: 0 12px 26px -18px rgba(0, 0, 0, 0.9);
}

.hero-copy { text-align: right; }

.hero-copy h1 {
  margin: 0 0 20px;
  font-size: clamp(2.1rem, 5.4vw, 4.3rem);
  line-height: 1.06;
  letter-spacing: -0.012em;
  color: #fdf7ef;
}

.lede {
  max-width: 44ch;
  margin: 0 0 4px auto;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.8;
  color: #e0d2c1;
}

.btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: 26px;
  padding: 12px 28px;
  background: var(--purple);
  color: #fdf8f1;
  font-family: var(--serif-ish);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 26px 32px 22px 30px;
  transition: transform 0.28s ease, background 0.28s ease;
}

.btn:hover { background: var(--brown); transform: translateY(-2px); }

/* 正文区骨架 */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 48px 22px 68px;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  align-items: start;
  gap: 34px;
}

.side {
  position: sticky;
  top: 72px;
  padding: 22px 18px 18px;
  background: var(--paper-2);
  border-bottom: 3px solid var(--brown);
  border-radius: 28px;
  box-shadow: 0 26px 46px -38px rgba(31, 23, 38, 0.85);
}

.side h2 {
  margin: 0 0 12px;
  font-size: 1.15rem;
  color: var(--ink);
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 13px 18px 12px 20px;
  color: var(--brown);
  font-size: 16px;
  text-decoration: none;
  transition: background 0.24s ease, color 0.24s ease;
}

.toc a:hover { background: var(--mist); color: var(--purple); }

.paper { min-width: 0; }

.content { padding: 0; }

.content div {
  background: var(--card);
  border-bottom: 3px solid var(--purple);
  border-radius: 28px;
  padding: 28px 30px;
  margin: 0 0 26px;
  box-shadow: 0 30px 52px -44px rgba(31, 23, 38, 0.9);
}

.content div:nth-of-type(even) { border-bottom-color: var(--brown); }

.content div:last-of-type { margin-bottom: 0; }

.content div[id] { scroll-margin-top: 84px; }

.content h2 {
  margin: 0 0 16px;
  font-size: clamp(1.4rem, 2.5vw, 1.95rem);
  color: var(--purple);
}

.content h3 {
  margin: 26px 0 12px;
  font-size: 1.18rem;
  color: var(--brown);
}

.content p { margin: 0 0 16px; }

.content p:last-child { margin-bottom: 0; }

.content ul,
.content ol { margin: 0 0 18px; padding-left: 22px; }

.content li { margin-bottom: 8px; }

.content a { color: var(--purple); text-underline-offset: 3px; }

.content blockquote {
  margin: 18px 0;
  padding: 14px 20px;
  background: var(--paper);
  border-left: 4px solid var(--brown);
  border-radius: 8px 20px 20px 8px;
  color: #3a2c3f;
}

.content img { border-radius: 20px; margin: 18px 0; }

.content table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 16px;
}

.content th,
.content td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.content th { background: var(--paper); font-family: var(--serif-ish); }

/* 页脚 */
.site-foot {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #efdfcd;
  padding: 56px 22px 22px;
}

.site-foot::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  right: -150px;
  bottom: -220px;
  border-radius: 52% 48% 38% 62%;
  background: radial-gradient(circle at 45% 45%, rgba(86, 34, 139, 0.5), transparent 70%);
  pointer-events: none;
}

.site-foot > div {
  position: relative;
  max-width: var(--wrap);
  margin: 0 auto;
}

.site-foot small { color: #bda184; }

.site-foot h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  color: #f7ede1;
}

.foot-nav nav { margin-top: 14px; }

.foot-nav dl {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 26px;
  margin: 0;
}

.foot-nav dt {
  font-family: var(--serif-ish);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #a98f74;
}

.foot-nav dd { margin: 0; }

.foot-nav dd a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 2px;
  color: #f4e9da;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.24s ease, border-color 0.24s ease;
}

.foot-nav dd a:hover { color: #d3b0f5; border-bottom-color: var(--brown); }

.giant {
  font-size: clamp(2rem, 9.2vw, 6rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 30px 0 26px !important;
  color: #f8efe3;
  word-break: break-word;
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  border-top: 1px solid rgba(248, 239, 227, 0.18);
  padding: 14px 0 4px;
}

.copy { margin: 0; font-size: 15px; color: #c6b2a0; }

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 18px 24px 16px 22px;
  color: #f8efe3;
  text-decoration: none;
  background: rgba(86, 34, 139, 0.45);
  transition: background 0.24s ease;
}

.totop:hover { background: var(--purple); }

/* 滚动出现 */
.rv {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* 断点 */
@media (max-width: 820px) {
  .wrap { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 28px 16px 44px; }
  .side { position: static; top: auto; padding: 18px 16px 14px; }
  .toc { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .toc a { padding: 6px 12px; background: var(--mist); }
  .content div { padding: 22px 18px; border-radius: 22px; margin-bottom: 20px; }
  .foot-nav dl { gap: 2px 18px; }
  .giant { margin: 22px 0 18px !important; }
}

@media (max-width: 760px) {
  .head-top { padding: 10px 16px; gap: 8px; }
  .brand { min-height: 42px; }
  .brand-name { font-size: 16px; }
  .main-nav {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 -16px;
    padding: 0 16px;
  }
  .main-nav a { padding: 10px 12px; font-size: 15px; }
  .chip-nav { padding: 4px 12px; }

  .hero-frame {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 22px 16px 28px;
    min-height: 0;
  }
  .hero-img { height: 178px; border-radius: 22px 62px 22px 72px; }
  .hero-figure.is-empty { min-height: 178px; border-radius: 22px 62px 22px 72px; }
  .badge { left: 10px; bottom: 10px; font-size: 13px; padding: 6px 14px; }
  .hero-copy { text-align: left; }
  .hero-copy h1 { font-size: clamp(1.75rem, 8.2vw, 2.4rem); margin-bottom: 14px; }
  .lede { margin-left: 0; font-size: 16px; line-height: 1.7; }
  .btn { margin-top: 18px; }
  .giant { font-size: clamp(1.7rem, 10vw, 2.6rem); }
  .site-foot { padding: 40px 16px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

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