/* ==========================================================================
   ALPHA GAME v7.0.0 · CLAUDE.DEV RETRO-MODERN PIXEL TECH DESIGN SYSTEM
   Standard: Benchmark claude.dev (Anthropic Claude Code Blog/Terminal) + Cursor
   Palette: Warm Obsidian Charcoal (#121211, #181816, #20201d) & Ivory White (#faf9f5)
   Aesthetic: Subtle Pixel Art Accents, Crisp-Edges Pixelgrams, Tactile Animations
   Updated: 2026-10-10 - v7.0 production ready with error handling and enhanced health monitoring
   ========================================================================== */

/* 字体由各页 <head> 的 preconnect + link 加载，禁止在此使用 @import：
   CSS @import 会形成 HTML → CSS → 字体 CSS → 字体文件 的四级阻塞瀑布。 */

:root {
  /* Typography - Old Money & Quiet Luxury Serif System */
  --font-old-money: 'Cinzel', 'Playfair Display', 'Noto Serif SC', serif;
  --font-serif-luxury: 'Noto Serif SC', 'Playfair Display', 'Lora', 'Songti SC', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --font-serif: 'Noto Serif SC', 'Playfair Display', 'Lora', 'Songti SC', serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-pixel: 'Press Start 2P', monospace;
  --font-pixel-clean: 'Silkscreen', monospace;

  /* Surfaces - claude.dev Warm Obsidian Charcoal Scale */
  --bg-canvas: #141413;
  --bg-rail: #10100f;
  --bg-sidebar: #181816;
  --bg-surface: #1d1c1a;
  --bg-surface-elevated: #242320;
  --bg-surface-hover: #2b2a26;
  --bg-surface-active: #34332e;

  /* Subtle Hairline Borders */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.14);
  --border-strong: rgba(255, 255, 255, 0.25);

  /* Typography Colors - claude.dev Ivory & Warm Slate */
  --text-primary: #faf9f5;
  --text-secondary: #b4b2a9;
  --text-muted: #7c7a72;
  --text-subtle: #55534c;

  /* Accents - High-contrast Monochrome Black & White */
  --accent-white: #ffffff;
  --accent-emerald: #ffffff;
  --accent-amber: #ffffff;
  --accent-terracotta: #ffffff;
  --accent-purple: #ffffff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  min-height: 100vh;
  background-color: #08080a;
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.07) 0%, transparent 60%),
    radial-gradient(circle at 10% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 40%),
    radial-gradient(circle at 90% 70%, rgba(255, 255, 255, 0.02) 0%, transparent 40%),
    radial-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 28px 28px;
  background-attachment: fixed;
  color: var(--text-primary);
  position: relative;
}

/* 微胶片沉浸噪点颗粒（消除塑料数码感，呈现老钱雅致质感） */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.035'/%3E%3C/svg%3E");
  z-index: 9999;
  opacity: 0.55;
}

.font-old-money {
  font-family: var(--font-old-money) !important;
  letter-spacing: 0.07em;
}

.font-serif-luxury {
  font-family: var(--font-serif-luxury) !important;
}

.brand-wordmark-inline {
  display: inline-block;
  height: 1.25rem;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 6px rgba(255, 255, 255, 0.25));
  transition: all 0.25s ease;
  vertical-align: middle;
}

.brand-wordmark-stacked {
  display: inline-block;
  height: 2.5rem;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 10px rgba(255, 255, 255, 0.3));
  transition: all 0.25s ease;
}

.font-mono {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #282824;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a3a34;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* ==========================================================================
   1. CLAUDE.DEV KEYBOARD NAVIGATION & RETRO PIXEL ELEMENTS
   ========================================================================== */

.nav-key-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  padding: 4px 9px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.nav-key-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-key-item.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-bottom: 2px solid var(--accent-emerald);
}

.nav-key-item .k {
  color: var(--accent-emerald);
  font-size: 10px;
  opacity: 0.9;
  letter-spacing: -0.5px;
}

/* 2. Pixel Mascot & Sprites (shape-rendering: crispEdges) */
.pixel-sprite {
  shape-rendering: crispEdges;
}

.pixel-mascot {
  shape-rendering: crispEdges;
  filter: drop-shadow(0 4px 10px rgba(255, 255, 255, 0.15));
  animation: pixelFloat 3.6s ease-in-out infinite;
  display: inline-block;
}

@keyframes pixelFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

.pixel-glint {
  animation: visorGlint 3.8s ease-in-out infinite;
}

@keyframes visorGlint {
  0%, 88%, 100% {
    opacity: 0.3;
  }
  92% {
    opacity: 1;
    filter: drop-shadow(0 0 4px #ffffff);
  }
  96% {
    opacity: 0.5;
  }
}

/* 3. Pixel Corner Badges & Reticles */
.pixel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.2px;
}

