:root {
  --bg0: #040606;
  --bg1: #000000;
  --headerH: 120px;
  --navTop: rgba(11, 58, 56, 0.92);
  --navMid: rgba(18, 88, 85, 0.62);
  --navFade: rgba(18, 88, 85, 0);
  --text: #e8f3f3;
  --muted: #a9c7c6;
  --orange: #f0914e;
  --orange2: #f3ab67;
  --glass: rgba(10, 10, 10, 0.28);
  --stroke: rgba(255, 255, 255, 0.12);
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
  --shadow2: 0 20px 40px rgba(0, 0, 0, 0.45);
  --radius-xl: 36px;
  --radius-lg: 28px;
  --radius-md: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ========== Custom Text Selection ========== */
::selection {
  background: rgba(240, 145, 78, 0.3);
  color: #fff;
}

::-moz-selection {
  background: rgba(240, 145, 78, 0.3);
  color: #fff;
}

/* ========== Top Header ========== */
.nav-anchor {
  position: relative;
  top: -124px;
  height: 0;
  width: 0;
  overflow: hidden;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
}

.nav-shell {
  height: var(--headerH);
  padding: 8px 18px 0;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  background: linear-gradient(180deg, var(--navTop) 0%, var(--navMid) 70%, var(--navFade) 100%);
  backdrop-filter: blur(28px) saturate(1.65) contrast(1.05);
  -webkit-backdrop-filter: blur(28px) saturate(1.65) contrast(1.05);
  position: relative;
  border-bottom: none;
}

.nav-shell::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: var(--headerH);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  opacity: 0.35;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 6px 6px 6px 10px;
  user-select: none;
}

.brand-word {
  font-family: "Cinzel Decorative", serif;
  font-size: 34px;
  letter-spacing: 0.4px;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
}

.brand-mark {
  display: grid;
  place-items: center;
}

.brand-logo {
  width: 64px;
  height: 64px;
  display: block;
  object-fit: cover;
  border-radius: 999px;
  box-shadow: none;
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 44px;
  padding-top: 14px;
  margin-right: clamp(12px, 4vw, 72px);
}

.nav a {
  font-size: 22px;
  font-weight: 500;
  opacity: 0.92;
  letter-spacing: 0.2px;
  position: relative;
  padding: 8px 2px;
  text-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.nav a:hover {
  opacity: 1;
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: rgba(191, 243, 241, 0.55);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.nav a:hover::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  margin-top: 14px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  margin: 6px auto;
  background: rgba(232, 243, 243, 0.85);
}

/* ========== Page Layout ========== */
.page {
  min-height: 100vh;
}

/* ========== Hero Banner ========== */
.hero-banner {
  padding: 0;
  position: relative;
}

.hero-banner__media {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  height: clamp(420px, 68vh, 820px);
  overflow: hidden;
}

.hero-banner__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.1s linear;
  will-change: transform;
}

.hero-banner__tail {
  height: clamp(90px, 12vh, 170px);
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: #000;
}

.hero-banner__overlay {
  position: absolute;
  left: 50%;
  top: calc(var(--headerH) + 96px);
  transform: translateX(-50%);
  width: min(860px, calc(100% - 64px));
  z-index: 2;
  pointer-events: none;
}

