/**
 * PRODIA NEXUS - 神经中枢样式系统
 * 
 * 设计语言: 有机感、呼吸感、高科技
 * 色彩: 深空背景 + 青绿主色 + 琥珀色强调
 */

/* ============================================================================
   CSS VARIABLES
   ============================================================================ */
:root {
    /* Primary Palette - Organic Cyan */
    --nexus-primary: #00e5cc;
    --nexus-primary-dim: #00b8a3;
    --nexus-primary-glow: rgba(0, 229, 204, 0.4);
    --nexus-primary-subtle: rgba(0, 229, 204, 0.08);

    /* Accent - Warm Amber for Actions */
    --nexus-action: #ffb020;
    --nexus-action-glow: rgba(255, 176, 32, 0.3);

    /* Alerts */
    --nexus-alert: #ff5252;
    --nexus-success: #4ade80;

    /* Deep Space Background */
    --bg-void: #0a0a12;
    --bg-surface: rgba(15, 20, 35, 0.9);
    --bg-card: rgba(20, 30, 50, 0.85);
    --bg-elevated: rgba(30, 45, 70, 0.9);

    /* Borders */
    --border-dim: rgba(0, 229, 204, 0.1);
    --border-active: rgba(0, 229, 204, 0.4);

    /* Typography */
    --font-display: "Inter", system-ui, -apple-system, sans-serif;
    --font-mono: "JetBrains Mono", monospace;

    /* Text */
    --text-primary: #f0f4f8;
    --text-secondary: #8ba3b8;
    --text-muted: #5a6a7a;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;

    /* Timing */
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================================
   RESET & BASE
   ============================================================================ */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-display);
    background: var(--bg-void);
    color: var(--text-primary);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

/* Accessibility: Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.1s !important;
    }
}

/* ============================================================================
   AMBIENT BACKGROUND
   ============================================================================ */
#ambient-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.vignette {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        var(--bg-void) 80%
    );
    pointer-events: none;
    z-index: 1;
}

/* ============================================================================
   MAIN CONTAINER
   ============================================================================ */
.nexus-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: var(--space-md);
}

/* ============================================================================
   HEADER
   ============================================================================ */
.nexus-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    border-bottom: 1px solid var(--border-dim);
    position: relative;
}

/* Alert Banner - 顶部报警横幅 */
.alert-banner {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.95), rgba(200, 50, 50, 0.95));
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 20px rgba(255, 82, 82, 0.4);
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.alert-banner.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.alert-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-banner .alert-icon {
    font-size: 1rem;
    color: #fff;
    animation: alert-shake 0.5s ease-in-out infinite;
}

@keyframes alert-shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

.alert-banner .alert-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alert-banner .alert-time {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-mono);
}

.alert-banner .alert-dismiss {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    transition: all 0.2s;
}

.alert-banner .alert-dismiss:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.brand-icon {
    font-size: 1.5rem;
    color: var(--nexus-primary);
    animation: brand-pulse 3s ease-in-out infinite;
}

@keyframes brand-pulse {
    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.brand-name {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 8px;
    background: linear-gradient(135deg, #fff 20%, var(--nexus-primary) 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-sub {
    font-size: 0.75rem;
    font-weight: 300;
    letter-spacing: 4px;
    color: var(--nexus-primary-dim);
    margin-left: var(--space-xs);
}

.status-cluster {
    display: flex;
    gap: var(--space-lg);
}

.status-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-item.slogan {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.status-item.slogan span {
    font-weight: 400 !important;
    color: var(--text-muted) !important;
    background: linear-gradient(90deg, var(--text-muted), var(--nexus-primary-dim));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.status-item i {
    color: var(--nexus-primary);
    font-size: 0.9rem;
}

.status-item span:not(.label):not(.status-dot) {
    font-weight: 600;
    color: var(--text-primary);
}

.status-item .label {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--nexus-success);
    box-shadow: 0 0 10px var(--nexus-success);
    animation: status-blink 2s ease-in-out infinite;
}

@keyframes status-blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.time-display {
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 400;
    letter-spacing: 2px;
    color: var(--text-muted);
}

/* Quick Language Switch Button */
.lang-switch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-dim);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    margin-right: var(--space-sm);
    outline: none;
    user-select: none;
}

.lang-switch-btn:hover {
    background: var(--nexus-primary-subtle);
    border-color: var(--nexus-primary);
    color: var(--nexus-primary);
    box-shadow: 0 0 10px var(--nexus-primary-glow);
    transform: translateY(-1px);
}

.lang-switch-btn:active {
    transform: translateY(0);
}

.lang-switch-btn i {
    font-size: 1rem;
    opacity: 0.8;
}

.lang-switch-btn span {
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(20, 25, 35, 0.9);
    border: 1px solid rgba(0, 229, 204, 0.2);
    border-radius: 12px;
    transition: all 0.3s;
    min-width: 240px;
}

.header-search:hover {
    border-color: rgba(0, 229, 204, 0.4);
    box-shadow: 0 0 15px rgba(0, 229, 204, 0.1);
}

.header-search:focus-within {
    background: rgba(0, 229, 204, 0.08);
    border-color: var(--nexus-primary);
    box-shadow: 0 0 20px rgba(0, 229, 204, 0.2);
}

.header-search i {
    color: var(--nexus-primary-dim);
    font-size: 1rem;
    transition: color 0.3s;
}

.header-search:focus-within i {
    color: var(--nexus-primary);
}

.header-search input {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: var(--text-primary);
    font-size: 0.95rem;
    flex: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
}

.header-search input:focus {
    background: transparent !important;
    outline: none !important;
}

.header-search input::placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* 移除浏览器自动填充的白色背景 */
.header-search input:-webkit-autofill,
.header-search input:-webkit-autofill:hover,
.header-search input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(20, 25, 35, 0.9) inset !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

@media (max-width: 1360px) {
    .nexus-container {
        padding: var(--space-sm);
    }

    .nexus-header {
        flex-wrap: wrap;
        row-gap: var(--space-sm);
    }

    .brand-name {
        font-size: 1.35rem;
        letter-spacing: 4px;
    }

    .status-cluster {
        gap: var(--space-md);
    }

    .status-item .label {
        display: none;
    }

    .time-display {
        font-size: 1rem;
    }
}

.admin-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s var(--ease-smooth);
}

