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

:root {
  --ink: #1c1726;
  --ink-2: #241d31;
  --ink-3: #2a2138;
  --violet: #6514ff;
  --magenta: #bf00ff;
  --text: #eee7f7;
  --muted: #c6b9dd;
  --line: rgba(255, 255, 255, 0.12);
  --radius: 28px;
  --gap: 48px;
  --edge: clamp(16px, 5vw, 64px);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: 'Montserrat', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: -20%;
  left: -20%;
  right: -20%;
  height: 150vh;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 18%, rgba(101, 20, 255, 0.4), transparent 46%),
    radial-gradient(circle at 86% 8%, rgba(191, 0, 255, 0.3), transparent 44%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 28px);
  animation: drift 26s ease-in-out infinite alternate;
}

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

a {
  color: #c8a6ff;
}

.site-head,
main,
.site-foot {
  position: relative;
  z-index: 1;
}

.wrap {
  max-width: 1240px;
  margin: 0 auto;
}

/* ---------- 顶部 ---------- */

.site-head {
  z-index: 30;
}

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 14px var(--edge);
  background: rgba(28, 23, 38, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 14px;
  font-family: 'Cormorant', 'Songti SC', serif;
  font-size: clamp(20px, 2.4vw, 30px);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.grp {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.grp-a {
  grid-column: 1;
  justify-content: flex-start;
}

.grp-b {
  grid-column: 3;
  justify-content: flex-end;
}

.grp a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 999px;
  color: #d9cfef;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.22s ease, background 0.22s ease;
}

.grp a:hover {
  color: #fff;
  background: linear-gradient(100deg, var(--violet), var(--magenta));
}

.menu-btn {
  display: none;
  grid-column: 1;
  justify-self: start;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}

.drop {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
  background: #221b2f;
  border-bottom: 1px solid var(--line);
}

.site-head.is-open .drop {
  max-height: 70vh;
  overflow: auto;
}

.drop-in {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 var(--edge);
}

.site-head.is-open .drop-in {
  padding: 16px var(--edge);
}

.drop ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.drop a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 16px;
  text-decoration: none;
}

.drop a:hover {
  background: rgba(101, 20, 255, 0.4);
  border-color: rgba(191, 0, 255, 0.7);
}

.anchor-bar {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px clamp(12px, 3vw, 40px);
  background: linear-gradient(90deg, var(--violet), var(--magenta));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4);
}

.anchors {
  display: flex;
  flex: 1 1 auto;
  gap: 6px;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.anchors a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(28, 23, 38, 0.24);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.anchors a:hover,
.anchors a.is-on {
  background: var(--ink);
}

.search {
  position: relative;
  flex: 0 0 auto;
}

.search input {
  width: clamp(104px, 15vw, 176px);
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(28, 23, 38, 0.28);
  color: #fff;
  font: inherit;
  font-size: 16px;
}

.search input::placeholder {
  color: rgba(255, 255, 255, 0.82);
}

.sug {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(280px, 74vw);
  margin: 0;
  padding: 8px;
  list-style: none;
  background: #241d31;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.55);
  z-index: 60;
}

.sug a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--text);
  font-size: 16px;
  text-decoration: none;
}

.sug a:hover {
  background: rgba(191, 0, 255, 0.32);
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: calc(100vh - 128px);
  padding: clamp(28px, 6vw, 80px) var(--edge);
  overflow: hidden;
}

.hero-in {
  position: relative;
  z-index: 2;
  max-width: min(760px, 94%);
  text-align: right;
}

.hero h1 {
  margin: 0;
  font-family: 'Cormorant', 'Songti SC', serif;
  font-size: clamp(38px, 9vw, 104px);
  font-weight: 600;
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 12px 44px rgba(0, 0, 0, 0.5);
}

.hero-slash {
  position: absolute;
  z-index: 1;
  left: -10%;
  right: -10%;
  bottom: -20%;
  height: 62%;
  background: linear-gradient(100deg, var(--violet), var(--magenta));
  transform: skewY(-7deg);
  opacity: 0.92;
}

/* ---------- 引言 ---------- */

.lead {
  padding: clamp(40px, 7vw, 84px) var(--edge) clamp(24px, 4vw, 48px);
}

.lead-in {
  max-width: 1000px;
  padding-left: clamp(18px, 3vw, 34px);
  border-left: 6px solid var(--magenta);
}

