/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: rgba(31, 41, 55, 0.9);

    --cyan-primary: #00f0ff;
    --cyan-secondary: #00a8b3;
    --cyan-glow: rgba(0, 240, 255, 0.3);

    --purple-primary: #7c3aed;
    --purple-secondary: #a78bfa;
    --purple-glow: rgba(124, 58, 237, 0.3);

    --green-primary: #10b981;
    --green-secondary: #34d399;
    --green-glow: rgba(16, 185, 129, 0.3);

    --red-primary: #ef4444;
    --red-secondary: #f87171;
    --red-glow: rgba(239, 68, 68, 0.3);

    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --border-color: rgba(0, 240, 255, 0.2);
    --border-hover: rgba(0, 240, 255, 0.4);

    --shadow-glow: 0 0 20px rgba(0, 240, 255, 0.2);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ==================== 背景效果 ==================== */
.background-grid {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: -1;
}

.background-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.05) 0%, transparent 70%);
}

.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan-primary), transparent);
    opacity: 0.5;
    animation: scan 4s linear infinite;
    pointer-events: none;
    z-index: 100;
}

@keyframes scan {
    0% { top: 0; }
    100% { top: 100vh; }
}

/* ==================== 容器 ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
}

/* ==================== 头部 ==================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0 40px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
}

.title-glow {
    color: var(--cyan-primary);
    text-shadow: 0 0 20px var(--cyan-glow), 0 0 40px var(--cyan-glow);
}

.subtitle {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 4px;
    margin-top: 4px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--green-secondary);
}

.pulse {
    width: 8px;
    height: 8px;
    background: var(--green-primary);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* ==================== 筛选面板 ==================== */
.filter-panel {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-label svg {
    width: 16px;
    height: 16px;
    stroke: var(--cyan-primary);
}

.cyber-select {
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2300f0ff'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.cyber-select:hover {
    border-color: var(--cyan-primary);
    box-shadow: 0 0 10px var(--cyan-glow);
}

.cyber-select:focus {
    outline: none;
    border-color: var(--cyan-primary);
    box-shadow: 0 0 20px var(--cyan-glow);
}

.cyber-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.cyber-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--cyan-primary), var(--cyan-secondary));
    border: none;
    border-radius: 8px;
    color: var(--bg-primary);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: auto;
}

.cyber-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.cyber-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px var(--cyan-glow);
}

.cyber-btn:active {
    transform: translateY(0);
}

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan-primary), var(--purple-primary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: var(--cyan-primary);
    box-shadow: 0 8px 32px rgba(0, 240, 255, 0.15);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.stat-icon.wins {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green-secondary);
}

.stat-icon.losses {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-secondary);
}

.stat-icon.kd {
    background: rgba(124, 58, 237, 0.1);
    color: var(--purple-secondary);
}

.stat-icon.duration {
    background: rgba(0, 240, 255, 0.1);
    color: var(--cyan-secondary);
}

.stat-icon.winrate {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-change {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.stat-change svg {
    width: 12px;
    height: 12px;
    stroke: currentColor;
}

.stat-change.positive {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green-secondary);
}

.stat-change.negative {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red-secondary);
}

.stat-change.neutral {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-secondary);
}

/* ==================== 图表区域 ==================== */
.chart-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.chart-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.title-accent {
    color: var(--cyan-primary);
}

.chart-tabs {
    display: flex;
    gap: 8px;
}

.chart-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chart-tab svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.chart-tab:hover {
    border-color: var(--cyan-primary);
    color: var(--cyan-primary);
}

.chart-tab.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--cyan-primary);
    color: var(--cyan-primary);
    box-shadow: 0 0 15px var(--cyan-glow);
}

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

/* 图表切换动画 */
.chart-container.switching {
    animation: chartSwitch 0.5s ease-in-out;
}

@keyframes chartSwitch {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    25% {
        opacity: 0;
        transform: translateX(-20px);
    }
    50% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ==================== 记录列表 ==================== */
.records-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    backdrop-filter: blur(10px);
}

.records-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.records-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

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

.table-header {
    display: grid;
    grid-template-columns: 100px 120px 80px 80px 80px 150px;
    padding: 12px 16px;
    background: rgba(0, 240, 255, 0.05);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table-row {
    display: grid;
    grid-template-columns: 100px 120px 80px 80px 80px 150px;
    padding: 16px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.table-row:hover {
    background: var(--bg-card-hover);
    border-left: 3px solid var(--cyan-primary);
}

.table-row:last-child {
    border-bottom: none;
}

.table-row .mode {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    display: inline-block;
}

.mode.rank { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.mode.casual { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.mode.clash { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.mode.solo { background: rgba(124, 58, 237, 0.2); color: #a78bfa; }

.table-row .result {
    font-weight: 600;
}

.result.win {
    color: var(--green-secondary);
}

.result.loss {
    color: var(--red-secondary);
}

/* ==================== 响应式 ==================== */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .chart-container {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .filter-panel {
        flex-direction: column;
    }

    .filter-group {
        width: 100%;
    }

    .cyber-select {
        width: 100%;
    }

    .cyber-btn {
        width: 100%;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .table-header,
    .table-row {
        grid-template-columns: 80px 100px 60px 60px 60px 120px;
        padding: 12px 8px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 16px;
    }

    .title {
        font-size: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 300px;
    }

    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }
}

/* ==================== 加载动画 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card,
.chart-section,
.records-section {
    animation: fadeInUp 0.6s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }
.stat-card:nth-child(5) { animation-delay: 0.5s; }

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--cyan-primary);
}
