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

:root {
  --v: #6514ff;
  --p: #bf00ff;
  --ink: #1c1726;
  --paper: #f8f5ff;
  --paper-2: #efe8ff;
  --soft: #ccc2e6;
  --line: rgba(255, 255, 255, 0.14);
  --nav-w: 200px;
  --r: 10px;
}

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

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

body {
  margin: 0;
  padding-left: var(--nav-w);
  background: var(--ink);
  color: #efeaf7;
  font-family: Karla, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -25%;
  z-index: -1;
  background:
    radial-gradient(circle at 16% 10%, rgba(101, 20, 255, 0.55), transparent 42%),
    radial-gradient(circle at 84% 82%, rgba(191, 0, 255, 0.42), transparent 46%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.045) 0 2px, transparent 2px 28px);
  animation: drift 30s linear infinite alternate;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) rotate(0deg); }
  to { transform: translate3d(2%, 2%, 0) rotate(2.5deg); }
}

a { color: inherit; }

img { max-width: 100%; }

/* ---------- 角落品牌 ---------- */
.shead {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 40;
  width: var(--nav-w);
  height: 78px;
  display: flex;
  align-items: center;
  padding: 0 20px;
}

.brand {
  display: inline-flex;
  text-decoration: none;
  border-radius: var(--r);
}

.brand .mark {
  width: 42px;
  height: 42px;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--v), var(--p));
  color: #fff;
  font-family: "Playfair Display SC", Georgia, serif;
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 10px 24px -10px var(--p);
  object-fit: cover;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.brand:hover .mark {
  transform: rotate(-6deg) scale(1.06);
  box-shadow: 0 14px 30px -10px var(--v);
}

/* ---------- 左侧竖排导航 ---------- */
.snav {
  position: fixed;
  left: 0;
  top: 78px;
  bottom: 0;
  z-index: 30;
  width: var(--nav-w);
  padding: 6px 16px 26px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.snav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.snav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--r);
  color: #ddd4f3;
  font-size: 16px;
  line-height: 1.3;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.snav a:hover,
.snav a[aria-current] {
  background: linear-gradient(120deg, var(--v), var(--p));
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
  transform: translateX(3px);
}

.snav .k {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  color: #c8b4ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.snav a:hover .k,
.snav a[aria-current] .k {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

/* ---------- 主体 ---------- */
main {
  max-width: 1160px;
  padding: 24px 40px 0 0;
}

/* ---------- 首屏 ---------- */
.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 30px;
  align-items: center;
  min-height: 45vh;
  padding: 6px 0 40px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.badge {
  margin: 0;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(191, 0, 255, 0.2);
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0.03em;
}

h1 {
  margin: 0;
  font-family: "Playfair Display SC", "Songti SC", Georgia, serif;
  font-weight: 700;
  font-size: clamp(32px, 4.6vw, 56px);
  line-height: 1.14;
  letter-spacing: 0.01em;
  background: linear-gradient(102deg, #ffffff 18%, #d9c8ff 58%, #f2b6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.lede {
  margin: 0;
  max-width: 32ch;
  color: #ded5f6;
  font-size: 16px;
}

.hero-art {
  position: relative;
  min-height: 230px;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--v), var(--p));
  box-shadow: 0 30px 60px -34px rgba(0, 0, 0, 0.9);
}

.hero-art::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(45deg, rgba(28, 23, 38, 0.16) 0 16px, transparent 16px 32px);
}

.hero-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(1.12) contrast(1.05);
}

/* ---------- 内容 + 侧栏 ---------- */
.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: 44px;
  align-items: start;
  padding-top: 40px;
  border-top: 1px solid var(--line);
}

.body-main { min-width: 0; }

.prose {
  position: relative;
  padding: 36px 34px 44px;
  border-radius: var(--r);
  background: var(--paper);
  background-image: radial-gradient(circle at 100% 0, rgba(191, 0, 255, 0.12), transparent 34%);
  color: #241d33;
  box-shadow: 0 26px 64px -36px rgba(0, 0, 0, 0.9);
}

.prose section { scroll-margin-top: 22px; }

.prose section + section {
  margin-top: 46px;
  padding-top: 34px;
  border-top: 2px dashed rgba(101, 20, 255, 0.22);
}

.prose h2 {
  margin: 0 0 14px;
  font-size: clamp(21px, 2.1vw, 27px);
  line-height: 1.3;
  color: var(--ink);
}

.prose h2::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 10px;
  vertical-align: middle;
  border-radius: 3px;
  background: linear-gradient(135deg, var(--v), var(--p));
  transform: rotate(45deg);
}

.prose h2 > span { display: inline; }

.prose h3 {
  margin: 26px 0 10px;
  font-size: 19px;
  line-height: 1.4;
  color: #3d2b63;
}

.prose h3 > span { display: inline; }

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

.prose a {
  color: #4a0ecf;
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

.prose li { margin: 0 0 8px; }

.prose li::marker { color: var(--p); }

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

.prose blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 5px solid var(--p);
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--paper-2);
}

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

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

.prose pre {
  overflow-x: auto;
  padding: 16px;
  border-radius: var(--r);
  background: var(--ink);
  color: #eee8fb;
}

.prose pre code { background: none; padding: 0; color: inherit; }

