/* Volvence Demo v3 - Homeostasis-Driven Emergence */
/* Dark Sci-Fi Aesthetic with Bioluminescent Accents */

:root {
  /* Core palette */
  --bg-deep: #04060d;
  --bg-surface: #0a0e1a;
  --bg-elevated: #111827;
  --bg-card: rgba(15, 23, 42, 0.85);
  
  /* Accent colors */
  --accent-cyan: #22d3ee;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-violet: #8b5cf6;
  --accent-blue: #3b82f6;
  
  /* State colors */
  --state-healthy: #10b981;
  --state-warning: #f59e0b;
  --state-danger: #ef4444;
  --state-calm: #22d3ee;
  
  /* Text colors */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* Border & glow */
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-accent: rgba(34, 211, 238, 0.3);
  --glow-cyan: 0 0 20px rgba(34, 211, 238, 0.3);
  --glow-emerald: 0 0 20px rgba(16, 185, 129, 0.3);
  --glow-rose: 0 0 20px rgba(244, 63, 94, 0.3);
  
  /* Fonts */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  
  /* Sizing */
  --monitor-width: 320px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-display);
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
}

body {
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(34, 211, 238, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
    var(--bg-deep);
}

/* ===========================
   OVERLAY SCREENS
   =========================== */

.overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(4, 6, 13, 0.96);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.overlay.active {
  display: flex;
  opacity: 1;
}

/* Intro Overlay */
.intro-content {
  max-width: 560px;
  padding: 48px;
  text-align: center;
}

.intro-title {
  margin-bottom: 24px;
}

.title-glyph {
  display: block;
  font-size: 32px;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  animation: glyphPulse 2s ease-in-out infinite;
}

@keyframes glyphPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

.intro-title h1 {
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.2em;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.title-sub {
  font-size: 14px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.intro-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

.intro-scenario {
  padding: 24px;
  border-radius: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  margin-bottom: 32px;
}

.scenario-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.scenario-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.scenario-phases {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.phase-tag {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11px;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.2);
  color: var(--accent-cyan);
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 40px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-emerald));
  color: var(--bg-deep);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-cyan);
}

.btn-icon {
  font-size: 14px;
}

/* Settlement Dashboard - 3 Column Horizontal Layout */
.settlement-dashboard {
  width: 95vw;
  max-width: 1400px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 40px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  box-shadow: var(--glow-cyan);
}

.dashboard-header {
  text-align: center;
  margin-bottom: 32px;
}

.dashboard-icon {
  display: block;
  font-size: 28px;
  color: var(--accent-emerald);
  margin-bottom: 12px;
  animation: glyphPulse 2s ease-in-out infinite;
}

.dashboard-header h2 {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dashboard-sub {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.dashboard-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.dashboard-col {
  padding: 20px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
}

.col-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.col-icon {
  font-size: 16px;
  color: var(--accent-cyan);
}

.col-header h3 {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* Column 1: Radar Evolution */
.radar-comparison {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 20px;
}

.radar-before, .radar-after {
  text-align: center;
}

.radar-label-mini {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

#radar-before-canvas, #radar-after-canvas {
  width: 120px;
  height: 120px;
  border-radius: 8px;
}

.radar-arrow {
  font-size: 24px;
  color: var(--accent-cyan);
  opacity: 0.6;
}

.radar-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.stat-label {
  font-size: 11px;
  color: var(--text-secondary);
}

.stat-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.stat-value.positive {
  color: var(--accent-emerald);
}

.stat-value.negative {
  color: var(--accent-rose);
}

/* Column 2: Cognitive Architecture */
.arch-section {
  margin-bottom: 16px;
}

.arch-label {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.arch-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.arch-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 11px;
}

.item-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.2);
  color: var(--text-muted);
}

.arch-item.old .item-tag {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.arch-item.new .item-tag {
  background: rgba(16, 185, 129, 0.25);
  color: var(--accent-emerald);
}

.item-name {
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.arch-item.new .item-name {
  color: var(--accent-emerald);
}

.arch-item.flash {
  animation: flashHighlight 1.5s ease-in-out infinite;
}

@keyframes flashHighlight {
  0%, 100% { 
    background: rgba(0, 0, 0, 0.2);
    box-shadow: none;
  }
  50% { 
    background: rgba(16, 185, 129, 0.15);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
  }
}

.arch-item.philosophy {
  flex-direction: column;
  align-items: flex-start;
}

.item-quote {
  font-style: italic;
  font-size: 11px;
  color: var(--accent-cyan);
  margin-top: 4px;
  padding-left: 8px;
  border-left: 2px solid var(--accent-cyan);
}

/* Column 3: Neural Network */
.neural-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 16px;
}

#neural-canvas {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: radial-gradient(circle at center, rgba(10, 14, 26, 0.8), var(--bg-deep));
}

.neural-highlight {
  position: absolute;
  top: 25%;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  animation: highlightPulse 2s ease-in-out infinite;
}

@keyframes highlightPulse {
  0%, 100% { 
    opacity: 0.7;
    transform: translateX(-50%) scale(1);
  }
  50% { 
    opacity: 1;
    transform: translateX(-50%) scale(1.05);
  }
}

.highlight-label {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-emerald);
}

