/* public/assets/css/tools/dev/speed-test.css */
.speed-workspace {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 顶部指标四宫格 */
.speed-metrics-top {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    width: 100%;
    max-width: 800px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .speed-metrics-top {
        grid-template-columns: repeat(2, 1fr);
    }
}

.speed-metric-box {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px 16px;
    text-align: center;
    transition: transform 0.2s;
}

.speed-metric-box:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--primary-rgb, 0, 102, 204), 0.3);
}

.speed-m-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.speed-m-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.speed-m-value small {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.6;
}

.speed-dot {
    width: 8px; height: 8px; border-radius: 50%;
}
.ping-dot { background: #f59e0b; }
.jitter-dot { background: #3b82f6; }
.text-green { color: #10b981; }
.text-purple { color: #8b5cf6; }

/* 主环形动画控制区 */
.speed-dial-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 20px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speed-dial-ring {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.speed-progress-svg {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    transform: rotate(-90deg);
}

.speed-circle-bg {
    fill: none;
    stroke: var(--bg-body);
    stroke-width: 10;
}

.speed-circle-fill {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-dasharray: 565.48; /* 2 * pi * 90 */
    stroke-dashoffset: 565.48;
    transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
}

/* 渐变与状态色 */
.speed-circle-fill.ping { stroke: #f59e0b; }
.speed-circle-fill.dl { stroke: #10b981; }
.speed-circle-fill.ul { stroke: #8b5cf6; }

/* 中心 GO 按钮与实时数据 */
.speed-dial-inner {
    position: relative;
    width: 240px; height: 240px;
    background: var(--bg-surface);
    border-radius: 50%;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.05), 0 10px 30px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.speed-btn-go {
    width: 120px; height: 120px;
    border-radius: 50%;
    background: transparent;
    border: 4px solid var(--primary-color);
    color: var(--primary-color);
    font-size: 2.2rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.speed-btn-go:hover {
    background: var(--primary-color);
    color: #fff;
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(var(--primary-rgb, 0, 102, 204), 0.3);
}

.speed-live-data {
    text-align: center;
    animation: fadeIn 0.3s;
}

.speed-live-lbl {
    font-size: 1rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase;
}

.speed-live-val {
    font-size: 3.5rem; font-weight: 900; line-height: 1; margin: 8px 0;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    background: linear-gradient(135deg, var(--text-main), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.speed-live-unit {
    font-size: 0.9rem; font-weight: 600; color: var(--text-muted);
}

/* 底部状态 */
.speed-status-bar {
    margin-top: 30px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

[data-theme="dark"] .speed-circle-bg { stroke: #1e293b; }
[data-theme="dark"] .speed-dial-inner { box-shadow: inset 0 4px 20px rgba(0,0,0,0.2), 0 10px 30px rgba(0,0,0,0.2); }