.admin-link:hover {
    background: var(--bg-elevated);
    border-color: var(--nexus-primary);
    color: var(--nexus-primary);
    box-shadow: 0 0 15px var(--nexus-primary-glow);
}

.admin-link i {
    font-size: 1rem;
}

/* ============================================================================
   CORE SECTION (3-Column Layout)
   ============================================================================ */
.nexus-core-section {
    flex: 1;
    display: grid;
    grid-template-columns: 340px 1fr 340px;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    overflow: hidden;
}

@media (max-width: 1360px) {
    .nexus-core-section {
        grid-template-columns: 300px 1fr 300px;
        gap: var(--space-sm);
    }
}

@media (max-width: 1200px) {
    .nexus-core-section {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }
    .stream-panel {
        max-height: 200px;
    }
}

/* ============================================================================
   STREAM PANELS (Perception & History)
   ============================================================================ */
.stream-panel {
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stream-header {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-dim);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.stream-header .header-left {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Help Icon & Tooltip */
.help-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.help-icon {
    color: var(--text-muted);
    font-size: 0.9rem;
    cursor: help;
    transition: all 0.3s var(--ease-out);
    opacity: 0.6;
}

.help-wrapper:hover .help-icon {
    color: var(--nexus-accent);
    opacity: 1;
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.4);
}

.help-wrapper .tooltip {
    position: absolute;
    top: 100%;
    right: -8px;
    width: max-content;
    max-width: 220px;
    padding: 8px 12px;
    margin-top: 8px;

    background: rgba(13, 13, 18, 0.95);
    border: 1px solid var(--nexus-primary-dim);
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);

    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0.5px;
    line-height: 1.5;
    color: var(--text-main);

    visibility: hidden;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.2s var(--ease-out);
    pointer-events: none;
}

.help-wrapper:hover .tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Tooltip Arrow */
.help-wrapper .tooltip::before {
    content: "";
    position: absolute;
    top: -4px;
    right: 12px;
    width: 8px;
    height: 8px;
    background: inherit;
    border-left: 1px solid var(--nexus-primary-dim);
    border-top: 1px solid var(--nexus-primary-dim);
    transform: rotate(45deg);
}

.perception-stream .stream-header {
    color: var(--nexus-primary);
}

.history-stream .stream-header {
    color: #9ca3ff;
}

.stream-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-sm);
}

/* Stream Items */
.stream-item {
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xs);
    border-radius: 8px;
    background: var(--bg-card);
    font-size: 0.85rem;
    animation: stream-in 0.4s var(--ease-bounce);
    cursor: pointer;
    transition: all 0.2s;
}

.stream-item:hover {
    background: var(--bg-elevated);
    transform: translateX(4px);
}

@keyframes stream-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stream-item .item-icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    margin-right: var(--space-sm);
    font-size: 0.7rem;
}

.perception-stream .stream-item .item-icon {
    color: var(--nexus-primary);
}

.stream-item .item-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    float: right;
}

/* Perception Items (Refined for Demo) */
.perception-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    font-family: "Inter", system-ui, sans-serif;
    animation: stream-in 0.3s ease-out;
    border-left: 2px solid transparent;
    background: rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.perception-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    transform: translateX(3px);
}

.perception-item.active {
    border-left-color: var(--nexus-primary);
    background: linear-gradient(90deg, rgba(0, 229, 204, 0.08), transparent);
}

/* 报警样式 */
.perception-item.alert {
    border-left-color: #ff6b6b;
    background: linear-gradient(90deg, rgba(255, 107, 107, 0.12), transparent);
}

.perception-item.alert .perception-icon {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

.perception-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--nexus-primary);
    font-size: 11px;
    background: rgba(0, 229, 204, 0.1);
    border-radius: 5px;
    flex-shrink: 0;
}

