/* ========== 全局重置 & 基础 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: #0a0a0a;
    color: #fff;
    overflow-x: hidden;
    scroll-behavior: smooth;
    overscroll-behavior: none;
}
#app {
    height: 100vh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
#app::-webkit-scrollbar { display: none; }

/* ========== 每个全屏区块 ========== */
.section {
    min-height: 100vh;
    height: auto;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 2rem 1.5rem;
    overflow: hidden;
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.section:not(.active) { opacity: 0.7; transform: scale(0.98); }
.section.active { opacity: 1; transform: scale(1); }
.section-inner {
    max-width: 1200px;
    width: 100%;
    z-index: 2;
    padding: 1rem 0;
}

/* ========== 英雄区 ========== */
.hero { position: relative; background: #0a0a0a; }
.hero-video {
    position: absolute;
    top: 50%; left: 50%;
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    transform: translate(-50%, -50%);
    z-index: 0;
    object-fit: cover;
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    z-index: 1;
}
.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1s ease, transform 1s ease;
}
.hero-content.visible { opacity: 1; transform: translateY(0); }
.game-title {
    font-size: clamp(2.8rem, 10vw, 6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 8px 30px rgba(0,0,0,0.7);
}
.server-address {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    margin: 1rem 0 0.5rem;
    background: rgba(255,255,255,0.1);
    display: inline-block;
    padding: 0.3rem 1.5rem;
    border-radius: 40px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.2);
    word-break: break-all;
}
.online-badge {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    margin: 1.5rem 0 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.online-dot {
    width: 14px;
    height: 14px;
    background: #4caf50;
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0% { box-shadow: 0 0 0 0 rgba(76,175,80,0.7); }
    70% { box-shadow: 0 0 0 10px rgba(76,175,80,0); }
    100% { box-shadow: 0 0 0 0 rgba(76,175,80,0); }
}
.game-version { font-size: clamp(0.8rem, 1.5vw, 1rem); opacity: 0.8; margin-top: 1rem; }
.scroll-hint {
    margin-top: 3rem;
    font-size: 0.9rem;
    opacity: 0.6;
    animation: bob 2s infinite;
}
@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

/* ========== 在线玩家列表 ========== */
.online-players {
    text-align: center;
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.3rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    word-break: break-word;
    line-height: 1.8;
    min-height: 1.8rem;
}
.online-players .player-tag {
    display: inline-block;
    background: rgba(255,255,255,0.12);
    padding: 0.1rem 0.8rem;
    border-radius: 20px;
    margin: 0.15rem 0.3rem;
    font-size: 0.8rem;
    border: 1px solid rgba(255,255,255,0.05);
    backdrop-filter: blur(2px);
}
.online-players .empty-tip {
    opacity: 0.5;
    font-style: italic;
}

/* ========== 背景图通用 ========== */
.section-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: brightness(0.4) blur(1px);
    z-index: 0;
}
.rank .section-bg {
    background-color: #1a0e2e;
    background-image: linear-gradient(135deg, #1a0e2e 0%, #0d1b2a 100%);
}
.section-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}
h2 {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.2rem;  /* 减小下边距，让表格上移 */
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
}
h2.visible { opacity: 1; transform: translateY(0); }

/* ========== 排行榜 (优化) ========== */
.rank-table-wrap {
    max-height: 60vh;           /* 增加高度，让表格更多空间 */
    overflow-y: auto;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    padding: 0.8rem;           /* 增加内边距让表格不贴边 */
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.rank-table-wrap::-webkit-scrollbar { width: 4px; }
.rank-table-wrap::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 4px; }

.rank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.85rem, 1.1vw, 1rem);
    table-layout: fixed;        /* 固定列宽，均匀分布 */
}
.rank-table th {
    text-align: left;
    padding: 0.6rem 0.4rem;
    border-bottom: 2px solid rgba(255,255,255,0.15);
    color: #ffb74d;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.rank-table td {
    padding: 0.5rem 0.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rank-table tr:last-child td { border-bottom: none; }

/* 列宽分配 (左中右) */
.rank-table .col-rank {
    width: 12%;
    text-align: center;
}
.rank-table .col-id {
    width: 38%;
    text-align: left;
}
.rank-table .col-duration {
    width: 30%;
    text-align: right;
    font-weight: 600;
    color: #4caf50;
}
.rank-table .col-status {
    width: 20%;
    text-align: center;
}

.rank-table .top1 .col-rank { color: #ffd700; }
.rank-table .top2 .col-rank { color: #c0c0c0; }
.rank-table .top3 .col-rank { color: #cd7f32; }

.rank-update-hint {
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.5;
    margin-top: 0.5rem;
}

/* 在线状态徽章 */
.status-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.status-online {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.status-offline {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.3);
    border: 1px solid rgba(255,255,255,0.05);
}
.rank-table tr.online-row td {
    background: rgba(76, 175, 80, 0.05);
}
.rank-table tr.online-row:hover td {
    background: rgba(76, 175, 80, 0.08);
}

/* ========== 连接步骤 ========== */
.steps {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}
.step {
    flex: 1 1 180px;
    max-width: 250px;
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(4px);
    padding: 1.5rem 1rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}
.step.visible { opacity: 1; transform: translateY(0); }
.step-num {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #ffb74d;
    margin-bottom: 0.3rem;
}
.step p { font-size: clamp(0.9rem, 1.2vw, 1.1rem); line-height: 1.4; }
.step p strong { color: #ffb74d; }

/* ========== 画廊 ========== */
.gallery { position: relative; }
.gallery-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-color: #0a0a0a;
    filter: blur(12px) brightness(0.5);
    opacity: 0.9;
    transition: background-image 1s ease-in-out;
    z-index: 0;
}
.gallery .section-overlay { z-index: 1; }
.gallery .section-inner { position: relative; z-index: 2; }
.gallery-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0 50px;
}
.gallery-viewport {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
}
.gallery-track {
    display: flex;
    flex-wrap: nowrap;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}
.gallery-track .slide {
    flex: 0 0 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 0;
    box-sizing: border-box;
    min-height: 200px;
}
.gallery-track img {
    width: auto;
    max-width: 100%;
    max-height: 50vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    display: block;
    transition: opacity 0.3s ease;
    opacity: 0.8;
}
.gallery-track .slide.active img { opacity: 1; }
.gallery-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 2.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.gallery-btn:hover { background: rgba(255,255,255,0.25); }
.gallery-btn:active { transform: translateY(-50%) scale(0.9); }
.gallery-btn.prev { left: 0; }
.gallery-btn.next { right: 0; }
@media (max-width: 480px) {
    .gallery-btn { width: 32px; height: 32px; font-size: 1.8rem; }
    .gallery-wrapper { padding: 0 30px; }
}
.gallery-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 1rem;
}
.gallery-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transition: background 0.3s, transform 0.3s;
    cursor: pointer;
}
.gallery-dots span.active { background: #fff; transform: scale(1.3); }

/* ========== 服务器载荷 ========== */
.load .section-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}
.load-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
    min-height: 80vh;
}
.load-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 1rem 0;
}
.load-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
    width: 100%;
}
.load-item {
    background: rgba(255,255,255,0.06);
    backdrop-filter: blur(4px);
    padding: 1.2rem 1rem;
    border-radius: 20px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.08);
}
.load-item .label { display: block; font-size: 0.85rem; opacity: 0.7; margin-bottom: 0.3rem; }
.load-item .value { font-size: clamp(1.5rem, 3vw, 2.2rem); font-weight: 700; }
.max { font-size: 0.9rem; opacity: 0.6; margin-left: 0.2rem; }
.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    margin: 0.5rem 0;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #ffb74d, #f44336);
    width: 0%;
    border-radius: 10px;
    transition: width 0.8s ease;
}