.lead h2 {
  margin: 0 0 14px;
  font-family: 'Cormorant', 'Songti SC', serif;
  font-size: clamp(30px, 5vw, 56px);
  font-weight: 600;
  line-height: 1.1;
  color: #fff;
}

.subtitle {
  margin: 0;
  max-width: 68ch;
  color: var(--muted);
  font-size: 17px;
}

/* ---------- 布局 ---------- */

.cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  gap: var(--gap);
  align-items: start;
  padding: 0 var(--edge) clamp(48px, 8vw, 96px);
}

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

.prose > section {
  position: relative;
  margin: 0 0 var(--gap);
  padding: clamp(22px, 4vw, 44px);
  padding-left: clamp(28px, 5vw, 52px);
  background: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  box-shadow: 0 28px 56px -28px rgba(0, 0, 0, 0.8);
  scroll-margin-top: 150px;
  overflow: hidden;
}

.prose > section:nth-child(even) {
  background: var(--ink-3);
}

.prose > section::before {
  content: "";
  position: absolute;
  left: 0;
  top: 26px;
  bottom: 26px;
  width: 6px;
  border-radius: 0 6px 6px 0;
  background: linear-gradient(180deg, var(--violet), var(--magenta));
}

.prose h2 {
  margin: 0 0 16px;
  font-family: 'Cormorant', 'Songti SC', serif;
  font-size: clamp(25px, 3.6vw, 40px);
  font-weight: 600;
  line-height: 1.16;
  color: #fff;
}

.prose h3 {
  margin: 28px 0 10px;
  font-size: 20px;
  line-height: 1.4;
  color: #e6dbff;
}

.prose p {
  margin: 0 0 16px;
  color: #d8cfe8;
}

.prose p:last-child,
.prose ul:last-child,
.prose ol:last-child {
  margin-bottom: 0;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose li {
  margin: 8px 0;
}

.prose strong {
  color: #fff;
}

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

.prose blockquote {
  margin: 22px 0;
  padding: 16px 20px;
  background: rgba(101, 20, 255, 0.16);
  border-left: 4px solid var(--magenta);
  border-radius: 0 18px 18px 0;
  color: #eadfff;
}

.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  margin: 18px 0;
}

.prose figure {
  margin: 18px 0;
}

/* ---------- 侧栏 ---------- */

.rail {
  position: sticky;
  top: 104px;
  padding: 22px;
  background: rgba(36, 29, 49, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 28px 56px -30px rgba(0, 0, 0, 0.85);
}

.rail-title {
  margin: 0 0 12px;
  color: #b9a9d6;
  font-size: 16px;
  letter-spacing: 0.18em;
}

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 14px;
  color: #e2d8f4;
  font-size: 16px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

.rail-list a:hover {
  background: linear-gradient(100deg, var(--violet), var(--magenta));
  color: #fff;
  transform: translateX(4px);
}

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

.site-foot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  padding: clamp(40px, 6vw, 72px) var(--edge) 0;
  background: #171221;
  border-top: 1px solid var(--line);
}

.f-logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: 'Cormorant', 'Songti SC', serif;
  font-size: 24px;
  color: #fff;
  text-decoration: none;
}

.f-nav nav dl {
  margin: 0;
  display: grid;
  gap: 2px;
}

.f-nav dt a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: #cfc3e6;
  font-size: 16px;
  text-decoration: none;
}

.f-nav dt a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.f-nav dd {
  margin: 0;
}

.f-meta p {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin: 0 0 4px;
  color: #a99cc2;
  font-size: 16px;
}

.f-bottom {
  grid-column: 1 / -1;
  margin-top: 12px;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.f-bottom p {
  margin: 0;
  color: #a99cc2;
  font-size: 16px;
}

.to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(100deg, var(--violet), var(--magenta));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 18px 34px -14px rgba(101, 20, 255, 0.9);
}

.to-top:hover {
  transform: translateY(-2px);
}

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

@media (max-width: 1000px) {
  .cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    position: static;
    top: auto;
  }
  .site-foot {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .prose > section {
    scroll-margin-top: 132px;
  }
}

@media (max-width: 900px) {
  .grp {
    display: none;
  }
  .menu-btn {
    display: inline-flex;
  }
}

@media (max-width: 600px) {
  .hero {
    min-height: calc(100vh - 152px);
  }
  .hero h1 {
    font-size: clamp(34px, 11vw, 60px);
  }
  .hero-in {
    max-width: 100%;
  }
  .f-meta p {
    min-height: 36px;
  }
  .search input {
    width: 96px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  body::before {
    animation: none;
  }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

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