/* 量化回测平台 - 自定义样式 */

/* 全局样式 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
}

.container {
    flex: 1;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 600;
    font-size: 1.3rem;
}

/* 卡片样式优化 */
.card {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.card-header {
    font-weight: 600;
}

/* 按钮样式 */
.btn {
    font-weight: 500;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
}

/* 代码编辑器相关 */
.code-editor {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    background-color: #1e1e1e;
    color: #d4d4d4;
    border: none;
    resize: none;
    min-height: 500px;
}

.code-editor:focus {
    background-color: #1e1e1e;
    color: #d4d4d4;
    box-shadow: none;
    border: none;
}

/* 代码高亮预览 */
pre.code-preview {
    background-color: #1e1e1e;
    color: #d4d4d4;
    border-radius: 8px;
    font-size: 13px;
    overflow-x: auto;
}

/* 表格样式 */
.table th {
    font-weight: 600;
    background-color: #f8f9fa;
    border-top: none;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,0,0,0.02);
}

/* 状态标签 */
.status-badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 600;
    border-radius: 0.375rem;
}

.status-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

.status-warning {
    background-color: #fff3cd;
    color: #664d03;
}

.status-danger {
    background-color: #f8d7da;
    color: #842029;
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 回测结果面板 */
.metrics-card {
    text-align: center;
    padding: 1.5rem;
}

.metrics-value {
    font-size: 2rem;
    font-weight: 700;
    color: #0d6efd;
}

.metrics-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

/* 侧边栏 */
.sidebar {
    min-height: calc(100vh - 56px);
    background-color: #fff;
    border-right: 1px solid #dee2e6;
}

.sidebar .nav-link {
    color: #333;
    padding: 0.75rem 1rem;
    border-radius: 0;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: #f8f9fa;
    color: #0d6efd;
}

/* 编辑器布局 */
.editor-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
}

.editor-toolbar {
    background-color: #fff;
    border-bottom: 1px solid #dee2e6;
    padding: 0.5rem 1rem;
}

.editor-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.editor-sidebar {
    width: 250px;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    padding: 1rem;
}

.editor-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 输出面板 */
.output-panel {
    height: 200px;
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem;
    overflow-y: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
}

.output-panel .log-info {
    color: #4fc1ff;
}

.output-panel .log-success {
    color: #4caf50;
}

.output-panel .log-error {
    color: #f44336;
}

.output-panel .log-warning {
    color: #ff9800;
}

/* 页脚 */
footer {
    margin-top: auto;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .editor-sidebar {
        display: none;
    }
    
    .metrics-value {
        font-size: 1.5rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    border: 0.25em solid #e9ecef;
    border-right-color: #0d6efd;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
