:root {
  --red: #ff0000;
  --vio: #8b00ff;
  --ink: #261717;
  --bg: #1b1111;
  --fg: #fdf3f3;
  --text: #f2e5e6;
  --muted: #d9c4c8;
  --line: rgba(255, 255, 255, 0.18);
  --line-soft: rgba(255, 255, 255, 0.1);
  --glass: rgba(38, 23, 23, 0.5);
  --font: "Atkinson Hyperlegible", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 112px;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.7;
  color: var(--fg);
  background-color: var(--bg);
  background-image:
    radial-gradient(52vw 46vw at 88% -6%, rgba(255, 0, 0, 0.3), transparent 62%),
    radial-gradient(48vw 48vw at 2% 22%, rgba(139, 0, 255, 0.28), transparent 64%),
    radial-gradient(64vw 52vw at 55% 106%, rgba(139, 0, 255, 0.2), transparent 66%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1.5px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(130% 92% at 50% 0, #000 12%, transparent 78%);
  mask-image: radial-gradient(130% 92% at 50% 0, #000 12%, transparent 78%);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

section {
  scroll-margin-top: 20px;
  scroll-margin-bottom: 104px;
}

.page {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(18px, 3vw, 44px);
  max-width: 1240px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 42px) clamp(14px, 4vw, 40px) 40px;
  align-items: start;
}

/* 左侧栏 */
.rail {
  position: sticky;
  top: clamp(12px, 3vw, 28px);
  padding: 18px 16px;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  border-radius: 0;
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  backdrop-filter: blur(14px) saturate(130%);
}

.eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #ff8a8a;
}

.rail-title {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #fff;
}

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

.rail-list a {
  display: block;
  padding: 10px 8px;
  min-height: 40px;
  font-size: 15px;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  color: #fff;
  border-left-color: var(--red);
  background: rgba(255, 0, 0, 0.09);
}

.rail-list a.is-current {
  color: #fff;
  border-left-color: var(--vio);
}

/* 主区 */
.main { min-width: 0; }

.gls > section {
  position: relative;
  display: block;
  margin: 0 0 clamp(16px, 2.4vw, 28px);
  padding: clamp(20px, 3vw, 38px);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 0;
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  transition: border-color 0.25s, background 0.25s;
}

.gls > section:hover { border-color: rgba(255, 0, 0, 0.45); }

.gls > section.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: calc(100svh - 150px);
  padding: clamp(22px, 4vw, 40px) 0 clamp(28px, 5vw, 56px);
  text-align: right;
  background: transparent;
  border: 0;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.hero-title {
  margin: 0;
  font-size: clamp(38px, 7.4vw, 92px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 46px rgba(255, 0, 0, 0.45), 0 0 92px rgba(139, 0, 255, 0.38);
}

.hero-title::after {
  content: "";
  display: block;
  width: clamp(90px, 22vw, 220px);
  height: 3px;
  margin: 22px 0 0 auto;
  background: linear-gradient(90deg, var(--vio), var(--red));
}

/* 正文排版 */
.gls small {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #ff8a8a;
}

.gls h2 {
  margin: 0 0 14px;
  font-size: clamp(22px, 2.6vw, 29px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: #fff;
}

.gls h3 {
  margin: 26px 0 10px;
  font-size: 19px;
  line-height: 1.35;
  color: #fff;
}

.gls p {
  margin: 0 0 14px;
  color: var(--text);
}

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

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

.gls a {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: rgba(255, 0, 0, 0.7);
  text-underline-offset: 3px;
}

.gls a:hover { color: #ffd9d9; }

.gls img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border: 1px solid var(--line);
}

.gls blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--vio);
  background: rgba(139, 0, 255, 0.12);
}

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

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

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

.gls strong { color: #fff; }

/* 底部固定条 */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px clamp(10px, 3vw, 26px);
  background: rgba(28, 17, 17, 0.68);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}

.dock-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  text-decoration: none;
}

.mark {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: cover;
}

.mark-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(140deg, var(--red), var(--vio));
}

.copy {
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--muted);
  white-space: nowrap;
}

.dock-nav {
  flex: 1 1 auto;
  min-width: 0;
}

.dock-nav dl {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.dock-nav dl::-webkit-scrollbar { display: none; }

.dock-nav dt {
  flex: 0 0 auto;
  padding-right: 8px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #ff8a8a;
}

.dock-nav dd {
  margin: 0;
  flex: 0 0 auto;
}

.dock-nav dd a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 11px;
  font-size: 15px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s, background 0.18s;
}

.dock-nav dd a:hover,
.dock-nav dd a:focus-visible {
  color: #fff;
  background: rgba(255, 0, 0, 0.16);
}

.dock-end { flex: 0 0 auto; }

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(120deg, var(--red), var(--vio));
  transition: filter 0.18s;
}

.top-link:hover { filter: brightness(1.15); }

/* 滚动显现 */
.js .gls > section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1), border-color 0.25s, background 0.25s;
}

.js .gls > section.hero,
.js .gls > section.is-in {
  opacity: 1;
  transform: none;
}

@media (max-width: 900px) {
  .copy { display: none; }
}

@media (max-width: 860px) {
  body { padding-bottom: 96px; }

  .page {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 14px 14px 28px;
  }

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

  .rail-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }

  .eyebrow { font-size: 11px; }

  .rail-title {
    margin: 0;
    font-size: 15px;
    letter-spacing: 0.12em;
  }

  .rail-list {
    display: flex;
    gap: 6px;
    margin: 8px 0 0;
    padding-bottom: 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }

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

  .rail-list a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 10px 11px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }

  .rail-list a:hover,
  .rail-list a:focus-visible {
    border-left-color: transparent;
    border-bottom-color: var(--red);
  }

  .rail-list a.is-current { border-left-color: transparent; }

  .gls > section { padding: 18px 16px; }

  .gls > section.hero {
    min-height: 0;
    padding: 20px 0 26px;
  }

  .dock-nav dt { display: none; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }

  .hero-title { font-size: clamp(32px, 10vw, 44px); }

  .top-link { padding: 0 12px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }

  .js .gls > section {
    opacity: 1;
    transform: none;
  }
}

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