/* AlphaPrompt 全局自定义样式 */

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #383b4c; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4a4d5e; }

/* 数字等宽字体 */
.font-tabular { font-variant-numeric: tabular-nums; font-family: 'JetBrains Mono', 'Fira Code', monospace; }

/* 导航激活状态 */
.nav-btn.active { background: rgba(124, 58, 237, 0.15); color: #a78bfa; }

/* 卡片悬停效果 */
.card-hover { transition: all 0.2s ease; }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); border-color: rgba(124, 58, 237, 0.3); }

/* 脉冲动画 */
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }

/* 骨架屏动画 */
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skeleton {
    background: linear-gradient(90deg, #1c1f2e 25%, #252838 50%, #1c1f2e 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

/* 涨跌颜色 */
.text-profit { color: #22c55e; }
.text-loss { color: #ef4444; }
.bg-profit { background-color: rgba(34, 197, 94, 0.15); }
.bg-loss { background-color: rgba(239, 68, 68, 0.15); }

/* 策略状态标签 */
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 9999px; font-size: 11px; font-weight: 500; }
.status-draft { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.status-paper_trading { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-backtesting { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.status-stopped { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

/* 表格样式 */
.data-table { width: 100%; border-collapse: collapse; }
.data-table thead th { padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 600; color: #9496a6; text-transform: uppercase; letter-spacing: 0.05em; border-bottom: 1px solid #252838; }
.data-table tbody td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid #1c1f2e; }
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: rgba(124, 58, 237, 0.05); }

/* 代码编辑器样式 */
.prompt-editor {
    background: #0f1117;
    border: 1px solid #252838;
    border-radius: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e2e8f0;
    padding: 16px;
    resize: vertical;
    min-height: 200px;
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}
.prompt-editor:focus { border-color: #7c3aed; }
.prompt-editor::placeholder { color: #4a4d5e; }

/* Toast动画 */
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }
.toast-enter { animation: slideIn 0.3s ease; }
.toast-exit { animation: slideOut 0.3s ease forwards; }

/* 置信度条 */
.confidence-bar { height: 4px; border-radius: 2px; background: #1c1f2e; overflow: hidden; }
.confidence-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }

/* 时间线 */
.timeline-item { position: relative; padding-left: 28px; }
.timeline-item::before { content: ''; position: absolute; left: 8px; top: 28px; bottom: -12px; width: 1px; background: #252838; }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: absolute; left: 0; top: 6px; width: 18px; height: 18px; border-radius: 50%; background: #161822; border: 2px solid #7c3aed; display: flex; align-items: center; justify-content: center; }

/* Tab样式 */
.tab-btn { padding: 8px 16px; font-size: 13px; color: #6b6e7f; border-bottom: 2px solid transparent; transition: all 0.2s; cursor: pointer; }
.tab-btn:hover { color: #9496a6; }
.tab-btn.active { color: #a78bfa; border-bottom-color: #7c3aed; }

/* 侧边信息 */
.side-label { font-size: 11px; color: #6b6e7f; margin-bottom: 2px; }
.side-value { font-size: 14px; font-weight: 600; color: #e2e8f0; }

/* 模态框背景 */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 90; }
.modal-content { position: fixed; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 91; max-height: 90vh; overflow-y: auto; }

/* 按钮样式 */
.btn-primary { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: white; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: all 0.2s; border: none; cursor: pointer; }
.btn-primary:hover { background: linear-gradient(135deg, #6d28d9, #5b21b6); box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3); }
.btn-secondary { background: #252838; color: #9496a6; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: all 0.2s; border: 1px solid #383b4c; cursor: pointer; }
.btn-secondary:hover { background: #2e3142; color: #e2e8f0; }
.btn-danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: all 0.2s; border: 1px solid rgba(239, 68, 68, 0.3); cursor: pointer; }
.btn-danger:hover { background: rgba(239, 68, 68, 0.25); }

/* 输入框 */
.input-field { background: #161822; border: 1px solid #252838; border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #e2e8f0; outline: none; transition: border-color 0.2s; width: 100%; }
.input-field:focus { border-color: #7c3aed; }
.input-field::placeholder { color: #4a4d5e; }

/* Select */
.select-field { background: #161822; border: 1px solid #252838; border-radius: 8px; padding: 8px 12px; font-size: 13px; color: #e2e8f0; outline: none; transition: border-color 0.2s; width: 100%; cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b6e7f' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.select-field:focus { border-color: #7c3aed; }

/* 响应式 */
@media (max-width: 768px) {
    .hide-mobile { display: none !important; }
}

/* 隐藏滚动条（用于tab横向滚动） */
.scrollbar-hide::-webkit-scrollbar { display: none; }
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }

/* 移动端导航按钮激活状态 */
.mobile-nav-btn.active {
    background: rgba(124, 58, 237, 0.15);
    color: #a78bfa;
}

/* 移动端表格优化 */
@media (max-width: 768px) {
    .data-table { font-size: 12px; }
    .data-table thead th { padding: 8px 8px; font-size: 10px; white-space: nowrap; }
    .data-table tbody td { padding: 8px 8px; font-size: 12px; white-space: nowrap; }
    
    /* 模态框移动端适配 */
    .modal-content { 
        width: calc(100% - 32px) !important; 
        max-width: 100% !important;
        left: 16px !important;
        right: 16px !important;
        transform: translateY(-50%) !important;
    }
    
    /* 编辑器移动端缩小字体 */
    .prompt-editor { font-size: 12px; padding: 12px; min-height: 150px; }
    
    /* 图表高度缩小 */
    #chart-compare, #chart-detail-perf { height: 240px !important; }
    #chart-drawdown, #chart-heatmap, #chart-detail-dd, #chart-detail-daily { height: 180px !important; }
}

/* 小屏幕额外优化 */
@media (max-width: 480px) {
    /* 页面内边距缩小 */
    #page-container { padding: 12px !important; }
    
    /* 卡片内边距缩小 */
    .card-hover { padding: 12px; }
    
    /* 按钮缩小 */
    .btn-primary, .btn-secondary, .btn-danger { padding: 6px 12px; font-size: 12px; }
    
    /* Tab按钮缩小 */
    .tab-btn { padding: 6px 12px; font-size: 12px; }
}