.hero-banner__card {
  border-radius: 18px;
  padding: clamp(20px, 3vw, 34px) clamp(18px, 3vw, 34px);
  background: rgba(10, 82, 78, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  text-align: center;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s,
              transform 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

body.loaded .hero-banner__card {
  opacity: 1;
  transform: translateY(0);
}

.hero-banner__title {
  margin: 0;
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 700;
  color: #f3a24f;
  letter-spacing: 0.02em;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
}

.hero-banner__title .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

body.loaded .hero-banner__title .char {
  opacity: 1;
  transform: translateY(0);
}

.hero-banner__subtitle {
  margin: 14px 0 0;
  font-size: clamp(18px, 2.6vw, 26px);
  line-height: 1.6;
  color: rgba(232, 243, 243, 0.92);
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease 1s, transform 0.6s ease 1s;
}

body.loaded .hero-banner__subtitle {
  opacity: 1;
  transform: translateY(0);
}

.hero-banner__subtitleLine {
  display: block;
}

.hero-banner__subtitleLine + .hero-banner__subtitleLine {
  margin-top: 8px;
}

/* ========== Reading Progress Bar ========== */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 4px;
  background: linear-gradient(90deg, rgba(150, 232, 224, 0.9), rgba(240, 145, 78, 0.95));
  z-index: 10000;
  transition: width 0.08s linear;
  box-shadow: 0 0 12px rgba(150, 232, 224, 0.5), 0 0 4px rgba(240, 145, 78, 0.3);
}

.reading-progress::after {
  content: "";
  position: absolute;
  right: 0;
  top: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(240, 145, 78, 1);
  box-shadow: 0 0 14px rgba(240, 145, 78, 0.7), 0 0 6px rgba(240, 145, 78, 0.4);
}

/* ========== Page Section / Container ========== */
.page-section {
  padding: 40px 0 56px;
}

section[id] {
  scroll-margin-top: calc(var(--headerH) + 10px);
}

.page-container {
  width: min(1200px, calc(100% - 56px));
  margin: 0 auto;
}

/* ========== Doc Layout (sidebar + content) ========== */
#model-toc {
  padding: 0;
  min-height: calc(100vh - var(--headerH));
  overflow: visible;
}

#model-toc .page-container {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  height: auto;
  padding: 50px 34px 28px 0;
}

.doc-layout {
  display: block;
  margin-top: 0;
  min-height: 0;
}

/* ========== Left Sidebar (fixed) ========== */
.doc-aside {
  position: fixed;
  left: 0;
  top: var(--headerH);
  width: 276px;
  height: calc(100vh - var(--headerH));
  border-radius: 26px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: var(--shadow2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 100;
}

.doc-aside.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.doc-aside__head {
  padding: 26px 22px 18px;
  border-bottom: none;
  flex-shrink: 0;
}

.doc-aside__title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(246, 210, 190, 0.95);
  text-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
  line-height: 1.18;
  text-align: center;
}

.doc-aside__title::after {
  content: "";
  display: block;
  height: 1px;
  margin: 18px auto 0;
  width: min(210px, 88%);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(140, 214, 210, 0.55), rgba(0, 0, 0, 0));
  opacity: 0.95;
}

.doc-toc {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px 14px 22px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
}

.doc-toc::-webkit-scrollbar {
  display: none;
}

.doc-toc-bar {
  position: absolute;
  right: 4px;
  top: 0;
  width: 5px;
  height: 60px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(243, 170, 85, 0.95), rgba(130, 230, 220, 0.8));
  opacity: 0.85;
  pointer-events: none;
  z-index: 2;
  will-change: transform;
  transition: opacity 0.3s ease;
  box-shadow: 0 0 8px rgba(243, 170, 85, 0.3);
}

.doc-toc:hover .doc-toc-bar {
  opacity: 1;
  box-shadow: 0 0 12px rgba(243, 170, 85, 0.45);
}

.doc-toc__link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px 14px;
  border-radius: 18px;
  color: rgba(150, 232, 224, 0.92);
  font-size: 18px;
  letter-spacing: 0.2px;
  text-align: center;
  border: 1px solid transparent;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.doc-toc__link::before {
  content: none;
}

.doc-toc__link:hover {
  background: rgba(240, 145, 78, 0.07);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(190, 248, 242, 0.98);
  transform: translateX(2px);
}

.doc-toc__link.is-active {
  background: rgba(240, 145, 78, 0.12);
  border-color: rgba(240, 145, 78, 0.28);
  color: rgba(210, 246, 244, 1);
}

.doc-toc__link.is-active::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(240, 145, 78, 0.9);
  flex-shrink: 0;
  animation: toc-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(240, 145, 78, 0.5);
}

@keyframes toc-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.doc-toc__link--sub {
  font-size: 15px;
  padding: 12px 14px 12px 28px;
  color: rgba(150, 232, 224, 0.7);
  border-left: 2px solid rgba(150, 232, 224, 0.18);
  border-radius: 0 18px 18px 0;
  margin-left: 18px;
}

.doc-toc__link--sub:hover {
  color: rgba(190, 248, 242, 0.95);
  border-left-color: rgba(150, 232, 224, 0.4);
}