.pixel-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-secondary);
  background: #1e1e1b;
  border: 1px solid rgba(255, 255, 255, 0.06);
}



/* Pixel Box Reticle */
.pixel-box {
  position: relative;
}

.pixel-box::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 4px;
  height: 4px;
  background: var(--accent-emerald);
}

.pixel-box::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 4px;
  height: 4px;
  background: var(--accent-emerald);
}

/* ==========================================================================
   PIXEL LOGO UI SYSTEM (Native Vector & 8-Bit Typography, No Blurry JPEGs)
   ========================================================================== */
.font-pixel-arcade {
  font-family: var(--font-pixel), monospace;
}

.font-pixel-clean {
  font-family: var(--font-pixel-clean), monospace;
}

.pixel-logo-emblem {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #090a0f;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 4px;
  image-rendering: pixelated;
  box-shadow: 
    inset 1px 1px 0 rgba(255, 255, 255, 0.22),
    inset -1px -1px 0 rgba(0, 0, 0, 0.8),
    0 2px 6px rgba(0, 0, 0, 0.5);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  flex-shrink: 0;
}

.pixel-logo-emblem::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0),
    rgba(255, 255, 255, 0) 50%,
    rgba(0, 0, 0, 0.35) 50%,
    rgba(0, 0, 0, 0.35)
  );
  background-size: 100% 4px;
  opacity: 0.35;
  border-radius: inherit;
  z-index: 1;
}

.pixel-logo-emblem svg {
  position: relative;
  z-index: 2;
  shape-rendering: crispEdges;
}

.pixel-logo-emblem img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.agent-logo-badge {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.agent-logo-badge:hover {
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.18);
}

.agent-logo-badge img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pixel-logo-emblem:hover,
.group:hover .pixel-logo-emblem {
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 
    inset 1px 1px 0 rgba(255, 255, 255, 0.35),
    inset -1px -1px 0 rgba(0, 0, 0, 0.9),
    0 4px 14px rgba(204, 120, 92, 0.28);
}

.pixel-brand-title {
  font-family: var(--font-pixel), monospace;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 1.4px;
  color: #faf9f5;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
  transition: all 0.2s ease;
}

.group:hover .pixel-brand-title {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 18px rgba(204, 120, 92, 0.5);
}

.pixel-tag-pill {
  font-family: var(--font-pixel), monospace;
  font-size: 7.5px;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #a1a1aa;
  letter-spacing: 0.6px;
}

/* ==========================================================================
   2. SURFACES, CARDS & TACTILE ANIMATIONS
   ========================================================================= */

.card-charcoal {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.card-charcoal:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px -10px rgba(0, 0, 0, 0.6);
}

/* Tactile Primary Button */
.btn-primary {
  background: var(--accent-white);
  color: #121211;
  font-weight: 500;
  font-size: 12px;
  padding: 7px 15px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-primary:hover {
  background: #eae7df;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.99);
}

.btn-secondary {
  background: #1a1a17;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 12px;
  padding: 7px 15px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-medium);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(1.5px) scale(0.985);
}

/* Universal Tactile Mechanical Press State */
button:active, 
.btn-primary:active, 
.btn-secondary:active, 
.home-demo-pill:active, 
.nav-key-item:active, 
.palette-cat-pill:active, 
.palette-course-item:active {
  transform: translateY(1.5px) scale(0.985) !important;
}

/* Badges */
.badge-emerald,
.badge-mono {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Topbar Context Button */
.topbar-book-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.topbar-book-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-medium);
}

/* Hint Grid & Cards */
.hint-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  max-width: 760px;
  margin: 0 auto;
}

@media (max-width: 640px) {
  .hint-grid {
    grid-template-columns: 1fr;
  }
}

.hint-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 11px 13px;
  text-align: left;
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.hint-card:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.5);
}

/* Chat Stream Messages */
.chat-stream {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg-row {
  display: flex;
  width: 100%;
}

.msg-row.user {
  justify-content: flex-end;
}

.msg-row.bot {
  justify-content: flex-start;
}

.user-bubble {
  max-width: 82%;
  background: #1f1f1b;
  color: #ffffff;
  padding: 11px 15px;
  border-radius: 13px;
  border-bottom-right-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.bot-card {
  max-width: 92%;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.06) 0%, rgba(18, 18, 22, 0.88) 100%) !important;
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  border-bottom-left-radius: 3px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: cardFadeUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.bot-card:hover {
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 20px 48px -12px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

@keyframes cardFadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.ref-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.tactical-option-card {
  background: #141412;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  transition: all 0.15s ease;
}

.tactical-option-card:hover {
  background: #1a1a17;
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(1px);
}

/* Session History Items */
.hist-item {
  padding: 7px 9px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-secondary);
  transition: all 0.14s ease;
  font-size: 12px;
}

.hist-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.hist-item.active {
  background: #1e1e1b;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

/* Knowledge Panel Rows */
.asset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: #141412;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.asset-row:hover {
  background: #1b1b18;
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateX(2px);
}

.chapter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 9px;
  background: #141412;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.chapter-row:hover {
  background: #1b1b18;
  border-color: rgba(255, 255, 255, 0.12);
}

