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

:root {
  --purple: #56228b;
  --purple-deep: #3d1863;
  --brown: #8b4513;
  --ink: #1f1726;
  --moss: #4f7a52;
  --paper: #f7f3ec;
  --card: #fffdf9;
  --line: rgba(31, 23, 38, 0.15);
  --soft: rgba(86, 34, 139, 0.07);
  --muted: #5f5368;
  --r-lg: 24px;
  --r-md: 16px;
  --r-sm: 10px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(430px 330px at 6% 2%, rgba(86, 34, 139, 0.12), transparent 70%),
    radial-gradient(520px 380px at 98% 10%, rgba(139, 69, 19, 0.12), transparent 72%),
    radial-gradient(640px 440px at 46% 104%, rgba(79, 122, 82, 0.13), transparent 70%),
    repeating-linear-gradient(46deg, rgba(31, 23, 38, 0.022) 0 1px, transparent 1px 8px);
  background-attachment: fixed;
  overflow-x: hidden;
}

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

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

:focus-visible {
  outline: 3px solid rgba(86, 34, 139, 0.55);
  outline-offset: 2px;
  border-radius: 8px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 顶部 ---------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: 60;
  background: linear-gradient(180deg, rgba(255, 253, 249, 0.94), rgba(255, 253, 249, 0.74));
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--line);
  border-radius: 0 0 28px 20px;
  box-shadow: 0 16px 34px -30px rgba(31, 23, 38, 0.85);
}

.brandline,
.menuline {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: 18px;
  padding-right: 18px;
}

.brandline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  padding-top: 10px;
  padding-bottom: 6px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 16px 11px 18px 12px;
  border: 1px solid var(--line);
}

.brand .mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 17px 11px 19px 12px;
  background: linear-gradient(145deg, var(--purple), var(--moss));
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
}

.brandtxt { line-height: 1.3; }

.searchbox {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.searchbox input {
  font: inherit;
  font-size: 0.96rem;
  color: var(--ink);
  border: 0;
  background: transparent;
  width: clamp(88px, 22vw, 168px);
  min-width: 0;
  padding: 8px 0;
}

.searchbox input:focus { outline: none; }

.searchbox button {
  font: inherit;
  font-size: 0.95rem;
  min-height: 40px;
  padding: 8px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  cursor: pointer;
}

.searchbox button:hover { background: var(--purple-deep); }

.menuline { padding-bottom: 8px; }

.nav { position: relative; }

.nav summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 500;
  cursor: pointer;
}

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

.nav summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--purple);
  border-bottom: 2px solid var(--purple);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.22s ease;
}

.nav[open] summary::after { transform: rotate(-135deg) translateY(-2px); }

.navmenu {
  list-style: none;
  margin: 10px 0 4px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(255, 253, 249, 0.97);
  border: 1px solid var(--line);
  border-radius: 20px 14px 20px 14px;
  box-shadow: 0 22px 44px -32px rgba(31, 23, 38, 0.9);
}

.navmenu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.98rem;
}

.navmenu a:hover { background: var(--soft); color: var(--purple); }

/* ---------- 主视觉 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-height: 45vh;
  padding: 64px 20px 84px;
  text-align: center;
  background: linear-gradient(155deg, #ece2f5 0%, #f3eee2 54%, #e9ebe0 100%);
  border-radius: 0 0 44px 34px;
}

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

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

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(31, 23, 38, 0.5), rgba(31, 23, 38, 0.28) 48%, rgba(31, 23, 38, 0.62));
}

.hero-inner {
  position: relative;
  z-index: 3;
  max-width: 820px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.62rem, 4.6vw, 2.55rem);
  line-height: 1.26;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

.hero.has-img h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(31, 23, 38, 0.55);
}

.badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  margin: 0;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 253, 249, 0.72);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.03em;
}

.hero-wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  width: 100%;
  height: 66px;
  z-index: 2;
  will-change: transform;
}

.hero-wave path { fill: var(--paper); }

/* ---------- 版面 ---------- */
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 18px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
}

.content {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg) 34px var(--r-lg) 34px;
  padding: 26px 20px 30px;
  min-width: 0;
}

.prose {
  max-width: 68ch;
  margin: 0 auto;
  overflow-wrap: break-word;
}

.prose > div {
  scroll-margin-top: 148px;
  padding-bottom: 4px;
}

.prose > div + div {
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px dashed rgba(139, 69, 19, 0.28);
}

.prose h2 {
  position: relative;
  margin: 0 0 10px;
  padding-left: 17px;
  font-size: clamp(1.26rem, 2.6vw, 1.55rem);
  line-height: 1.32;
  font-weight: 600;
  color: var(--ink);
}

.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.32em;
  width: 9px;
  height: 1.05em;
  border-radius: 9px 3px 11px 4px;
  background: linear-gradient(180deg, var(--purple), var(--moss));
}

.subtitle,
.prose p.subtitle,
.prose p.subhead,
.prose p.lead,
.prose p.desc {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--purple-deep);
}

.prose p { margin: 0 0 15px; }

.prose ul,
.prose ol { margin: 0 0 16px; padding-left: 1.25em; }

