/* 基础样式重置 - 统一风格 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    overflow-x: hidden;
    font-size: 14px; /* 基准字体大小缩小 - 统一风格 */
}

/* 浅灰色背景 - 统一风格 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
    line-height: 1.5; /* 行高适当减小 - 统一风格 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
}

/* 容器宽度设置 - 统一风格 */
.container {
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 - 统一风格 */
header {
    background: #2c3e50;
    padding: 8px 0; /* 减少内边距 - 统一风格 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px; /* 缩小间距 - 统一风格 */
}

.logo-circle {
    width: 36px; /* 缩小尺寸 - 统一风格 */
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1E90FF, #00CED1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.logo-text {
    font-size: 1.1rem; /* 缩小字体 - 统一风格 */
    font-weight: normal;
    color: white;
    letter-spacing: 0.5px;
}

/* 导航栏样式 - 统一风格 */
nav ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 15px; /* 缩小间距 - 统一风格 */
    padding: 0;
}

nav ul li {
    flex: none;
}

nav ul li a {
    display: flex;
    align-items: center;
    gap: 6px; /* 缩小间距 - 统一风格 */
    padding: 6px 10px; /* 缩小内边距 - 统一风格 */
    background: transparent;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 0.85rem; /* 缩小字体 - 统一风格 */
    touch-action: manipulation;
    white-space: nowrap;
}

nav ul li a:hover {
    color: #4CAF50;
}

nav ul li a.current {
    color: #4CAF50;
}

.nav-icon {
    font-size: 1rem; /* 缩小图标 - 统一风格 */
}

/* 主内容区域 */
main {
    flex: 1;
    padding: 15px 0; /* 减少内边距 - 统一风格 */
}

/* 页面标题 - 缩小字体 */
.page-title {
    text-align: center;
    color: #333;
    margin: 20px 0 8px; /* 减少边距 - 统一风格 */
    font-size: 1.8rem; /* 缩小字体 - 统一风格 */
    font-weight: 700;
}

/* 服务器状态网格布局 */
.server-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px; /* 缩小间距 - 统一风格 */
    margin: 20px 0; /* 减少外边距 - 统一风格 */
}

/* 服务器卡片样式 - 统一风格 */
.server-card {
    background: white;
    border-radius: 10px;
    padding: 15px; /* 减少内边距 - 统一风格 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center;
    display: flex;
    flex-direction: column;
    min-height: 180px; /* 减小最小高度 */
    cursor: pointer;
}

/* 服务器卡片悬停效果 - 减小动画幅度 */
.server-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border-color: #4CAF50;
}

/* 服务器头部样式 */
.server-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px; /* 减少边距 - 统一风格 */
    padding-bottom: 8px; /* 减少内边距 - 统一风格 */
    border-bottom: 2px solid rgba(76, 175, 80, 0.3);
}

.server-header.online {
    border-color: #4CAF50;
}

.server-header.offline {
    border-color: #f44336;
}

.server-icon {
    width: 40px; /* 缩小尺寸 */
    height: 40px;
    border-radius: 8px;
    margin-right: 12px; /* 缩小间距 */
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px; /* 缩小字体 */
    color: #666;
    overflow: hidden;
}

.server-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-name {
    font-size: 1.2rem; /* 缩小字体 */
    font-weight: 700;
    color: #333;
    flex: 1;
}

.server-status {
    padding: 5px 10px; /* 减小内边距 */
    border-radius: 20px;
    font-size: 0.8rem; /* 缩小字体 */
    font-weight: bold;
    color: white;
}

.server-status.online {
    background: #4CAF50;
}

.server-status.offline {
    background: #f44336;
}

/* 服务器信息样式 */
.server-info {
    margin-bottom: 10px; /* 减少边距 */
}

.server-info label {
    font-weight: bold;
    color: #666;
    display: block;
    margin-bottom: 4px; /* 减少边距 */
    font-size: 0.85rem; /* 缩小字体 */
}

.server-info p {
    margin: 0;
    color: #333;
    font-size: 0.95rem; /* 缩小字体 */
}

/* 服务器类型标签 */
.server-type-badge {
    display: inline-block;
    padding: 3px 8px; /* 减小内边距 */
    border-radius: 12px;
    font-size: 0.75rem; /* 缩小字体 */
    font-weight: 500;
    margin-top: 4px; /* 减少边距 */
}

