@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

:root {
  --ink: #1c1726;
  --p: #6514ff;
  --s: #bf00ff;
  --paper: #f8f4ff;
  --line: rgba(28, 23, 38, .16);
  --mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, "PingFang SC", "Microsoft YaHei", monospace;
  --sans: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --r: 10px;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  background-image: repeating-linear-gradient(135deg, rgba(101, 20, 255, .055) 0 2px, transparent 2px 15px);
  animation: drift 30s linear infinite;
}

@keyframes drift { to { background-position: 240px 240px; } }

img { max-width: 100%; height: auto; }
a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--s); outline-offset: 2px; }

/* ---------- 顶栏 ---------- */
.top {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px clamp(16px, 4vw, 48px);
  background: #fff;
  border-bottom: 3px solid var(--ink);
}

.top-nav p { margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.top-nav--l p { justify-content: flex-start; }
.top-nav--r p { justify-content: flex-end; }

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 13px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 999px;
  transition: background .24s, color .24s;
}
.top-nav a:hover { background: var(--p); color: #fff; }

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 16px;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(17px, 2.2vw, 21px);
  letter-spacing: .05em;
  color: #fff;
  text-decoration: none;
  border-radius: var(--r);
  background: linear-gradient(95deg, var(--p), var(--s));
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  transition: background .2s, transform .2s;
}
.cta:hover { background: var(--s); transform: translateY(-2px); }

/* ---------- 粘性标签条 ---------- */
.chips {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 8px clamp(12px, 4vw, 48px);
  background: rgba(255, 255, 255, .95);
  border-bottom: 2px solid var(--ink);
  overflow-x: auto;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chips-nav p { margin: 0; display: flex; gap: 8px; white-space: nowrap; }

.chips-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 15px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border: 2px solid var(--ink);
  border-radius: 999px;
  transition: background .22s, color .22s, border-color .22s;
}
.chips-nav a:hover, .chips-nav a.on { background: var(--p); border-color: var(--p); color: #fff; }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: clamp(40px, 8vw, 80px) 20px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(165deg, #fff 0%, #f3ecff 58%, #ece0ff 100%);
}

.hero::before {
  content: "";
  position: absolute;
  left: -10%;
  right: -10%;
  bottom: -22%;
  height: 54%;
  z-index: -2;
  background: linear-gradient(100deg, var(--p), var(--s));
  transform: skewY(-5deg);
  opacity: .93;
}

.hero::after {
  content: "";
  position: absolute;
  top: -90px;
  left: -70px;
  width: 300px;
  height: 300px;
  z-index: -2;
  border-radius: 50%;
  background: radial-gradient(circle, var(--s), transparent 68%);
  opacity: .5;
}

