/* 引入科技感字体 */
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;500;700&display=swap');

:root {
    --bg-dark: #0b0c15;
    --bg-radial: radial-gradient(circle at 50% 0%, #1a1c2e 0%, #0b0c15 80%);
    --accent: #00f2ea;
    --accent-glow: rgba(0, 242, 234, 0.4);
    --text-main: #ffffff;
    --text-muted: #64748b;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
    background: var(--bg-dark);
    background-image: var(--bg-radial);
    color: var(--text-main);
    font-family: 'Rajdhani', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden; /* 防止手机横向滚动 */
}

/* --- 顶部导航 --- */
.header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(90deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* --- 主内容区 (Flex 居中) --- */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    gap: 40px;
}

/* --- 顶部数据卡片 (Ping/Up/Down) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    width: 100%;
    max-width: 800px;
    transition: all 0.5s ease;
    opacity: 0; /* 测速开始时显示 */
    transform: translateY(-20px);
}

.stats-grid.visible { opacity: 1; transform: translateY(0); }

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label { font-size: 0.9rem; color: var(--text-muted); letter-spacing: 1px; margin-bottom: 0.5rem; text-transform: uppercase; }
.stat-val { font-size: 2rem; font-weight: 700; color: #fff; line-height: 1; }
.stat-unit { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* 激活状态的高亮 */
.stat-card.active { border-color: var(--accent); box-shadow: 0 0 15px var(--accent-glow); }
.stat-card.active .stat-val { color: var(--accent); }

/* --- 仪表盘区域 --- */
.gauge-box {
    position: relative;
    width: 360px;
    height: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 巨大的 GO 按钮 */
.go-btn {
    position: absolute;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: transparent;
    color: #fff;
    font-family: 'Rajdhani', sans-serif;
    font-size: 3.5rem;
    font-weight: 500;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 0px var(--accent-glow);
}

.go-btn:hover {
    background: rgba(0, 242, 234, 0.05);
    box-shadow: 0 0 30px var(--accent-glow);
    transform: scale(1.05);
    letter-spacing: 2px;
}

.go-btn.hidden { opacity: 0; pointer-events: none; transform: scale(0.8); }

/* 中心实时数字 */
.live-data {
    position: absolute;
    text-align: center;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.live-data.visible { opacity: 1; }

.live-num { font-size: 5.5rem; font-weight: 300; line-height: 0.9; text-shadow: 0 0 20px rgba(0,0,0,0.5); }
.live-unit { font-size: 1.2rem; color: var(--accent); letter-spacing: 1px; }

/* --- 底部信息栏 --- */
.footer-bar {
    width: 100%;
    padding: 1.5rem;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: center;
}

.footer-content {
    width: 100%;
    max-width: 900px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inf-group { display: flex; align-items: center; gap: 12px; }
.inf-icon { font-size: 1.5rem; color: var(--text-muted); }
.inf-text h4 { font-size: 1rem; font-weight: 500; color: #fff; }
.inf-text p { font-size: 0.8rem; color: var(--text-muted); }

/* --- 📱 移动端完美适配 (Responsive) --- */
@media (max-width: 768px) {
    .header { padding: 1rem; }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr 1fr; /* 仍然保持三列，但缩小 */
        gap: 0.5rem;
        padding: 0 10px;
    }
    
    .stat-val { font-size: 1.5rem; }
    .stat-label { font-size: 0.7rem; }
    
    .gauge-box { width: 300px; height: 300px; margin: 20px 0; }
    .go-btn { width: 130px; height: 130px; font-size: 2.5rem; }
    .live-num { font-size: 4rem; }

    .footer-content { flex-direction: column; gap: 20px; text-align: center; }
    .inf-group { flex-direction: column; gap: 5px; }
}

@media (max-width: 380px) {
    /* 针对超小屏幕手机 (iPhone SE) */
    .gauge-box { width: 260px; height: 260px; }
    .stats-grid { gap: 4px; }
}