.doc-toc__link--sub.is-active {
  color: rgba(210, 246, 244, 1);
  border-left-color: rgba(240, 145, 78, 0.7);
  background: rgba(240, 145, 78, 0.08);
}

/* ========== Doc Content ========== */
.doc-content {
  min-width: 0;
  margin-left: calc(276px + 46px);
  padding-top: 8px;
  padding-bottom: 120px;
  height: auto;
  overflow: visible;
  padding-left: clamp(18px, 2.2vw, 44px);
  padding-right: clamp(28px, 3.2vw, 56px);
  font-size: clamp(22px, 0.7vw + 18px, 25px);
  line-height: 2;
  color: rgba(232, 243, 243, 0.88);
}

.doc-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.doc-section + .doc-section {
  margin-top: 72px;
}

/* section divider animation */
.doc-section + .doc-section::before {
  content: "";
  display: block;
  width: 0;
  height: 1px;
  margin: 0 auto 72px;
  background: linear-gradient(90deg, transparent, rgba(150, 232, 224, 0.4), rgba(240, 145, 78, 0.3), transparent);
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.doc-section + .doc-section.is-visible::before {
  width: 80%;
}

.doc-title {
  margin: 0 0 32px;
  font-family: "Georgia", "SimSun", "STSong", "Songti SC", serif;
  font-size: clamp(34px, 1.4vw + 28px, 44px);
  font-weight: 900;
  color: rgba(240, 145, 78, 0.95);
  letter-spacing: 0.06em;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.4);
  position: relative;
  padding-bottom: 18px;
  transition: text-shadow 0.3s ease;
}

.doc-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, rgba(240, 145, 78, 0.9), rgba(240, 145, 78, 0));
  border-radius: 2px;
}

.doc-title:hover {
  text-shadow: 0 10px 26px rgba(240, 145, 78, 0.35),
               0 0 40px rgba(240, 145, 78, 0.1);
}

.doc-subtitle {
  margin: 72px 0 26px;
  font-family: "Georgia", "SimSun", "STSong", "Songti SC", serif;
  font-size: clamp(28px, 1.1vw + 22px, 36px);
  font-weight: 700;
  color: rgba(150, 232, 224, 0.92);
  letter-spacing: 0.04em;
  text-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
  position: relative;
  padding-left: 20px;
}

.doc-subtitle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 60%;
  min-height: 24px;
  border-radius: 3px;
  background: linear-gradient(180deg, rgba(150, 232, 224, 0.8), rgba(150, 232, 224, 0.2));
}

.doc-subtitle::after {
  content: "";
  display: block;
  width: 0;
  height: 2px;
  margin-top: 10px;
  background: linear-gradient(90deg, currentColor, transparent);
  opacity: 0.3;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
}

.doc-subtitle.is-visible::after {
  width: 120px;
}

.doc-paragraph {
  margin: 0;
  font-size: 1em;
  line-height: 2.15;
  color: rgba(232, 243, 243, 0.92);
  letter-spacing: 0.03em;
  text-indent: 2em;
  background: linear-gradient(135deg, rgba(14, 74, 72, 0.22) 0%, rgba(0, 0, 0, 0.18) 100%);
  border-left: 4px solid rgba(150, 232, 224, 0.35);
  padding: 22px 28px;
  border-radius: 0 16px 16px 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 4px solid rgba(150, 232, 224, 0.35);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: border-left-color 0.3s ease, background 0.3s ease;
}

.doc-paragraph:hover {
  border-left-color: rgba(240, 145, 78, 0.5);
  background: linear-gradient(135deg, rgba(14, 74, 72, 0.28) 0%, rgba(0, 0, 0, 0.22) 100%);
}

.doc-paragraph + .doc-paragraph {
  margin-top: 24px;
}

.doc-paragraph strong {
  color: rgba(240, 185, 120, 0.95);
  font-weight: 700;
}

@keyframes border-glow {
  0% { border-left-color: rgba(150, 232, 224, 0.1); }
  60% { border-left-color: rgba(150, 232, 224, 0.55); }
  100% { border-left-color: rgba(150, 232, 224, 0.35); }
}

.doc-paragraph.is-visible {
  animation: border-glow 1.2s ease forwards;
}

/* ========== Lists ========== */
.doc-list {
  margin: 14px 0 18px;
  padding-left: 1.4em;
  color: rgba(232, 243, 243, 0.9);
  line-height: 2.1;
}

