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

:root {
  --red: #ff0000;
  --violet: #8b00ff;
  --ink: #261717;
  --ink-soft: #4a3333;
  --rail: 250px;
  --glass: rgba(255, 255, 255, 0.22);
  --glass-hard: rgba(255, 255, 255, 0.62);
  --edge: 1px solid rgba(255, 255, 255, 0.34);
  --r: 10px;
}

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

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

body {
  margin: 0;
  padding-left: var(--rail);
  min-height: 100vh;
  font-family: Figtree, "Noto Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.68;
  color: var(--ink);
  background:
    radial-gradient(760px 620px at 88% -6%, #ff6352 0%, rgba(255, 99, 82, 0) 62%),
    radial-gradient(680px 640px at 6% 26%, #bb45ff 0%, rgba(187, 69, 255, 0) 66%),
    linear-gradient(165deg, var(--red) 0%, #d0184f 46%, var(--violet) 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

.stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(240px 240px at 78% 68%, rgba(255, 255, 255, 0.38), rgba(255, 255, 255, 0) 70%),
    radial-gradient(180px 180px at 30% 88%, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0) 72%);
  z-index: 0;
}

/* ---------- 左侧固定栏 ---------- */

.top {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding: 1.15rem 1rem 1.4rem;
  background: rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-right: var(--edge);
  box-shadow: 1px 0 0 rgba(38, 23, 23, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.3rem 0.35rem;
  text-decoration: none;
  color: var(--ink);
  border-radius: var(--r);
  transition: transform 0.18s ease, background 0.18s ease;
}

.brand .mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  border-radius: var(--r);
  background: linear-gradient(150deg, var(--red), var(--violet));
  box-shadow: 0 6px 16px rgba(38, 23, 23, 0.28);
}

.brand .name {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand:hover { background: rgba(255, 255, 255, 0.34); transform: translateX(2px); }

.top nav { flex: 0 1 auto; }

.top nav p {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.top nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.72rem;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.42);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.top nav a::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 0.42rem;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--red), var(--violet));
}

.top nav a:hover {
  background: rgba(255, 255, 255, 0.66);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(38, 23, 23, 0.18);
}

.cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border-radius: var(--r);
  background: linear-gradient(140deg, #e00000, #7a00e0);
  box-shadow: 0 10px 24px rgba(38, 23, 23, 0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cta:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(38, 23, 23, 0.36); }

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

main {
  position: relative;
  z-index: 1;
  padding: 1.4rem clamp(1rem, 4vw, 3.2rem) 0;
  max-width: 1120px;
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.7rem;
  min-height: 45vh;
  padding: 1.2rem clamp(0.9rem, 3vw, 2rem) 1.6rem;
  text-align: right;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.14);
  border: var(--edge);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  box-shadow: 0 18px 44px rgba(38, 23, 23, 0.18);
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -12% -55% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 68%);
}

.badge {
  position: relative;
  margin: 0 0 auto;
  padding: 0.36rem 0.85rem;
  transform: rotate(-2.5deg);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px rgba(38, 23, 23, 0.2);
  animation: float 5.5s ease-in-out infinite;
}

.badge figcaption {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--ink);
}

@keyframes float {
  0%, 100% { transform: rotate(-2.5deg) translateY(0); }
  50% { transform: rotate(-2.5deg) translateY(-5px); }
}

.hero h1 {
  position: relative;
  margin: 0;
  font-size: clamp(1.9rem, 5.6vw, 4.2rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
  max-width: 22ch;
}

.lede {
  position: relative;
  margin: 0;
  max-width: 46ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ---------- 正文骨架 ---------- */

.shell {
  display: grid;
  grid-template-columns: minmax(0, 218px) minmax(0, 1fr);
  gap: clamp(0.9rem, 2.4vw, 1.6rem);
  align-items: start;
  margin-top: clamp(1rem, 2.6vw, 1.8rem);
}

.side {
  position: sticky;
  top: 1.2rem;
  padding: 0.9rem 0.9rem 1rem;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.42);
  border: var(--edge);
  -webkit-backdrop-filter: blur(15px) saturate(150%);
  backdrop-filter: blur(15px) saturate(150%);
  box-shadow: 0 14px 32px rgba(38, 23, 23, 0.16);
}

.side h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.side hr {
  margin: 0.5rem 0 0.7rem;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(38, 23, 23, 0.4), rgba(38, 23, 23, 0.04));
}

.side-links {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.side-links a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.32rem 0.4rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.16s ease, color 0.16s ease, padding-left 0.16s ease;
}

