@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

:root {
  --ink: #1c1726;
  --ink-2: #241d33;
  --ink-3: #2a1f3d;
  --pri: #6514ff;
  --acc: #bf00ff;
  --paper: #f5f0fb;
  --muted: #cabfdd;
  --line: rgba(191, 0, 255, .22);
  --radius: 18px;
  --serif: 'Playfair Display', 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --body: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Courier New', monospace;
}

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

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

body {
  margin: 0;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--paper);
  background: var(--ink);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -12%;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(closest-side at 22% 12%, rgba(101, 20, 255, .34), transparent 72%),
    radial-gradient(closest-side at 84% 74%, rgba(191, 0, 255, .26), transparent 72%),
    radial-gradient(closest-side at 50% 100%, rgba(101, 20, 255, .18), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
}

body::after {
  background-image:
    repeating-linear-gradient(90deg, rgba(245, 240, 251, .045) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(0deg, rgba(245, 240, 251, .045) 0 1px, transparent 1px 84px);
  opacity: .55;
  animation: slide 40s linear infinite;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(3%, 2%, 0) scale(1.08); }
}

@keyframes slide {
  from { background-position: 0 0, 0 0; }
  to { background-position: 168px 84px, 84px 168px; }
}

img { max-width: 100%; height: auto; display: block; border-radius: 12px; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--acc);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 顶栏 ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px clamp(12px, 3vw, 30px);
  background: rgba(19, 14, 27, .84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 8px 0 2px;
  text-decoration: none;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 17px;
  letter-spacing: .01em;
  color: #fff;
}

.mark-dot {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--pri), var(--acc));
  transform: rotate(45deg);
  box-shadow: 0 0 16px rgba(191, 0, 255, .7);
}

.mark-img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}

.mark-name { white-space: nowrap; }

.tabs {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-block: 2px;
}

.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 16px;
  color: var(--muted);
  white-space: nowrap;
  transition: background-color .22s ease, color .22s ease, transform .22s ease;
}

.tab::before {
  content: "";
  width: 7px;
  height: 7px;
  background: currentColor;
  transform: rotate(45deg);
  opacity: .8;
  transition: transform .22s ease, opacity .22s ease;
}

.tab:hover,
.tab:focus-visible {
  background: var(--pri);
  color: #fff;
}

.tab:hover::before { transform: rotate(45deg) scale(1.5); opacity: 1; }

/* ---------- 头图 ---------- */

.hero {
  min-height: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(44px, 9vw, 96px) clamp(16px, 5vw, 48px);
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  margin: 0;
  max-width: 16ch;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.6rem, 9.4vw, 6rem);
  line-height: 1.03;
  letter-spacing: -.025em;
  background: linear-gradient(96deg, #ffffff 0%, #d5c0ff 46%, var(--acc) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- 主区 ---------- */

.stage {
  display: grid;
  grid-template-columns: minmax(190px, 246px) minmax(0, 1fr);
  gap: clamp(20px, 3.6vw, 48px);
  align-items: start;
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 64px) clamp(14px, 4vw, 48px) clamp(46px, 7vw, 88px);
}

.rail {
  position: sticky;
  top: 78px;
  background: rgba(36, 29, 51, .78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: 0 26px 54px -40px rgba(0, 0, 0, .95);
}

.rail h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 12px;
  padding-left: 4px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

h2 > span + span {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--acc);
  transform: rotate(45deg);
}

.rail-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chip {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 16px;
  text-decoration: none;
  color: var(--muted);
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.chip:hover,
.chip:focus-visible {
  background: rgba(101, 20, 255, .34);
  color: #fff;
  transform: translateX(4px);
}

/* ---------- 正文块 ---------- */

.flow { min-width: 0; }

.flow > div {
  background: linear-gradient(180deg, var(--ink-2), #20192c);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 44px);
  box-shadow: 0 30px 66px -46px rgba(0, 0, 0, .98), 0 1px 0 rgba(255, 255, 255, .05) inset;
  scroll-margin-top: 92px;
  transition: border-color .25s ease, box-shadow .25s ease;
}

.flow > div + div { margin-top: clamp(26px, 4.6vw, 54px); }

.flow > div:nth-of-type(even) {
  background: linear-gradient(180deg, #1a1425, var(--ink-3));
}

.flow > div:hover {
  border-color: rgba(191, 0, 255, .45);
  box-shadow: 0 34px 70px -44px rgba(101, 20, 255, .9), 0 1px 0 rgba(255, 255, 255, .07) inset;
}

.flow h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5em;
  margin: 0 0 26px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(1.45rem, 3.6vw, 2.1rem);
  line-height: 1.16;
  letter-spacing: -.01em;
  color: #fff;
}

.flow h2 > span:first-child { position: relative; }

.flow h2 > span:first-child::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -9px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--pri), var(--acc));
}

