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

:root {
  --plum: #56228b;
  --clay: #8b4513;
  --ink: #1f1726;
  --lilac: #e9def5;
  --sand: #f4ece2;
  --shell: #fdf8f2;
  --moss: #6f7d4a;
  --soft: 0 14px 32px -22px rgba(31, 23, 38, 0.75);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: 'Baloo 2', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink);
  background:
    radial-gradient(120% 55% at 6% -8%, #efe2f8 0%, rgba(239, 226, 248, 0) 62%),
    radial-gradient(85% 50% at 102% 2%, #f8e7d5 0%, rgba(248, 231, 213, 0) 58%),
    var(--sand);
  background-attachment: fixed;
}

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

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

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 60;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}
.skip:focus { top: 10px; }

/* ---------- 头部：品牌行 + 菜单行 ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 10px clamp(14px, 3vw, 36px) 12px;
  background: rgba(253, 248, 242, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(86, 34, 139, 0.14);
}

.top-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1120px;
  margin: 0 auto;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}

.mark-img {
  width: 40px;
  height: 40px;
  border-radius: 58% 42% 50% 50% / 46% 56% 44% 54%;
}

.mark-blob {
  width: 32px;
  height: 28px;
  background: linear-gradient(135deg, var(--plum), var(--clay));
  border-radius: 62% 38% 52% 48% / 50% 62% 38% 50%;
}

.brand {
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--plum);
}

.top-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1120px;
  margin: 8px auto 0;
}

nav.menu { flex: 1 1 auto; min-width: 0; }

nav.menu ol {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 2px 3px;
  overflow-x: auto;
  scrollbar-width: none;
}

nav.menu ol::-webkit-scrollbar { display: none; }

nav.menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--lilac);
  color: var(--plum);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease, transform 0.22s ease;
}

nav.menu a:hover,
nav.menu a:focus-visible {
  background: var(--plum);
  color: #fff;
  transform: translateY(-2px);
}

.search {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--soft);
}

.search input {
  width: min(34vw, 190px);
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  outline: none;
}

.search input:focus-visible { outline: 2px solid var(--plum); border-radius: 999px; }

.search button {
  min-height: 40px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.search button:hover { background: var(--plum); }

/* ---------- 骨架 ---------- */

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 28px);
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 45vh;
  padding: 26px 0 40px;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  background: linear-gradient(90deg, var(--plum), var(--clay) 65%, var(--moss));
  clip-path: polygon(0 100%, 0 42%, 100% 0, 100% 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: clamp(16px, 3vw, 40px);
  align-items: center;
  width: 100%;
  margin: 0;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5.2vw, 3.5rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  color: var(--plum);
}

.hero-desc {
  margin: 0 0 20px;
  max-width: 36ch;
  font-size: 1.05rem;
  color: #4b3a55;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-cta:hover { background: var(--clay); transform: translateY(-2px); }

.hero-fig { position: relative; }

.hero-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 52% 48% 44% 56% / 46% 42% 58% 54%;
  box-shadow: 0 22px 44px -22px rgba(31, 23, 38, 0.85);
}

.fig-blob {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: radial-gradient(circle at 32% 30%, #f0e2fa 0%, #d9c2ee 46%, #b98fd8 100%);
  border-radius: 56% 44% 40% 60% / 44% 40% 60% 56%;
}

/* ---------- 侧栏 + 正文 ---------- */

.layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: clamp(16px, 2.6vw, 34px);
  align-items: start;
  margin: 30px 0 60px;
}

.rail {
  position: sticky;
  top: 158px;
  padding: 18px 16px 16px;
  background: #fff;
  border-radius: 26px 26px 22px 22px;
  box-shadow: var(--soft);
}

.rail small {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.18em;
  color: var(--clay);
}

