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

:root {
  --ink: #1f1726;
  --violet: #56228b;
  --umber: #8b4513;
  --paper: #f4edf7;
  --muted: #c3b3d0;
  --line: rgba(244, 237, 247, 0.16);
  --glass: rgba(255, 255, 255, 0.055);
  --mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    radial-gradient(900px 520px at 84% -10%, rgba(86, 34, 139, 0.55), transparent 62%),
    radial-gradient(720px 460px at 4% 14%, rgba(139, 69, 19, 0.32), transparent 60%),
    radial-gradient(900px 700px at 48% 106%, rgba(86, 34, 139, 0.26), transparent 66%);
  background-repeat: no-repeat;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
}

/* 顶部品牌栏：品牌居中，菜单分列两侧 */
.brandbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 18px clamp(12px, 4vw, 48px) 8px;
}

.mini {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.mini:first-child {
  justify-content: flex-start;
}

.mini:last-child {
  justify-content: flex-end;
}

.mini a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  font-size: 16px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.mini a:hover,
.mini a:focus-visible {
  color: var(--paper);
  background: rgba(244, 237, 247, 0.09);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--paper);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
}

.mark {
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 22%;
  background: linear-gradient(140deg, var(--violet), var(--umber));
  box-shadow: 0 0 0 1px rgba(244, 237, 247, 0.28);
}

/* 粘性胶囊锚点条 */
.dock {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px clamp(10px, 3vw, 30px);
  background: rgba(31, 23, 38, 0.74);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dock-nav {
  display: flex;
  flex: 1 1 auto;
  gap: 8px;
  padding: 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
  min-width: 0;
}

.dock-nav::-webkit-scrollbar {
  display: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 15px;
  font-size: 16px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--paper);
  background: rgba(244, 237, 247, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: background-color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.pill:hover,
.pill:focus-visible {
  background: rgba(139, 69, 19, 0.44);
  border-color: rgba(244, 237, 247, 0.42);
  transform: translateY(-2px);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--umber);
  box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.26);
}

.reach {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--violet), var(--umber));
  box-shadow: 0 10px 26px rgba(86, 34, 139, 0.42);
}

/* 点阵首屏 */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(18px, 3vw, 30px);
  min-height: 70vh;
  padding: clamp(28px, 6vw, 76px) clamp(14px, 4vw, 48px) clamp(22px, 4vw, 44px);
  text-align: right;
  overflow: hidden;
  background-image: radial-gradient(rgba(244, 237, 247, 0.16) 1px, transparent 1px);
  background-size: 22px 22px;
}

.hero::after {
  content: "";
  position: absolute;
  right: -12%;
  bottom: -34%;
  width: min(680px, 80%);
  height: 70%;
  border-radius: 50% 50% 42% 58%;
  background: radial-gradient(closest-side, rgba(86, 34, 139, 0.5), transparent);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: min(780px, 100%);
  margin-left: auto;
}

h1 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: clamp(1.85rem, 5.2vw, 3.4rem);
  line-height: 1.16;
  letter-spacing: -0.01em;
}

.lede {
  max-width: 52ch;
  margin: 0 0 22px auto;
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.7;
  color: var(--muted);
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 26px;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--violet), var(--umber));
  box-shadow: 0 12px 30px rgba(86, 34, 139, 0.4);
}

.hero-fig {
  position: relative;
  z-index: 1;
  margin: 0;
  will-change: transform;
}

.hero-img {
  display: block;
  width: 100%;
  height: clamp(170px, 30vh, 320px);
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 120px 26px 120px 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

/* 左栏 + 正文结构：main > div.wrap > article > section */
.wrap {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: start;
  gap: clamp(20px, 4vw, 52px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 58px) clamp(14px, 4vw, 48px);
}

.side {
  position: sticky;
  top: 74px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.eyebrow {
  display: block;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--umber);
}

.side-title {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 1.1rem;
  letter-spacing: 0.04em;
}

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

.toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 4px 8px;
  font-size: 16px;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.toc .n {
  min-width: 20px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--umber);
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--paper);
  border-left-color: var(--violet);
  background: rgba(86, 34, 139, 0.18);
}

.stage {
  min-width: 0;
}

.content {
  font-size: 17.5px;
  line-height: 1.78;
  color: #e8ddf2;
}

.content article {
  padding: 34px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}

.content article:first-child {
  padding-top: 0;
  border-top: 0;
}

.content h2 {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: clamp(1.32rem, 2.6vw, 1.72rem);
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: var(--paper);
}

.content h3 {
  margin: 24px 0 10px;
  font-family: var(--mono);
  font-size: 1.13rem;
  color: var(--paper);
}

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

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

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

.content a {
  color: #cba6f5;
}

.content img {
  display: block;
  margin: 18px 0;
  height: auto;
  border-radius: 80px 18px 80px 18px;
}

.content blockquote {
  margin: 0 0 16px;
  padding: 12px 18px;
  border-left: 3px solid var(--umber);
  border-radius: 0;
  background: rgba(139, 69, 19, 0.16);
}

.content figure {
  margin: 18px 0;
}

/* 页脚：多 article 分区 */
.foot {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(22px, 4vw, 48px);
  padding: clamp(30px, 5vw, 56px) clamp(16px, 4vw, 48px) 24px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.3);
}

.foot h2 {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sub input {
  flex: 1 1 180px;
  min-height: 46px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(244, 237, 247, 0.07);
}

.sub input::placeholder {
  color: var(--muted);
}

.sub button {
  min-height: 46px;
  padding: 0 24px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(120deg, var(--violet), var(--umber));
}

.foot dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
  margin: 0;
}

.foot dt {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.2em;
  color: var(--umber);
}

.foot dd {
  margin: 0;
}

.foot dd a {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-size: 16px;
  color: var(--muted);
  text-decoration: none;
}

.foot dd a:hover,
.foot dd a:focus-visible {
  color: var(--paper);
}

.foot-base {
  grid-column: 1 / -1;
  padding-top: 18px;
  text-align: center;
  border-top: 1px solid var(--line);
}

.foot-base p {
  margin: 0;
  font-size: 15px;
  color: rgba(244, 237, 247, 0.58);
}

.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  min-height: 44px;
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
  color: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(31, 23, 38, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.totop.on {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

@media (min-width: 800px) {
  body {
    background-attachment: fixed;
  }
}

@media (max-width: 860px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .side {
    position: static;
  }

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

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

@media (max-width: 760px) {
  .brandbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
    padding-top: 14px;
  }

  .brand {
    grid-row: 1;
    justify-self: center;
  }

  .mini,
  .mini:first-child,
  .mini:last-child {
    justify-content: center;
  }
}

@media (max-width: 560px) {
  .hero {
    min-height: 0;
    padding-top: 22px;
  }

  .hero::after {
    display: none;
  }

  .hero-img {
    height: 190px;
    border-radius: 70px 18px 70px 18px;
  }

  .content {
    font-size: 17px;
  }

  .content article {
    scroll-margin-top: 72px;
  }

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

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