/* ===== CSS Variables ===== */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #764ba2;
    --text: #333;
    --text-light: #666;
    --bg-glass: rgba(255, 255, 255, 0.3);
    --radius: 20px;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: url('../png/状态背景.webp') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    width: 100%;
}

/* ===== 右侧固定返回首页按钮 ===== */
.back-home-btn {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    background-color: #3366ff;
    color: white;
    border: 2px solid #3366ff;
    border-radius: 50px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 160px;
    font-size: 18px;
    writing-mode: vertical-rl;
    text-orientation: upright;
    letter-spacing: 2px;
    box-shadow: 0 4px 16px rgba(51, 102, 255, 0.3);
}

.back-home-btn:hover {
    background-color: #1a4bcc;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 6px 24px rgba(51, 102, 255, 0.5);
}

.back-home-btn:active {
    transform: translateY(-50%) scale(0.95);
}

/* ===== 导航栏 ===== */
.navbar {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    position: sticky;
    top: 10px;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-20px);
}

.logo {
    font-size: clamp(18px, 4vw, 24px);
    font-weight: bold;
    color: var(--primary);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    text-decoration: none;
    color: #f0f0f0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: clamp(12px, 2vw, 14px);
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    text-shadow: 0 0 8px rgba(51, 102, 255, 0.3);
}

/* ===== 内容区域 ===== */
.content {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius);
    padding: clamp(20px, 5vw, 40px);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.section {
    display: block;
}

/* ===== 标题 ===== */
h1 {
    color: var(--text);
    margin-bottom: 25px;
    font-size: clamp(24px, 5vw, 32px);
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
}

h2 {
    color: var(--text-light);
    margin-bottom: 20px;
    font-size: clamp(18px, 4vw, 24px);
    text-align: center;
}

/* ===== 卡片样式 ===== */
.card {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: clamp(15px, 3vw, 25px);
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(30px);
}

/* ===== 状态网格 ===== */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
    gap: 15px;
}

.status-item {
    text-align: center;
    padding: 15px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    opacity: 0;
    transform: translateY(20px);
}

.status-value {
    font-size: clamp(24px, 5vw, 36px);
    font-weight: bold;
    color: var(--primary);
    margin: 8px 0;
    word-break: break-all;
}

.status-label {
    color: #777;
    font-size: clamp(11px, 2vw, 14px);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ===== 在线状态指示器 ===== */
.online-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.online {
    background: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.offline {
    background: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

/* ===== 玩家列表 ===== */
.player-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.player-item {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: clamp(13px, 2.5vw, 14px);
    opacity: 0;
    transform: translateX(-15px);
}

.player-item:last-child {
    border-bottom: none;
}

.player-name {
    font-weight: 500;
}

/* ===== 测速区域 ===== */
.speed-test {
    text-align: center;
    padding: 20px 15px;
}

.speed-result {
    font-size: clamp(36px, 8vw, 48px);
    font-weight: bold;
    color: var(--primary);
    margin: 15px 0;
}

.speed-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 12px;
    font-size: clamp(14px, 3vw, 18px);
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    margin: 0 auto;
}

.speed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}
.speed-btn:active {
    transform: translateY(0);
}
.speed-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.refresh-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    padding: 10px 28px;
    border-radius: 12px;
    font-size: clamp(13px, 2.5vw, 15px);
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: inline-block;
    margin: 0 auto;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}
.refresh-btn:active {
    transform: translateY(0);
}
.refresh-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinning {
    display: inline-block;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== 联系我们 ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 15px;
}

.contact-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    opacity: 0;
    transform: translateY(20px);
}

.contact-icon {
    font-size: clamp(28px, 5vw, 36px);
    margin-bottom: 10px;
}

.contact-title {
    font-size: clamp(16px, 3vw, 18px);
    font-weight: bold;
    color: var(--text);
    margin-bottom: 8px;
}

.contact-info {
    color: var(--text-light);
}

.contact-btn {
    display: inline-block;
    margin-top: 15px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}
.contact-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    padding: 12px 24px;
    border-radius: 30px;
    color: white;
    border-left: 4px solid #4CAF50;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.error {
    border-left-color: #f44336;
}

