/* ========== 全局变量与重置 ========== */
:root {
    --bg-dark: #0f0f1a;
    --bg-card: #14141f;
    --bg-header: #1e1e2c;
    --bg-table: #0e0e18;
    --border-color: #2c2c3e;
    --border-light: #262636;
    --text-primary: #eaeef2;
    --text-secondary: #aaa;
    --accent-blue: #4c6ef5;
    --accent-green: #2d6a2d;
    --accent-orange: #f0a500;
    --accent-red: #8b3a3a;
    --highlight-green: #9bff9b;
    --warning-orange: #ffaa66;
    --error-red: #ff9e7a;
}

* { box-sizing: border-box; }

body {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    padding: 24px 20px;
    margin: 0;
}

.container {
    max-width: 2500px;
    margin: 0 auto;
}

/* 顶部布局 */
.top-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}
.title-area h1 {
    font-size: 1.7rem;
    font-weight: 600;
    margin: 0;
    color: #eef2ff;
}
.status-bar {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.status-bar .count {
    color: var(--highlight-green);
    font-weight: bold;
}

/* 操作栏统一样式 */
.unified-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
    background: #111118;
    padding: 12px 24px;
    border-radius: 48px;
    margin: 20px 0 24px;
}
.btn-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}
.api-btn {
    cursor: pointer;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: bold;
    padding: 8px 20px;
    border: none;
    transition: 0.2s;
}
.api-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}
.tab-btn {
    background: #2a2a30;
    color: #777;
    font-size: 1rem;
    padding: 8px 15px;
    border-radius: 40px;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}
.tab-btn.active {
    background: #1a1a2a;
    color: #fa0000 !important;
}

/* 通用下拉框（用于所有视图） */
.group-select {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #4c6ef5 !important;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-family: inherit;
    cursor: pointer;
}
.group-select option {
    background-color: #111111 !important;
    color: #ffffff !important;
}

/* 图表容器 */
#chartContainer {
    min-height: 300px;
    background: var(--bg-dark);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

/* 加载、错误占位 */
.loading-placeholder, .error-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text-secondary);
    font-size: 1.2rem;
}
.error-placeholder .retry-btn {
    margin-top: 16px;
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 8px 24px;
    border-radius: 40px;
    cursor: pointer;
}

/* 通用图表工具栏（Mini 和 Advanced 共用基础样式） */
.chart-toolbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.chart-toolbar select {
    background-color: #000 !important;
    color: #fff !important;
    border: 1px solid #4c6ef5 !important;
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-family: inherit;
    cursor: pointer;
}
.chart-toolbar select option {
    background-color: #111 !important;
    color: #fff !important;
}
.chart-toolbar span {
    color: #aaa;
    font-size: 0.85rem;
}

/* 底部 */
footer {
    margin-top: 40px;
    text-align: center;
    font-size: 11px;
    color: #5a5a7a;
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #1e1e2a; }
::-webkit-scrollbar-thumb { background: #4c6a8f; border-radius: 10px; }

/* 响应式 - 通用部分 */
@media (max-width: 1280px) {
    .unified-action-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ========== 暂时不清除（可疑无用样式） ========== */
/* .manual-btn 可能未使用，保留以备后续 */
.manual-btn {
    background: var(--accent-green) !important;
    color: #e0ffe0 !important;
}