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

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

:root {
  --red: #ff0000;
  --violet: #8b00ff;
  --ink: #261717;
  --txt: #f8f2f2;
  --dim: #d9c6ca;
  --glass: rgba(255, 255, 255, 0.085);
  --edge: rgba(255, 255, 255, 0.2);
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.38);
  --serif: 'Playfair Display', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--txt);
  overflow-x: clip;
  min-height: 100vh;
  background:
    radial-gradient(58vw 58vw at 8% -8%, rgba(139, 0, 255, 0.5), transparent 62%),
    radial-gradient(46vw 46vw at 104% 2%, rgba(255, 0, 0, 0.36), transparent 64%),
    radial-gradient(72vw 46vw at 46% 114%, rgba(139, 0, 255, 0.3), transparent 68%),
    var(--ink);
  background-attachment: fixed;
}

img { max-width: 100%; }

/* ---------- 顶部玻璃导航 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(38, 23, 23, 0.55);
  border-bottom: 1px solid var(--edge);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 1220px;
  margin: 0 auto;
  padding: 0.35rem 0.9rem;
}

nav ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.1rem;
}

nav ol:first-of-type { flex: 1 1 0; justify-content: flex-start; }
nav ol:last-of-type { flex: 1 1 0; justify-content: flex-end; }

nav ol a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.35rem 0.6rem;
  border-radius: 8px;
  color: #f2e8e9;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.2;
  transition: background 0.25s ease, color 0.25s ease;
}

nav ol a::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-right: 0.45em;
  border-radius: 2px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--red), var(--violet));
}

nav a:hover { background: rgba(255, 255, 255, 0.13); color: #fff; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  min-height: 46px;
  padding: 0.25rem 0.6rem;
  text-decoration: none;
  color: #fff;
  border-radius: 10px;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--red), var(--violet));
  box-shadow: 0 8px 20px rgba(139, 0, 255, 0.45);
}

.logo { width: 32px; height: 32px; border-radius: 10px; object-fit: cover; }

.brand-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.4rem 1.05rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: linear-gradient(120deg, var(--red), var(--violet));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 26px rgba(255, 0, 0, 0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(255, 0, 0, 0.4); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  max-width: 1220px;
  margin: 0 auto;
  padding: clamp(1.4rem, 3.5vw, 2.8rem) 1rem clamp(1.6rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1rem, 3vw, 2.4rem);
  align-items: center;
  min-height: 45vh;
}

.ghost {
  position: absolute;
  left: -0.06em;
  top: -0.3em;
  z-index: 0;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(6rem, 24vw, 15rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.07);
  pointer-events: none;
  user-select: none;
}

.hero-copy { position: relative; z-index: 1; }

.brandline {
  margin: 0 0 0.7rem;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
  color: #f0c9d4;
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.05rem, 5.6vw, 3.6rem);
  line-height: 1.14;
  letter-spacing: -0.01em;
  background: linear-gradient(105deg, #ffffff 8%, #ffd2d2 55%, #d9b6ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-wrap: balance;
}

.hero-art {
  position: relative;
  z-index: 1;
  min-height: 240px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: linear-gradient(150deg, rgba(255, 0, 0, 0.3), rgba(139, 0, 255, 0.4));
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.hero-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  will-change: transform;
}

/* ---------- 内容区 ---------- */
.shell {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 1rem 1rem;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  gap: clamp(1rem, 2.6vw, 1.8rem);
  align-items: start;
}

.side {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 0.9rem;
}