.perception-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.perception-time {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
    flex-shrink: 0;
}

/* History Items (Enhanced for Demo) */
.history-item {
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
    background: var(--bg-card);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    animation: stream-in 0.4s var(--ease-bounce);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.history-item:hover {
    background: var(--bg-elevated);
    transform: translateX(3px);
}

.history-item.user {
    border-left-color: var(--nexus-primary);
    background: linear-gradient(90deg, rgba(0, 229, 204, 0.06), var(--bg-card));
}

.history-item.assistant {
    border-left-color: #9ca3ff;
    background: linear-gradient(90deg, rgba(156, 163, 255, 0.06), var(--bg-card));
}

.history-item.system {
    border-left-color: var(--text-muted);
    opacity: 0.7;
}

.history-header {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.9;
}

.history-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    border-radius: 4px;
}

.history-item.user .history-icon {
    color: var(--nexus-primary);
    background: rgba(0, 229, 204, 0.12);
}

.history-item.assistant .history-icon {
    color: #9ca3ff;
    background: rgba(156, 163, 255, 0.12);
}

.history-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.history-item.user .history-label {
    color: var(--nexus-primary);
}

.history-item.assistant .history-label {
    color: #9ca3ff;
}

.history-time {
    margin-left: auto;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.history-content {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ============================================================================
   CORE METRICS PANELS
   ============================================================================ */
.core-metrics {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20;
}

.core-metrics.left-metrics {
    top: 20px;
    left: 20px;
}

.core-metrics.right-metrics {
    top: 20px;
    right: 20px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(10, 10, 15, 0.8);
    border: 1px solid rgba(0, 229, 204, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    min-width: 130px;
    transition: all 0.3s ease;
    animation: metric-fade-in 0.6s ease-out backwards;
    cursor: pointer;
}

.metric-card:nth-child(1) { animation-delay: 0.1s; }
.metric-card:nth-child(2) { animation-delay: 0.2s; }
.metric-card:nth-child(3) { animation-delay: 0.3s; }

@keyframes metric-fade-in {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.right-metrics .metric-card {
    animation-name: metric-fade-in-right;
}

@keyframes metric-fade-in-right {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.metric-card:hover {
    border-color: rgba(0, 229, 204, 0.5);
    box-shadow: 0 0 20px rgba(0, 229, 204, 0.15);
    transform: scale(1.02);
}

.metric-card:active {
    transform: scale(0.98);
    box-shadow: 0 0 10px rgba(0, 229, 204, 0.3);
}

.metric-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 229, 204, 0.15);
    border-radius: 6px;
    color: var(--nexus-primary);
    font-size: 0.8rem;
}

.metric-icon.warning {
    background: rgba(255, 176, 32, 0.15);
    color: #ffb020;
}

.metric-icon.success {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.metric-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.metric-value {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-mono);
    line-height: 1.2;
}

.metric-value small {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-left: 2px;
}

.metric-label {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-trend {
    font-size: 0.55rem;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.metric-trend.up {
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
}

.metric-trend.down {
    background: rgba(231, 76, 60, 0.15);
    color: #e74c3c;
}

.metric-trend.neutral {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* 响应式隐藏 */
@media (max-width: 1400px) {
    .core-metrics {
        display: none;
    }
}

/* ============================================================================
   NEXUS CENTER (Awareness Sphere) - ULTRA ENHANCED
   ============================================================================ */
.nexus-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    gap: var(--space-lg);
    padding-top: var(--space-xl);
}

/* The Sphere */
.awareness-sphere {
    position: relative;
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 多层背景光晕效果 */
.awareness-sphere::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    background: 
        radial-gradient(circle, rgba(0, 229, 204, 0.2) 0%, transparent 40%),
        radial-gradient(circle at 30% 30%, rgba(88, 166, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(156, 163, 255, 0.1) 0%, transparent 50%);
    animation: sphere-glow 4s ease-in-out infinite, sphere-rotate 20s linear infinite;
    z-index: -1;
}

@keyframes sphere-glow {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.6; filter: blur(0px); }
    50% { transform: scale(1.15) rotate(180deg); opacity: 1; filter: blur(2px); }
}

@keyframes sphere-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 多重脉冲波纹 */
.awareness-sphere::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--nexus-primary);
    animation: pulse-wave 3s ease-out infinite;
    opacity: 0;
}

@keyframes pulse-wave {
    0% { transform: scale(0.5); opacity: 0.8; border-width: 3px; }
    100% { transform: scale(2.5); opacity: 0; border-width: 1px; }
}

/* ============================================================================
   SCAN LINE EFFECT
   ============================================================================ */
.scan-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--nexus-primary) 20%, 
        rgba(255, 255, 255, 0.9) 50%, 
        var(--nexus-primary) 80%, 
        transparent 100%);
    box-shadow: 0 0 20px var(--nexus-primary), 0 0 40px var(--nexus-primary);
    animation: scan-vertical 4s ease-in-out infinite;
    z-index: 5;
    opacity: 0.8;
}

