/* ==========================================================================
   设计令牌（本页作用域；不污染主题）
   ========================================================================== */
.rd-wrap {
    --c-brand: #2563eb;
    --c-brand-strong: #1d4ed8;
    --c-brand-weak: #eff6ff;
    --c-brand-line: #bfdbfe;
    --c-fg: #0f172a;
    --c-fg-2: #3f3f46;
    --c-fg-3: #71717a;
    --c-fg-4: #a1a1aa;
    --c-line: #e4e4e7;
    --r-ctrl: 10px;
}

/* ==========================================================================
   雷达图（radar-dev）—— 站点浅色体系（slate + 蓝），作用域 .rd-*
   ========================================================================== */
.rd-wrap {
    --rd-fg: #09090b;
    --rd-muted: #71717a;
    --rd-border: #e4e4e7;
    --rd-soft: #fafafa;
    --rd-blue: #2563eb;
    --rd-blue-soft: #eff6ff;
    --rd-red: #dc2626;
    --rd-amber: #d97706;

    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 20px 44px;
    color: var(--rd-fg);
    font-size: 14px;
    line-height: 1.55;
    font-variant-numeric: tabular-nums;
}

.rd-wrap *,
.rd-wrap *::before,
.rd-wrap *::after { box-sizing: border-box; }

/* 头部 */
.rd-head { margin-bottom: 16px; }
.rd-head h1 { margin: 0 0 4px; font-size: 24px; font-weight: 600; }
.rd-head p { margin: 0; font-size: 13px; color: var(--rd-muted); }

/* 卡片 */
.rd-card {
    background: #fff;
    border: 1px solid var(--rd-border);
    border-radius: 12px;
    padding: 16px;
}

.rd-card + .rd-card { margin-top: 16px; }

.rd-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 600;
}

.rd-card-title .rd-muted { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--rd-muted); }

/* 站点选择 / 日期 */
.rd-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.rd-label { font-size: 12px; color: var(--rd-muted); white-space: nowrap; }

.rd-input,
.rd-select {
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--rd-border);
    border-radius: 8px;
    background: #fff;
    color: var(--rd-fg);
    font-size: 13px;
}

.rd-input { min-width: 180px; }
.rd-input:focus,
.rd-select:focus { outline: none; border-color: #a1a1aa; }
.rd-select { min-width: 190px; }

/* 图像区：容器固定比例，无论 824×738 还是 825×739 都不跳动 */
.rd-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 825 / 739;
    max-height: 74vh;
    margin: 14px auto 0;
    background: #f8fafc;
    border: 1px solid var(--rd-border);
    border-radius: 12px;
    overflow: hidden;
}

.rd-stage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.rd-stage img[hidden] { display: none; }

/* loading */
.rd-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--rd-muted);
    font-size: 13px;
    background: rgba(248, 250, 252, .86);
    z-index: 4;
}

.rd-loading[hidden] { display: none; }

.rd-spinner {
    width: 26px;
    height: 26px;
    border: 2px solid #dbeafe;
    border-top-color: var(--rd-blue);
    border-radius: 50%;
    animation: rd-spin .8s linear infinite;
}

@keyframes rd-spin { to { transform: rotate(360deg); } }

/* 错误 / 空态 */
.rd-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    text-align: center;
    color: #b45309;
    font-size: 13px;
    background: rgba(255, 251, 235, .94);
    z-index: 5;
}

.rd-error[hidden] { display: none; }
.rd-error strong { color: #92400e; font-size: 14px; }

.rd-empty {
    padding: 26px 16px;
    text-align: center;
    color: var(--rd-muted);
    font-size: 13px;
}

.rd-empty[hidden] { display: none; }
.rd-empty strong { display: block; margin-bottom: 4px; color: var(--rd-fg); font-size: 14px; }

/* 播放控制 */
.rd-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.rd-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    min-width: 92px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--r-ctrl);
    background: var(--c-brand);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}

.rd-play:hover { background: var(--c-brand-strong); }
.rd-play:disabled { opacity: .45; cursor: not-allowed; }

.rd-play svg { width: 14px; height: 14px; }

.rd-range-wrap { flex: 1 1 320px; min-width: 220px; display: flex; align-items: center; gap: 10px; }