.rail h2 {
  margin: 2px 0 12px;
  font-size: 1.16rem;
  color: var(--plum);
}

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  background: #f6eefb;
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.rail-list a:hover { background: var(--plum); color: #fff; }

.to-top {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 1rem;
  text-decoration: none;
}

.prose { min-width: 0; }

.prose div {
  margin-bottom: 20px;
  padding: clamp(18px, 3vw, 34px);
  background: var(--shell);
  border-radius: 4px;
  box-shadow: var(--soft);
  scroll-margin-top: 152px;
}

.prose div:nth-of-type(even) { background: #fff; }

.prose small {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.16em;
  color: var(--clay);
}

.prose h2 {
  margin: 0.1em 0 0.7em;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  line-height: 1.32;
  color: var(--plum);
}

.prose h3 {
  margin: 1.2em 0 0.5em;
  font-size: clamp(1.15rem, 2.2vw, 1.32rem);
  line-height: 1.4;
  color: var(--clay);
}

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

.prose ul,
.prose ol { padding-left: 1.35em; }

.prose li { margin: 0.35em 0; }

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

.prose img { border-radius: 18px; }

.prose blockquote {
  margin: 1em 0;
  padding: 0.7em 1.1em;
  background: #f2f6e9;
  border-left: 6px solid var(--moss);
  border-radius: 4px;
  color: #3c4331;
}

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

.prose code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.95em;
  padding: 0.1em 0.36em;
  border-radius: 6px;
  background: #eee4f7;
}

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

.prose th,
.prose td {
  padding: 0.55em 0.75em;
  border-bottom: 1px solid #e7dbf0;
  text-align: left;
}

.prose th { color: var(--plum); }

.prose .hit {
  outline: 3px solid var(--clay);
  outline-offset: 4px;
}

/* ---------- 页脚 ---------- */

footer {
  margin-top: 46px;
  padding: 44px clamp(14px, 3vw, 36px) 18px;
  background: var(--ink);
  color: #f2ebf7;
  border-radius: clamp(30px, 7vw, 70px) clamp(30px, 7vw, 70px) 0 0;
}

.foot {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.2fr;
  gap: 26px;
  max-width: 1120px;
  margin: 0 auto;
}

.bigb {
  margin: 0;
  font-size: clamp(1.9rem, 5.6vw, 3.4rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #c9a6e8;
}

.foot ul {
  list-style: none;
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
}

.foot li a {
  display: flex;
  align-items: center;
  min-height: 42px;
  color: #e3d5f0;
  font-size: 1rem;
  text-decoration: none;
}

.foot li a:hover { color: #fff; text-decoration: underline; }

address {
  display: grid;
  gap: 4px;
  font-style: normal;
}

address .lab { color: #b79ad0; font-size: 1rem; }

address .who {
  display: flex;
  align-items: center;
  min-height: 42px;
  color: #f2ebf7;
  font-size: 1rem;
}

.foot-bar {
  max-width: 1120px;
  margin: 26px auto 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: #bda8cc;
}

.foot-bar p { margin: 0; font-size: 1rem; }

/* ---------- 显现 ---------- */

.rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

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

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
  .hero { min-height: 0; padding: 20px 0 34px; }
  .hero-img,
  .fig-blob { aspect-ratio: 16 / 10; max-height: 40vh; }
  .hero-desc { max-width: none; }

  .layout { grid-template-columns: 1fr; margin: 22px 0 46px; }
  .rail { position: static; border-radius: 22px; }
  .rail-list { grid-template-columns: 1fr 1fr; }
  .prose div { scroll-margin-top: 138px; }

  .foot { grid-template-columns: 1fr 1fr; gap: 18px; }
  .foot-col:first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .top-menu { flex-wrap: wrap; gap: 8px; }
  nav.menu { flex: 1 1 100%; order: 1; }
  .search { flex: 1 1 100%; order: 2; }
  .search input { width: 100%; flex: 1 1 auto; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .rail-list { grid-template-columns: 1fr; }
  .foot { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
  nav.menu a,
  .hero-cta,
  .search button,
  .rail-list a { transition: none; }
}

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