:root {
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-color: #409eff;
    --accent-hover: #66b1ff;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
    
    --success: #67c23a;
    --warning: #e6a23c;
    --danger: #f56c6c;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

/* Navigation */
.navbar {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-brand i {
    font-size: 1.5rem;
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    font-weight: 500;
}

.nav-link:hover {
    background-color: var(--bg-color);
    color: var(--accent-color);
}

.nav-link.active {
    background-color: var(--accent-color);
    color: #ffffff;
}

.nav-link i {
    font-size: 1.2rem;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
    }
    
    .nav-link {
        flex: 1;
        justify-content: center;
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .nav-link span {
        display: none;
    }
    
    .nav-link i {
        font-size: 1.5rem;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

.header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.header-content .badge {
    background-color: var(--accent-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.theme-toggle button {
    background: var(--card-bg);
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle button:hover {
    transform: translateY(-2px);
    background-color: var(--accent-color);
    color: white;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.full-width {
    grid-column: 1 / -1;
}

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

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

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    padding-bottom: 10px;
}

.card-header h2 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.card-header h2 i {
    color: var(--accent-color);
}

.status-indicator {
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: rgba(128, 128, 128, 0.1);
}

.status-indicator.online {
    color: var(--success);
    background-color: rgba(103, 194, 58, 0.1);
}

.status-indicator.offline {
    color: var(--danger);
    background-color: rgba(245, 108, 108, 0.1);
}

/* Stat Items */
.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stat-item .label {
    color: var(--text-secondary);
}

.stat-item .value {
    font-weight: 700;
    font-size: 1.2rem;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stat-box {
    background-color: rgba(128, 128, 128, 0.05);
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-box.full-width {
    grid-column: 1 / -1;
    display: block;
    text-align: left;
}

.stat-box .label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.stat-box .value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-box .value-small {
    font-weight: 600;
}

/* Progress Bars */
.progress-bar-container {
    height: 8px;
    background-color: rgba(128, 128, 128, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 5px;
}

.progress-bar-container.large {
    height: 8px;
    margin-top: 5px;
}

.progress-bar {
    height: 100%;
    background-color: var(--accent-color);
    width: 0%;
    transition: width 0.5s ease-out, background-color 0.3s;
}

.progress-bar.warning { background-color: var(--warning); }
.progress-bar.danger { background-color: var(--danger); }

/* Dual Layer Progress Bar */
.progress-bar-container.dual-layer {
    position: relative;
    height: 8px;
    background-color: rgba(128, 128, 128, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-container.dual-layer .progress-bar {
    position: absolute;
    height: 100%;
    transition: width 0.5s ease-out;
    border-radius: 4px;
}

.progress-bar.layer-bottom {
    z-index: 1;
}

.progress-bar.layer-top {
    z-index: 2;
}

.progress-bar.tooldelta {
    background: linear-gradient(90deg, #FF9800, #FF5722);
}

.progress-bar.luminol {
    background: linear-gradient(90deg, #2196F3, #03A9F4);
}

/* Memory Legend */
.memory-legend {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 0.85rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
}

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

.legend-color.tooldelta {
    background: linear-gradient(90deg, #FF9800, #FF5722);
}

.legend-color.luminol {
    background: linear-gradient(90deg, #2196F3, #03A9F4);
}

.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Pills Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.stat-pill {
    display: flex;
    align-items: center;
    background-color: rgba(128, 128, 128, 0.05);
    padding: 15px;
    border-radius: 8px;
}

.stat-pill i {
    font-size: 2rem;
    margin-right: 15px;
    color: var(--text-secondary);
    opacity: 0.7;
}

.pill-content {
    display: flex;
    flex-direction: column;
}

.pill-content .label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pill-content .value {
    font-size: 1.2rem;
    font-weight: 700;
}

/* Player List */
.player-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.player-chip {
    display: flex;
    align-items: center;
    background-color: rgba(64, 158, 255, 0.1);
    color: var(--accent-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.2s;
}

.player-chip:hover {
    background-color: var(--accent-color);
    color: white;
    transform: scale(1.05);
}

.player-chip img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 8px;
    flex-shrink: 0;
}

.player-chip img[style*="display: none"] {
    margin-right: 0;
}

/* Server-specific player colors */
.player-chip.tooldelta-player {
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.player-chip.luminol-player {
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.player-info {
    font-size: 0.75rem;
    margin-left: 12px;
    font-family: 'Courier New', monospace;
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.player-info .item {
    display: inline-flex;
    align-items: center;
    margin-right: 8px;
}

.player-info .label {
    color: var(--text-secondary);
    opacity: 0.7;
    font-weight: 400;
    margin-right: 2px;
}

.player-info .value-time {
    color: #4CAF50;
    font-weight: 600;
    min-width: 40px;
}

.player-info .value-id {
    color: #2196F3;
    font-weight: 600;
    min-width: 40px;
}

.player-info .value-gold {
    color: #FFC107;
    font-weight: 600;
    min-width: 50px;
}

.empty-msg {
    color: var(--text-secondary);
    font-style: italic;
    width: 100%;
    text-align: center;
    padding: 20px;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.footer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: rgba(128, 128, 128, 0.08);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
}

.footer-icon svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.footer-icon i {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.footer-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.footer-icon:active {
    transform: translateY(-1px);
}

/* Bilibili icon specific styles */
.footer-icon.bilibili {
    color: #FB7299;
}

.footer-icon.bilibili svg {
    fill: currentColor;
}

.footer-icon.bilibili:hover {
    background-color: #FB7299;
    color: white;
}

.footer-icon.bilibili:hover svg {
    transform: scale(1.1);
}

/* QQ icon specific styles */
.footer-icon.qq {
    color: #12B7F5;
}

.footer-icon.qq i {
    color: currentColor;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    width: 100%;
    height: 100%;
    position: relative;
    top: 1px; /* 微调垂直居中 */
}

.footer-icon.qq:hover {
    background-color: #12B7F5;
    color: white;
}

.footer-icon.qq:hover i {
    transform: scale(1.1);
}

/* Remove old text-icon styles */
.footer-icon .text-icon {
    display: none;
}

.timestamp {
    margin-top: 5px;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Checkbox Toggle for Theme (if used as checkbox instead of button) */
/* Hidden elements based on config */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes themeSpread {
    0% {
        transform: scale(0);
        opacity: 0.8;
        border-radius: 50%;
    }
    100% {
        transform: scale(200);
        opacity: 0;
        border-radius: 50%;
    }
}

.theme-spread-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 主题切换过渡容器 */
.theme-transition-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

/* 克隆的内容容器 */
.theme-cloned-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    /* 初始状态：完全不显示 */
    clip-path: circle(0px at var(--clip-x, 50%) var(--clip-y, 50%));
    transition: clip-path 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: clip-path;
}

/* 扩散动画 - 通过 JS 动态添加 */
.theme-cloned-content.expanding {
    clip-path: circle(150vmax at var(--clip-x, 50%) var(--clip-y, 50%));
}

/* 确保克隆的内容正确应用主题 */
#app-clone {
    width: 100%;
    height: 100%;
}

@media (max-width: 600px) {
    .header-content h1 { font-size: 1.5rem; }
    .grid-2 { grid-template-columns: 1fr; }
    .stat-pill { flex-direction: column; text-align: center; }
    .stat-pill i { margin-right: 0; margin-bottom: 5px; }
    
    /* Footer icons responsive */
    .footer-links {
        gap: 15px;
    }
    
    .footer-icon {
        width: 40px;
        height: 40px;
    }
    
    .footer-icon svg,
    .footer-icon i {
        width: 20px;
        height: 20px;
        font-size: 20px;
    }
}

/* Chart Styles */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

.time-range-select {
    background-color: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.time-range-select:hover {
    border-color: var(--accent-color);
}

.time-range-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* Chart responsive */
@media (max-width: 768px) {
    .chart-container {
        height: 250px;
    }
    
    .card-header h2 {
        font-size: 1rem;
    }
    
    .time-range-select {
        font-size: 0.85rem;
        padding: 5px 10px;
    }
}