/* ==========================================================================
   3. COMMAND PALETTE & MODALS
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100 !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active {
  display: flex !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.modal-box {
  background-color: #0c0c10 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.95), 0 0 50px rgba(0, 0, 0, 0.8);
  transform: scale(0.97);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-box {
  transform: scale(1);
}

.palette-box {
  background: #151513;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  box-shadow: 0 30px 70px -15px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.04);
  transform: scale(0.97);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.active .palette-box {
  transform: scale(1);
}

.palette-cat-pill {
  padding: 3px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 11px;
  font-family: var(--font-mono);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.14s ease;
}

.palette-cat-pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.palette-cat-pill.active {
  background: #faf9f5;
  color: #121211;
  font-weight: 600;
  border-color: #faf9f5;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.palette-item:hover, .palette-item.focused {
  background: #1d1d19;
  border-color: rgba(255, 255, 255, 0.09);
}

.palette-item.is-mounted {
  background: rgba(16, 185, 129, 0.04);
  border-color: rgba(16, 185, 129, 0.2);
}

.scrollbar-thin::-webkit-scrollbar {
  width: 4px;
}
.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}
.scrollbar-thin::-webkit-scrollbar-thumb {
  background: #2b2b26;
  border-radius: 999px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: #1a1a17;
  color: #faf9f5;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  padding: 8px 14px;
  font-size: 12px;
  font-family: var(--font-mono);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Homepage Interactive Demo Pills */
.home-demo-pill {
  padding: 5px 12px;
  border-radius: 6px;
  background: #171714;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d1cfc7;
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.14s ease;
}

.home-demo-pill:hover {
  background: #22221e;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.home-demo-pill:active {
  transform: translateY(1px);
}

/* Responsive Knowledge Panel Behavior */
@media (max-width: 1024px) {
  #knowledgePanel {
    position: fixed;
    right: 0;
    top: 45px;
    bottom: 0;
    z-index: 30;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
  }
}

#knowledgePanel.panel-collapsed {
  display: none !important;
}

/* ==========================================================================
   4. CONSULTATION MODAL & CARDS (屿 ISLAND BENCHMARK)
   ========================================================================== */
.consult-card {
  background: #151513;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.consult-card:hover {
  background: #191916;
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-2px);
}

.qr-frame {
  background: #ffffff;
  padding: 8px;
  border-radius: 12px;
  display: inline-block;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-family: var(--font-sans);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.14s ease;
  cursor: pointer;
}
.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}
.sidebar-nav-item.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 500;
}

/* ==========================================================================
   5. SERIF TYPOGRAPHY & MULTI-PANE COCKPIT (CLAUDE DESIGN & KIRO/WEKNORA BENCHMARK)
   ========================================================================== */
.font-serif {
  font-family: var(--font-serif) !important;
}

.editorial-heading {
  font-family: var(--font-serif) !important;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: #faf9f5;
}

.insight-prose {
  font-family: var(--font-serif) !important;
  font-size: 13px;
  line-height: 1.68;
  color: #eae8e1;
}

/* Multi-Pane Cockpit Architecture */
.cockpit-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--bg-canvas);
}

/* ==========================================================================
   VIBECAFE-INSPIRED MINIMALIST SIDEBAR (240px Fixed, Flyouts & Floating Widget)
   ========================================================================== */
.vibe-sidebar-fixed {
  width: 240px;
  background-color: #09090b !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 12px;
  z-index: 50;
  transition: width 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.vibe-sidebar-fixed.collapsed {
  width: 64px !important;
}

.vibe-sidebar-fixed.collapsed .vibe-sidebar-text,
.vibe-sidebar-fixed.collapsed .vibe-sidebar-chevron,
.vibe-sidebar-fixed.collapsed .vibe-sidebar-badge,
.vibe-sidebar-fixed.collapsed .vibe-profile-info {
  display: none !important;
}

.vibe-sidebar-fixed.collapsed .vibe-nav-link {
  justify-content: center;
  padding: 8px 0;
}

.vibe-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: #a1a1aa;
  text-decoration: none;
  transition: all 0.16s ease;
  position: relative;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
}