@keyframes scan-vertical {
    0%, 100% { top: 10%; opacity: 0; }
    10% { opacity: 0.8; }
    50% { top: 90%; opacity: 0.8; }
    60% { opacity: 0; }
}

/* ============================================================================
   ENERGY ARCS
   ============================================================================ */
.energy-arc {
    position: absolute;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    border: 2px solid transparent;
    border-top-color: var(--nexus-primary);
    filter: drop-shadow(0 0 8px var(--nexus-primary));
    animation: arc-rotate 3s linear infinite;
}

.energy-arc.arc1 {
    animation-duration: 3s;
    opacity: 0.9;
}

.energy-arc.arc2 {
    width: 140%;
    height: 140%;
    animation-duration: 5s;
    animation-direction: reverse;
    border-top-color: rgba(88, 166, 255, 0.7);
    filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.7));
    opacity: 0.6;
}

.energy-arc.arc3 {
    width: 160%;
    height: 160%;
    animation-duration: 7s;
    border-top-color: rgba(156, 163, 255, 0.5);
    filter: drop-shadow(0 0 6px rgba(156, 163, 255, 0.5));
    opacity: 0.4;
}

@keyframes arc-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ============================================================================
   DATA STREAMS
   ============================================================================ */
.data-stream {
    position: absolute;
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, var(--nexus-primary), transparent);
    opacity: 0;
    animation: stream-flow 2s ease-in-out infinite;
}

.data-stream.stream1 {
    top: -80px;
    left: 50%;
    animation-delay: 0s;
}

.data-stream.stream2 {
    bottom: -80px;
    left: 50%;
    transform: rotate(180deg);
    animation-delay: 0.5s;
}

.data-stream.stream3 {
    top: 50%;
    left: -80px;
    transform: rotate(90deg);
    animation-delay: 1s;
}

.data-stream.stream4 {
    top: 50%;
    right: -80px;
    transform: rotate(-90deg);
    animation-delay: 1.5s;
}

@keyframes stream-flow {
    0% { opacity: 0; height: 20px; }
    30% { opacity: 1; height: 80px; }
    70% { opacity: 1; height: 80px; }
    100% { opacity: 0; height: 20px; }
}

/* ============================================================================
   ORBIT PARTICLES
   ============================================================================ */
.orbit-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--nexus-primary);
    border-radius: 50%;
    box-shadow: 
        0 0 10px var(--nexus-primary),
        0 0 20px var(--nexus-primary),
        0 0 30px var(--nexus-primary);
    animation: orbit 4s linear infinite;
}

.orbit-particle.op1 {
    animation-duration: 4s;
}

.orbit-particle.op2 {
    animation-duration: 6s;
    animation-delay: -2s;
    width: 6px;
    height: 6px;
    background: #58a6ff;
    box-shadow: 0 0 10px #58a6ff, 0 0 20px #58a6ff;
}

.orbit-particle.op3 {
    animation-duration: 8s;
    animation-delay: -4s;
    width: 5px;
    height: 5px;
    background: #9ca3ff;
    box-shadow: 0 0 10px #9ca3ff, 0 0 20px #9ca3ff;
}

@keyframes orbit {
    from {
        transform: rotate(0deg) translateX(160px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translateX(160px) rotate(-360deg);
    }
}

/* ============================================================================
   HEX GRID BACKGROUND
   ============================================================================ */
.hex-grid {
    position: absolute;
    width: 400px;
    height: 400px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='49' viewBox='0 0 28 49'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%2300e5cc' fill-opacity='0.08'%3E%3Cpath d='M13.99 9.25l13 7.5v15l-13 7.5L1 31.75v-15l12.99-7.5zM3 17.9v12.7l10.99 6.34 11-6.35V17.9l-11-6.34L3 17.9z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    animation: hex-pulse 4s ease-in-out infinite;
    z-index: -2;
    border-radius: 50%;
    mask-image: radial-gradient(circle, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(circle, black 30%, transparent 70%);
}

@keyframes hex-pulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.05); }
}

.sphere-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid var(--border-dim);
    animation: ring-rotate linear infinite;
}

.sphere-ring.outer {
    width: 100%;
    height: 100%;
    animation-duration: 60s;
    border-style: dashed;
    border-color: rgba(0, 229, 204, 0.4);
    border-width: 2px;
}

/* 外环上的数据点 */
.sphere-ring.outer::before,
.sphere-ring.outer::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--nexus-primary);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--nexus-primary), 0 0 30px var(--nexus-primary);
}

.sphere-ring.outer::before {
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
}

.sphere-ring.outer::after {
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
}

.sphere-ring.middle {
    width: 75%;
    height: 75%;
    animation-duration: 40s;
    animation-direction: reverse;
    border-color: var(--nexus-primary);
    border-width: 2px;
    opacity: 0.7;
    box-shadow: 0 0 30px rgba(0, 229, 204, 0.3), inset 0 0 30px rgba(0, 229, 204, 0.15);
}