.prose table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th, .prose td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(28, 23, 38, 0.14);
  text-align: left;
}

.prose th { background: var(--paper-2); }

.prose hr {
  border: 0;
  border-top: 2px dashed rgba(101, 20, 255, 0.22);
  margin: 28px 0;
}

/* ---------- 右侧栏 ---------- */
.rail {
  position: sticky;
  top: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 22px 20px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--r);
  background: linear-gradient(160deg, rgba(101, 20, 255, 0.34), rgba(191, 0, 255, 0.14));
  box-shadow: 0 20px 44px -30px rgba(0, 0, 0, 0.9);
}

.rail-h {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.08em;
}

.rail-h > span {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 3px solid var(--p);
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.rail-list li {
  opacity: 0;
  animation: rise 0.5s ease forwards;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.rail-list li:nth-child(1) { animation-delay: 0.04s; }
.rail-list li:nth-child(2) { animation-delay: 0.09s; }
.rail-list li:nth-child(3) { animation-delay: 0.14s; }
.rail-list li:nth-child(4) { animation-delay: 0.19s; }
.rail-list li:nth-child(5) { animation-delay: 0.24s; }
.rail-list li:nth-child(6) { animation-delay: 0.29s; }
.rail-list li:nth-child(7) { animation-delay: 0.34s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rail-list a {
  display: block;
  min-height: 42px;
  padding: 9px 2px;
  color: #e8dfff;
  font-size: 16px;
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.rail-list a:hover {
  color: #fff;
  padding-left: 7px;
}

.rail-art {
  height: 10px;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--v) 0 10px, var(--p) 10px 20px);
  opacity: 0.85;
}

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 76px;
  padding: 48px 40px 26px 0;
  border-top: 2px solid rgba(255, 255, 255, 0.13);
  background: rgba(10, 7, 16, 0.55);
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.05fr 1.4fr;
  gap: 42px;
  align-items: start;
}

.foot-h {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.35;
}

.foot-h > span {
  display: inline-block;
  padding-bottom: 4px;
  border-bottom: 3px solid var(--v);
}

.foot-desc {
  margin: 0;
  max-width: 32ch;
  color: var(--soft);
  font-size: 16px;
}

.foot-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.foot-links dl { margin: 0; }

.foot-links dt {
  margin-bottom: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.foot-links dd { margin: 0; }

.foot-links a {
  display: inline-block;
  min-height: 42px;
  padding: 9px 0;
  color: var(--soft);
  font-size: 16px;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.foot-links a:hover {
  color: #fff;
  transform: translateX(3px);
}

.sub {
  display: grid;
  gap: 10px;
  max-width: 470px;
  margin: 38px 0 0;
}

.sub-label {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

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

.sub input {
  flex: 1 1 210px;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 16px;
}

.sub input::placeholder { color: #a99ec6; }

.sub input:focus-visible,
.sub button:focus-visible,
a:focus-visible {
  outline: 3px solid #d9c8ff;
  outline-offset: 2px;
}

.sub button {
  min-height: 48px;
  padding: 10px 28px;
  border: 0;
  border-radius: var(--r);
  background: linear-gradient(120deg, var(--v), var(--p));
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sub button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -12px var(--p);
}

.foot-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 16px;
}

.copy {
  margin: 0;
  color: #a99ec6;
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  color: #e8dfff;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.22s ease, color 0.22s ease;
}

.totop:hover {
  background: linear-gradient(120deg, var(--v), var(--p));
  color: #fff;
}

/* ---------- 平板 ---------- */
@media (max-width: 1000px) {
  main { padding-right: 26px; }
  .foot { padding-right: 26px; }
  .wrap { gap: 30px; grid-template-columns: minmax(0, 1fr) 236px; }
}

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  body { padding-left: 0; padding-bottom: 86px; }

  .shead {
    width: auto;
    height: 62px;
    padding: 0 12px;
  }

  .snav {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: auto;
    height: 72px;
    padding: 9px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(18, 13, 26, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
  }

  .snav ol { flex-direction: row; gap: 8px; }

  .snav a {
    min-height: 54px;
    padding: 8px 13px;
    white-space: nowrap;
  }

  .snav a:hover,
  .snav a[aria-current] { transform: none; }

  main {
    max-width: none;
    padding: 72px 16px 0;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 22px;
    padding: 4px 0 28px;
  }

  .hero-art {
    order: 2;
    min-height: 0;
    aspect-ratio: 16 / 9;
  }

  .wrap {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-top: 26px;
  }

  .rail {
    order: -1;
    position: static;
    padding: 18px 16px;
  }

  .prose { padding: 26px 18px 32px; }

  .foot {
    margin-top: 52px;
    padding: 36px 16px 22px;
  }

  .foot-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .foot-links { gap: 18px; }
}

@media (max-width: 420px) {
  .foot-links { grid-template-columns: repeat(2, 1fr); }
  .sub input { flex: 1 1 100%; }
  .sub button { width: 100%; }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  body::before { animation: none; }

  .rail-list li {
    opacity: 1;
    animation: none;
  }

  .snav a,
  .brand .mark,
  .sub button,
  .foot-links a,
  .rail-list a,
  .totop {
    transition: none;
  }
}

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