.server-type-badge.java {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.server-type-badge.bedrock {
    background-color: #e3f2fd;
    color: #1565c0;
}

/* 玩家列表样式 */
.player-list {
    margin-top: 12px; /* 减少边距 */
}

.player-list h4 {
    font-size: 0.85rem; /* 缩小字体 */
    color: #666;
    margin-bottom: 6px; /* 减少边距 */
    font-weight: bold;
}

.player-names {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    max-height: 70px; /* 减小最大高度 */
    overflow-y: auto;
    padding: 4px; /* 减小内边距 */
}

.player-tag {
    background-color: rgba(76, 175, 80, 0.2);
    color: #2e7d32;
    padding: 3px 6px; /* 减小内边距 */
    border-radius: 12px;
    font-size: 0.75rem; /* 缩小字体 */
    transition: all 0.3s ease;
}

.player-tag:hover {
    background-color: rgba(76, 175, 80, 0.3);
}

.no-players {
    color: #999;
    font-style: italic;
    font-size: 0.85rem; /* 缩小字体 */
}

/* 无服务器提示 */
.no-servers {
    text-align: center;
    padding: 40px 20px; /* 减少内边距 */
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px auto; /* 减少外边距 */
    border: 1px solid #e0e0e0;
}

.no-servers h2 {
    color: #333;
    margin-bottom: 12px; /* 减少边距 */
    font-size: 1.5rem; /* 缩小字体 */
}

.no-servers p {
    color: #666;
    font-size: 1rem; /* 缩小字体 */
}

/* 底部样式 - 透明纯文字显示（如首页） */
footer {
    background: transparent; /* 改为透明背景 */
    padding: 20px 0; /* 调整内边距 */
    text-align: center;
    border-top: none; /* 去掉上边框 */
    font-size: 0.85rem; /* 保持字体大小 - 统一风格 */
    width: 100%;
    margin-top: auto;
}

footer p {
    margin: 5px 0;
    color: #666; /* 改为深灰色，在浅色背景上可见 */
}

footer a {
    color: #4CAF50; /* 链接改为绿色 */
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #2E7D32; /* 悬停时深绿色 */
    text-decoration: underline;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
}

.modal-header {
    padding: 15px; /* 减少内边距 */
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem; /* 缩小字体 */
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px; /* 缩小字体 */
    cursor: pointer;
    color: #666;
    padding: 5px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.close-btn:hover {
    background-color: #f0f0f0;
}

.modal-body {
    padding: 15px; /* 减少内边距 */
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

/* 图表相关样式 */
.chart-wrapper {
    height: 250px; /* 减小高度 */
    margin: 15px 0; /* 减少外边距 */
}

.date-selector {
    display: flex;
    align-items: center;
    gap: 8px; /* 缩小间距 */
    margin-bottom: 12px; /* 减少边距 */
    background-color: #f9f9f9;
    padding: 12px; /* 减少内边距 */
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    flex-wrap: wrap;
}

.date-selector label {
    font-weight: bold;
    color: #333;
    font-size: 0.9rem; /* 缩小字体 */
}

.date-input {
    padding: 6px 10px; /* 减小内边距 */
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem; /* 缩小字体 */
}

.date-btn {
    padding: 6px 12px; /* 减小内边距 */
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 0.9rem; /* 缩小字体 */
}

.date-btn:hover {
    background-color: #45a049;
}

/* 统计摘要样式 */
.date-range-stats {
    margin-top: 15px; /* 减少边距 */
    padding: 12px; /* 减少内边距 */
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.date-range-stats h4 {
    margin-top: 0;
    margin-bottom: 12px; /* 减少边距 */
    color: #495057;
    font-size: 0.95rem; /* 缩小字体 */
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px; /* 缩小间距 */
}

.stat-item {
    text-align: center;
    padding: 8px; /* 减少内边距 */
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-item label {
    display: block;
    font-size: 0.8rem; /* 缩小字体 */
    color: #6c757d;
    margin-bottom: 4px; /* 减少边距 */
}

.stat-item span {
    display: block;
    font-size: 1rem; /* 缩小字体 */
    font-weight: bold;
    color: #495057;
}

/* 响应式设计 - 平板和桌面 */
@media (min-width: 768px) {
    html, body {
        font-size: 15px; /* 桌面端稍大一些 - 统一风格 */
    }
    
    .logo-circle {
        width: 45px; /* 调整尺寸 - 统一风格 */
        height: 45px;
    }
    
    .logo-text {
        font-size: 1rem; /* 缩小字体 - 统一风格 */
    }
    
    nav ul {
        gap: 20px; /* 调整间距 - 统一风格 */
    }
    
    nav ul li a {
        padding: 8px 12px; /* 调整内边距 - 统一风格 */
        font-size: 0.9rem; /* 缩小字体 - 统一风格 */
    }
    
    .nav-icon {
        font-size: 1.1rem; /* 调整图标大小 - 统一风格 */
    }
    
    main {
        padding: 30px 0; /* 调整内边距 - 统一风格 */
    }
    
    .server-grid {
        grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
        gap: 25px; /* 调整间距 - 统一风格 */
        margin: 30px 0; /* 调整外边距 - 统一风格 */
    }
    
    .server-card {
        padding: 20px; /* 调整内边距 - 统一风格 */
    }
    
    .page-title {
        font-size: 2.2rem; /* 缩小字体 - 统一风格 */
    }
    
    .modal-header h3 {
        font-size: 1.5rem; /* 调整字体大小 */
    }
}

@media (max-width: 767px) {
    html, body {
        font-size: 13px; /* 移动端更小 - 统一风格 */
    }
    
    .header-content {
        flex-direction: column;
        gap: 8px; /* 缩小间距 - 统一风格 */
    }
    
    .logo-container {
        width: 100%;
        justify-content: center;
    }
    
    nav {
        width: 100%;
    }
    
    nav ul {
        justify-content: center;
        gap: 8px; /* 缩小间距 - 统一风格 */
    }
    
    nav ul li a {
        padding: 5px 8px; /* 缩小内边距 - 统一风格 */
        font-size: 0.8rem; /* 缩小字体 - 统一风格 */
    }
    
    .nav-icon {
        font-size: 0.9rem; /* 缩小图标 - 统一风格 */
    }
    
    .page-title {
        font-size: 1.5rem; /* 缩小字体 - 统一风格 */
    }
    
    .server-grid {
        grid-template-columns: 1fr;
    }
    
    .date-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}