.vibe-nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.06);
}

.vibe-nav-link.active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.12);
  font-weight: 600;
}

.vibe-badge-beta {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.28);
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 4px;
}

/* Floating Submenu Popover Card */
.vibe-flyout-menu {
  position: absolute;
  left: calc(100% + 8px);
  top: 0;
  width: 196px;
  background: #0d0d11;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.88);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 60;
}

.vibe-flyout-trigger:hover .vibe-flyout-menu,
.vibe-flyout-trigger:focus-within .vibe-flyout-menu,
.vibe-flyout-menu:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.vibe-flyout-item {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: #d4d4d8;
  font-family: var(--font-mono);
  text-decoration: none;
  transition: all 0.15s ease;
}

.vibe-flyout-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Main Container Adjustment when Vibe Sidebar is present */
.has-vibe-sidebar {
  padding-left: 240px;
  transition: padding-left 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.has-vibe-sidebar.sidebar-collapsed {
  padding-left: 64px !important;
}

@media (max-width: 767px) {
  .has-vibe-sidebar {
    padding-left: 0 !important;
  }
}

/* ==========================================================================
   AUTO-EXPANDING BLACK & WHITE SIDEBAR (Hover Reveal Text + SVG)
   ========================================================================== */
#globalLeftRail,
.global-rail,
.cockpit-rail {
  width: 56px;
  background-color: #08080a !important;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 7px;
  flex-shrink: 0;
  z-index: 60;
  overflow: hidden;
  white-space: nowrap;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s ease, background-color 0.22s ease;
  user-select: none;
}

#globalLeftRail:hover,
.global-rail:hover,
.cockpit-rail:hover {
  width: 204px !important;
  background-color: #0c0c0e !important;
  border-right-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: 14px 0 36px rgba(0, 0, 0, 0.88);
}

.rail-nav-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.rail-btn,
.rail-item {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  color: #a1a1aa;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  text-decoration: none;
  overflow: hidden !important;
  flex-shrink: 0;
}

#globalLeftRail:hover .rail-btn,
#globalLeftRail:hover .rail-item,
.global-rail:hover .rail-btn,
.global-rail:hover .rail-item,
.cockpit-rail:hover .rail-btn,
.cockpit-rail:hover .rail-item {
  width: 100%;
  padding: 0 10px;
}

.rail-icon {
  width: 40px !important;
  min-width: 40px !important;
  height: 40px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0 !important;
  color: inherit;
}

.rail-icon svg,
.rail-btn svg,
.rail-item svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
  color: inherit;
  flex-shrink: 0;
}

/* 文字标签：默认收缩，hover 展开显示 */
.rail-label {
  display: inline-block !important;
  opacity: 0;
  max-width: 0px !important;
  width: 0px !important;
  margin-left: 0;
  overflow: hidden !important;
  white-space: nowrap !important;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2px;
  color: inherit;
  transition: opacity 0.18s ease, max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), margin-left 0.18s ease, width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

#globalLeftRail:hover .rail-label,
.global-rail:hover .rail-label,
.cockpit-rail:hover .rail-label {
  opacity: 1;
  max-width: 135px !important;
  width: auto !important;
  margin-left: 6px;
  pointer-events: auto;
}

/* Hover 状态：极简黑白高光 */
.rail-btn:hover,
.rail-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.12);
}

/* 激活态（Active）：纯白高光黑白反色，无任何绿色 */
.rail-btn.active,
.rail-item.active {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 600;
  border-color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.18);
}

.rail-btn.active svg,
.rail-btn.active .rail-icon svg,
.rail-item.active svg,
.rail-item.active .rail-icon svg {
  color: #000000 !important;
  stroke: #000000 !important;
}

/* 隐藏旧 tooltip */
.rail-tooltip {
  display: none !important;
}

/* Logo 区展开文字 */
.rail-logo-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 3px;
  border-radius: 8px;
  text-decoration: none;
  overflow: hidden;
  color: #ffffff;
}

.rail-logo-text {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  opacity: 0;
  max-width: 0px !important;
  width: 0px !important;
  margin-left: 0;
  overflow: hidden !important;
  white-space: nowrap !important;
  font-family: var(--font-old-money);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: #ffffff;
  transition: opacity 0.18s ease, max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), margin-left 0.18s ease, width 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.rail-logo-text .brand-wordmark-inline {
  height: 13px;
  width: auto;
  max-width: 105px;
  object-fit: contain;
}

#globalLeftRail:hover .rail-logo-text,
.global-rail:hover .rail-logo-text,
.cockpit-rail:hover .rail-logo-text {
  opacity: 1;
  max-width: 145px !important;
  width: auto !important;
  margin-left: 8px;
}

