/* 主体样式 */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fafc;
    color: #333;
    font-size: 14px;
    overflow-x: hidden;
    width: 100vw;
    height: 100vh;
}

.dashboard-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8fafc;
}

.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    padding: 8px;
    width: 100%;
}

.left-panel {
    width: 30%;
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: #f8fafc;
    overflow-y: auto;
}

.right-panel {
    width: 70%;
    display: flex;
    flex-direction: column;
    padding: 8px;
    background: #f8fafc;
    overflow-y: auto;
}

/* 统一卡片样式 - 永久阴影 */
.card {
    border-radius: 12px;
    border: none;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 8px;
    width: 100%;
}

.card-title {
    color: #2c3e50;
    font-weight: 600;
    padding: 8px 10px;
    margin: 0;
    font-size: 1rem;
}

.card-body {
    padding: 8px;
}

/* 隐藏按钮 */
.btn-square {
    display: none !important;
}

/* 下方卡片区域 */
.bottom-cards {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.server-card {
    flex: 1;
    background: #ffffff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 12px;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.server-card .card-section-title {
    flex-shrink: 0;
}

.server-list {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
}

.player-list-card {
    flex: 3;
    background: #ffffff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 12px;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.player-list-card .card-section-title {
    flex-shrink: 0;
}

.card-section-title {
    color: #2c3e50;
    font-weight: 600;
    padding: 0 0 8px 0;
    margin: 0;
    font-size: 0.95rem;
}

/* ==================== 首页创意加载动画 ==================== */
.page-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: #2c3e50;
}

.loading-logo {
    font-size: 3rem;
    margin-bottom: 30px;
    color: #5b9bd5;
    animation: bounce 1.5s ease-in-out infinite;
}

/* 修复加载动画三角形方向问题 */
@keyframes bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.loading-bars {
    display: flex;
    justify-content: center;
    gap: 6px; /* 稍微减小间隔 */
    height: 45px; /* 稍微减小高度 */
}

.loading-bar {
    width: 10px; /* 稍微减小宽度 */
    height: 35px; /* 稍微减小高度 */
    background: #5b9bd5;
    border-radius: 5px; /* 稍微减小圆角 */
    animation: barPulse 1.2s ease-in-out infinite;
}

/* 通过不同延迟营造层次感 */
.loading-bar:nth-child(1) { animation-delay: 0s; }
.loading-bar:nth-child(2) { animation-delay: 0.1s; }
.loading-bar:nth-child(3) { animation-delay: 0.2s; }
.loading-bar:nth-child(4) { animation-delay: 0.3s; }
.loading-bar:nth-child(5) { animation-delay: 0.4s; }
.loading-bar:nth-child(6) { animation-delay: 0.5s; }
.loading-bar:nth-child(7) { animation-delay: 0.6s; }

@keyframes barPulse {
    0%, 100% { 
        transform: scaleY(0.6); 
        opacity: 0.7; 
    }
    50% { 
        transform: scaleY(1); 
        opacity: 1; 
    }
}

/* 移除加载文字 */
.loading-text {
    display: none; /* 隐藏文字 */
}

/* 全局进度条 - 修改后的样式 */
#global-progress-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 10000;
    overflow: hidden;
}

#global-progress {
    position: absolute;
    top: 0;
    left: 0; /* 确保从最左边开始 */
    width: 0%; /* 初始宽度为0% */
    height: 100%;
    background: linear-gradient(90deg, #a1c4fd, #c2e9fb); /* 使用更淡的颜色 */
    box-shadow: 0 0 8px rgba(161, 196, 253, 0.6); /* 更柔和的阴影 */
    transition: width 0.4s ease-out; /* 添加缓动效果使动画更自然 */
    border-radius: 0 2px 2px 0;
}

/* 完成动画效果 */
#global-progress.complete {
    width: 100% !important;
    opacity: 0;
    transform: scaleY(1.5);
    transition: all 0.5s ease-in-out;
}

/* 时间范围显示 */
.time-range-display {
    font-size: 0.8rem;
    color: #6c757d;
    margin-left: 10px;
    font-weight: normal;
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #ffffff;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* 服务器列表滚动条 */
.server-list::-webkit-scrollbar,
.players-container::-webkit-scrollbar {
    width: 6px;
}

.server-list::-webkit-scrollbar-track,
.players-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.server-list::-webkit-scrollbar-thumb,
.players-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.server-list::-webkit-scrollbar-thumb:hover,
.players-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 响应式 */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .left-panel, .right-panel {
        width: 100%;
        padding: 8px;
    }
    
    .bottom-cards {
        flex-direction: column;
    }
    
    .server-card, .player-list-card {
        flex: none;
    }
}

/* 隐藏左侧面板滚动条但保持功能 */
.left-panel::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.left-panel::-webkit-scrollbar-thumb {
    background: transparent;
}

/* 修复 DateRangePicker 样式 */
.daterangepicker {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.daterangepicker td.available:hover,
.daterangepicker th.available:hover {
    background-color: #e9ecef;
}

.daterangepicker td.active,
.daterangepicker td.active:hover {
    background-color: #4361ee;
}

.daterangepicker select.monthselect,
.daterangepicker select.yearselect {
    font-size: 12px;
    padding: 2px;
    margin: 0 2px;
}

/* ==================== 新增 DateRangePicker 美化样式 ==================== */
/* 自定义美化下拉列表（适用于 daterangepicker 的月份和年份选择） */
.daterangepicker .drp-calendar .select-wrapper {
    position: relative;
    display: inline-block;
    margin: 0 2px;
}

.daterangepicker .drp-calendar .select-wrapper::after {
    content: "▼";
    font-size: 10px;
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
}

.daterangepicker .drp-calendar .select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 20px 4px 8px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    outline: none;
    width: auto;
    min-width: 60px;
}

/* 图表tooltip优化 - 美化样式 */
.chartjs-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, 0);
    transition: all .1s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.chartjs-tooltip .chartjs-tooltip-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.chartjs-tooltip .chartjs-tooltip-body {
    font-weight: 400;
}

/* 玩家卡片高亮效果 */
.player-card.highlight {
    background-color: #e3f2fd !important;
    border-color: #5b9bd5;
    box-shadow: 0 2px 8px rgba(91, 155, 213, 0.3);
}

/* 加载状态下的图表禁用样式 */
.chart-container.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* 选中数据点的样式优化 */
.player-chart-selected-point {
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.5);
}

/* 面板加载蒙版 */
.panel-loading-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(2px);
    z-index: 99999 !important;
    border-radius: 12px;
}
