/* ==========================================================================
   CHIACCOUNT // HOYOVERSE GAMES DOCS & SECURITY GUIDE
   Apple-grade White-Bluish Luxury Theme & Midnight Navy Dark Mode
   Genshin Impact • Honkai: Star Rail • Zenless Zone Zero
   ========================================================================== */

:root {
  /* Fonts */
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", Menlo, Monaco, Consolas, "Courier New", monospace;

  /* Ambient Canvas Colors (Light Mode - ChiAccount Signature) */
  --bg-base: #f8fbff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f6fc;
  --bg-hover: #eaf1fa;
  --bg-active: #e1ebf8;
  
  /* Borders */
  --border-light: rgba(0, 113, 227, 0.1);
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #0071e3;

  /* Typography */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --text-inverse: #ffffff;

  /* Brand Colors & Gradients */
  --chi-blue: #0071e3;
  --chi-blue-hover: #005bb5;
  --chi-blue-light: #e8f3fc;
  --chi-sky: #38bdf8;
  --chi-indigo: #4f46e5;
  --chi-grad: linear-gradient(135deg, #0056cb 0%, #0071e3 40%, #2563eb 75%, #38bdf8 100%);
  --chi-grad-subtle: linear-gradient(135deg, rgba(0, 113, 227, 0.08) 0%, rgba(56, 189, 248, 0.08) 100%);

  /* Game Accent Colors */
  --genshin-gold: #e5a93c;
  --genshin-bg: rgba(229, 169, 60, 0.1);
  --hsr-cyan: #3bc5e7;
  --hsr-bg: rgba(59, 197, 231, 0.1);
  --zzz-orange: #ff6800;
  --zzz-bg: rgba(255, 104, 0, 0.1);

  /* Status Accents */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --info: #0284c7;
  --info-bg: #f0f9ff;
  --info-border: #bae6fd;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 113, 227, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  --shadow-md: 0 4px 16px -2px rgba(0, 113, 227, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 16px 36px -8px rgba(0, 113, 227, 0.12), 0 4px 12px rgba(15, 23, 42, 0.04);

  /* Layout */
  --topbar-height: 64px;
  --sidebar-width: 300px;
  --toc-width: 240px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;

  /* Transitions */
  --trans: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   DARK THEME (Discord Official Dark Theme Palette)
   Deep #313338 Canvas, #2b2d31 Panels, #1e1f22 Insets, #5865f2 Blurple
   ========================================================================== */
[data-theme="dark"] {
  /* Discord Canvas & Surface Palette */
  --bg-base: #313338;             /* Discord Main Chat/Canvas */
  --bg-surface: #2b2d31;          /* Discord Channels & Cards */
  --bg-surface-elevated: #383a40; /* Discord Modals & Popovers */
  --bg-subtle: #1e1f22;           /* Discord Server Bar & Insets */
  --bg-hover: #35373c;            /* Discord Channel Hover */
  --bg-active: #404249;           /* Discord Selected Item */

  /* Discord Borders & Dividers */
  --border-light: rgba(255, 255, 255, 0.08);
  --border-subtle: #3f4147;
  --border-strong: #4e5058;
  --border-focus: #5865f2;

  /* Discord Typography */
  --text-primary: #f2f3f5;        /* Discord Header / Bright White */
  --text-secondary: #dbdee1;      /* Discord Main Body Text */
  --text-muted: #949ba4;          /* Discord Timestamp / Muted */
  --text-subtle: #80848e;         /* Discord Subtle Meta */
  --text-inverse: #111214;

  /* Discord Blurple Accent Colors */
  --chi-blue: #5865f2;            /* Discord Blurple */
  --chi-blue-hover: #4752c4;      /* Discord Blurple Hover */
  --chi-blue-light: rgba(88, 101, 242, 0.2);
  --chi-sky: #7289da;
  --chi-indigo: #5865f2;
  --chi-grad: linear-gradient(135deg, #5865f2 0%, #7289da 55%, #8ea1e1 100%);
  --chi-grad-subtle: linear-gradient(135deg, rgba(88, 101, 242, 0.16) 0%, rgba(114, 137, 218, 0.08) 100%);

  /* Game Accents in Discord Dark */
  --genshin-bg: rgba(229, 169, 60, 0.14);
  --hsr-bg: rgba(59, 197, 231, 0.14);
  --zzz-bg: rgba(255, 104, 0, 0.14);

  /* Discord Status Indicators */
  --success: #23a55a;             /* Discord Online Green */
  --success-bg: rgba(35, 165, 90, 0.16);
  --success-border: rgba(35, 165, 90, 0.35);
  --warning: #f0b232;             /* Discord Idle Yellow */
  --warning-bg: rgba(240, 178, 50, 0.16);
  --warning-border: rgba(240, 178, 50, 0.35);
  --danger: #f23f43;              /* Discord DND / Mention Red */
  --danger-bg: rgba(242, 63, 67, 0.18);
  --danger-border: rgba(242, 63, 67, 0.38);
  --info: #5865f2;
  --info-bg: rgba(88, 101, 242, 0.16);
  --info-border: rgba(88, 101, 242, 0.35);

  /* Discord Soft Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.45);
}

/* ==========================================================================
   BASE RESET
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-height) + 24px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  background-color: var(--bg-base);
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ==========================================================================
   AMBIENT AURORA BACKGROUND
   ========================================================================== */
.ambient-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.45;
  transform: translateZ(0);
}

.glow-1 {
  width: 500px;
  height: 500px;
  top: -100px;
  right: -50px;
  background: radial-gradient(circle, rgba(0, 113, 227, 0.25) 0%, rgba(56, 189, 248, 0) 70%);
}

.glow-2 {
  width: 600px;
  height: 600px;
  top: 35%;
  left: -200px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(56, 189, 248, 0) 70%);
}

/* Discord Dark Theme Ambient Glow */
[data-theme="dark"] .glow-orb {
  opacity: 0.25;
}
[data-theme="dark"] .glow-1 {
  background: radial-gradient(circle, rgba(88, 101, 242, 0.25) 0%, transparent 70%);
}
[data-theme="dark"] .glow-2 {
  background: radial-gradient(circle, rgba(114, 137, 218, 0.18) 0%, transparent 70%);
}

/* ==========================================================================
   TOPBAR NAVIGATION
   ========================================================================== */
.docs-topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-light);
  z-index: 50;
  transition: background 0.25s ease, border-color 0.25s ease;
}

