/* OneNav 网址自动测速 - 结果徽章样式 v3.0
 * 测速信息为预览图底部全宽横条，半透明渐变背景 + 毛玻璃
 * 内部多个来源胶囊（💻/📱/🌐）居中并排，各自上色 */

/* 预览图底部测速横条（与图片重叠、同宽） */
.site-detail-preview .preview-img .onenav-speed-badge {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    z-index: 2;
}

/* 横条容器：半透明渐变 + 毛玻璃，胶囊居中 */
.onenav-speed-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.45) 60%, rgba(15, 23, 42, 0) 100%);
    backdrop-filter: blur(3px);
    line-height: 1.6;
}
.onenav-speed-badge b {
    font-weight: 600;
}
.onenav-speed-badge .onenav-speed-detail {
    font-weight: 400;
    opacity: .8;
}

/* 单个来源胶囊 */
.onenav-speed-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.onenav-speed-chip.fast { background: rgba(5, 150, 105, 0.95); }
.onenav-speed-chip.mid  { background: rgba(217, 119, 6, 0.95); }
.onenav-speed-chip.slow { background: rgba(220, 38, 38, 0.95); }
/* 排队中：灰色半透明 + 呼吸动画 */
.onenav-speed-chip.pending {
    background: rgba(100, 116, 139, 0.7);
    font-weight: 500;
    animation: dspeed-pending-breathe 1.8s ease-in-out infinite;
}
@keyframes dspeed-pending-breathe {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.5; }
}
/* 超时/失败：深灰底，无呼吸动画 */
.onenav-speed-chip.failed {
    background: rgba(30, 41, 59, 0.9);
    font-weight: 500;
    cursor: help;
}

/* ===== 自定义 hover tooltip（美化浮层） =====
 * 显示时由 JS 移入 body 并 fixed 定位（left/top 内联），
 * 避免被预览图 overflow 裁切；显隐由 JS 的 mouseover/mouseout 控制 */
.speed-tooltip {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 99999;
    min-width: 170px;
    max-width: 320px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.97);
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.75;
    white-space: nowrap;
    pointer-events: none;
}
.speed-tooltip .st-title {
    font-weight: 600;
    color: #fff;
    font-size: 12px;
    margin-bottom: 7px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.speed-tooltip .st-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}
.speed-tooltip .st-row span {
    color: #94a3b8;
}
.speed-tooltip .st-row b {
    color: #f1f5f9;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* 测速中 / 失败状态：横条背景已有，文字白色居中 */
.onenav-speed-badge.testing,
.onenav-speed-badge.fail {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

/* 暗色模式适配（横条已是深色半透明，微调文字） */
.io-black-mode .onenav-speed-badge.testing,
.io-black-mode .onenav-speed-badge.fail {
    color: #e5e7eb;
}

/* 移动端：横条紧凑 */
@media (max-width: 480px) {
    .onenav-speed-badge {
        padding: 8px 10px;
        gap: 6px;
    }
    .onenav-speed-chip {
        padding: 2px 8px;
        font-size: 11px;
    }
    .onenav-speed-badge.testing,
    .onenav-speed-badge.fail {
        font-size: 11px;
    }
}