/* 中环数据点 */
.sphere-ring.middle::before,
.sphere-ring.middle::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--nexus-primary);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--nexus-primary), 0 0 24px var(--nexus-primary);
}

.sphere-ring.middle::before {
    top: 50%;
    left: -3px;
    transform: translateY(-50%);
}

.sphere-ring.middle::after {
    top: 50%;
    right: -3px;
    transform: translateY(-50%);
}

.sphere-ring.inner {
    width: 50%;
    height: 50%;
    animation-duration: 20s;
    border-width: 3px;
    border-color: var(--nexus-primary);
    opacity: 0.95;
    box-shadow: 
        0 0 40px rgba(0, 229, 204, 0.4), 
        inset 0 0 40px rgba(0, 229, 204, 0.2),
        0 0 80px rgba(0, 229, 204, 0.2);
}

@keyframes ring-rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.sphere-core {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(0, 229, 204, 0.3), rgba(0, 229, 204, 0.1) 50%, transparent 70%);
    border: 3px solid var(--nexus-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 50px var(--nexus-primary-glow),
        0 0 100px var(--nexus-primary-glow),
        inset 0 0 40px rgba(0, 229, 204, 0.3);
    animation: core-breathe 4s ease-in-out infinite;
    z-index: 10;
    position: relative;
}

/* 核心内部光效 */
.sphere-core::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 229, 204, 0.4) 0%, transparent 60%);
    animation: core-inner-pulse 2s ease-in-out infinite;
}

/* 核心外部光环 */
.sphere-core::after {
    content: '';
    position: absolute;
    width: 120%;
    height: 120%;
    border-radius: 50%;
    border: 1px solid rgba(0, 229, 204, 0.5);
    animation: core-outer-ring 3s ease-in-out infinite;
}

@keyframes core-inner-pulse {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; }
}

@keyframes core-outer-ring {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 0.4; }
}

.sphere-core.active {
    animation: core-active 0.5s ease-in-out infinite;
}

@keyframes core-breathe {
    0%, 100% {
        transform: scale(1);
        box-shadow: 
            0 0 50px var(--nexus-primary-glow), 
            0 0 100px rgba(0, 229, 204, 0.3),
            inset 0 0 40px rgba(0, 229, 204, 0.2);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 
            0 0 80px var(--nexus-primary-glow), 
            0 0 150px rgba(0, 229, 204, 0.4),
            inset 0 0 60px rgba(0, 229, 204, 0.3);
    }
}

@keyframes core-active {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.core-logo {
    width: 55px;
    height: 55px;
    object-fit: contain;
    transform: translateY(-5px);
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 10px var(--nexus-primary));
    animation: logo-glow 3s ease-in-out infinite;
}

@keyframes logo-glow {
    0%, 100% { filter: drop-shadow(0 0 10px var(--nexus-primary)); }
    50% { filter: drop-shadow(0 0 20px var(--nexus-primary)) drop-shadow(0 0 40px rgba(0, 229, 204, 0.5)); }
}

/* ============================================================================
   FLOATING PARTICLES - ENHANCED
   ============================================================================ */
.floating-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--nexus-primary);
    border-radius: 50%;
    box-shadow: 
        0 0 8px var(--nexus-primary), 
        0 0 16px var(--nexus-primary),
        0 0 24px rgba(0, 229, 204, 0.5);
    animation: float-particle 8s ease-in-out infinite;
}

/* 主色粒子 */
.particle.p1 { top: 5%; left: 15%; animation-delay: 0s; animation-duration: 7s; }
.particle.p2 { top: 15%; right: 10%; animation-delay: 1s; animation-duration: 9s; }
.particle.p3 { bottom: 20%; left: 8%; animation-delay: 2s; animation-duration: 6s; }
.particle.p4 { bottom: 10%; right: 20%; animation-delay: 0.5s; animation-duration: 8s; }

/* 蓝色粒子 */
.particle.p5 { 
    top: 35%; left: 3%; 
    animation-delay: 1.5s; animation-duration: 10s; 
    width: 3px; height: 3px;
    background: #58a6ff;
    box-shadow: 0 0 8px #58a6ff, 0 0 16px #58a6ff;
}
.particle.p6 { 
    top: 30%; right: 5%; 
    animation-delay: 2.5s; animation-duration: 7s; 
    width: 3px; height: 3px;
    background: #58a6ff;
    box-shadow: 0 0 8px #58a6ff, 0 0 16px #58a6ff;
}

/* 紫色粒子 */
.particle.p7 { 
    bottom: 35%; left: 20%; 
    animation-delay: 3s; animation-duration: 9s; 
    width: 5px; height: 5px;
    background: #9ca3ff;
    box-shadow: 0 0 10px #9ca3ff, 0 0 20px #9ca3ff;
}
.particle.p8 { 
    bottom: 30%; right: 15%; 
    animation-delay: 0.8s; animation-duration: 11s; 
    width: 3px; height: 3px;
    background: #9ca3ff;
    box-shadow: 0 0 8px #9ca3ff, 0 0 16px #9ca3ff;
}