.hero-art { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.ha {
  position: absolute;
  display: block;
  overflow: hidden;
  border: 4px solid #fff;
  border-radius: var(--r);
  box-shadow: 0 22px 54px rgba(28, 23, 38, .3);
}
.ha--a { top: 14%; left: 3%; width: min(28vw, 290px); transform: rotate(-6deg); }
.ha--b { right: 4%; bottom: 12%; width: min(24vw, 250px); transform: rotate(5deg); }
.ha-img { display: block; width: 100%; filter: grayscale(.18) contrast(1.06); }

.hero-copy { position: relative; max-width: 880px; text-align: center; }

.hero h1 {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(30px, 6vw, 62px);
  line-height: 1.16;
  letter-spacing: .01em;
  text-shadow: 3px 3px 0 rgba(255, 255, 255, .92);
}

.hero-btns {
  margin: 26px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.hero-btns a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 10px 24px;
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  transition: transform .2s, background .2s, color .2s;
}
.hero-btns a:first-child { background: var(--ink); color: #fff; }
.hero-btns a:last-child { background: #fff; color: var(--ink); border: 2px solid var(--ink); }
.hero-btns a:hover { transform: translateY(-3px); }
.hero-btns a:first-child:hover { background: var(--s); }
.hero-btns a:last-child:hover { background: var(--p); border-color: var(--p); color: #fff; }

/* ---------- 主区 ---------- */
.main { padding: clamp(32px, 6vw, 72px) clamp(16px, 4vw, 48px); }

.grid {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: clamp(28px, 4.5vw, 56px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
}

.side {
  position: sticky;
  top: 76px;
  padding: 18px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: var(--r);
  box-shadow: 8px 8px 0 rgba(101, 20, 255, .2);
}

.side-h { margin: 0; font-family: var(--mono); font-size: 21px; line-height: 1.3; }

.subtitle {
  margin: 2px 0 14px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--p);
  letter-spacing: .04em;
}

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

.side-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 10px;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border-radius: 8px;
  transition: background .2s, color .2s;
}
.side-list a:hover { background: var(--p); color: #fff; }

/* ---------- 正文 ---------- */
.prose { min-width: 0; }

.prose > article {
  padding: clamp(18px, 3vw, 34px);
  background: #fff;
  border-radius: var(--r);
  border-left: 6px solid var(--p);
  box-shadow: 0 16px 40px rgba(28, 23, 38, .1);
}
.prose > article:nth-of-type(even) { border-left-color: var(--s); }
.prose > article + article { margin-top: clamp(32px, 5vw, 56px); }
.prose article[id] { scroll-margin-top: 96px; }

.prose h2 {
  margin: 0 0 8px;
  padding-bottom: 10px;
  font-family: var(--mono);
  font-size: clamp(23px, 3.2vw, 32px);
  line-height: 1.28;
  border-bottom: 3px solid var(--line);
}

.prose h3 { margin: 28px 0 8px; font-size: 20px; line-height: 1.4; }

.prose p { margin: 0 0 16px; }
.prose p.subtitle, .prose .subtitle { margin: -2px 0 18px; }

.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.35em; }
.prose li { margin-bottom: 9px; }

.prose a {
  color: var(--p);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--s); }

.prose img { display: block; margin: 20px 0; border-radius: var(--r); }

.prose blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  background: #f6f0ff;
  border-left: 5px solid var(--s);
  border-radius: 0 var(--r) var(--r) 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }

.prose table { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: 16px; }
.prose th, .prose td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.prose th { background: #f3ecff; font-family: var(--mono); }

.prose code {
  padding: 2px 6px;
  font-family: var(--mono);
  font-size: 15px;
  background: #f3ecff;
  border-radius: 6px;
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: clamp(36px, 6vw, 72px);
  padding: clamp(26px, 4vw, 44px) clamp(16px, 4vw, 48px);
  background: var(--ink);
  color: #fff;
}

.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 22px 40px;
  max-width: 1180px;
  margin: 0 auto;
}

.foot-nav p { margin: 0; display: flex; flex-wrap: wrap; gap: 3px; }

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 11px;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  transition: background .2s;
}
.foot-nav a:hover { background: var(--s); }

.foot-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.foot-form label { font-size: 16px; }

.foot-form input {
  width: 150px;
  min-height: 40px;
  padding: 8px 14px;
  font: inherit;
  font-size: 16px;
  color: #fff;
  background: transparent;
  border: 2px solid #fff;
  border-radius: 999px;
}
.foot-form input::placeholder { color: rgba(255, 255, 255, .65); }

.foot-form button {
  min-height: 40px;
  padding: 8px 20px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--p);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}
.foot-form button:hover { background: var(--s); }

.foot-bot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  max-width: 1180px;
  margin: 26px auto 0;
  padding-top: 16px;
  font-size: 16px;
  border-top: 1px solid rgba(255, 255, 255, .25);
}

.foot-links { margin: 0; display: flex; gap: 16px; }
.foot-links a { color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .side { position: static; }
  .hero { min-height: 64vh; padding-top: clamp(70px, 20vw, 130px); }
  .ha--a { width: 120px; top: 5%; left: 2%; }
  .ha--b { width: 102px; right: 2%; bottom: 7%; }
  .hero-copy { max-width: 100%; }
}

@media (max-width: 760px) {
  .top { grid-template-columns: 1fr auto; padding: 12px 16px; }
  .top-nav { display: none; }
  .brand { justify-self: start; }
  .cta { justify-self: end; }
  .foot-row { flex-direction: column; align-items: flex-start; }
  .foot-form { width: 100%; }
  .foot-form input { flex: 1 1 120px; width: auto; }
  .foot-bot { flex-direction: column; }
  .prose > article { padding: 18px; }
}

@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}
