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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
    background: #f6faff;
    color: #223046;
    line-height: 1.7;
}

/* 顶部导航栏 */
header {
    background: #e3f0fc;
    box-shadow: 0 2px 8px rgba(91,164,229,0.06);
    text-align: center;
}
nav {
    max-width: 1100px;
    margin: 0 auto;
}
nav ul {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    list-style: none;
    padding: 1.2rem 0;
}
nav a {
    color: #2563eb;
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.2s;
}
nav a:hover {
    color: #1e40af;
}

/* 主页Banner */
.hero {
    background: #e3f0fc;
    border-radius: 18px;
    text-align: center;
    padding: 3.5rem 1rem 2.5rem 1rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 2px 12px rgba(91,164,229,0.08);
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-title-with-logo {
    position: relative;
    margin-bottom: 1.2rem;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.hero-title-with-logo .site-logo {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 200px;
    max-width: 200px;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(91,164,229,0.10);
    background: #fff;
}
.hero-title-with-logo h1 {
    text-align: center;
    font-size: 2.6rem;
    color: #2563eb;
    margin-bottom: 0.5rem;
    width: 100%;
    padding-left: 220px; /* 为logo留出空间 */
}
.hero-title-with-logo p {
    color: #223046;
    font-size: 1.2rem;
    text-align: center;
    padding-left: 220px; /* 与标题对齐 */
    margin: 0;
}

/* 主要内容区 */
main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.5rem 1rem 1rem 1rem;
}

/* 主页活动海报样式 */
.homepage-posters {
    width: 100%;
    margin: 2rem 0;
    padding: 0;
}

.posters-loading,
.no-posters,
.posters-error {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: 300px;
    font-size: 1.2rem;
    color: #666;
}

.posters-error {
    color: #ff4444;
}

.homepage-poster-link {
    display: block;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto 1rem;
    aspect-ratio: 21/9;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
}

.homepage-poster {
    width: 100%;
    height: 100%;
    position: relative;
}

.homepage-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 12px;
}

.homepage-poster-link:hover .homepage-poster img {
    transform: scale(1.05);
}

.homepage-poster-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: transparent;
    color: white;
    transition: opacity 0.3s ease;
}

.homepage-poster-overlay h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.homepage-poster-overlay p {
    font-size: 1rem;
    margin: 0;
    opacity: 0.9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .homepage-posters {
        margin: 1rem 0;
    }
    
    .homepage-poster-overlay {
        padding: 1rem;
    }
    
    .homepage-poster-overlay h3 {
        font-size: 1.2rem;
    }
    
    .homepage-poster-overlay p {
        font-size: 0.9rem;
    }
}

/* 卡片通用样式 */
.link-card, .server-card, .announcement-card, .donate-card, .vip-tier {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(91,164,229,0.07);
    padding: 2rem 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow 0.2s;
}
.link-card:hover, .server-card:hover, .announcement-card:hover, .donate-card:hover, .vip-tier:hover {
    box-shadow: 0 6px 24px rgba(91,164,229,0.13);
}

/* 快速链接区 */
.quick-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin-top: 2.5rem;
    justify-content: center;
}
.link-card h3 {
    color: #2563eb;
    margin-bottom: 0.7rem;
}
.btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.7rem 1.4rem;
    font-weight: 600;
    margin-top: 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}
.btn:hover {
    background: #1e40af;
}

/* 服务器列表 */
.server-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}
.server-card h2 {
    color: #2563eb;
    margin-bottom: 0.5rem;
}
.server-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0 0.5rem 0;
}
.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}
.status-indicator.online {
    background-color: #22c55e;
}
.status-indicator.offline {
    background-color: #a1a1aa;
}
.server-features {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid #e3f0fc;
}
.server-features h3 {
    color: #2563eb;
    margin-bottom: 0.5rem;
}
.server-features ul {
    margin-left: 1rem;
    color: #223046;
}