.flow h3 {
  display: flex;
  align-items: center;
  gap: .5em;
  margin: 30px 0 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.22rem;
  line-height: 1.35;
  color: #fff;
}

.flow p {
  margin: 0 0 1.05em;
  max-width: 64ch;
  color: var(--muted);
}

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

.flow ul,
.flow ol {
  margin: 0 0 1.15em;
  padding-left: 1.35em;
  max-width: 64ch;
}

.flow li { margin-bottom: .45em; color: var(--muted); }

.flow li::marker { color: var(--acc); }

.flow strong { color: #fff; }

.flow a {
  color: #d7bcff;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: color .2s ease;
}

.flow a:hover { color: #fff; }

.flow blockquote {
  margin: 1.3em 0;
  padding: 16px 20px;
  border-left: 4px solid var(--acc);
  border-radius: 0 14px 14px 0;
  background: rgba(101, 20, 255, .16);
}

.flow blockquote p { margin: 0; }

.flow figure { margin: 1.4em 0; }

.flow figure img { border-radius: var(--radius); }

.flow figcaption {
  margin-top: .6em;
  font-size: 16px;
  color: var(--muted);
}

.flow aside {
  margin: 1.4em 0;
  padding: 16px 20px;
  border: 1px dashed rgba(191, 0, 255, .45);
  border-radius: 14px;
  background: rgba(191, 0, 255, .08);
}

.flow table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.2em;
  font-size: 16px;
}

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

.flow th { color: #fff; }

.flow code {
  font-family: var(--mono);
  font-size: 15px;
  background: rgba(101, 20, 255, .22);
  padding: 2px 6px;
  border-radius: 6px;
}

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

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(28px, 5vw, 52px) clamp(16px, 4vw, 48px) 44px;
  border-top: 2px solid var(--pri);
  background: linear-gradient(180deg, rgba(101, 20, 255, .16), transparent 78%);
}

.foot-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mark-sm { font-size: 18px; }

.foot-geo {
  display: block;
  width: 64px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--pri), var(--acc), transparent);
}

.foot-nav h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

.foot-nav dl {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 0 10px;
  margin: 0;
}

.foot-nav dt a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  color: var(--muted);
  text-decoration: none;
  transition: color .2s ease;
}

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

.foot-nav dd { margin: 0; }

.foot-nav dd a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-height: 44px;
  color: var(--acc);
  text-decoration: none;
}

.foot-nav dd a::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
  opacity: .65;
}

.foot-nav dd a:hover::before { opacity: 1; }

.foot-end {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-left: auto;
}

.foot-end .copy {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 16px;
  text-decoration: none;
  color: var(--paper);
  transition: background-color .22s ease, color .22s ease, border-color .22s ease;
}

.to-top:hover {
  background: var(--acc);
  border-color: var(--acc);
  color: #fff;
}

/* ---------- 入场 ---------- */

.anim .flow > div.rv {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2, .75, .3, 1);
}

.anim .flow > div.rv.in {
  opacity: 1;
  transform: none;
}

/* ---------- 窄屏 ---------- */

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

  .rail {
    position: static;
    padding: 12px;
  }

  .rail h2 { margin-bottom: 10px; }

  .rail-list {
    flex-direction: row;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .rail-list::-webkit-scrollbar { display: none; }

  .chip {
    flex: 0 0 auto;
    background: rgba(101, 20, 255, .2);
    white-space: nowrap;
    transform: none;
  }

  .chip:hover { transform: none; }

  .flow > div { scroll-margin-top: 74px; }

  .foot { flex-direction: column; }

  .foot-end {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 460px) {
  .hero { min-height: 62vh; }
  .hero h1 { font-size: clamp(2.3rem, 11.5vw, 3.2rem); }
  .mark { font-size: 16px; }
  .mark-dot { width: 13px; height: 13px; }
}

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