.side-card,
.to-top {
  display: block;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.side-h {
  margin: 0 0 0.7rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
}

.side-h > span {
  background: linear-gradient(100deg, #ffffff, #ffc9d8 60%, #d5b3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.1rem;
  counter-reset: toc;
}

.toc li { counter-increment: toc; }

.toc a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 40px;
  padding: 0.2rem 0.4rem;
  border-left: 2px solid transparent;
  border-radius: 8px;
  color: #f0e6e7;
  font-size: 0.95rem;
  line-height: 1.3;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.toc a::before {
  content: counter(toc, decimal-leading-zero);
  flex: none;
  font-family: var(--serif);
  font-size: 0.85rem;
  color: #ffb9b9;
  letter-spacing: 0.02em;
}

.toc a:hover { background: rgba(255, 255, 255, 0.1); border-left-color: var(--red); }

.to-top { text-decoration: none; text-align: center; }
.to-top .side-h { margin: 0; font-size: 1rem; }

.prose { min-width: 0; }

article.prose > article {
  margin: 0 0 1.15rem;
  padding: clamp(1.15rem, 3vw, 2rem);
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  scroll-margin-top: 96px;
}

.prose p { margin: 0 0 1rem; line-height: 1.85; color: #e9dfe0; }
.prose p:last-child { margin-bottom: 0; }

.prose h2 {
  position: relative;
  margin: 0 0 0.8rem;
  padding-left: 0.85rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.3;
}

.prose h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.34em;
  bottom: 0.34em;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(var(--red), var(--violet));
}

.prose h2 > span {
  background: linear-gradient(100deg, #ffffff, #ffd3d3 50%, #d8b7ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.prose h3 {
  margin: 1.4rem 0 0.5rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  line-height: 1.35;
  color: #fff;
}

.prose h3 > span {
  background: linear-gradient(100deg, #ffffff, #ffd8de 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.prose ul,
.prose ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.prose li { margin: 0 0 0.45rem; line-height: 1.75; }

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

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

.prose blockquote {
  margin: 1rem 0;
  padding: 0.85rem 1.1rem;
  border-left: 3px solid var(--violet);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 255, 255, 0.07);
  color: #f4e9f0;
}

.prose strong { color: #fff; }

.prose img {
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--edge);
}

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  margin: 0 0 1rem;
  border-collapse: collapse;
}

.prose th,
.prose td { border: 1px solid var(--edge); padding: 0.5rem 0.7rem; text-align: left; }

.prose code {
  font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace;
  font-size: 0.95em;
  padding: 0.1em 0.35em;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
}

.prose hr { border: 0; height: 1px; margin: 1.4rem 0; background: var(--edge); }

/* ---------- 页脚 ---------- */
.foot {
  max-width: 1220px;
  margin: 2.2rem auto 0;
  padding: 0 1rem 2rem;
}

.foot-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: clamp(1.2rem, 3.5vw, 2.1rem);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: linear-gradient(112deg, rgba(255, 0, 0, 0.3), rgba(139, 0, 255, 0.4));
  box-shadow: var(--shadow);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.foot-cta h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 3.6vw, 2.1rem);
  line-height: 1.25;
}

.foot-cta h2 > span {
  background: linear-gradient(100deg, #ffffff, #ffd6e0 65%, #d9b9ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.foot-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1.3rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.foot-btn:hover { background: rgba(255, 255, 255, 0.28); }

.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.6rem;
  padding: 0 0.3rem;
}

.foot-cols dl { margin: 0; }

.foot-cols dt {
  margin-bottom: 0.35rem;
  font-size: 0.9375rem;
  letter-spacing: 0.12em;
  color: #f2bfcd;
}

.foot-cols dd { margin: 0; }

.foot-cols dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #f1e7e8;
  font-size: 0.975rem;
  text-decoration: none;
}

.foot-cols dd a:hover { color: #fff; text-decoration: underline; }

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.9375rem;
  color: var(--dim);
}

.foot-base p { margin: 0; }

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--dim);
  text-decoration: none;
}

.foot-base a:hover { color: #fff; }

/* ---------- 动效 ---------- */
.js [data-rv] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.js [data-rv].in { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; order: -1; }
  .toc { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .to-top { justify-self: start; padding: 0.7rem 1rem; }
}

@media (max-width: 820px) {
  .topbar { position: static; }
  nav { flex-wrap: wrap; justify-content: center; padding: 0.5rem 0.7rem; gap: 0.35rem; }
  .brand { order: -1; flex: 1 1 100%; justify-content: center; }
  nav ol { flex: 1 1 46%; justify-content: center; }
  nav ol:last-of-type { justify-content: center; }
  article.prose > article { scroll-margin-top: 16px; }
}

@media (max-width: 680px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 1.2rem 0.9rem 1.6rem;
  }
  .hero-art { min-height: 200px; }
  .ghost { font-size: 8rem; top: -0.18em; }
  .foot-cols { grid-template-columns: minmax(0, 1fr); gap: 0.4rem; }
  .foot-base { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-rv] { opacity: 1; transform: none; transition: none; }
  .hero-art img { transform: none !important; }
  .nav-cta { transition: none; }
}

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