/* 公告系统 */
.announcements {
    max-width: 800px;
    margin: 0 auto;
}
.announcement-card.pinned {
    border: 2px solid #60a5fa;
    background: #f0f7ff;
}
.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e3f0fc;
}
.announcement-header h2 {
    color: #2563eb;
    margin: 0;
}
.announcement-date {
    color: #64748b;
    font-size: 0.95rem;
}
.announcement-content {
    line-height: 1.8;
    color: #223046;
}
.announcement-content ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #e3f0fc;
    border-radius: 6px;
    font-size: 1rem;
    font-family: 'Microsoft YaHei', 'PingFang SC', Arial, sans-serif;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.form-group input[type="checkbox"] {
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* 捐赠页面 */
.donate-intro {
    text-align: center;
    max-width: 600px;
    margin: 2rem auto 1rem auto;
    padding: 1rem;
}
.donate-methods {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
    margin: 2.5rem 0;
}
.qr-code {
    margin: 1.2rem 0;
}
.qr-code img {
    max-width: 180px;
    height: auto;
    border-radius: 8px;
    border: 1px solid #e3f0fc;
}

/* VIP特权 */
.vip-benefits {
    margin-top: 3rem;
}
.vip-benefits h2 {
    text-align: center;
    color: #2563eb;
    margin-bottom: 2rem;
}
.vip-tiers {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}
.vip-tier h3 {
    color: #2563eb;
    margin-bottom: 1rem;
}
.vip-tier ul {
    list-style: none;
    margin: 1.2rem 0;
    padding: 0;
}
.vip-tier li {
    margin: 0.5rem 0;
    color: #223046;
}
.price {
    font-size: 1.3rem;
    color: #2563eb;
    font-weight: bold;
    margin-top: 1rem;
}

/* 页脚 */
footer {
    background: #e3f0fc;
    color: #223046;
    text-align: center;
    padding: 1.2rem;
    margin-top: 3rem;
    border-radius: 12px 12px 0 0;
    font-size: 1rem;
}

/* 服务器导航 */
.server-navigation {
    display: flex;
    justify-content: space-between;
    margin: 2rem 0;
    padding: 0 1rem;
}
.nav-btn {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.7rem 1.4rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}
.nav-btn:hover {
    background: #1e40af;
    color: #fff;
}
.nav-btn.active {
    background-color: #4CAF50;
}

/* 文件查看器样式 */
.files-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}
.files-header {
    text-align: center;
    margin-bottom: 30px;
}
.files-header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}
.files-header p {
    color: #666;
    font-size: 16px;
}
.file-list {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}
.file-item:hover {
    background-color: #f9f9f9;
}
.file-item:last-child {
    border-bottom: none;
}
.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}
.file-icon {
    font-size: 24px;
    margin-right: 15px;
    color: #4CAF50;
}
.file-details {
    flex: 1;
}
.file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}
.file-size {
    font-size: 14px;
    color: #666;
}
.file-time {
    font-size: 14px;
    color: #999;
    margin-top: 3px;
}
.download-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}
.download-btn:hover {
    background-color: #45a049;
}
.sort-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 6px;
}
.sort-btn {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}
.sort-btn:hover {
    background-color: #f0f0f0;
}
.sort-btn.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}
.sort-direction {
    margin-left: 5px;
    font-size: 12px;
}
.pin-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    font-size: 16px;
    margin-right: 10px;
    transition: color 0.3s;
}
.pin-btn:hover {
    color: #ffcc00;
}
.pin-btn.pinned {
    color: #ffcc00;
}
.file-item.pinned {
    background-color: #fff9e6;
}
.no-files {
    text-align: center;
    padding: 40px;
    color: #666;
}
.pinned-indicator {
    color: #ffcc00;
    font-size: 14px;
    margin-right: 10px;
}

/* 服务器信息样式 */
.status {
    padding: 5px 10px;
    border-radius: 5px;
    color: white;
}
.online {
    background-color: #4CAF50;
}
.offline {
    background-color: #f44336;
}
.server-info {
    margin: 20px;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.player-list {
    margin-top: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 5px;
}
.player-list h3 {
    margin-top: 0;
    color: #333;
}
.player-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.player-list li {
    padding: 5px 10px;
    margin: 2px 0;
    background-color: #fff;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 服务器导航样式修复 */
.server-navigation {
    text-align: center;
    margin: 1rem 0;
}
.server-navigation nav {
    display: inline-block;
}
.server-navigation ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}
.server-navigation li {
    margin: 0 5px;
}

/* 文件查看器样式 */
.files-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}
.files-header {
    text-align: center;
    margin-bottom: 30px;
}
.files-header h1 {
    color: #333;
    font-size: 28px;
    margin-bottom: 10px;
}
.files-header p {
    color: #666;
    font-size: 16px;
}
.file-list {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}
.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s;
}
.file-item:hover {
    background-color: #f9f9f9;
}
.file-item:last-child {
    border-bottom: none;
}
.file-info {
    display: flex;
    align-items: center;
    flex: 1;
}
.file-icon {
    font-size: 24px;
    margin-right: 15px;
    color: #4CAF50;
}
.file-details {
    flex: 1;
}
.file-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
}
.file-size {
    font-size: 14px;
    color: #666;
}
.file-time {
    font-size: 14px;
    color: #999;
    margin-top: 3px;
}
.download-btn {
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}
.download-btn:hover {
    background-color: #45a049;
}
.sort-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 6px;
}
.sort-btn {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}
.sort-btn:hover {
    background-color: #f0f0f0;
}
.sort-btn.active {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}
.sort-direction {
    margin-left: 5px;
    font-size: 12px;
}
.pin-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ccc;
    font-size: 16px;
    margin-right: 10px;
    transition: color 0.3s;
}
.pin-btn:hover {
    color: #ffcc00;
}
.pin-btn.pinned {
    color: #ffcc00;
}
.file-item.pinned {
    background-color: #fff9e6;
}
.no-files {
    text-align: center;
    padding: 40px;
    color: #666;
}
.pinned-indicator {
    color: #ffcc00;
    font-size: 14px;
    margin-right: 10px;
}