.cockpit-sidebar {
  width: 250px;
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 20;
}

.cockpit-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background-color: var(--bg-canvas);
  overflow: hidden;
}

.metric-pill-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 14px;
  transition: all 0.15s ease;
}
.metric-pill-card:hover {
  border-color: var(--border-medium);
  background: var(--bg-surface-elevated);
}

.pixel-mascot {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ==========================================================================
   ALPHA GAME · HACKERTRIP PORTAL & BLACK HOLE COSMIC SYSTEM
   ========================================================================== */

.blackhole-hero {
  position: relative;
  background-color: #000000;
  overflow: hidden;
}

.blackhole-image-wrap {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.blackhole-image-wrap picture,
.blackhole-image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 44%;
  transform: scale(1.0);
  filter: brightness(0.96) contrast(1.06);
  image-rendering: -webkit-optimize-contrast;
  will-change: transform;
}

.cosmic-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 48%, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.55) 45%, #000000 88%),
              linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, transparent 20%, transparent 70%, #000000 100%);
  z-index: 2;
}

/* Hackertrip-inspired Portal Cards */
.portal-card {
  position: relative;
  background: rgba(8, 8, 10, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portal-card::before {
  content: '';
  position: absolute;
  inset-inline: 0;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(204, 120, 92, 0.6), transparent);
  opacity: 0.4;
  transition: opacity 0.25s ease;
}

.portal-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-3px);
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.8), 0 0 25px rgba(204, 120, 92, 0.09);
}

.portal-card:hover::before {
  opacity: 1;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.8), transparent);
}

.portal-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #b4b2a9;
}

.portal-badge-green {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.portal-badge-terracotta {
  background: rgba(204, 120, 92, 0.12);
  border-color: rgba(204, 120, 92, 0.3);
  color: #f59e0b;
}

.portal-badge-purple {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.3);
  color: #a78bfa;
}

/* Hackertrip Terminal Preview Box */
.terminal-preview-box {
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
}

/* Stat Pill */
.hero-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono);
  font-size: 11px;
  color: #d4d4d8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  transition: all 0.15s ease;
}
.hero-stat-pill:hover {
  background: rgba(18, 18, 22, 0.9);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

/* ==========================================================================
   LIQUID GLASS DESIGN SYSTEM (液态玻璃高奢拟物质感)
   ========================================================================== */
.liquid-glass {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 40%, rgba(12, 12, 16, 0.75) 100%);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 
    0 16px 40px -10px rgba(0, 0, 0, 0.85),
    0 4px 14px -2px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.4);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.liquid-glass:hover {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 
    0 22px 50px -12px rgba(0, 0, 0, 0.92),
    0 8px 20px -2px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.45);
}

.liquid-glass-elevated {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.11) 0%, rgba(20, 20, 26, 0.82) 45%, rgba(8, 8, 10, 0.94) 100%);
  backdrop-filter: blur(32px) saturate(210%);
  -webkit-backdrop-filter: blur(32px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 
    0 24px 60px -12px rgba(0, 0, 0, 0.9),
    0 8px 24px -4px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 0 rgba(0, 0, 0, 0.5);
}

.liquid-glass-pill {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 4px 12px rgba(0, 0, 0, 0.5);
}

.liquid-glass-input {
  background: rgba(0, 0, 0, 0.65) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}
.liquid-glass-input:focus {
  border-color: rgba(255, 255, 255, 0.35) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 16px rgba(255, 255, 255, 0.12) !important;
}

/* ==========================================================================
   THINK 深度思考动效 (Thinking Engine Animation)
   ========================================================================== */
.think-container {
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(14, 14, 18, 0.85) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 10px 28px -6px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  margin-bottom: 12px;
  transition: all 0.22s ease;
}

.think-container:hover {
  border-color: rgba(255, 255, 255, 0.18);
}

.think-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid transparent;
  transition: background 0.18s ease;
}
.think-header:hover {
  background: rgba(255, 255, 255, 0.05);
}
.think-container.expanded .think-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.think-pulse-orb {
  position: relative;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.think-pulse-orb .core {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px #ffffff;
}
.think-pulse-orb.thinking .ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  animation: think-ripple 1.6s cubic-bezier(0, 0.2, 0.8, 1) infinite;
}

@keyframes think-ripple {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(1.9); opacity: 0; }
}

.think-shimmer-text {
  background: linear-gradient(90deg, #888888 0%, #ffffff 50%, #888888 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: think-shimmer 2.2s infinite linear;
  font-family: var(--font-mono);
  font-weight: 600;
}

@keyframes think-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.think-steps-list {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.35);
}