.neural-caption {
  text-align: center;
}

.caption-main {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-emerald);
  margin-bottom: 4px;
}

.caption-sub {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
}

.dashboard-footer {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.footer-note {
  font-size: 13px;
  font-style: italic;
  color: var(--text-muted);
}

/* Back to Index Button */
.back-to-index {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  margin-top: 8px;
  border: 1px solid var(--accent-cyan);
  border-radius: 10px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  background: rgba(34, 211, 238, 0.1);
  color: var(--accent-cyan);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.back-to-index:hover {
  background: rgba(34, 211, 238, 0.2);
  box-shadow: var(--glow-cyan);
  transform: translateY(-2px);
}

/* === V4: Policy Network Chart === */
.policy-chart {
  padding: 12px;
}

.policy-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-align: center;
}

.q-value-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.q-bar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.q-label {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.q-bar-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.q-bar {
  height: 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  font-size: 10px;
  font-family: var(--font-mono);
  transition: width 0.5s ease;
}

.q-bar.old {
  background: rgba(100, 100, 100, 0.4);
  color: var(--text-muted);
}

.q-bar.new.positive {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.6));
  color: var(--accent-emerald);
}

.q-bar.new.negative {
  background: rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.q-change {
  font-size: 9px;
  align-self: flex-end;
}

.q-change.positive {
  color: var(--accent-emerald);
}

.q-change.negative {
  color: var(--accent-rose);
}

.policy-insight {
  margin-top: 16px;
  padding: 10px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.insight-icon {
  font-size: 16px;
}

.insight-text {
  font-size: 11px;
  color: var(--accent-amber);
}

/* === V4: Entropy Chart === */
.entropy-chart {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#entropy-canvas {
  width: 100%;
  height: 120px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.entropy-phases {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
}

.phase-label {
  font-size: 8px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.entropy-annotations {
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
}

.annotation {
  font-size: 8px;
  padding: 2px 6px;
  border-radius: 4px;
}

.annotation.stable {
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
}

.annotation.chaos {
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.1);
}

.annotation.peak {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.1);
}

.annotation.order {
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
}

.entropy-caption {
  text-align: center;
  margin-top: 8px;
}

/* === V4: Asset Card === */
.asset-card {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(6, 182, 212, 0.05));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.asset-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.asset-name {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-emerald);
  margin-bottom: 4px;
}

.asset-version {
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.asset-tags {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}

.asset-tag {
  font-size: 9px;
  padding: 3px 8px;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.asset-tag.performance {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.asset-tag.streaming {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.asset-ownership {
  font-size: 10px;
  margin-bottom: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.ownership-label {
  color: var(--text-muted);
}

.ownership-value {
  color: var(--accent-emerald);
  font-weight: 600;
}

.asset-stats {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.asset-stat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 10px;
}

.stat-icon {
  font-size: 12px;
}

.stat-text {
  color: var(--text-secondary);
}

/* Settlement responsive */
@media (max-width: 1024px) {
  .dashboard-columns {
    grid-template-columns: 1fr 1fr;
  }
  
  .col-neural {
    grid-column: span 2;
  }
  
  .neural-container {
    max-width: 300px;
    margin: 0 auto 16px;
  }
}

@media (max-width: 768px) {
  .dashboard-columns {
    grid-template-columns: 1fr;
  }
  
  .col-neural {
    grid-column: span 1;
  }
}

/* ===========================
   MAIN LAYOUT
   =========================== */

.main-container {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ===========================
   LEFT COLUMN: LIFE MONITOR
   =========================== */

.life-monitor {
  width: var(--monitor-width);
  min-width: var(--monitor-width);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
}

.monitor-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.3);
}

.header-icon {
  font-size: 16px;
  color: var(--accent-cyan);
}

.monitor-header h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-primary);
}

/* Radar Section */
.radar-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.radar-title {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.radar-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 260px;
  margin: 0 auto;
}

#radar-canvas {
  width: 100%;
  height: 100%;
  border-radius: 12px;
}

.radar-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.radar-label {
  position: absolute;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: color 0.3s, transform 0.3s;
}

.radar-label[data-axis="physiological"] {
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
}

.radar-label[data-axis="safety"] {
  top: 35%;
  right: -2%;
  transform: translateY(-50%);
}

.radar-label[data-axis="belonging"] {
  bottom: 12%;
  right: 5%;
}

.radar-label[data-axis="esteem"] {
  bottom: 12%;
  left: 5%;
}

.radar-label[data-axis="selfActual"] {
  top: 35%;
  left: -2%;
  transform: translateY(-50%);
}

.radar-label.active {
  color: var(--accent-cyan);
  transform: scale(1.1);
}

.radar-label.warning {
  color: var(--accent-amber);
}

.radar-label.danger {
  color: var(--accent-rose);
}

.radar-note {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  font-style: italic;
}

/* Vitals Section */
.vitals-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.vitals-title {
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.vitals-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vital-item {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.vital-item.pulse {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
}

.vital-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.vital-icon {
  font-size: 12px;
  opacity: 0.8;
}

.vital-label {
  flex: 1;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.vital-value {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.vital-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.vital-fill {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  transition: width 0.5s ease-out;
}

.vital-fill.stress {
  background: linear-gradient(90deg, var(--accent-amber), var(--accent-rose));
}

.vital-fill.entropy {
  background: linear-gradient(90deg, var(--accent-violet), var(--accent-rose));
}

.vital-fill.dopamine {
  background: linear-gradient(90deg, var(--accent-emerald), var(--accent-cyan));
}

/* State Summary */
.state-summary {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.summary-item {
  padding: 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-subtle);
}

.summary-item.philosophy {
  background: rgba(34, 211, 238, 0.05);
  border-color: rgba(34, 211, 238, 0.2);
}

.summary-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.summary-value {
  display: block;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.4;
}

.summary-item.philosophy .summary-value {
  font-style: italic;
  color: var(--accent-cyan);
}

/* ===========================
   RIGHT COLUMN: THE FLOW
   =========================== */

.the-flow {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.flow-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

.flow-header h2 {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-primary);
}

.time-indicator {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent-cyan);
}

/* Timeline Container */
.timeline-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.timeline-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Phase Separator */
.phase-separator {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  margin: 8px 0;
  flex-shrink: 0;
}

.phase-separator::before,
.phase-separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-accent), transparent);
}

.phase-title {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  white-space: nowrap;
}

/* Timeline Header */
.timeline-header {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr 100px 100px 110px;
  gap: 10px;
  padding: 10px 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-accent);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px 8px 0 0;
}

.header-cell {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  text-align: center;
}

.header-cell:first-child {
  text-align: left;
}

/* Timeline Row - 6 Column Layout: User | 推理链 | AI | Strategy | Need | Philosophy */
.timeline-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr 100px 100px 110px;
  align-items: start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid transparent;
  opacity: 0;
  transform: translateY(20px);
  animation: rowAppear 0.4s ease-out forwards;
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
  min-height: 60px;
  flex-shrink: 0;
}

