/* ============================================================================
 * Alpha-Core V13.2 视觉样式
 * ============================================================================
 * 说明：
 * - 这个文件包含了所有自定义样式
 * - 基础样式使用 Tailwind CSS（通过 CDN 引入）
 * - 这里主要定义动画、特殊效果和颜色变量
 * ============================================================================ */

/* 颜色变量定义 */
:root {
    --bg-base: #09090b;           /* 基础背景色（深黑） */
    --bg-panel: #18181b;          /* 面板背景色（浅黑） */
    --border-color: #27272a;      /* 边框颜色 */
    --accent-primary: #8b5cf6;    /* 主题色（紫色） */
    --accent-up: #ef4444;         /* 上涨色（红色） */
    --accent-down: #10b981;       /* 下跌色（绿色） */
    --text-main: #e4e4e7;         /* 主文本色 */
    --text-muted: #71717a;        /* 次要文本色 */
}

/* 基础布局 */
body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: 'PingFang SC', 'Microsoft YaHei', 'JetBrains Mono', monospace;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================================
 * 扫描线动画（科技感效果）
 * ============================================================================ */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--accent-primary), transparent);
    opacity: 0.5;
    animation: scan 4s linear infinite;
    pointer-events: none;
    z-index: 20;
}

@keyframes scan {
    0% {
        top: 0%;
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.8;
    }
    100% {
        top: 100%;
        opacity: 0;
    }
}

/* ============================================================================
 * 模态框（弹窗）样式
 * ============================================================================ */

/* 模态框遮罩层 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 90;
    display: none;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.modal-backdrop.active {
    display: block;
    opacity: 1;
}

/* AI 分析模态框 */
.ai-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -45%) scale(0.95);
    width: 700px;
    max-width: 95%;
    max-height: 85vh;
    background: #18181b;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 60px rgba(139, 92, 246, 0.15);
    z-index: 100;
    display: none;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-modal.active {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

/* AI 模态框内容区域 */
.ai-content {
    font-size: 0.9rem;
    line-height: 1.7;
    color: #d4d4d8;
    padding: 1.5rem;
    overflow-y: auto;
}

.ai-content h1,
.ai-content h2 {
    color: #fff;
    font-weight: bold;
    margin: 1rem 0 0.5rem;
}

.ai-content p {
    margin-bottom: 0.8rem;
}

.ai-content strong {
    color: var(--accent-primary);
}

.ai-content li {
    margin-left: 1rem;
    list-style: disc;
    color: #a1a1aa;
}

/* ============================================================================
 * 聊天窗口样式
 * ============================================================================ */
.chat-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 340px;
    height: 480px;
    background: #18181b;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    z-index: 50;
    transform: translateY(120%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.chat-widget.open {
    transform: translateY(0);
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    background: #09090b;
}

/* 聊天气泡 */
.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    margin-bottom: 10px;
    max-width: 85%;
    font-size: 0.85rem;
    line-height: 1.4;
}

/* AI 消息气泡 */
.bubble-ai {
    background: #27272a;
    color: #e4e4e7;
    border-bottom-left-radius: 2px;
}

/* 用户消息气泡 */
.bubble-user {
    background: var(--accent-primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
    margin-left: auto;
}

/* ============================================================================
 * 徽章样式（实盘/仿真）
 * ============================================================================ */

/* 实盘徽章（带呼吸灯效果） */
.badge-live {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulse-red 2s infinite;
}

/* 仿真徽章 */
.badge-sim {
    background: rgba(168, 85, 247, 0.15);
    color: #d8b4fe;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* 红色呼吸灯动画 */
@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* ============================================================================
 * 按钮样式
 * ============================================================================ */

/* 功能按钮（悬浮工具栏） */
.btn-feature {
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.btn-feature:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(2px);
}

/* ============================================================================
 * 加载动画
 * ============================================================================ */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--accent-primary);
    animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ============================================================================
 * 滚动条样式（美化）
 * ============================================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #18181b;
}

::-webkit-scrollbar-thumb {
    background: #3f3f46;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #52525b;
}

/* ============================================================================
 * 响应式设计（小屏幕优化）
 * ============================================================================ */
@media (max-width: 1024px) {
    /* 在小屏幕上隐藏侧边栏 */
    .w-72 {
        display: none;
    }
    
    /* 聊天窗口在小屏幕上缩小 */
    .chat-widget {
        width: 280px;
        height: 400px;
        bottom: 16px;
        right: 16px;
    }
}