/* ===== 底部信息 ===== */
.footer {
    text-align: center;
    padding: 20px 15px;
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(12px, 2vw, 14px);
    opacity: 0;
    transform: translateY(20px);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-bottom: 25px;
    text-align: left;
    gap: 20px;
}

.footer-section {
    flex: 1;
    min-width: 200px;
}

.footer-section h3 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: clamp(14px, 2.5vw, 16px);
}

.footer-section ul {
    list-style: none;
    padding: 0;
}
.footer-section li {
    margin-bottom: 6px;
}
.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: clamp(12px, 2vw, 14px);
}
.footer-section p {
    color: rgba(255, 255, 255, 0.7);
    font-size: clamp(12px, 2vw, 14px);
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 15px;
    margin-top: 15px;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}

/* ===== 光效控制区域 ===== */
.glow-toggle-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 12, 15, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 6px 12px 6px 16px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.toggle-label {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    user-select: none;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-switch .toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease, background 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    transform: translateX(20px);
    background: #ffffff;
}

.toggle-switch:has(input:checked) {
    background: #3366ff;
}

.toggle-switch:hover {
    opacity: 0.9;
    transform: scale(1.02);
}
.toggle-switch:active .toggle-slider {
    transform: scale(0.9);
}
.toggle-switch:has(input:checked):active .toggle-slider {
    transform: translateX(20px) scale(0.9);
}

.glow-type-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 16px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.glow-type-btn:hover {
    background: rgba(51, 102, 255, 0.3);
    transform: scale(1.1);
    border-color: #3366ff;
}
.glow-type-btn:active {
    transform: scale(0.9);
}

/* ===== 光效 ===== */
#glow {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: none !important;
    z-index: 999999 !important;
    mix-blend-mode: soft-light;
    will-change: background;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#glow.active {
    opacity: 1;
}

/* ===== 自动滚动控制容器（播放按钮 + 速度滑块 + 单按钮方向切换） ===== */
.auto-scroll-container {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(10, 12, 15, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 8px 16px 8px 12px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.auto-scroll-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.auto-scroll-btn:hover {
    background: rgba(51, 102, 255, 0.4);
    transform: scale(1.05);
}
.auto-scroll-btn.playing {
    background: rgba(51, 102, 255, 0.5);
    animation: auto-scroll-pulse 1.5s ease-in-out infinite;
}
.auto-scroll-btn:active {
    transform: scale(0.9);
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.speed-control input[type="range"] {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    transition: background 0.2s;
}
.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3366ff;
    cursor: pointer;
    box-shadow: 0 0 6px rgba(51, 102, 255, 0.4);
}
.speed-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3366ff;
    cursor: pointer;
    border: none;
}
.speed-control #speedDisplay {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    min-width: 32px;
    text-align: center;
    user-select: none;
}

/* ===== 方向切换按钮（单按钮循环切换 ↑/↓） ===== */
.direction-control {
    display: flex;
    align-items: center;
}
.dir-toggle-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}
.dir-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}
.dir-toggle-btn.active-up {
    background: rgba(51, 102, 255, 0.4);
    color: #fff;
    box-shadow: 0 0 12px rgba(51, 102, 255, 0.3);
}
.dir-toggle-btn.active-down {
    background: rgba(51, 102, 255, 0.4);
    color: #fff;
    box-shadow: 0 0 12px rgba(51, 102, 255, 0.3);
}
.dir-toggle-btn:active {
    transform: scale(0.9);
}

@keyframes auto-scroll-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(51, 102, 255, 0.15); }
    50% { box-shadow: 0 0 25px rgba(51, 102, 255, 0.5); }
}

/* ===== 回到顶部按钮（上移避开自动滚动控件） ===== */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 100px;
    background: #3366ff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 40;
    opacity: 0;
    visibility: hidden;
    font-size: 20px;
    color: white;
    border: none;
    outline: none;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}
