/**
 * 回放管理页样式
 *
 * ⚠️ 全局渗漏防护：index.html 一次性加载 css/pages/ 下全部样式表，
 * 裸类名（.form-row / .tab-panel / .pagination 等）会打到别的页面，
 * 也会打到挂在 body 下的 #modal-overlay 弹窗。
 * 所以：
 *   1. 页面内元素一律 `.replay-container .rp-xxx` 双前缀；
 *   2. 弹窗里的表单类必须**不带容器前缀**（弹窗不在 .replay-container 里），
 *      靠 `rp-` 唯一前缀防冲突 —— 与 website.css 的 .ws-form-* 同一套路；
 *   3. 分页器刻意不复用全局 `.pagination`（那条基线是 column 居中，按钮会竖排），
 *      改用 `.rp-pagination` 并显式 flex-direction: row。
 * ⚠️ 内联 style 控显隐写死 'block'/'none'（switchTab 里），CSS 不要去覆盖 display。
 */

/* ==================== 页头 ==================== */
.replay-container .rp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.replay-container .rp-title h2 {
    margin: 0;
    font-size: 20px;
    color: #0f172a;
}
.replay-container .rp-sub {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #94a3b8;
}

/* ==================== 提示条 ==================== */
.replay-container .rp-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    line-height: 1.75;
    margin-bottom: 14px;
}
.replay-container .rp-note.is-ok {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}
.replay-container .rp-note.is-warn {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}
.replay-container .rp-note.is-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}
.replay-container .rp-note code {
    background: rgba(15, 23, 42, .06);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 12px;
}