/* 备案号 */
.footer-badges {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.3rem 1.5rem;
    padding: 0.8rem 0 0.3rem 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 0.75rem;
    opacity: 0.7;
    letter-spacing: 0.3px;
    width: 100%;
    margin-top: 1rem;
}
.badge-label { color: #fff; opacity: 0.8; }
.badge-link {
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    padding-bottom: 2px;
    transition: opacity 0.2s, border-bottom-color 0.2s;
}
.badge-link:hover { opacity: 1; border-bottom-color: rgba(255,255,255,0.3); }

/* ========== 音乐播放器 ========== */
.music-player {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(20,20,30,0.8);
    backdrop-filter: blur(10px);
    padding: 6px 14px 6px 10px;
    border-radius: 40px;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.play-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}
.play-btn:hover { background: rgba(255,255,255,0.1); }
.volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 4px;
    outline: none;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}
.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
}
.volume-icon { color: #fff; font-size: 1rem; opacity: 0.7; }
@media (max-width: 480px) {
    .music-player { bottom: 12px; right: 12px; padding: 4px 10px 4px 8px; gap: 6px; }
    .play-btn { font-size: 1.3rem; width: 28px; height: 28px; }
    .volume-slider { width: 50px; }
    .volume-icon { font-size: 0.8rem; }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .section { padding: 1.5rem 1rem; }
    .step { flex: 1 1 140px; padding: 1rem 0.8rem; }
    .load-grid { grid-template-columns: repeat(2, 1fr); gap: 1rem; }
    .load-item { padding: 1rem 0.8rem; }
    .gallery-track img { max-height: 35vh; }
    .rank-table-wrap { max-height: 50vh; }
    .rank-table { font-size: 0.75rem; }
    .rank-table th, .rank-table td { padding: 0.4rem 0.2rem; }
    .rank-table .col-rank { width: 10%; }
    .rank-table .col-id { width: 35%; }
    .rank-table .col-duration { width: 30%; }
    .rank-table .col-status { width: 25%; }
}
@media (max-width: 480px) {
    .load-grid { grid-template-columns: 1fr 1fr; gap: 0.8rem; }
    .steps { gap: 0.8rem; }
    .step { flex: 1 1 120px; }
    .server-address { font-size: 0.9rem; padding: 0.2rem 1rem; }
    .footer-badges { font-size: 0.65rem; gap: 0.2rem 0.8rem; padding: 0.4rem 0 0.2rem 0; flex-wrap: wrap; }
    .badge-label, .badge-link { white-space: nowrap; }
    .rank-table-wrap { max-height: 45vh; padding: 0.3rem; }
    .rank-table { font-size: 0.65rem; }
    .rank-table th, .rank-table td { padding: 0.3rem 0.1rem; }
    .status-badge { font-size: 0.55rem; padding: 0.05rem 0.3rem; }
}

