/* 用量信息页面样式 */

/* 仪表板布局 */
.dashboard-container {
    display: flex;
    min-height: calc(100vh - 200px);
    max-width: 1400px;
    margin: 0 auto;
    gap: 0;
}

/* 侧边栏 */
.sidebar {
    width: 250px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-primary);
    padding: 2rem 0;
    position: fixed;
    left: 0;
    top: 80px;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1.5rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-weight: 500;
}

.sidebar-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.sidebar-link.active {
    background: var(--accent-primary);
    color: white;
}

.sidebar-icon {
    font-size: 1.2rem;
    width: 20px;
    text-align: center;
}

.sidebar-text {
    font-size: 0.95rem;
}

/* 内容区域 */
.content-area {
    flex: 1;
    padding: 2rem 3rem;
    background: var(--bg-primary);
    margin-left: 250px;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.header-left {
    flex: 1;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-filter {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.time-filter:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* 统计卡片 */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.balance {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.stat-icon.consumption {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.stat-icon.requests {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-icon.tokens {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

.stat-info {
    flex: 1;
}

.stat-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.stat-change {
    font-size: 0.85rem;
    font-weight: 500;
}

.stat-change.positive {
    color: #10b981;
}

.stat-change.negative {
    color: #ef4444;
}

/* 图表区域 */
.charts-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.chart-card {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    padding: 1.5rem;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.chart-legend {
    display: flex;
    gap: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 3px;
}

.legend-color {
    background: var(--accent-primary);
}

.legend-color.blue {
    background: #3b82f6;
}

.legend-color.green {
    background: #10b981;
}

.legend-color.purple {
    background: #8b5cf6;
}

.legend-color.orange {
    background: #f59e0b;
}

.legend-color.pink {
    background: #ec4899;
}

.chart-container {
    position: relative;
    height: 250px;
}

/* 记录区域 */
.records-section {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border-primary);
    padding: 1.5rem;
}

.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.export-btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.export-btn:hover {
    background: var(--accent-secondary);
}

.export-icon {
    font-size: 1rem;
}

.records-table {
    overflow-x: auto;
}

.usage-table {
    width: 100%;
    border-collapse: collapse;
}

.usage-table th,
.usage-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-primary);
}

.usage-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-table td {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.usage-table tr:last-child td {
    border-bottom: none;
}

.usage-table tr:hover {
    background: var(--bg-tertiary);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }
    
    .sidebar {
        position: static;
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-primary);
        padding: 1rem 0;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 1rem;
    }
    
    .sidebar-link {
        white-space: nowrap;
    }
    
    .content-area {
        margin-left: 0;
        padding: 1.5rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .records-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}