.doc-list__item {
  margin: 14px 0 0;
  text-indent: 0;
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.doc-list.is-visible .doc-list__item {
  opacity: 1;
  transform: translateX(0);
}

.doc-list.is-visible .doc-list__item:nth-child(1) { transition-delay: 0.05s; }
.doc-list.is-visible .doc-list__item:nth-child(2) { transition-delay: 0.15s; }
.doc-list.is-visible .doc-list__item:nth-child(3) { transition-delay: 0.25s; }
.doc-list.is-visible .doc-list__item:nth-child(4) { transition-delay: 0.35s; }
.doc-list.is-visible .doc-list__item:nth-child(5) { transition-delay: 0.45s; }

.doc-list__item::marker {
  color: rgba(150, 232, 224, 0.5);
}

.doc-list__item strong {
  color: rgba(240, 185, 120, 0.95);
}

/* ========== Figures / Images ========== */
.doc-media--full {
  margin: 32px 0 38px;
  border-radius: 18px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--shadow2);
  cursor: zoom-in;
}

.doc-media--full img {
  width: 88%;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), filter 0.5s ease;
}

.doc-media--full:hover img {
  transform: scale(1.05);
  filter: brightness(1.08);
}

.doc-media__caption {
  padding: 16px 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.doc-media__caption strong {
  display: block;
  font-size: 0.95em;
  color: rgba(240, 185, 120, 0.95);
  margin-bottom: 6px;
}

.doc-media__caption span {
  display: block;
  font-size: 0.88em;
  color: rgba(169, 199, 198, 0.85);
  line-height: 1.7;
}

/* ========== Tables ========== */
.doc-tableWrap {
  margin-top: 22px;
  margin-bottom: 22px;
  border-radius: 20px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.26);
  box-shadow: var(--shadow2);
  -webkit-overflow-scrolling: touch;
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
}

.doc-table--compact {
  max-width: 500px;
  margin: 0 auto;
}

.doc-table th,
.doc-table td {
  padding: 18px 20px;
  text-align: center;
  vertical-align: top;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(232, 243, 243, 0.9);
  line-height: 1.9;
  text-indent: 0;
}

.doc-table th {
  font-weight: 800;
  color: rgba(210, 246, 244, 0.96);
  background: linear-gradient(90deg, rgba(14, 74, 72, 0.55), rgba(0, 0, 0, 0.15));
  position: sticky;
  top: 0;
  z-index: 1;
}

.doc-table tbody tr {
  transition: background 0.25s ease;
}

.doc-table tbody tr:nth-child(odd) td {
  background: rgba(255, 255, 255, 0.02);
}

.doc-table tbody tr:hover td {
  background: rgba(240, 145, 78, 0.08);
}

.cell-green {
  color: rgba(80, 220, 120, 0.95);
  font-weight: 700;
}

.cell-red {
  color: rgba(220, 80, 80, 0.7);
  font-weight: 600;
}

/* ========== State Grid ========== */
.state-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 24px 0 28px;
  justify-content: center;
}

.state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 128px;
  height: 84px;
  border-radius: 16px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}

.state-card:hover {
  transform: translateY(-3px);
}

.state-label {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
  margin-bottom: 2px;
}

.state-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.state-idle { background: rgba(148, 163, 184, 0.7); }
.state-repair { background: rgba(22, 163, 74, 0.7); }
.state-pa { background: rgba(234, 88, 12, 0.7); }
.state-sa { background: rgba(124, 58, 237, 0.7); }
.state-exit { background: rgba(220, 38, 38, 0.7); }

/* ========== Priority Chain ========== */
.priority-chain {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0 28px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.priority-item {
  padding: 8px 18px;
  border-radius: 20px;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}

.p-exit { background: rgba(220, 38, 38, 0.75); }
.p-pa { background: rgba(234, 88, 12, 0.75); }
.p-sa { background: rgba(124, 58, 237, 0.75); }
.p-repair { background: rgba(22, 163, 74, 0.75); }
.p-idle { background: rgba(148, 163, 184, 0.65); }

.priority-arrow {
  font-size: 1.2rem;
  font-weight: 700;
  color: rgba(150, 232, 224, 0.6);
}

/* ========== Highlight Box ========== */
.highlight-box {
  margin: 22px 0;
  padding: 18px 24px;
  border-radius: 16px;
  border-left: 4px solid rgba(240, 145, 78, 0.8);
  background: rgba(240, 145, 78, 0.08);
  color: rgba(240, 185, 120, 0.95);
  font-weight: 600;
  font-size: 1.05em;
  line-height: 1.7;
}

/* ========== Comparison Cards ========== */
.comparison-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0 28px;
}