@keyframes rowAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.timeline-row.highlight {
  border-color: var(--accent-cyan);
  box-shadow: var(--glow-cyan);
  background: rgba(34, 211, 238, 0.08);
}

.timeline-row.danger {
  border-color: var(--accent-rose);
  box-shadow: var(--glow-rose);
  background: rgba(244, 63, 94, 0.08);
}

.timeline-row.emergence {
  border-color: var(--accent-emerald);
  box-shadow: var(--glow-emerald);
  background: rgba(16, 185, 129, 0.08);
}

/* Row Cells */
.row-time {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}

.row-user, .row-ai {
  font-size: 16px;  /* 放大两号: 12px -> 16px */
  line-height: 1.5;
  color: var(--text-secondary);
}

.row-user {
  padding-left: 12px;
  border-left: 2px solid var(--accent-amber);
}

/* Actor type variants for User column */
.row-user.actor-env {
  border-left-color: var(--accent-rose);
}

.row-user.actor-env .speaker {
  color: var(--accent-rose);
}

.row-user.actor-ai-action {
  border-left-color: var(--accent-cyan);
}

.row-user.actor-ai-action .speaker {
  color: var(--accent-cyan);
}

.row-ai {
  padding-left: 12px;
  border-left: 2px solid var(--accent-cyan);
}