.prose li { margin: 0.4em 0; }

.prose a {
  color: var(--purple);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose img {
  display: block;
  margin: 12px 0;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
}

.prose figure { margin: 18px 0; }

.prose figcaption {
  font-size: 0.95rem;
  color: var(--muted);
  margin-top: 8px;
}

.prose blockquote {
  margin: 20px 0;
  padding: 16px 20px;
  border-left: 5px solid var(--brown);
  border-radius: 4px 18px 18px 4px;
  background: rgba(139, 69, 19, 0.07);
}

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

.prose table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 0.98rem;
}

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

.prose th { background: rgba(86, 34, 139, 0.08); }

.prose code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.94em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(31, 23, 38, 0.07);
}

.prose hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 26px 0;
}

/* ---------- 侧栏 ---------- */
.side {
  background: rgba(255, 253, 249, 0.86);
  border: 1px solid var(--line);
  border-radius: 28px 16px 28px 16px;
  padding: 22px 18px;
}

.side h2 {
  margin: 0 0 6px;
  font-size: 1.06rem;
  line-height: 1.35;
  color: var(--purple-deep);
}

.side .subtitle {
  margin: 0 0 14px;
  font-size: 0.95rem;
  color: var(--muted);
}

.sidelist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.sidelist a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 13px 9px 13px 9px;
  text-decoration: none;
  color: var(--ink);
  background: rgba(86, 34, 139, 0.05);
  font-size: 0.96rem;
}

.sidelist a::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 60% 40% 55% 45%;
  background: var(--moss);
}

.sidelist a:hover { background: rgba(86, 34, 139, 0.13); color: var(--purple); }

/* ---------- 页脚 ---------- */
.sitefoot {
  max-width: 1120px;
  margin: 44px auto 0;
  padding: 30px 20px 26px;
  display: grid;
  gap: 22px;
  border-top: 1px solid var(--line);
}

.sitefoot address {
  font-style: normal;
  display: grid;
  gap: 8px;
  align-content: start;
}

.fbrand {
  font-weight: 600;
  font-size: 1.06rem;
  color: var(--purple);
}

.fdesc {
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--muted);
}

.footlinks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  align-content: start;
}

.footlinks a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 11px;
  border-radius: 11px;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.96rem;
}

.footlinks a:hover { background: var(--soft); color: var(--purple); }

.copy {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- 回到顶部 ---------- */
.totop {
  position: fixed;
  right: 14px;
  bottom: 16px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(86, 34, 139, 0.92);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.95rem;
  text-decoration: none;
}

.totop:hover { background: var(--purple-deep); color: #fff; }

/* ---------- 断点 ---------- */
@media (min-width: 760px) {
  .sitefoot {
    grid-template-columns: 1.15fr 1fr;
    align-items: start;
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (min-width: 900px) {
  .nav summary { display: none; }

  .navmenu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 4px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .nav:not([open]) .navmenu { display: flex; }

  .navmenu a {
    min-height: 42px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.96rem;
  }

  .wrap {
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: 34px;
    align-items: start;
  }

  .side {
    position: sticky;
    top: 122px;
  }

  .content { padding: 34px 34px 38px; }

  .hero { padding-top: 72px; padding-bottom: 96px; }
}

@media (min-width: 1140px) {
  .brandline,
  .menuline { padding-left: 0; padding-right: 0; }
}

@media (max-width: 420px) {
  body { font-size: 16.5px; }

  .hero { min-height: 48vh; padding: 56px 16px 76px; }

  .badge { top: 10px; right: 10px; padding: 8px 13px; }

  .content { padding: 22px 15px 26px; }

  .prose > div + div { margin-top: 30px; padding-top: 22px; }

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

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .prose > div {
    animation: rise 0.55s cubic-bezier(0.22, 0.7, 0.3, 1) both;
  }

  .prose > div:nth-child(2) { animation-delay: 0.06s; }
  .prose > div:nth-child(3) { animation-delay: 0.12s; }
  .prose > div:nth-child(4) { animation-delay: 0.18s; }
  .prose > div:nth-child(5) { animation-delay: 0.24s; }
  .prose > div:nth-child(6) { animation-delay: 0.3s; }
  .prose > div:nth-child(7) { animation-delay: 0.36s; }

  .sidelist li {
    animation: slide 0.45s ease both;
  }

  .sidelist li:nth-child(2) { animation-delay: 0.05s; }
  .sidelist li:nth-child(3) { animation-delay: 0.1s; }
  .sidelist li:nth-child(4) { animation-delay: 0.15s; }
  .sidelist li:nth-child(5) { animation-delay: 0.2s; }
  .sidelist li:nth-child(6) { animation-delay: 0.25s; }
  .sidelist li:nth-child(7) { animation-delay: 0.3s; }

  @keyframes rise {
    from { opacity: 0; transform: translate3d(0, 16px, 0); }
    to { opacity: 1; transform: none; }
  }

  @keyframes slide {
    from { opacity: 0; transform: translate3d(-8px, 0, 0); }
    to { opacity: 1; transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-wave { transform: none !important; }
}

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