.back-to-top:hover {
    background: #1a4bcc;
    transform: scale(1.15);
    box-shadow: 0 0 20px rgba(51, 102, 255, 0.4);
}
.back-to-top:active {
    transform: scale(0.95);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .back-home-btn {
        width: 40px;
        height: 120px;
        font-size: 14px;
        right: 10px;
    }

    .navbar {
        position: relative;
        top: 0;
        flex-direction: column;
        gap: 8px;
        padding: 10px 16px;
    }
    .nav-links {
        width: 100%;
        justify-content: center;
        gap: 4px;
    }
    .nav-links a {
        padding: 6px 10px;
        font-size: 12px;
        min-height: 40px;
    }

    .content {
        padding: 16px;
    }

    .card {
        padding: 16px;
        margin-bottom: 14px;
    }

    h1 {
        font-size: clamp(20px, 5vw, 26px);
        margin-bottom: 18px;
    }
    h2 {
        font-size: clamp(16px, 4vw, 20px);
    }

    .status-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .status-item {
        padding: 12px 8px;
    }
    .status-value {
        font-size: clamp(18px, 5vw, 28px);
    }
    .status-label {
        font-size: 10px;
    }

    .speed-result {
        font-size: clamp(28px, 8vw, 40px);
    }
    .speed-btn {
        padding: 10px 24px;
        font-size: 14px;
        min-height: 48px;
    }
    .refresh-btn {
        padding: 8px 20px;
        font-size: 13px;
        min-height: 44px;
    }

    .contact-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
    .contact-item {
        padding: 16px 12px;
    }
    .contact-icon {
        font-size: 28px;
    }
    .contact-title {
        font-size: 15px;
    }
    .contact-info {
        font-size: 13px;
    }
    .contact-btn {
        padding: 8px 18px;
        font-size: 13px;
        min-height: 40px;
    }

    .footer-grid {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    .footer-section {
        min-width: auto;
    }

    .glow-toggle-container {
        top: 72px;
        right: 10px;
        padding: 4px 10px 4px 12px;
        gap: 6px;
    }
    .toggle-label {
        font-size: 11px;
    }
    .toggle-switch {
        width: 38px;
        height: 21px;
    }
    .toggle-switch .toggle-slider {
        width: 17px;
        height: 17px;
        top: 2px;
        left: 2px;
    }
    .toggle-switch input[type="checkbox"]:checked + .toggle-slider {
        transform: translateX(17px);
    }
    .glow-type-btn {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }

    .auto-scroll-container {
        bottom: 80px;
        right: 10px;
        padding: 6px 12px 6px 10px;
        gap: 8px;
    }
    .auto-scroll-btn {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .speed-control input[type="range"] {
        width: 50px;
    }
    .speed-control #speedDisplay {
        font-size: 11px;
        min-width: 28px;
    }
    .dir-toggle-btn {
        width: 28px;
        height: 28px;
        font-size: 15px;
    }

    /* 移动端回到顶部按钮：上移避开自动滚动控件 */
    .back-to-top {
        width: 40px;
        height: 40px;
        font-size: 18px;
        bottom: 130px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .back-home-btn {
        width: 32px;
        height: 100px;
        font-size: 11px;
        right: 6px;
    }

    .status-grid {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    .status-item {
        padding: 8px 4px;
    }
    .status-value {
        font-size: clamp(14px, 4vw, 22px);
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .speed-result {
        font-size: clamp(24px, 6vw, 32px);
    }

    .glow-toggle-container {
        top: 68px;
        right: 8px;
        padding: 3px 8px 3px 10px;
        gap: 4px;
    }
    .toggle-label {
        font-size: 10px;
    }
    .toggle-switch {
        width: 34px;
        height: 19px;
    }
    .toggle-switch .toggle-slider {
        width: 15px;
        height: 15px;
        top: 2px;
        left: 2px;
    }
    .toggle-switch input[type="checkbox"]:checked + .toggle-slider {
        transform: translateX(15px);
    }
    .glow-type-btn {
        width: 20px;
        height: 20px;
        font-size: 11px;
    }

    .auto-scroll-container {
        bottom: 72px;
        right: 8px;
        padding: 4px 10px 4px 8px;
        gap: 6px;
    }
    .auto-scroll-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    .speed-control input[type="range"] {
        width: 40px;
    }
    .speed-control #speedDisplay {
        font-size: 10px;
        min-width: 24px;
    }
    .dir-toggle-btn {
        width: 24px;
        height: 24px;
        font-size: 13px;
    }
}

/* ===== 触摸设备优化 ===== */
@media (hover: none) and (pointer: coarse) {
    .nav-links a,
    .btn,
    .speed-btn,
    .refresh-btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}