/* 诊断工具样式 */
.diagnostic-section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}
.diagnostic-section.success {
    background-color: #e8f5e9;
    border-color: #4caf50;
}
.diagnostic-section.error {
    background-color: #ffebee;
    border-color: #f44336;
}
#data-result.success {
    color: #4caf50;
}
#data-result.error {
    color: #f44336;
}
pre {
    background-color: #f5f5f5;
    padding: 10px;
    border-radius: 3px;
    overflow-x: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    .hero h1 {
        font-size: 2rem;
    }
    .quick-links, .server-list, .donate-methods, .vip-tiers {
        grid-template-columns: 1fr;
    }
    main {
        padding: 1rem;
    }
    .server-navigation ul {
        flex-direction: column;
    }
    .server-navigation li {
        margin: 5px 0;
    }
}

/* 活动页面样式 */
.activities-container {
    max-width: 900px;
    margin: 2rem auto;
}

/* 活动卡片样式 - 基于坐标系统实现 */
.activity-card {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, auto);
    background: #C1E5F5;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 12px;
    margin-bottom: 1.5rem;
    transition: all 0.3s;
    width: 100%;
    /* 高度由内容自动决定，确保海报能完整显示 */
}

.activity-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

/* 正在进行的活动卡片样式 */
.activity-card.ongoing {
    background: #D9F2D0;
}

/* 置顶活动卡片样式 */
.activity-card.pinned {
    background: #FFC0CB;
}

/* 活动海报样式 - 21:9比例，占据(1,1)到(2,3)的区域 */
.activity-poster {
    grid-column: 1 / 3;
    grid-row: 1 / 4;
    overflow: hidden;
    border-radius: 6px;
    position: relative;
    /* 确保海报容器高度足够容纳21:9比例的图片 */
}

.activity-poster img {
    width: 100%;
    height: auto;
    object-fit: contain;
    aspect-ratio: 21/9;
    border-radius: 6px; /* 添加圆角样式 */
    /* 使用object-contain确保图片完整显示，无留白边 */
}

/* 活动信息区域 - 占据(3,1)到(3,3)的区域 */
.activity-info {
    grid-column: 3 / 4;
    grid-row: 1 / 4;
    padding: 0 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.activity-info h3 {
    color: #2563eb;
    margin: 0 0 8px 0;
    font-size: 1rem;
    line-height: 1.2;
}

.activity-description {
    color: #223046;
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.4;
    flex: 1;
}

/* 置顶标识 */
.pinned-badge {
    display: inline-block;
    background-color: #f59e0b;
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-bottom: 4px;
    align-self: flex-start;
}

/* 活动底部信息 - 占据(1,4)到(3,4)的区域 */
.activity-footer {
    grid-column: 1 / 4;
    grid-row: 4 / 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    /* 移除白色横线 */
}

.activity-time {
    color: #223046;
    font-size: 0.85rem;
    text-align: left;
}

.activity-specific-time {
    color: #666;
    font-size: 0.8rem;
    font-style: italic;
}

.activity-location {
    color: #223046;
    font-size: 0.85rem;
    text-align: center;
}

.activity-detail-btn {
    background-color: #2563eb;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.3s;
}

.activity-detail-btn:hover {
    background-color: #1d4ed8;
}

/* 活动详情页样式 */
.activity-detail {
    max-width: 900px;
    margin: 2rem auto;
}

.activity-header {
    text-align: center;
    margin-bottom: 2rem;
}

.activity-header h1 {
    color: #2563eb;
    margin-bottom: 1rem;
}

/* 海报容器 */
.activity-poster-container {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    width: 100%;
}

/* 海报图片 - 21:9比例 */
.activity-poster-large {
    width: 100%;
    max-width: 700px;
    overflow: hidden;
    border-radius: 12px;
}

.activity-poster-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 21/9;
}

.activity-content {
    width: 100%;
}

.activity-content .activity-meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e3f0fc;
}

.activity-content .activity-description,
.activity-content .activity-details {
    margin-bottom: 2rem;
}

.activity-content h3 {
    color: #2563eb;
    margin-bottom: 1rem;
}

/* 活动图片画廊 */
.activity-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* 图片点击放大模态框 */
.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.image-modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative;
}

.modal-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px 15px;
    z-index: 1001;
}

.modal-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.activity-gallery img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(91,164,229,0.07);
}

.activity-actions {
    text-align: center;
    margin-top: 2rem;
}

/* 加载状态和错误状态 */
.loading,
.no-activities,
.error {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.error {
    color: #ef4444;
}

/* 响应式调整 */
@media (max-width: 768px) {
    /* 活动卡片在移动端的布局调整 */
    .activity-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
    }
    
    .activity-poster {
        grid-column: 1;
        grid-row: 1;
        margin-bottom: 1rem;
    }
    
    .activity-info {
        grid-column: 1;
        grid-row: 2;
        padding: 0;
    }
    
    .activity-footer {
        grid-column: 1;
        grid-row: 3;
    }
    
    /* 活动详情页在移动端的布局调整 */
    .activity-poster-container {
        margin-bottom: 1.5rem;
    }
    
    .activity-poster-large {
        max-width: 100%;
    }
    
    .activity-content .activity-meta {
        justify-content: center;
    }
}