.rd-range {
    flex: 1;
    height: 6px;
    border-radius: 4px;
    background: linear-gradient(90deg, #93c5fd 0%, #2563eb 100%);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.rd-range:disabled { opacity: .5; cursor: not-allowed; }

.rd-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--c-brand-strong);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .35);
}

.rd-time {
    min-width: 132px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.rd-count { font-size: 12px; color: var(--rd-muted); white-space: nowrap; }

.rd-error-text { color: var(--rd-red); font-size: 12px; }

/* 播放速度分段控件（浅色体系，与站点时间轴语言一致） */
.rd-speed {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rd-speed-btn {
    padding: 7px 12px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-ctrl);
    background: #fff;
    color: var(--c-fg-2);
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.rd-speed-btn:hover { border-color: var(--c-brand-line); background: var(--c-brand-weak); color: var(--c-brand-strong); }

.rd-speed-btn.is-active { border-color: var(--c-brand); background: var(--c-brand); color: #fff; font-weight: 600; }

.rd-speed-btn:focus-visible {
    outline: 2px solid var(--c-brand);
    outline-offset: 2px;
}

/* 键盘可达性 */
.rd-play:focus-visible,
.rd-input:focus-visible,
.rd-range:focus-visible {
    outline: 2px solid var(--c-brand);
    outline-offset: 2px;
}

/* 响应式 */
@media (max-width: 720px) {
    .rd-wrap { padding: 16px 12px 32px; }
    .rd-head h1 { font-size: 20px; }
    .rd-stage { max-height: 56vh; }
    .rd-input, .rd-select { min-width: 0; width: 100%; }
    .rd-row { gap: 6px; }
    .rd-time { min-width: 0; }
}
/* ── 类型切换（雷达拼图 / 单站雷达） ───────────────────────── */
.rd-type {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rd-type-btn {
    padding: 7px 14px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-ctrl);
    background: #fff;
    color: var(--c-fg-2);
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.rd-type-btn:hover { border-color: var(--c-brand-line); background: var(--c-brand-weak); color: var(--c-brand-strong); }
.rd-type-btn.is-active { border-color: var(--c-brand); background: var(--c-brand); color: #fff; font-weight: 600; }
.rd-type-btn:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }

.rd-row[hidden],
.rd-input[hidden] { display: none !important; }

@media (max-width: 720px) {
    .rd-type-btn,
    .rd-speed-btn { padding: 6px 10px; font-size: 12px; }
}

/* ── 按钮网格（产品 / 省份 / 站点 / 日期，替代全部下拉） ───────── */
.rd-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 4px;
}

.rd-buttons[hidden] { display: none !important; }

.rd-btn {
    padding: 7px 14px;
    border: 1px solid var(--c-line);
    border-radius: var(--r-ctrl);
    background: #fff;
    color: var(--c-fg-2);
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.rd-btn:hover { border-color: var(--c-brand-line); background: var(--c-brand-weak); color: var(--c-brand-strong); }
.rd-btn.is-active { border-color: var(--c-brand); background: var(--c-brand); color: #fff; font-weight: 600; }
.rd-btn:focus-visible { outline: 2px solid var(--c-brand); outline-offset: 2px; }

.rd-btn-date {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    padding: 7px 14px;
    border-radius: var(--r-ctrl);
}

.rd-btn-main { font-size: 13px; font-weight: 600; }
.rd-time-note { margin: 6px 0 0; font-size: 12px; color: var(--c-fg-3); line-height: 1.5; }

.rd-card-title--date { margin-top: 14px; }
.rd-source-note { display: block; margin-top: 4px; color: var(--rd-muted); font-size: 12px; }
.rd-source-note:empty { display: none; }

@media (max-width: 720px) {
    .rd-btn,
    .rd-btn-date { padding: 6px 10px; font-size: 12px; }
    .rd-buttons { gap: 6px; }
}


/* 四态统一：禁用（与产品/类型/速度按钮一致） */
.rd-btn:disabled,
.rd-type-btn:disabled,
.rd-speed-btn:disabled {
    color: var(--c-fg-4);
    border-color: var(--c-line);
    background: #fcfcfd;
    cursor: not-allowed;
}