/* 额外粒子 */
.particle.p9 { top: 50%; left: -5%; animation-delay: 4s; animation-duration: 8s; width: 2px; height: 2px; }
.particle.p10 { top: 45%; right: -3%; animation-delay: 2s; animation-duration: 10s; width: 2px; height: 2px; }
.particle.p11 { 
    top: 8%; left: 45%; 
    animation-delay: 1s; animation-duration: 6s; 
    width: 3px; height: 3px;
    background: #58a6ff;
    box-shadow: 0 0 8px #58a6ff, 0 0 16px #58a6ff;
}
.particle.p12 { 
    bottom: 5%; left: 40%; 
    animation-delay: 3.5s; animation-duration: 7s; 
    width: 4px; height: 4px;
}

@keyframes float-particle {
    0%, 100% {
        transform: translate(0, 0) scale(1);
        opacity: 0.3;
    }
    20% {
        transform: translate(15px, -20px) scale(1.3);
        opacity: 0.9;
    }
    40% {
        transform: translate(-10px, -35px) scale(0.7);
        opacity: 1;
    }
    60% {
        transform: translate(-20px, -15px) scale(1.2);
        opacity: 0.7;
    }
    80% {
        transform: translate(5px, -5px) scale(0.9);
        opacity: 0.5;
    }
}

/* Energy Beams */
.energy-beam {
    position: absolute;
    height: 2px;
    width: 150px;
    background: linear-gradient(to right, var(--nexus-primary), transparent);
    opacity: 0;
    transition: opacity 0.5s;
    top: 50%;
    transform: translateY(-50%);
}

.energy-beam.left {
    left: -170px;
    background: linear-gradient(to left, var(--nexus-primary), transparent);
}

.energy-beam.right {
    right: -170px;
}

.energy-beam.active {
    opacity: 1;
    animation: beam-flow 1s linear infinite;
}

@keyframes beam-flow {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0.3;
    }
}

/* ============================================================================
   PROACTIVE BUBBLE
   ============================================================================ */
.proactive-bubble {
    /* Fixed Positioning - Break out of the container! */
    position: fixed;
    top: 50%;
    left: 50%;
    /* width: 95% replaced by clamp for better responsiveness */
    width: min(90%, 800px);
    max-width: none; /* Let width property control it */

    /* Sci-Fi Glass Material */
    /* Position inside Nexus Center (Absolute) */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%) scale(0.95);
    width: 95%; /* Fit within center col */
    max-width: 800px;
    max-height: calc(
        100% - 32px
    ); /* Constrain height with safety margin to prevent overflow */

    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--nexus-primary-dim);
    border-radius: 16px;
    box-shadow:
        0 0 50px rgba(0, 0, 0, 0.8),
        0 0 0 1px rgba(0, 229, 204, 0.1),
        inset 0 0 30px rgba(0, 229, 204, 0.05);

    padding: 10px;

    opacity: 0;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 100; /* Above sphere */
    pointer-events: none;

    display: flex;
    flex-direction: column;
}

.proactive-bubble.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* Sci-Fi Corner Accents (Pseudo-element) */
.proactive-bubble::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        var(--nexus-primary-dim),
        transparent
    );
    opacity: 0.5;
}

/* Ensure content scrolls within the fixed/max height bubble */
.bubble-content {
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1; /* Take up remaining space */
    /* padding-right: 8px; Removed to push scrollbar to edge */
    min-height: 0; /* Critical for flex scrolling */
    word-wrap: break-word; /* Force wrap to prevent hz scroll */
    overflow-wrap: break-word;
}

/* Custom Scrollbar for Bubble */
.bubble-content::-webkit-scrollbar {
    width: 4px; /* Thinner scrollbar */
}
.bubble-content::-webkit-scrollbar-track {
    background: transparent;
}
.bubble-content::-webkit-scrollbar-thumb {
    background: var(--nexus-primary-dim);
    border-radius: 2px;
}

.bubble-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--nexus-primary);
    margin-bottom: var(--space-sm);
    padding-bottom: var(--space-xs);
    border-bottom: 1px solid rgba(0, 229, 204, 0.1);
}

.bubble-header .header-left,
.bubble-header .header-right {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.bubble-header i {
    font-size: 1rem;
}

.bubble-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bubble-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.bubble-time {
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.65rem;
}

.bubble-content {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--text-primary);
    /* max-height: 200px; Removed to allow flex expansion */
    overflow-y: auto;
}

.bubble-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    flex-wrap: wrap;
}

.bubble-action-btn {
    padding: var(--space-xs) var(--space-md);
    background: var(--nexus-primary-subtle);
    border: 1px solid var(--nexus-primary-dim);
    border-radius: 20px;
    color: var(--nexus-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.bubble-action-btn:hover {
    background: var(--nexus-primary);
    color: var(--bg-void);
}

.bubble-action-btn.primary {
    background: var(--nexus-primary);
    color: var(--bg-void);
}

.bubble-action-btn.primary:hover {
    background: #fff;
}

/* ============================================================================
   WAKE INDICATOR
   ============================================================================ */
.wake-indicator {
    /* Use relative positioning within flex layout */
    position: relative;
    order: 1; /* Place below sphere */
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-dim);
    border-radius: 30px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    margin-top: var(--space-md);
}

.wake-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.wake-pulse {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--nexus-primary);
    animation: wake-pulse 2s ease-in-out infinite;
}

