/* ========================================
   网络延迟测试工具样式
   ======================================== */

html, body { height: 100%; overflow: hidden; margin: 0; }
body { display: flex; align-items: center; justify-content: center; padding-top: 70px; }

.main-content {
    width: 100%; max-width: 900px; height: calc(100vh - 120px);
    display: flex; align-items: center; padding: 0 20px; padding-bottom: 50px; z-index: 10;
}
.container { width: 100%; height: 100%; }
.tool-card {
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-xl);
    overflow: hidden; display: flex; flex-direction: column; width: 100%; height: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.panel-header {
    padding: 8px 16px; font-size: 12px; font-weight: 600; color: var(--text-muted);
    background: rgba(255,255,255,0.02); border-bottom: 1px solid rgba(255,255,255,0.05); flex-shrink: 0;
}

/* 控制区 */
.latency-controls { padding: 16px; background: rgba(0,0,0,0.2); border-bottom: 1px solid var(--border-color); flex-shrink: 0; }
.latency-control-group { margin-bottom: 12px; }
.latency-control-group label { display: block; font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.latency-select, .latency-input {
    width: 100%; padding: 10px 14px; background: rgba(255,255,255,0.05); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); color: var(--text-primary); font-size: 14px; outline: none;
}
.latency-select:focus, .latency-input:focus { border-color: var(--primary-color); }
.latency-input::placeholder { color: var(--text-muted); }
.latency-select { cursor: pointer; }
.latency-btn {
    width: 100%; padding: 12px; border-radius: var(--radius-md); border: none; cursor: pointer;
    font-size: 14px; font-weight: 600; color: white; transition: 0.2s;
    background: linear-gradient(135deg, #10b981, #059669);
}
.latency-btn:hover { box-shadow: 0 4px 15px rgba(16,185,129,0.4); }
.latency-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 结果区 */
.latency-results { flex: 1; overflow-y: auto; padding: 16px; }
.latency-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px; color: var(--text-muted); gap: 12px; }
.latency-placeholder i { font-size: 48px; }

/* 统计卡片 */
.latency-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.latency-stat { background: rgba(255,255,255,0.03); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 14px; text-align: center; }
.latency-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.latency-stat-value { font-size: 22px; font-weight: 700; font-family: var(--font-mono); }
.latency-stat-value.good { color: #22c55e; }
.latency-stat-value.medium { color: #f59e0b; }
.latency-stat-value.bad { color: #ef4444; }

/* 列表 */
.latency-list { display: flex; flex-direction: column; gap: 4px; }
.latency-item { display: flex; align-items: center; padding: 8px 12px; background: rgba(255,255,255,0.02); border-radius: var(--radius-sm); font-size: 13px; }
.latency-item-num { width: 40px; color: var(--text-muted); font-size: 12px; }
.latency-item-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.05); border-radius: 3px; margin: 0 12px; overflow: hidden; }
.latency-item-fill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.latency-item-fill.good { background: #22c55e; }
.latency-item-fill.medium { background: #f59e0b; }
.latency-item-fill.bad { background: #ef4444; }
.latency-item-val { width: 80px; text-align: right; font-family: var(--font-mono); font-size: 13px; }

@media (max-width: 600px) {
    .latency-stats { grid-template-columns: repeat(2, 1fr); }
}