.think-step-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9ca3af;
  transition: all 0.2s ease;
}
.think-step-row.active {
  color: #ffffff;
  font-weight: 500;
}
.think-step-row.done {
  color: #d1d5db;
}

.think-step-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}
.think-step-row.active .think-step-dot {
  background: #ffffff;
  box-shadow: 0 0 6px #ffffff;
  animation: pulse-dot 1s infinite alternate;
}
.think-step-row.done .think-step-dot {
  background: #ffffff;
}

@keyframes pulse-dot {
  0% { transform: scale(0.85); opacity: 0.6; }
  100% { transform: scale(1.3); opacity: 1; }
}

.think-body {
  padding: 12px 14px;
  font-size: 11px;
  line-height: 1.7;
  color: #c4c4c8;
  font-family: var(--font-mono);
  background: rgba(4, 4, 6, 0.6);
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  max-height: 240px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.think-duration-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e4e4e7;
}

/* ==========================================================================
   ADMIN SETTINGS & LOCAL API MODAL (后台管理员设置)
   ========================================================================== */
.admin-modal-box {
  background: linear-gradient(145deg, rgba(22, 22, 28, 0.95) 0%, rgba(10, 10, 14, 0.98) 100%);
  backdrop-filter: blur(36px) saturate(220%);
  -webkit-backdrop-filter: blur(36px) saturate(220%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 
    0 28px 70px -15px rgba(0, 0, 0, 0.95),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  border-radius: 20px;
}

.admin-mode-pill {
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 500;
  transition: all 0.18s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: #a1a1aa;
}
.admin-mode-pill.active {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.18);
}

.ping-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d4d4d8;
}
.ping-status-badge.online {
  background: rgba(255, 255, 255, 0.12);
  border-color: #ffffff;
  color: #ffffff;
}
.ping-status-badge.error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}
/* ==========================================================================
   MARKDOWN BODY & HIGH-END EDITORIAL TYPOGRAPHY (专栏长文与博客高奢排版)
   ========================================================================== */
.markdown-body {
  color: #d6d6dc;
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.85;
  letter-spacing: 0.015em;
  word-break: break-word;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
  color: #ffffff;
  font-family: var(--font-serif-luxury);
  font-weight: 700;
  line-height: 1.4;
  margin-top: 1.8em;
  margin-bottom: 0.75em;
  letter-spacing: -0.01em;
}

.markdown-body h1 {
  font-size: 1.65rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.45em;
}

.markdown-body h2 {
  font-size: 1.35rem;
  border-left: 3px solid #ffffff;
  padding-left: 0.65rem;
  margin-top: 1.9em;
}

.markdown-body h3 {
  font-size: 1.15rem;
  color: #f4f4f5;
}

.markdown-body h4 {
  font-size: 1rem;
  color: #e4e4e7;
}

.markdown-body p {
  margin-bottom: 1.25em;
  color: #cfd0d6;
}

.markdown-body strong {
  color: #ffffff;
  font-weight: 700;
}

.markdown-body em {
  color: #e4e4e7;
  font-style: italic;
  font-family: var(--font-serif-luxury);
}

.markdown-body blockquote {
  margin: 1.6em 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
  border-left: 3px solid #ffffff;
  border-radius: 0 12px 12px 0;
  color: #e5e5eb;
  font-style: normal;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

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

.markdown-body ul,
.markdown-body ol {
  margin: 1.1em 0;
  padding-left: 1.4rem;
}

.markdown-body ul {
  list-style-type: disc;
}

.markdown-body ol {
  list-style-type: decimal;
}

.markdown-body li {
  margin-bottom: 0.5em;
  color: #cfd0d6;
}

.markdown-body hr {
  margin: 2.2em 0;
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.16) 50%, transparent 100%);
}

.markdown-body code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.18em 0.45em;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #ffffff;
}

.markdown-body pre {
  margin: 1.5em 0;
  padding: 1.1rem 1.25rem;
  background: #09090d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow-x: auto;
}

.markdown-body pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
  color: #e4e4e7;
}

.markdown-body a {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 255, 255, 0.35);
  transition: all 0.2s ease;
}

.markdown-body a:hover {
  text-decoration-color: #ffffff;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.88rem;
  font-family: var(--font-mono);
}

.markdown-body th,
.markdown-body td {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.markdown-body th {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  font-weight: 600;
}

.markdown-body tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.markdown-body img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin: 1.6em auto;
  display: block;
  box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.8);
}

/* ==========================================================================
   ARTICLE CARDS & HERO EDITORIAL STYLES
   ========================================================================== */