.side-links a:hover {
  padding-left: 0.7rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.side-pic {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0.9rem;
  border-radius: 8px;
}

.prose {
  padding: clamp(1rem, 3vw, 2.1rem);
  border-radius: var(--r);
  background: var(--glass-hard);
  border: 1px solid rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 20px 48px rgba(38, 23, 23, 0.18);
  overflow-wrap: break-word;
}

.prose > section {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px dashed rgba(38, 23, 23, 0.18);
}

.prose > section:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

section[id] { scroll-margin-top: 24px; }

.prose h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.24rem, 2.6vw, 1.56rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.prose h3 {
  margin: 1.3rem 0 0.45rem;
  font-size: 1.05rem;
  line-height: 1.4;
}

.prose p { margin: 0 0 0.8rem; }

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

.prose a:hover { color: var(--violet); }

.prose ul,
.prose ol { margin: 0 0 0.9rem; padding-left: 1.2rem; }

.prose li { margin-bottom: 0.32rem; }

.prose blockquote {
  margin: 0 0 0.9rem;
  padding: 0.7rem 0.95rem;
  border-left: 3px solid var(--violet);
  border-radius: 0 8px 8px 0;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-soft);
}

.prose strong { font-weight: 700; }

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.prose figure { margin: 0 0 0.9rem; }

.prose figcaption {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin-bottom: 0.9rem;
  font-size: 0.94rem;
}

.prose th,
.prose td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid rgba(38, 23, 23, 0.16);
  text-align: left;
}

.prose hr {
  border: 0;
  height: 1px;
  background: rgba(38, 23, 23, 0.16);
  margin: 0.9rem 0;
}

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

.foot {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem 1.4rem;
  margin-top: clamp(1.2rem, 3vw, 2rem);
  padding: 1.6rem clamp(1rem, 4vw, 3.2rem) 1.2rem;
  background: rgba(38, 23, 23, 0.72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fbeeee;
}

.foot dl { margin: 0; }

.foot dt {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: rgba(255, 233, 233, 0.72);
}

.foot dd { margin: 0.4rem 0 0; }

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.1rem 0;
  font-size: 0.94rem;
  color: #fdecec;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.26);
  transition: color 0.16s ease, border-color 0.16s ease;
}

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

.copy {
  grid-column: 1 / -1;
  margin: 0.4rem 0 0;
  padding-top: 0.8rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  color: rgba(255, 236, 236, 0.7);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

/* ---------- 回到顶部 ---------- */

.totop {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  min-height: 44px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-size: 0.86rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.85);
  border: var(--edge);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 22px rgba(38, 23, 23, 0.22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

/* ---------- 滚动显现 ---------- */

.js [data-reveal],
.js .prose > section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js [data-reveal].in,
.js .prose > section.in {
  opacity: 1;
  transform: none;
}

/* ---------- 移动端 ---------- */

@media (max-width: 880px) {
  body { padding-left: 0; }

  .top {
    position: sticky;
    inset: 0 0 auto 0;
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    padding: 0.5rem 0.7rem;
    border-right: 0;
    border-bottom: var(--edge);
  }

  .brand { order: 1; padding: 0.2rem; }

  .cta {
    order: 2;
    margin: 0 0 0 auto;
    min-height: 42px;
    padding: 0.45rem 0.85rem;
    font-size: 0.88rem;
  }

  .top nav { order: 3; flex: 1 1 100%; }

  .top nav p {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .top nav p::-webkit-scrollbar { display: none; }

  .top nav a { white-space: nowrap; padding: 0.4rem 0.66rem; font-size: 0.88rem; }

  main { padding: 0.7rem 0.7rem 0; }

  .hero {
    min-height: 0;
    padding: 0.85rem 0.9rem 1.1rem;
    align-items: flex-start;
    text-align: left;
    gap: 0.55rem;
  }

  .badge { margin: 0; padding: 0.28rem 0.7rem; }

  .hero h1 { font-size: clamp(1.9rem, 8.4vw, 2.5rem); }

  .lede { font-size: 0.95rem; }

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

  .side { position: static; }

  .side-links { flex-direction: row; flex-wrap: wrap; gap: 0.2rem; }

  .side-links a { min-height: 40px; padding: 0.3rem 0.55rem; background: rgba(255, 255, 255, 0.55); }

  .side-links a:hover { padding-left: 0.55rem; }

  section[id] { scroll-margin-top: 132px; }

  .prose { padding: 1rem 0.95rem; }

  .foot { grid-template-columns: 1fr 1fr; padding: 1.3rem 0.9rem 1.1rem; }

  .copy { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .badge { animation: none; }
  .js [data-reveal],
  .js .prose > section { opacity: 1; transform: none; transition: none; }
  .brand:hover,
  .top nav a:hover,
  .cta:hover { transform: none; }
}

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