.comp-card {
  border-radius: 18px;
  border: 1px solid rgba(150, 232, 224, 0.15);
  background: linear-gradient(160deg, rgba(10, 60, 58, 0.3) 0%, rgba(0, 0, 0, 0.25) 100%);
  padding: 22px 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.comp-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
}

.comp-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(150, 232, 224, 0.92);
  margin: 0 0 12px;
}

.comp-card ul {
  list-style: disc;
  padding-left: 18px;
  margin: 0;
}

.comp-card li {
  font-size: 0.92rem;
  margin-bottom: 6px;
  color: rgba(232, 243, 243, 0.78);
}

.comp-card li::marker {
  color: rgba(150, 232, 224, 0.5);
}

/* ========== Result Blocks ========== */
.result-blocks {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 24px 0 28px;
}

.result-block {
  border-radius: 18px;
  border: 1px solid rgba(150, 232, 224, 0.12);
  border-left: 4px solid rgba(150, 232, 224, 0.6);
  background: rgba(0, 0, 0, 0.22);
  padding: 18px 22px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.result-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.result-block h4 {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(150, 232, 224, 0.92);
  margin: 0 0 8px;
}

.result-block p {
  margin: 0;
  font-size: 0.95em;
  color: rgba(232, 243, 243, 0.78);
  text-indent: 0;
  line-height: 1.7;
}

.result-block p strong {
  color: rgba(240, 185, 120, 0.95);
}

/* ========== Phase Tags ========== */
.phase-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 18px 0 22px;
}

.phase-tag {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.92rem;
  font-weight: 600;
  background: rgba(150, 232, 224, 0.1);
  color: rgba(150, 232, 224, 0.92);
  border: 1px solid rgba(150, 232, 224, 0.2);
}

/* ========== References ========== */
.ref-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
  box-shadow: var(--shadow2);
}

.ref-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ref-wrapper:not(.is-expanded) .ref-list {
  max-height: var(--ref-collapsed-h, 210px);
  overflow: hidden;
}

.ref-wrapper.is-expanded .ref-list {
  max-height: none;
}

.ref-item {
  position: relative;
  padding: 14px 22px;
  margin: 0;
  font-size: 0.92em;
  line-height: 1.85;
  color: rgba(232, 243, 243, 0.82);
  text-indent: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease;
}

.ref-item:last-child {
  border-bottom: none;
}

.ref-item:hover {
  background: rgba(150, 232, 224, 0.04);
}

.ref-item em {
  color: rgba(150, 232, 224, 0.88);
  font-style: italic;
}

.ref-fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  height: 80px;
  background: linear-gradient(to bottom, rgba(4, 6, 6, 0), rgba(4, 6, 6, 0.95));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.ref-wrapper.is-expanded .ref-fade {
  opacity: 0;
}

.ref-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 22px;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.3);
  color: rgba(150, 232, 224, 0.92);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  font-family: inherit;
}

.ref-toggle:hover {
  background: rgba(240, 145, 78, 0.08);
  color: rgba(240, 185, 120, 0.95);
}

.ref-toggle__icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.3s ease;
  margin-top: -3px;
}

.ref-wrapper.is-expanded .ref-toggle__icon {
  transform: rotate(-135deg);
  margin-top: 3px;
}

/* ========== code ========== */
code {
  font-family: "Fira Code", "Consolas", monospace;
  font-size: 0.88em;
  background: rgba(150, 232, 224, 0.1);
  color: rgba(150, 232, 224, 0.95);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(150, 232, 224, 0.15);
}