.article-card {
  background: linear-gradient(180deg, rgba(20, 20, 26, 0.8) 0%, rgba(11, 11, 15, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  overflow: hidden;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-3px);
  box-shadow: 0 20px 42px -12px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.article-cover-wrap {
  position: relative;
  width: 100%;
  height: 190px;
  overflow: hidden;
  background-color: #0b0b0e;
}

.article-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(40%) contrast(108%);
  transition: transform 0.5s ease, filter 0.5s ease;
}

.article-card:hover .article-cover-img {
  transform: scale(1.04);
  filter: grayscale(15%) contrast(112%);
}

.article-cover-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 6, 8, 0.1) 0%, rgba(10, 10, 14, 0.85) 100%);
}

/* Markdown Toolbar for Post Creator */
.md-toolbar-btn {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #a1a1aa;
  font-family: var(--font-mono);
  font-size: 11px;
  transition: all 0.16s ease;
}

.md-toolbar-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}


/* 强制正方形 logo/avatar 容器 */

.logo-avatar-square {
  width: 56px !important;
  height: 56px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 10px !important;
  overflow: hidden !important;
}
.logo-avatar-square img,
.logo-avatar-square svg {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center !important;
}

/* ==========================================================================
   SITE SHELL · 全站统一顶部导航栏（2026-10-22）
   目标：9 个页面共享同一套 shell，消除侧栏体系分裂与布局跳变
   规范：0 破折号 / 0 Emoji
   ========================================================================== */

:root {
  --shell-h: 72px;
  --shell-h-mobile: 64px;
  --shell-bg: rgba(8, 8, 10, 0.88);
  --shell-border: rgba(255, 255, 255, 0.07);
  --shell-container-max: 1280px;
  --shell-bg-canvas: #08080a;
}

.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--shell-h);
  background: var(--shell-bg);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--shell-border);
  z-index: 50;
}

.site-nav-inner {
  max-width: var(--shell-container-max);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 20px;
}

.site-nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}

.site-nav-brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #101014;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif-luxury);
  font-size: 15px;
  font-weight: 700;
  color: #faf9f5;
  line-height: 1;
}

.site-nav-brand-text {
  font-family: var(--font-serif-luxury);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #faf9f5;
  line-height: 1;
  white-space: nowrap;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 100%;
}

.site-nav-link {
  position: relative;
  font-size: 13px;
  font-weight: 400;
  color: #9a9aa2;
  text-decoration: none;
  padding: 6px 0;
  transition: color 0.18s ease;
  white-space: nowrap;
}

.site-nav-link:hover {
  color: #ffffff;
}

.site-nav-link.is-active {
  color: #ffffff;
  font-weight: 600;
}

.site-nav-link.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
}

.site-nav-link.is-utility {
  color: #5f5f66;
  font-size: 12px;
}

.site-nav-link.is-utility:hover {
  color: #b4b2a9;
}

.site-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 16px;
  border-radius: 9999px;
  background: #faf9f5;
  color: #0a0a0c;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.site-nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(255, 255, 255, 0.14);
}

.site-nav-cta:active {
  transform: translateY(0);
}

/* 移动端汉堡 */
.site-nav-burger {
  display: none;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #faf9f5;
  cursor: pointer;
}

/* 移动端下拉面板 */
.site-nav-mobile {
  display: none;
  position: fixed;
  top: var(--shell-h-mobile);
  left: 0;
  right: 0;
  background: rgba(8, 8, 10, 0.98);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--shell-border);
  z-index: 49;
  padding: 14px 20px 20px;
  flex-direction: column;
  gap: 4px;
}

.site-nav-mobile.is-open {
  display: flex;
}

.site-nav-mobile .site-nav-link {
  padding: 12px 4px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.site-nav-mobile .site-nav-link.is-active::after {
  display: none;
}

.site-nav-mobile .site-nav-link.is-active {
  color: #ffffff;
}

/* 主区让位（统一上内距） */
body.site-shell {
  padding-top: calc(var(--shell-h) + 20px);
  background-color: var(--shell-bg-canvas) !important;
  color: #faf9f5;
}

/* 小屏适配 */
@media (max-width: 1023px) {
  .site-nav-links {
    display: none;
  }
  .site-nav-burger {
    display: inline-flex;
  }
  .site-nav {
    height: var(--shell-h-mobile);
  }
  body.site-shell {
    padding-top: calc(var(--shell-h-mobile) + 16px);
  }
}

/* ==========================================================================
   LANDING · 独立落地页（与 app shell 完全分离）
   设计取向：编辑级排版 / 大留白 / 单色克制 / hero 独立成屏
   规范：0 破折号 / 0 Emoji
   ========================================================================== */

/* 极简浮动品牌条：不做全站导航 */
.landing-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  pointer-events: none;
}

.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  pointer-events: auto;
}