.row-user .speaker, .row-ai .speaker {
  display: block;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.row-user .speaker {
  color: var(--accent-amber);
}

.row-ai .speaker {
  color: var(--accent-cyan);
}

.row-user .content, .row-ai .content {
  color: var(--text-primary);
  font-size: 14px !important;  /* 放大两号 */
}

/* Actor Type Tags - styled via JavaScript */
.actor-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 6px;
  vertical-align: middle;
  letter-spacing: 0.05em;
}

.actor-tag.env {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.actor-tag.ai-action {
  background: rgba(6, 182, 212, 0.2);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.actor-tag.user-action {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Typewriter Effect */
.typewriter-target {
  min-height: 1.5em;
  display: inline-block;
}

.typewriter-target.typing::after {
  content: '|';
  animation: blink 0.7s infinite;
  color: var(--accent-cyan);
  font-weight: normal;
  margin-left: 1px;
}

.typewriter-target.typed::after {
  content: '';
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Reward Column */
.row-reward {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-family: var(--font-mono);
  position: relative;
}

.reward-signal {
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.reward-signal.positive {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
}

.reward-signal.negative {
  background: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
}

.reward-signal.neutral {
  background: rgba(148, 163, 184, 0.15);
  color: var(--text-muted);
}

.reward-signal.strong-positive {
  background: rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  animation: rewardPulse 0.6s ease-out;
}

.reward-signal.strong-negative {
  background: rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
  animation: rewardPulse 0.6s ease-out;
}

@keyframes rewardPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Hidden/Reveal animations for sequential display */
.cell-hidden {
  opacity: 0;
  transform: translateX(-10px);
}

.cell-reveal {
  opacity: 1;
  transform: translateX(0);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

/* Text Pulse Animation for emergence - only on the text, not the row */
.text-pulse {
  animation: textPulseEmergence 0.8s ease-out;
}

@keyframes textPulseEmergence {
  0% { transform: scale(1); }
  15% { transform: scale(1.15); box-shadow: 0 0 20px rgba(16, 185, 129, 0.6); }
  30% { transform: scale(0.98); }
  50% { transform: scale(1.08); box-shadow: 0 0 15px rgba(16, 185, 129, 0.4); }
  70% { transform: scale(1); }
  85% { transform: scale(1.04); box-shadow: 0 0 10px rgba(16, 185, 129, 0.2); }
  100% { transform: scale(1); box-shadow: none; }
}

/* Reward Beam Animation */
.reward-beam {
  position: fixed;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
}

.reward-beam.positive {
  background: var(--accent-emerald);
  box-shadow: 0 0 15px var(--accent-emerald), 0 0 30px var(--accent-emerald), 0 0 45px rgba(16, 185, 129, 0.5);
}

.reward-beam.negative {
  background: var(--accent-rose);
  box-shadow: 0 0 15px var(--accent-rose), 0 0 30px var(--accent-rose), 0 0 45px rgba(244, 63, 94, 0.5);
}

/* Radar Mini in Row */
.row-radar {
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-mini {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.3);
}

/* Strategy/Need/Philosophy Columns */
.row-strategy, .row-motive, .row-capability {
  font-size: 10px;
  display: flex;
  align-items: center;
  align-self: center;
  color: var(--text-muted);
  position: relative;
}

.row-strategy .cell-value,
.row-motive .cell-value,
.row-capability .cell-value {
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  line-height: 1.3;
}

.row-strategy .cell-value.new,
.row-motive .cell-value.new,
.row-capability .cell-value.new {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Emergence Heartbeat Animation */
.cell-value.emergence {
  animation: heartbeat 0.6s ease-out;
}

@keyframes heartbeat {
  0% { transform: scale(1); }
  25% { transform: scale(1.15); }
  50% { transform: scale(1); }
  75% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Light Beam Animation for Emergence */
.emergence-beam {
  position: fixed;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 12px var(--accent-emerald), 0 0 24px var(--accent-emerald), 0 0 36px rgba(16, 185, 129, 0.6);
  pointer-events: none;
  z-index: 1000;
}

/* Reasoning Chain Styles */
.row-reasoning {
  display: flex;
  align-items: center;
  align-self: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 11px;
}

.chain-item {
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(34, 211, 238, 0.1);
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-5px);
  transition: opacity 0.25s ease-out, transform 0.25s ease-out;
}

.chain-item.chain-reveal {
  opacity: 1;
  transform: translateX(0);
}

.chain-arrow {
  color: var(--accent-cyan);
  font-weight: bold;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}

.chain-arrow.chain-reveal {
  opacity: 0.7;
  transform: scale(1);
}

.chain-item.radar-state {
  background: rgba(34, 211, 238, 0.15);
  border-left: 2px solid var(--accent-cyan);
}

.chain-item.motive-state {
  background: rgba(245, 158, 11, 0.12);
  border-left: 2px solid var(--accent-amber);
}

.chain-item.strategy-state {
  background: rgba(139, 92, 246, 0.12);
  border-left: 2px solid var(--accent-violet);
}

.chain-item.philosophy-state {
  background: rgba(16, 185, 129, 0.12);
  border-left: 2px solid var(--accent-emerald);
  font-style: italic;
}

/* Emergence items */
.chain-item.emergence-item {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald);
  font-weight: 500;
}

/* Chain reward with heart icons */
.chain-item.chain-reward {
  font-size: 14px;
  opacity: 0;
  transform: scale(0.8);
  padding: 2px 6px;
  background: transparent;
  border: none;
}

.chain-item.chain-reward.show {
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.chain-item.chain-reward.positive {
  background: transparent;
  border: none;
}

.chain-item.chain-reward.negative {
  background: transparent;
  border: none;
}

.reward-arrow {
  color: var(--accent-amber);
}

/* Strategy/Need/Philosophy columns (right of AI) */
.row-strategy,
.row-motive,
.row-capability {
  display: flex;
  align-items: center;
  align-self: center;
  justify-content: center;
  font-size: 10px;
  min-height: 40px;
}

.row-strategy .cell-value,
.row-motive .cell-value,
.row-capability .cell-value {
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.4);
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.row-strategy .cell-value {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-violet);
  border-color: rgba(139, 92, 246, 0.4);
}

.row-motive .cell-value {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border-color: rgba(245, 158, 11, 0.4);
}

.row-capability .cell-value {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border-color: rgba(16, 185, 129, 0.5);
  font-style: italic;
}

/* Emergence text hidden state */
.emergence-text.cell-hidden {
  opacity: 0;
  transform: scale(0.8);
}

.emergence-text.cell-reveal {
  opacity: 1;
  transform: scale(1);
}

.row-internal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
}

.internal-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.internal-label {
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  min-width: 50px;
}

.internal-value {
  color: var(--text-secondary);
}

.internal-value.highlight {
  color: var(--accent-cyan);
  font-weight: 500;
}

.internal-value.warning {
  color: var(--accent-amber);
}

.internal-value.danger {
  color: var(--accent-rose);
}

.internal-value.emergence {
  color: var(--accent-emerald);
  font-weight: 500;
}

.row-physio {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
}

.physio-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.physio-label {
  font-size: 8px;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  min-width: 45px;
}

.physio-value {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-secondary);
}

.physio-value.up {
  color: var(--accent-emerald);
}

.physio-value.up::before {
  content: "↑";
  margin-right: 2px;
}

.physio-value.down {
  color: var(--accent-rose);
}

.physio-value.down::before {
  content: "↓";
  margin-right: 2px;
}

.physio-value.spike {
  color: var(--accent-amber);
  font-weight: 600;
}

/* Progress Section */
.progress-section {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
}

/* Control Bar */
.control-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.play-pause-btn, .speed-btn {
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid var(--accent-cyan);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.play-pause-btn {
  padding: 8px 20px;
  font-size: 13px;
}

.speed-btn {
  font-size: 11px;
  padding: 6px 12px;
  background: rgba(100, 100, 100, 0.2);
  border-color: var(--border-subtle);
}

.speed-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.speed-indicator {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-amber);
  padding: 4px 8px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  min-width: 40px;
  text-align: center;
}

.play-pause-btn:hover, .speed-btn:hover {
  transform: scale(1.02);
}

.play-pause-btn.paused {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(6, 182, 212, 0.2));
  border-color: var(--accent-emerald);
  animation: pausedPulse 1.5s ease-in-out infinite;
}

@keyframes pausedPulse {
  0%, 100% { box-shadow: 0 0 5px rgba(16, 185, 129, 0.3); }
  50% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.5); }
}

.progress-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-emerald));
  transition: width 0.5s ease-out;
}