[data-theme="dark"] .docs-topbar {
  background: rgba(43, 45, 49, 0.94);
  border-bottom: 1px solid #232428;
}

.topbar-container {
  max-width: 1560px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 113, 227, 0.2));
  transition: transform 0.25s ease;
}

.brand-section:hover .brand-logo {
  transform: scale(1.06) rotate(-3deg);
}

.brand-titles {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.brand-title span {
  background: var(--chi-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  background: var(--chi-blue-light);
  color: var(--chi-blue);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--trans);
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.topbar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  padding: 7px 12px;
  border-radius: var(--radius-md);
  transition: var(--trans);
}

.topbar-link:hover {
  color: var(--chi-blue);
  background: var(--chi-blue-light);
}

.topbar-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  background: #5865f2;
  color: #ffffff !important;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(88, 101, 242, 0.25);
  transition: var(--trans);
}

.topbar-discord-btn:hover {
  transform: translateY(-1px);
  background: #4752c4;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.35);
}

.mobile-menu-btn {
  display: none;
}

/* ==========================================================================
   APP LAYOUT (Sidebar + Main Docs + Right TOC)
   ========================================================================== */
.docs-layout {
  max-width: 1560px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  min-height: calc(100vh - var(--topbar-height));
  position: relative;
  z-index: 1;
}

/* SIDEBAR */
.docs-sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  padding: 24px 16px 40px;
  border-right: 1px solid var(--border-light);
  background: transparent;
}

.sidebar-group {
  margin-bottom: 24px;
}

.sidebar-title {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 12px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--trans);
  position: relative;
}

/* Game Icon in Sidebar */
.sidebar-game-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.sidebar-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.2s ease;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.sidebar-link:hover svg {
  color: var(--chi-blue);
}

.sidebar-link.active {
  color: var(--chi-blue);
  background: var(--chi-blue-light);
  font-weight: 700;
}

.sidebar-link.active svg {
  color: var(--chi-blue);
}

.badge-order {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  margin-left: auto;
}

.badge-critical {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-border);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* Sidebar support banner */
.sidebar-box {
  background: var(--chi-grad-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 20px;
}

.sidebar-box-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-box-p {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 10px;
}

.sidebar-box-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  font-size: 0.78rem;
  font-weight: 700;
  background: #5865f2;
  color: #ffffff;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: var(--trans);
}

.sidebar-box-btn:hover {
  background: #4752c4;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
.docs-main {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
  max-width: 920px;
}

/* Hero Section */
.docs-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 36px 36px 32px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.docs-hero::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 340px;
  height: 100%;
  background: radial-gradient(circle at 100% 0%, rgba(0, 113, 227, 0.09) 0%, transparent 70%);
  pointer-events: none;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--chi-blue);
  background: var(--chi-blue-light);
  border: 1px solid var(--border-light);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 14px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--chi-blue);
  box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.7);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(0, 113, 227, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 113, 227, 0); }
}

.docs-hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.docs-hero-title span {
  background: var(--chi-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.docs-hero-desc {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 720px;
  margin-bottom: 24px;
}

/* 3 HoYoverse Games Quick Badges */
.games-quick-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.game-badge-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.88rem;
  transition: var(--trans);
}

.game-badge-item:hover {
  background: var(--bg-hover);
  border-color: var(--chi-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.game-badge-img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

/* ==========================================================================
   TOO MANY REQUESTS & 3-7 DAYS SPECIAL PROTOCOL ALERT
   ========================================================================== */
.too-many-requests-card {
  background: var(--bg-surface);
  border: 2px solid #ef4444;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 32px 0 44px;
  box-shadow: 0 10px 30px -5px rgba(239, 68, 68, 0.15);
  position: relative;
  overflow: hidden;
}

.too-many-requests-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: #ef4444;
}

.tmr-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.tmr-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin: 0;
}

.tmr-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  background: #fee2e2;
  color: #b91c1c;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  white-space: nowrap;
}