/* ========== Formula Block ========== */
.doc-formula-block {
  margin: 1.6em 0;
  padding: 1.4em 2em;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.doc-formula-block mjx-container {
  margin: 0.45em 0 !important;
}

/* ========== Scroll Reveal ========== */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-left.is-visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-scale.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* ========== Image Lightbox ========== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  pointer-events: none;
  opacity: 0;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, opacity 0.4s ease;
  cursor: zoom-out;
}

.lightbox.is-open {
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  pointer-events: auto;
  opacity: 1;
}

.lightbox img {
  max-width: 90vw;
  max-height: 88vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  transform: scale(0.8);
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.4s ease;
}

.lightbox.is-open img {
  transform: scale(1);
  opacity: 1;
}

.lightbox__close {
  position: absolute;
  top: 28px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.8);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox__close:hover {
  background: rgba(240, 145, 78, 0.3);
  transform: rotate(90deg);
}

/* ========== Mouse Cursor Glow ========== */
.cursor-glow {
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(150, 232, 224, 0.14) 0%, rgba(150, 232, 224, 0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  will-change: left, top;
}

.cursor-glow.is-active {
  opacity: 1;
}

/* ========== Back to Top ========== */
.back-to-top {
  position: fixed;
  bottom: 36px;
  right: 36px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid rgba(150, 232, 224, 0.35);
  background: radial-gradient(circle at 40% 40%, rgba(20, 90, 86, 0.7), rgba(6, 30, 28, 0.8));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: rgba(150, 232, 224, 0.95);
  font-size: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  opacity: 0;
  transform: translateY(40px) scale(0.6);
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
              background 0.25s ease,
              border-color 0.25s ease,
              box-shadow 0.25s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.back-to-top::before {
  content: "";
  width: 14px;
  height: 14px;
  border-left: 2.5px solid rgba(150, 232, 224, 0.9);
  border-top: 2.5px solid rgba(150, 232, 224, 0.9);
  transform: rotate(45deg) translateY(4px);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              border-color 0.25s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.back-to-top:hover {
  background: radial-gradient(circle at 40% 40%, rgba(60, 120, 110, 0.8), rgba(20, 50, 48, 0.85));
  border-color: rgba(240, 145, 78, 0.6);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.4), 0 0 20px rgba(240, 145, 78, 0.15);
  transform: translateY(-3px) scale(1.08);
}

.back-to-top:hover::before {
  border-color: rgba(240, 185, 120, 1);
  transform: rotate(45deg) translateY(1px);
}

.back-to-top:active {
  transform: translateY(0) scale(0.95);
  transition-duration: 0.1s;
}

@keyframes btn-ring {
  0% { transform: scale(1); opacity: 0.6; }
  70% { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}

.back-to-top.is-visible::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(150, 232, 224, 0.4);
  animation: btn-ring 2.5s ease-out infinite;
  pointer-events: none;
  background: none;
}

.back-to-top:hover::after {
  animation: none;
  border-color: transparent;
  opacity: 0;
}

/* ========== Target Section Flash ========== */
@keyframes section-flash {
  0% { background: rgba(150, 232, 224, 0.08); }
  100% { background: transparent; }
}

.doc-section.is-targeted {
  animation: section-flash 1.5s ease forwards;
  border-radius: 12px;
}

/* ========== Responsive ========== */
@media (max-width: 1100px) {
  .nav {
    gap: 28px;
    margin-right: 22px;
  }
  .nav a {
    font-size: 20px;
  }
  .brand-word {
    font-size: 30px;
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: block;
  }
  .nav {
    position: absolute;
    right: 14px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px) saturate(1.35);
    -webkit-backdrop-filter: blur(20px) saturate(1.35);
  }
  .nav.is-open {
    display: flex;
  }

  .doc-layout {
    display: block;
    min-height: auto;
  }

  .doc-aside {
    position: relative;
    left: auto;
    top: auto;
    width: 100%;
    height: auto;
    opacity: 1;
    pointer-events: auto;
  }

  .doc-toc {
    max-height: none;
    overflow: visible;
  }

  #model-toc {
    min-height: auto;
    overflow: visible;
  }

  #model-toc .page-container {
    padding: 26px 22px 28px 0;
  }

  .doc-content {
    margin-left: 0;
    height: auto;
    overflow: visible;
    padding-left: 14px;
    padding-right: 14px;
  }

  .comparison-cards {
    grid-template-columns: 1fr;
  }
}