/* ==================== 概览卡 ==================== */
.replay-container .rp-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.replay-container .rp-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 13px 15px;
}
.replay-container .rp-card.is-warn {
    border-color: #fcd34d;
    background: #fffdf5;
}
.replay-container .rp-card-label {
    font-size: 12px;
    color: #64748b;
}
.replay-container .rp-card-value {
    font-size: 25px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-all;
}
.replay-container .rp-card-sub {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

/* ==================== Tab ==================== */
.replay-container .rp-tabs {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    background: #f1f5f9;
    border-radius: 10px;
    margin-bottom: 16px;
}
.replay-container .rp-tab {
    padding: 7px 16px;
    border: none;
    background: transparent;
    border-radius: 7px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    transition: all .15s;
}
.replay-container .rp-tab:hover {
    background: #e2e8f0;
    color: #334155;
}
.replay-container .rp-tab.is-active {
    background: #fff;
    color: #0f172a;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

/* ==================== 工具条 ==================== */
.replay-container .rp-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.replay-container .rp-spacer {
    flex: 1 1 auto;
}
.replay-container .rp-search {
    flex: 0 1 260px;
    min-width: 180px;
}
.replay-container .rp-tip {
    font-size: 13px;
    color: #64748b;
}
.replay-container .rp-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    white-space: nowrap;
}
.replay-container .rp-check input {
    width: 15px;
    height: 15px;
    cursor: pointer;
}

/* ==================== 表格 ==================== */
.replay-container .rp-table-wrap {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow-x: auto;
}
.replay-container .rp-op {
    white-space: nowrap;
}
.replay-container .rp-op .btn {
    margin-right: 5px;
}
.replay-container .rp-op .btn:last-child {
    margin-right: 0;
}

/* ==================== 单元格内的排版小件（弹窗里也用，故不带容器前缀） ==================== */
.rp-strong {
    color: #0f172a;
    font-weight: 600;
}
.rp-dim {
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
}
.rp-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #475569;
    word-break: break-all;
}
.rp-truncate {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.replay-container .rp-link {
    border: none;
    background: none;
    padding: 0;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.replay-container .rp-link:hover {
    color: var(--primary-light);
}

/* ==================== 徽标 ==================== */
.rp-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.6;
    background: #f1f5f9;
    color: #64748b;
    white-space: nowrap;
}
.rp-badge.is-ok { background: #ecfdf5; color: #047857; }
.rp-badge.is-warn { background: #fffbeb; color: #b45309; }
.rp-badge.is-bad { background: #fef2f2; color: #b91c1c; }
.rp-badge.is-info { background: #eef2ff; color: var(--primary-color); }
.rp-badge.is-manual { background: #f5f3ff; color: #6d28d9; }

/* ==================== 占位 ==================== */
.rp-placeholder {
    padding: 22px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}
.rp-placeholder.is-error {
    color: #b91c1c;
}

/* ==================== 分页器 ==================== */
.replay-container .rp-pagination {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
}
.replay-container .rp-page-gap {
    color: #94a3b8;
    padding: 0 2px;
}
.replay-container .rp-pageinfo {
    color: #94a3b8;
    font-size: 12px;
    margin-left: 6px;
}

/* ==========================================================================
   弹窗内的表单 —— 不带 .replay-container 前缀！
   弹窗挂在 body 下的 #modal-overlay，不在页面容器里；
   靠 `rp-` 唯一前缀防冲突（与 website.css 的 .ws-form-* 一致）。
   ========================================================================== */
.rp-form {
    font-size: 13px;
    color: #334155;
}
.rp-form-alert {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 12px;
    line-height: 1.75;
    color: #64748b;
    margin-bottom: 14px;
}
.rp-form-alert code {
    background: rgba(15, 23, 42, .06);
    padding: 1px 5px;
    border-radius: 4px;
}
.rp-form-title {
    font-size: 13px;
    font-weight: 600;
    color: #0f172a;
    margin: 14px 0 8px;
}
.rp-form-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.rp-form-label {
    flex: 0 0 92px;
    text-align: right;
    font-size: 13px;
    color: #64748b;
    /* 用 padding-top 对齐首行，不用魔法 line-height：textarea 多行时也不会跑偏 */
    padding-top: 12px;
    line-height: 1.5;
}
.rp-form-ctrl {
    flex: 1 1 auto;
    min-width: 0;
}
.rp-form-hint {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.65;
    margin-top: 4px;
}
.rp-form-hint code {
    background: rgba(15, 23, 42, .06);
    padding: 1px 4px;
    border-radius: 3px;
}
.rp-req {
    color: #dc2626;
    margin-left: 2px;
}
.rp-readonly {
    padding: 7px 11px;
    background: #f1f5f9;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
    line-height: 1.6;
}

/* 弹窗里的清单（授权明细 / 登录记录）
   行高固定 38px，max-height 必须取行高的整数倍（38 × 8 = 304），
   否则末行会被卡片底边切一半。 */
.rp-grant-list {
    max-height: 304px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.rp-grant-item {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 0 12px;
    min-height: 38px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    line-height: 1.5;
    box-sizing: border-box;
}
.rp-grant-item:last-child {
    border-bottom: none;
}
.rp-grant-item .rp-strong {
    flex: 0 1 auto;
}

/* 授权弹窗里的账号多选（行高固定 38px；max-height 取行高整数倍，否则末行被切半） */
.rp-account-pick {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.rp-account-head {
    display: flex;
    gap: 8px;
    padding: 8px 10px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.rp-account-head input {
    flex: 1 1 auto;
}
.rp-account-list {
    max-height: 304px;   /* 38 × 8 */
    overflow-y: auto;
}
.rp-account-item {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border-bottom: 1px solid #f8fafc;
    cursor: pointer;
    font-size: 13px;
    box-sizing: border-box;
}
.rp-account-item:hover {
    background: #f8fafc;
}
.rp-account-item input {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    cursor: pointer;
}
.rp-account-item .rp-strong {
    flex: 0 0 auto;
}
.rp-account-list .rp-placeholder {
    padding: 14px;
}
.rp-account-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #64748b;
}
.rp-account-foot .rp-link {
    border: none;
    background: none;
    padding: 0;
    color: var(--primary-color);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

/* ==================== 响应式 ==================== */
@media (max-width: 900px) {
    .replay-container .rp-toolbar .rp-search {
        flex: 1 1 100%;
        min-width: 0;
    }
    .replay-container .rp-spacer {
        display: none;
    }
}
@media (max-width: 640px) {
    .rp-form-row { flex-direction: column; gap: 4px; }
    .rp-form-label { flex: none; text-align: left; line-height: 1.6; }
    .replay-container .rp-cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ==================== 场次过滤芯片（视频绑定 Tab） ==================== */
.replay-container .rp-conf-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    border-radius: 999px;
    font-size: 12px;
    color: #3730a3;
    white-space: nowrap;
}
.replay-container .rp-conf-chip strong {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.replay-container .rp-conf-chip-x {
    border: none;
    background: none;
    padding: 0 2px;
    font-size: 12px;
    line-height: 1;
    color: #6366f1;
    cursor: pointer;
}
.replay-container .rp-conf-chip-x:hover { color: var(--primary-color); }

/* ==================== 批量导入结果 ==================== */
.replay-container .rp-import-result {
    max-height: 320px;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}
.replay-container .rp-import-result .table { margin: 0; }
.replay-container .rp-import-result td { vertical-align: top; font-size: 13px; }