@keyframes wake-pulse {
    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.3);
        opacity: 1;
    }
}

/* ============================================================================
   FOOTER (Aligned with Core Section)
   ============================================================================ */
.nexus-footer {
    display: grid;
    grid-template-columns: 340px 1fr 340px;
    gap: var(--space-md);
    padding: 14px var(--space-md);
    background: linear-gradient(180deg, rgba(10, 15, 25, 0.95) 0%, rgba(5, 10, 18, 0.98) 100%);
    border-top: 1px solid rgba(0, 229, 204, 0.15);
    align-items: center;
    position: relative;
    z-index: 200;
}

/* Footer Left - User Info */
.footer-left {
    display: flex;
    justify-content: flex-start;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 8px;
    background: rgba(0, 229, 204, 0.05);
    border: 1px solid rgba(0, 229, 204, 0.2);
    border-radius: 25px;
    transition: all 0.3s;
    height: 48px;
}

.user-info:hover {
    border-color: rgba(0, 229, 204, 0.4);
    background: rgba(0, 229, 204, 0.1);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nexus-primary), var(--nexus-primary-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-void);
    font-size: 0.8rem;
}

.user-details {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    font-size: 0.65rem;
    color: var(--nexus-primary);
    padding: 3px 8px;
    background: rgba(0, 229, 204, 0.1);
    border-radius: 10px;
    font-weight: 500;
}

.user-menu-btn {
    display: none;
}

/* Footer Center - Input */
.footer-center {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 50px;
}

/* Hide quick insights */
.quick-insights {
    display: none;
}

/* Footer Right - Tool Buttons */
.footer-right {
    display: flex;
    justify-content: flex-end;
}

.bi-tools {
    display: flex;
}

.bi-tools-grid {
    display: flex;
    gap: 4px;
}

.bi-tool-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 0 10px;
    height: 32px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    white-space: nowrap;
    transition: all 0.2s;
    cursor: pointer;
}

.bi-tool-btn i {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.bi-tool-btn span {
    color: var(--text-muted);
}

.bi-tool-btn:hover {
    background: rgba(0, 229, 204, 0.1);
    border-color: rgba(0, 229, 204, 0.3);
}

.bi-tool-btn:hover i,
.bi-tool-btn:hover span {
    color: var(--nexus-primary);
}

.bi-tool-btn.admin:hover {
    background: rgba(255, 176, 32, 0.1);
    border-color: rgba(255, 176, 32, 0.3);
}

.bi-tool-btn.admin:hover i,
.bi-tool-btn.admin:hover span {
    color: var(--nexus-action);
}

/* Responsive */
@media (max-width: 1400px) {
    .bi-tool-btn span {
        display: none;
    }
    .bi-tool-btn {
        padding: 0;
        width: 32px;
        border-radius: 50%;
    }
}

@media (max-width: 1200px) {
    .nexus-footer {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }
    .footer-left, .footer-right {
        justify-content: center;
    }
}

/* ============================================================================
   QUICK QUESTIONS - 快捷问题
   ============================================================================ */
.quick-questions {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: nowrap;
    z-index: 30;
}

.quick-q-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(0, 229, 204, 0.08);
    border: 1px solid rgba(0, 229, 204, 0.2);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.quick-q-btn i {
    color: var(--nexus-primary);
    font-size: 0.75rem;
}

.quick-q-btn:hover {
    background: rgba(0, 229, 204, 0.15);
    border-color: rgba(0, 229, 204, 0.4);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 229, 204, 0.2);
}

.quick-q-btn:active {
    transform: translateY(0);
}

@media (max-width: 1100px) {
    .quick-questions {
        display: none;
    }
}

/* Input Hub - 输入框容器 */
.input-hub {
    display: flex;
    align-items: center;
    width: 100%;
    background: rgba(15, 20, 30, 0.9);
    border: 1px solid rgba(0, 229, 204, 0.2);
    border-radius: 25px;
    padding: 8px 6px;
    min-height: 52px;
}

.input-hub:focus-within {
    border-color: rgba(0, 229, 204, 0.4);
    box-shadow: 0 0 15px rgba(0, 229, 204, 0.1);
}

/* Voice Orb - 录音按钮（加强脉冲效果）*/
.voice-orb {
    position: relative;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 229, 204, 0.1);
    border: 1px solid rgba(0, 229, 204, 0.3);
    color: var(--nexus-primary-dim);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-left: 3px;
}

.voice-orb:hover {
    color: var(--nexus-primary);
    border-color: var(--nexus-primary);
    background: rgba(0, 229, 204, 0.15);
}

