* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #111936;
    --bg-card: #151b3b;
    --border-color: #1e2a5e;
    --accent-primary: #00d4ff;
    --accent-secondary: #7b2cbf;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7b2cbf 100%);
    --text-primary: #ffffff;
    --text-secondary: #8892b0;
    --success: #00ff88;
    --danger: #ff4757;
    --warning: #ffa502;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-primary);
    overflow-x: hidden;
}

/* 背景动画 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(123, 44, 191, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 导航栏 */
.navbar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 30px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 30px rgba(0, 212, 255, 0.1);
}

.navbar h1 {
    font-size: 28px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 12px;
}

.navbar h1::before {
    content: '';
    width: 8px;
    height: 35px;
    background: var(--accent-gradient);
    border-radius: 4px;
}

.nav-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
}

.live-time {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: 20px;
}

.live-time::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

/* 自动刷新设置 */
.auto-refresh {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-refresh select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.auto-refresh select:hover {
    border-color: var(--accent-primary);
}

.auto-refresh select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

#refreshCountdown {
    font-size: 12px;
    color: var(--accent-primary);
    min-width: 100px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    border-color: var(--accent-primary);
}

/* 主布局 */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

/* 统计卡片行 */
.stats-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gradient);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 212, 255, 0.15);
    border-color: var(--accent-primary);
}

.stat-card h4 {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-card .value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Consolas', monospace;
}

.stat-card .change {
    font-size: 14px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-card .change.positive {
    color: var(--success);
}

.stat-card .change.negative {
    color: var(--danger);
}

.stat-card .icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 48px;
    opacity: 0.15;
}

/* 图表面板 */
.chart-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    backdrop-filter: blur(10px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 20px;
}

.chart-header h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-header h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

/* 时间选择按钮 */
.quick-dates {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.quick-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.quick-btn:hover {
    color: var(--accent-primary);
}

.quick-btn.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 450px;
    margin: 20px 0;
}

#balanceChart, #myChart {
    width: 100% !important;
    height: 100% !important;
}

/* 日期范围选择 */
.date-range-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 25px 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.date-range-panel h3 {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
}

.date-range {
    display: flex;
    gap: 15px;
    align-items: center;
    flex: 1;
}

.date-range input[type="date"] {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 14px;
    min-width: 160px;
    transition: all 0.3s;
}

.date-range input[type="date"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.date-range input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.date-range span {
    color: var(--text-secondary);
    font-size: 14px;
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 400px;
    color: var(--text-secondary);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading p {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 未配置提示 */
.no-config-notice {
    background: linear-gradient(135deg, rgba(255, 165, 2, 0.1) 0%, rgba(255, 71, 87, 0.1) 100%);
    border: 1px solid var(--warning);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    text-align: center;
}

.no-config-notice h3 {
    color: var(--warning);
    font-size: 20px;
    margin-bottom: 12px;
}

.no-config-notice p {
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.no-config-notice a {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    padding: 12px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
}

.no-config-notice a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 255, 0.3);
}

/* 错误提示 */
.error-message {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 400px;
    color: var(--text-secondary);
}

/* 提现记录面板 */
.withdrawal-panel {
    margin-top: 25px;
}

.withdrawal-records {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 200px;
    overflow-y: auto;
    padding: 5px;
}

.withdrawal-record-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
}

.withdrawal-record-item:hover {
    border-color: var(--success);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 255, 136, 0.1);
}

.record-date {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 8px;
}

.record-amount {
    color: var(--success);
    font-size: 20px;
    font-weight: 700;
}

.record-remark {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stats-row .stat-card:nth-child(4),
    .stats-row .stat-card:nth-child(5) {
        grid-column: span 1;
    }
}

@media (max-width: 1100px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-row .stat-card:nth-child(5) {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    .container {
        padding: 15px;
    }
    
    .navbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 15px 20px;
    }
    
    .navbar h1 {
        font-size: 22px;
    }
    
    .nav-buttons {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .live-time {
        margin-right: 0;
        justify-content: center;
    }
    
    .auto-refresh {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .auto-refresh select {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    #refreshCountdown {
        min-width: auto;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .stats-row .stat-card:nth-child(5) {
        grid-column: span 1;
    }
    
    .stat-card .value {
        font-size: 26px;
    }
    
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-range-panel {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-range {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .date-range input[type="date"] {
        flex: 1;
        min-width: 140px;
    }
    
    .chart-container {
        height: 350px;
    }
    
    .withdrawal-records {
        grid-template-columns: 1fr;
    }
    
    .record-amount {
        font-size: 18px;
    }
}

@media (min-width: 1920px) {
    .container {
        padding: 30px 50px;
    }
    
    .chart-container {
        height: 550px;
    }
    
    .stat-card .value {
        font-size: 38px;
    }
    
    .navbar h1 {
        font-size: 32px;
    }
}

/* 大屏模式 (2K+) */
@media (min-width: 2560px) {
    .container {
        max-width: 2400px;
        padding: 40px 80px;
    }
    
    .chart-container {
        height: 700px;
    }
    
    .stat-card {
        padding: 35px;
    }
    
    .stat-card .value {
        font-size: 48px;
    }
    
    .navbar h1 {
        font-size: 38px;
    }
}