.progress-phases {
  display: flex;
  justify-content: space-between;
}

.phase-marker {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  transition: color 0.3s;
}

.phase-marker.active {
  color: var(--accent-cyan);
}

.phase-marker.completed {
  color: var(--accent-emerald);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1400px) {
  .timeline-header,
  .timeline-row {
    grid-template-columns: 1fr 1.3fr 1fr 90px 90px 100px;
    gap: 8px;
    font-size: 10px;
  }
  
  .chain-item {
    font-size: 10px;
    padding: 3px 6px;
  }
  
  .row-strategy .cell-value,
  .row-motive .cell-value,
  .row-capability .cell-value {
    font-size: 9px;
    padding: 4px 6px;
  }
}

@media (max-width: 1200px) {
  .timeline-header,
  .timeline-row {
    grid-template-columns: 1fr 1.2fr 1fr 80px 80px 90px;
    gap: 6px;
  }
  
  .row-strategy .cell-value,
  .row-motive .cell-value,
  .row-capability .cell-value {
    font-size: 8px;
    padding: 3px 5px;
  }
}

@media (max-width: 1024px) {
  :root {
    --monitor-width: 280px;
  }
  
  .timeline-header,
  .timeline-row {
    grid-template-columns: 1fr 1fr 70px 70px 70px;
    gap: 6px;
    padding: 10px 12px;
  }
  
  .row-reasoning {
    display: none;
  }
  
  .header-cell:nth-child(2) {
    display: none;
  }
  
  .chain-item {
    font-size: 9px;
    padding: 2px 5px;
  }
}

@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }
  
  .life-monitor {
    width: 100%;
    min-width: auto;
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
  }
  
  .the-flow {
    flex: 1;
    min-height: 60vh;
  }
  
  .radar-container {
    max-width: 200px;
  }
  
  .timeline-header,
  .timeline-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  
  .row-reasoning, .row-strategy, .row-motive, .row-capability {
    display: none;
  }
  
  .header-cell:nth-child(2),
  .header-cell:nth-child(4),
  .header-cell:nth-child(5),
  .header-cell:nth-child(6) {
    display: none;
  }
}

/* ===========================
   ANIMATIONS
   =========================== */

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(34, 211, 238, 0.2); }
  50% { box-shadow: 0 0 25px rgba(34, 211, 238, 0.4); }
}

@keyframes dangerPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(244, 63, 94, 0.2); }
  50% { box-shadow: 0 0 25px rgba(244, 63, 94, 0.5); }
}

.pulse-animation {
  animation: pulseGlow 1.5s ease-in-out infinite;
}

.danger-pulse {
  animation: dangerPulse 0.8s ease-in-out infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