/* 录音状态 - 强脉冲效果 */
.voice-orb.listening {
    background: linear-gradient(135deg, #ff6b6b, #ff8e53);
    border-color: #ff6b6b;
    color: #fff;
    box-shadow: 
        0 0 25px rgba(255, 107, 107, 0.7),
        0 0 50px rgba(255, 107, 107, 0.4),
        0 0 80px rgba(255, 107, 107, 0.2);
    animation: voice-pulse 1s ease-in-out infinite;
}

.voice-orb.listening::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid rgba(255, 107, 107, 0.8);
    background: transparent;
    animation: voice-ripple 1.2s ease-out infinite;
    z-index: -1;
}

.voice-orb.listening::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid rgba(255, 142, 83, 0.6);
    background: transparent;
    animation: voice-ripple 1.2s ease-out infinite 0.4s;
    z-index: -1;
}

@keyframes voice-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 
            0 0 25px rgba(255, 107, 107, 0.7),
            0 0 50px rgba(255, 107, 107, 0.4);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 
            0 0 40px rgba(255, 107, 107, 0.9),
            0 0 80px rgba(255, 107, 107, 0.5),
            0 0 120px rgba(255, 107, 107, 0.3);
    }
}

@keyframes voice-ripple {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

@keyframes voice-ripple {
    0% {
        transform: scale(1);
        opacity: 0.4;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

.voice-orb.streaming {
    background: var(--nexus-action);
    border-color: var(--nexus-action);
    color: var(--bg-void);
}

.orb-glow {
    display: none;
}

/* Input Container - 输入区域 */
.input-container {
    flex: 1;
    position: relative;
    margin: 0 10px;
    display: flex;
    align-items: center;
}

.input-container input {
    display: none;
}

.input-container textarea {
    width: 100%;
    padding: 0 8px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-display);
    outline: none;
    resize: none;
    line-height: 1.5;
    height: auto;
    min-height: 22px;
    max-height: 66px;
    overflow-y: auto;
}

.input-container textarea::placeholder {
    color: var(--text-muted);
}

.input-container input::placeholder {
    color: var(--text-muted);
}

/* Send Button - 发送按钮 */
.send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--nexus-primary), var(--nexus-primary-dim));
    border: none;
    color: var(--bg-void);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-right: 3px;
}

.send-btn:hover {
    background: linear-gradient(135deg, #fff, var(--nexus-primary));
    transform: scale(1.05);
}

/* Clear button */
.clear-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-muted);
    font-size: 0.6rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
}

.clear-btn.visible {
    display: flex;
}

.clear-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

/* Voice Waveform - 隐藏，演示模式不需要 */
.voice-waveform {
    display: none !important;
}

/* Responsive */
@media (max-width: 1200px) {
    .bi-tool-btn span {
        display: none;
    }
    .bi-tool-btn {
        padding: 6px 8px;
        border-radius: 50%;
        width: 32px;
    }
}

@media (max-width: 900px) {
    .nexus-footer {
        flex-wrap: wrap;
    }
    .footer-center {
        order: -1;
        flex-basis: 100%;
        max-width: 100%;
    }
}

/* Quick Insights - Hidden for demo */
.quick-insights {
    display: none;
}

/* ============================================================================
   RESPONSE MODAL
   ============================================================================ */
.response-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.response-overlay.visible {
    display: flex;
}

.response-modal {
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    background: var(--bg-elevated);
    border: 1px solid var(--nexus-primary-dim);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-dim);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--nexus-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-card);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--nexus-alert);
    color: #fff;
}

/* Modal Body Typography & Spacing */
.modal-body {
    padding: var(--space-xl); /* Increased padding for better L/R spacing */
    overflow-y: auto;
    font-size: 0.95rem;
    line-height: 1.7; /* Relaxed line height */
    color: var(--text-secondary);
}

/* Markdown Content Improvements */
.modal-body p,
.bubble-content p {
    margin-bottom: 1em;
}

.modal-body ul,
.modal-body ol,
.bubble-content ul,
.bubble-content ol {
    padding-left: 1.5em; /* Better indentation */
    margin-bottom: 1em;
}

.modal-body li,
.bubble-content li {
    margin-bottom: 0.5em; /* Space between list items */
}

/* Highlight Strong Text */
.modal-body strong,
.bubble-content strong {
    color: var(--text-primary);
    font-weight: 600;
}
.modal-body h1,
.modal-body h2,
.modal-body h3 {
    color: var(--nexus-primary);
    margin-bottom: var(--space-md);
}

.modal-body p {
    margin-bottom: var(--space-md);
}

.modal-body code {
    background: var(--bg-card);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.modal-body pre {
    background: var(--bg-card);
    padding: var(--space-md);
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: var(--space-md);
}

.modal-body pre code {
    background: none;
    padding: 0;
}

/* Charts in bubble */
.nexus-chart {
    width: 100%;
    height: 250px;
    background: var(--bg-card);
    border-radius: 12px;
    margin: var(--space-md) 0;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-dim);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--nexus-primary-dim);
}