.landing-brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(16, 16, 20, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif-luxury);
  font-size: 14px;
  font-weight: 700;
  color: #faf9f5;
  line-height: 1;
}

.landing-brand-name {
  font-family: var(--font-serif-luxury);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #faf9f5;
}

.landing-topbar-links {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.landing-topbar-link {
  pointer-events: auto;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #8b8b93;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(12, 12, 15, 0.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.landing-topbar-link:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

/* HERO · 独立整屏 */
.landing-hero {
  position: relative;
  min-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 104px 24px 72px;
  overflow: hidden;
}

.landing-hero-glow {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 1100px;
  height: 1100px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.055) 0%,
    rgba(255, 255, 255, 0.015) 32%,
    transparent 62%
  );
  pointer-events: none;
}

.landing-hero-inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 860px;
  text-align: center;
}

.landing-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.28em;
  color: #6f6f78;
  margin: 0 0 20px;
}

.landing-eyebrow-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #6f6f78;
  display: inline-block;
}

.landing-title {
  margin: 0 0 22px;
  font-family: var(--font-serif-luxury);
  font-size: clamp(44px, 8vw, 96px);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: #faf9f5;
}

.landing-title em {
  font-style: italic;
  font-weight: 400;
  color: #cfcdc4;
}

.landing-lede {
  margin: 0 auto 38px;
  max-width: 640px;
  font-size: 14.5px;
  line-height: 1.85;
  color: #8f8f98;
}

.landing-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.landing-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 28px;
  border-radius: 9999px;
  background: #faf9f5;
  color: #0a0a0c;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.landing-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.13);
}

.landing-btn-ghost {
  display: inline-flex;
  align-items: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9a9aa2;
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.landing-btn-ghost:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.24);
}

.landing-note {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #63636b;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.landing-note-sep {
  width: 1px;
  height: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: inline-block;
}

/* 向下提示 */
.landing-hero-scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.22), transparent);
  overflow: hidden;
}

.landing-hero-scroll span {
  position: absolute;
  top: 0;
  left: 0;
  width: 1px;
  height: 16px;
  background: #ffffff;
  animation: landingScrollDot 2.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes landingScrollDot {
  0% { transform: translateY(-16px); opacity: 0; }
  35% { opacity: 1; }
  100% { transform: translateY(40px); opacity: 0; }
}

/* 落地页后续板块：与 hero 明确分离 */
.landing-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.1), transparent);
  margin: 0 auto;
  max-width: 1100px;
}

@media (max-width: 767px) {
  .landing-topbar {
    padding: 16px 18px;
  }
  .landing-hero {
    padding: 104px 20px 72px;
    min-height: 92vh;
  }
  .landing-eyebrow {
    margin-bottom: 30px;
  }
  .landing-lede {
    font-size: 13.5px;
  }
  .landing-hero-scroll {
    display: none;
  }
}

/* LANDING · 纯黑编辑级底色（移除点阵，避免与宋体风格冲突） */
body.landing-page {
  background-color: #07070a !important;
  background-image: none !important;
}
body.landing-page::after {
  display: none !important;
}

/* LANDING · 标题二阶用字重与灰度做层次，绝不使用中文伪斜体 */
.landing-title em {
  font-style: normal !important;
  font-weight: 300;
  color: #9a978e;
  letter-spacing: 0.01em;
}

/* ==========================================================================
   FORUM · 列表式论坛（对标 new.web.cafe 行式结构）
   规范：0 破折号 / 0 Emoji
   ========================================================================== */

.forum-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.forum-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.forum-row:hover {
  background-color: rgba(255, 255, 255, 0.026);
}

.forum-row-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #faf9f5;
  margin-top: 2px;
}

.forum-row-body {
  flex: 1;
  min-width: 0;
}

.forum-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #6f6f78;
  margin-bottom: 6px;
}

.forum-row-author {
  color: #b4b2a9;
  font-weight: 600;
}

.forum-row-dot {
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #4a4a51;
  display: inline-block;
}

.forum-row-title {
  margin: 0 0 6px;
  font-family: var(--font-serif-luxury);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: #faf9f5;
  transition: color 0.16s ease;
}

.forum-row:hover .forum-row-title {
  color: #d9d7cf;
}

.forum-row-summary {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.75;
  color: #8a8a92;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.forum-row-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.forum-row-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #83838b;
}

.forum-row-stats {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #6f6f78;
  padding-top: 22px;
}

@media (max-width: 767px) {
  .forum-row {
    flex-wrap: wrap;
    padding: 16px 8px;
  }
  .forum-row-stats {
    width: 100%;
    padding-top: 0;
    padding-left: 48px;
    gap: 14px;
  }
  .forum-row-title {
    font-size: 14px;
  }
}