[data-theme="dark"] .tmr-badge {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}

.tmr-title-text {
  white-space: nowrap;
}

.tmr-lead {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 16px;
}

.tmr-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}

.tmr-box {
  padding: 16px;
  border-radius: var(--radius-md);
}

.tmr-box.reason {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
}

.tmr-box.solution {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
}

.tmr-box-title {
  font-size: 0.92rem;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tmr-box.reason .tmr-box-title { color: var(--danger); }
.tmr-box.solution .tmr-box-title { color: var(--success); }

.tmr-box-p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ==========================================================================
   GAME CARD HEADERS & SECTIONS
   ========================================================================== */
.doc-section {
  margin-bottom: 60px;
  scroll-margin-top: calc(var(--topbar-height) + 24px);
}

.game-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.game-title-wrap {
  display: flex;
  align-items: center;
  gap: 16px;
}

.game-main-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.game-h2 {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.game-order-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--chi-blue);
  background: var(--chi-blue-light);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.doc-h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 28px 0 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.doc-p {
  font-size: 0.96rem;
  color: var(--text-secondary);
  line-height: 1.68;
  margin-bottom: 16px;
}

/* Step cards */
.step-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 20px 0;
}

.step-card {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--trans);
}

.step-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.step-number {
  width: 32px;
  height: 32px;
  background: var(--chi-blue-light);
  color: var(--chi-blue);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.step-content {
  flex: 1;
}

.step-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 5px;
}

.step-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* Callout Boxes */
.callout {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  margin: 20px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid transparent;
}

.callout-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 2px;
}

.callout-body {
  flex: 1;
}

.callout-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.callout-text {
  font-size: 0.88rem;
  line-height: 1.5;
}

.callout-danger {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: #991b1b;
}
[data-theme="dark"] .callout-danger { color: #fca5a5; }
.callout-danger .callout-title { color: var(--danger); }

.callout-warning {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: #92400e;
}
[data-theme="dark"] .callout-warning { color: #fde68a; }
.callout-warning .callout-title { color: var(--warning); }

.callout-success {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: #065f46;
}
[data-theme="dark"] .callout-success { color: #6ee7b7; }
.callout-success .callout-title { color: var(--success); }

/* Interactive Checklist */
.interactive-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin: 24px 0;
}

.checklist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.checklist-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.score-badge-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.score-progress-bar {
  width: 140px;
  height: 8px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.score-fill {
  height: 100%;
  width: 0%;
  background: var(--chi-grad);
  transition: width 0.35s ease;
  border-radius: var(--radius-full);
}

.score-text {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--chi-blue);
}

.checklist-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--trans);
}

.check-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

.check-item.completed {
  background: var(--success-bg);
  border-color: var(--success-border);
}

.check-item.completed .check-label {
  text-decoration: line-through;
  color: var(--text-muted);
}

.check-box {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--border-strong);
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--trans);
}

.check-item.completed .check-box {
  background: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.check-info {
  flex: 1;
}

.check-label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.check-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.checklist-reset {
  margin-top: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
  transition: color 0.2s ease;
}

.checklist-reset:hover {
  color: var(--danger);
}

/* ==========================================================================
   TABLE OF CONTENTS (RIGHT SIDEBAR)
   ========================================================================== */
.docs-toc {
  width: var(--toc-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--topbar-height);
  height: calc(100vh - var(--topbar-height));
  overflow-y: auto;
  padding: 36px 16px 40px;
  border-left: 1px solid var(--border-light);
  display: block;
}

.toc-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-link {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  display: block;
  transition: var(--trans);
  border-left: 2px solid transparent;
}

.toc-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.toc-link.active {
  color: var(--chi-blue);
  border-left-color: var(--chi-blue);
  font-weight: 600;
  background: var(--chi-blue-light);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.docs-footer {
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
  padding: 36px 24px;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1560px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.footer-copy {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-links a {
  font-size: 0.84rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--chi-blue);
}

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1200px) {
  .docs-toc {
    display: none;
  }
  .docs-main {
    max-width: 100%;
  }
}

@media (max-width: 860px) {
  .docs-sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--topbar-height));
    background: var(--bg-surface);
    border-right: 1px solid var(--border-light);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 45;
  }

  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .docs-main {
    padding: 24px 20px 60px;
  }

  .docs-hero {
    padding: 24px 20px;
  }

  .docs-hero-title {
    font-size: 1.7rem;
  }

  .tmr-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .topbar-container {
    padding: 0 16px;
  }

  .brand-title {
    font-size: 1rem;
  }

  .brand-badge {
    display: none;
  }
}
