/* ============================================================ */
/* 状态.ui.css - 状态页基础 + UI组件 */
/* ============================================================ */

/* ===== CSS Variables（差异部分，公共变量由公共基础.css 提供） ===== */
:root {
    --primary: #3366ff;
    --primary-dark: #1a4bcc;
    --secondary: #5588ff;
    --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);
    --bg-light: #f2f2f7;
    --card-bg-light: #ffffff;
    --navbar-bg-light: rgba(242, 242, 247, 0.8);
    --separator-light: #e5e5ea;
}

[data-theme="dark"] {
    --bg-light: #1c1c1e;
    --text-light: #f2f2f7;
    --card-bg-light: #2c2c2e;
    --navbar-bg-light: rgba(28, 28, 30, 0.8);
    --separator-light: #38383a;
}

/* ===== Base ===== */
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;
}
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 5px 10px;
}
.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);
}
@media (max-width: 768px) {
    .mobile-menu-btn { display: block; }
    .nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 10px 0;
    }
    .nav-links.open { display: flex; }
    .navbar { flex-wrap: wrap; }
}

/* ===== 卡片 ===== */
.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(51, 102, 255, 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(51, 102, 255, 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(51, 102, 255, 0.3); }

/* ===== 页脚 ===== */
.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;
}

/* ===== 回到顶部 ===== */
.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); }

/* ===== 无障碍：聚焦轮廓 ===== */
button:focus-visible,
a:focus-visible,
input:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}