:root {
    color: var(--text-primary);
    background: var(--bg-page);
    font-family: var(--font-system);
}

body {
    margin: 0;
    min-width: 320px;
    background: var(--bg-page);
}

#ops-center-root {
    min-height: 100vh;
}

/* ---- 应用外壳：左侧固定导航 + 内容区，宽度对齐主后台侧边栏（248px） ---- */

.ops-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 248px minmax(0, 1fr);
}

.ops-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    border-right: 1px solid var(--border);
    background: var(--bg-card);
    padding: var(--space-5) var(--space-3);
}

.ops-brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-2);
}

.ops-brand > span {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: var(--radius-control);
    background: var(--primary);
    color: var(--active-contrast, #fff);
    font-size: 13px;
    font-weight: 800;
}

.ops-brand strong {
    display: block;
    font-size: 16px;
    line-height: 1.25;
}

.ops-brand small {
    color: var(--text-tertiary);
    font-size: 11px;
}

.ops-nav {
    display: grid;
    gap: var(--space-2);
}

.ops-nav button {
    display: flex;
    width: 100%;
    height: 38px;
    align-items: center;
    gap: var(--space-3);
    border: 0;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0 var(--space-3);
    text-align: left;
    transition:
        background var(--motion-fast) var(--ease-standard),
        color var(--motion-fast) var(--ease-standard);
}

.ops-nav button:hover {
    background: var(--primary-hover);
    color: var(--text-primary);
}

/* active 优先级必须高于 hover：hover 到别的项时当前页仍要保持高亮底色 */
.ops-nav button.is-active,
.ops-nav button.is-active:hover {
    background: var(--primary-surface);
    color: var(--primary);
    font-weight: 700;
}

.ops-main {
    min-width: 0;
    background: var(--bg-page);
}

/* ---- 页面骨架 ---- */

.ops-page {
    display: grid;
    gap: var(--space-5);
    padding: var(--space-6);
}

.ops-view {
    display: grid;
    gap: var(--space-5);
}

.ops-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ops-status {
    display: inline-flex;
    height: 28px;
    align-items: center;
    border: 1px solid var(--success-border);
    border-radius: 999px;
    background: var(--success-surface);
    color: var(--success);
    font-size: 12px;
    font-weight: 700;
    padding: 0 var(--space-3);
}

.ops-status.is-loading {
    border-color: var(--info-border);
    background: var(--info-surface);
    color: var(--info);
}

.ops-alert {
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-card);
    background: var(--warning-surface);
    color: var(--warning);
    font-weight: 700;
    padding: var(--space-3) var(--space-4);
}

.ops-pool-actions,
.ops-config-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    white-space: nowrap;
}

.ops-config-actions {
    justify-content: flex-end;
}

.ops-pool-adjustment-form {
    display: contents;
}

.ops-pool-adjustment-content {
    display: grid;
    gap: var(--space-4);
    padding-top: var(--space-4) !important;
}

.ops-pool-adjustment-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 0;
}

.ops-pool-adjustment-note {
    border: 1px solid var(--info-border);
    border-radius: var(--radius-control);
    background: var(--info-surface);
    color: var(--info);
    font-size: 13px;
    font-weight: 700;
    padding: var(--space-3);
}

.ops-rollback-content {
    display: grid;
    gap: var(--space-4);
    min-height: 320px;
}

#lucky-gift-rollback-title small {
    display: block;
    margin-top: var(--space-1);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
}

.ops-rollback-warning {
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-control);
    background: var(--warning-surface);
    color: var(--warning);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.6;
    padding: var(--space-3) var(--space-4);
}

.ops-rollback-table {
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    overflow: auto;
}

.ops-rollback-row {
    display: grid;
    grid-template-columns: 48px 70px 120px 112px 100px 100px 144px minmax(176px, 1fr);
    align-items: center;
    min-width: 940px;
    min-height: 58px;
    border-bottom: 1px solid var(--row-border);
    cursor: pointer;
    padding: 0 var(--space-2);
}

.ops-rollback-row:last-child {
    border-bottom: 0;
}

.ops-rollback-row.is-selected {
    background: var(--primary-surface);
}

.ops-rollback-head {
    min-height: 44px;
    background: var(--bg-card-strong);
    color: var(--text-secondary);
    cursor: default;
    font-size: 13px;
    font-weight: 700;
}

.ops-rollback-empty {
    display: grid;
    min-height: 180px;
    place-items: center;
    color: var(--text-secondary);
}

/* ---- 幸运礼物配置弹窗 ---- */

.MuiDialog-paper.ops-config-dialog-paper {
    width: 94vw;
    max-width: 1520px;
    height: 92vh;
    max-height: 92vh;
    margin: var(--space-4);
    overflow: hidden;
}

.ops-config-form {
    display: flex;
    min-height: 0;
    height: 100%;
    flex-direction: column;
}

.ops-config-title {
    display: grid;
    flex: 0 0 auto;
    gap: var(--space-1);
    padding: var(--space-4) var(--space-6) var(--space-3);
}

.ops-config-title small {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 700;
}

.ops-config-summary {
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    margin: 0;
    padding: 0 var(--space-6) var(--space-3);
}

.ops-config-dialog-content {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden !important;
    background: var(--bg-card);
    padding: 0 !important;
}

.ops-config-validation {
    display: grid;
    max-height: 112px;
    flex: 0 0 auto;
    gap: var(--space-2);
    overflow-y: auto;
    margin: var(--space-3) var(--space-4) 0;
    border: 1px solid var(--danger-border, #fecaca);
    border-radius: var(--radius-control);
    background: var(--danger-surface, #fef2f2);
    color: var(--danger, #dc2626);
    padding: var(--space-3) var(--space-4);
}

.ops-config-validation:focus-visible {
    outline: 2px solid var(--danger, #dc2626);
    outline-offset: 2px;
}

.ops-config-validation ul {
    display: grid;
    gap: 2px;
    margin: 0;
    padding-left: 20px;
}

.ops-config-metric {
    display: grid;
    min-width: 0;
    gap: 2px;
    border-left: 1px solid var(--border);
    padding: var(--space-1) var(--space-3);
}

.ops-config-metric:first-child {
    border-left: 0;
    padding-left: 0;
}

.ops-config-metric dt {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-config-metric dd {
    overflow: hidden;
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-config-layout {
    display: grid;
    min-height: 0;
    height: 100%;
    flex: 1 1 auto;
    grid-template-columns: clamp(500px, 40vw, 620px) minmax(0, 1fr);
    overflow: hidden;
}

.ops-config-params {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-columns: 92px minmax(0, 1fr);
    overflow: hidden;
    border-right: 1px solid var(--border);
}

.ops-config-section-nav {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: var(--space-1);
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: var(--bg-card-strong, #f8fafc);
    padding: var(--space-3) var(--space-2);
}

.ops-config-section-nav strong {
    color: var(--text-tertiary);
    font-size: 11px;
    letter-spacing: 0.04em;
    padding: var(--space-1) var(--space-2) var(--space-2);
}

.ops-config-section-nav button {
    min-height: 34px;
    border: 0;
    border-left: 2px solid transparent;
    border-radius: var(--radius-control);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 0 var(--space-2);
    text-align: left;
    transition:
        background var(--motion-fast) var(--ease-standard),
        border-color var(--motion-fast) var(--ease-standard),
        color var(--motion-fast) var(--ease-standard);
}

.ops-config-section-nav button:hover {
    background: var(--primary-hover);
}

.ops-config-section-nav button.is-active {
    border-left-color: var(--primary);
    background: var(--primary-surface);
    color: var(--primary);
}

.ops-config-section-list {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: var(--space-3) var(--space-4) var(--space-6);
    scroll-behavior: smooth;
}

.ops-config-section {
    display: grid;
    gap: var(--space-3);
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: var(--bg-card);
    padding: var(--space-3) 0 var(--space-5);
}

.ops-config-section + .ops-config-section {
    padding-top: var(--space-5);
}

.ops-config-section:last-child {
    border-bottom: 0;
}

.ops-config-section h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.3;
}

.ops-config-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.ops-config-section__head span {
    border-radius: var(--radius-pill);
    background: var(--warning-surface);
    color: var(--warning);
    font-size: 11px;
    font-weight: 800;
    padding: 3px var(--space-2);
    white-space: nowrap;
}

.ops-config-section__head span.is-ok {
    background: var(--success-surface);
    color: var(--success);
}

.ops-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.ops-form-grid__wide {
    grid-column: 1 / -1;
}

.ops-config-enabled-field {
    min-height: var(--control-height);
    justify-content: space-between;
    margin: 0 !important;
    border: 1px solid var(--border);
    border-radius: var(--radius-control);
    padding: 0 var(--space-3);
}

.ops-config-enabled-field .MuiFormControlLabel-label {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
}

.ops-field-note {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 12px;
    line-height: 1.5;
}

.ops-jackpot-rule-groups {
    display: grid;
    gap: var(--space-4);
}

.ops-jackpot-rule-group {
    display: grid;
    gap: var(--space-3);
    margin: 0;
    padding: 0;
}

.ops-jackpot-rule-group + .ops-jackpot-rule-group {
    border-top: 1px solid var(--border);
    padding-top: var(--space-4);
}

.ops-jackpot-rule-group__head {
    display: grid;
    gap: 3px;
}

.ops-jackpot-rule-group__head h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.4;
}

.ops-jackpot-rule-group__head p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.5;
}

.ops-field-label {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 4px;
    border-radius: 3px;
    cursor: help;
    white-space: nowrap;
}

/* OutlinedInput 会在 notch 的 legend 中复制一次 label；保留其宽度计算，但隐藏复制品，
 * 避免同一个说明入口在键盘 Tab 顺序中出现两次。 */
.MuiOutlinedInput-notchedOutline legend .ops-field-label {
    visibility: hidden;
}

.ops-field-help-trigger {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-tertiary);
    font-size: 14px;
    transition:
        background var(--motion-fast) var(--ease-standard),
        color var(--motion-fast) var(--ease-standard);
}

.ops-field-label:hover .ops-field-help-trigger,
.ops-field-label:focus-visible .ops-field-help-trigger {
    background: var(--primary-hover);
    color: var(--primary);
}

.ops-field-label:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-border, #93c5fd);
}

/* Tooltip 通过 portal 渲染，必须用自身 class 承载完整排版；字段内只保留问号，不牺牲表单密度。 */
.MuiTooltip-tooltip.ops-field-help-tooltip {
    max-width: min(420px, calc(100vw - 32px));
    border: 1px solid rgb(148 163 184 / 32%);
    border-radius: var(--radius-control);
    background: #0f172a;
    box-shadow: 0 16px 40px rgb(15 23 42 / 28%);
    color: #f8fafc;
    padding: var(--space-3) var(--space-4);
}

.ops-field-help-content {
    display: grid;
    gap: var(--space-2);
}

.ops-field-help-content > strong {
    color: #ffffff;
    font-size: 13px;
    line-height: 1.4;
}

.ops-field-help-content dl {
    display: grid;
    gap: 7px;
    margin: 0;
}

.ops-field-help-content dl > div {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: start;
    gap: var(--space-2);
}

.ops-field-help-content dt {
    color: #93c5fd;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.55;
}

.ops-field-help-content dd {
    margin: 0;
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.55;
}

.ops-stage-designer {
    display: grid;
    min-width: 0;
    min-height: 0;
    align-content: start;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 0;
    background: var(--bg-card);
}

.ops-stage-tabs {
    position: sticky;
    z-index: 3;
    top: 0;
    display: grid;
    min-width: 0;
    min-height: 64px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    padding: 0 var(--space-4);
}

.ops-stage-tab {
    display: grid;
    min-width: 0;
    min-height: 64px;
    align-content: center;
    gap: 3px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2) var(--space-3);
    text-align: left;
    transition:
        background var(--motion-fast) var(--ease-standard),
        border-color var(--motion-fast) var(--ease-standard),
        color var(--motion-fast) var(--ease-standard);
}

.ops-stage-tab__name {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
}

.ops-stage-tab__name strong {
    color: inherit;
    font-size: 13px;
}

.ops-stage-tab__name small,
.ops-stage-tab__metrics {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-stage-tab.is-warn .ops-stage-tab__name small {
    color: var(--warning);
}

.ops-stage-tab:hover {
    background: var(--primary-hover);
}

.ops-stage-tab.is-active {
    border-bottom-color: var(--primary);
    color: var(--text-primary);
}

/* 阶段有问题（概率未闭合 / RTP 偏离）时 tab 下划线转告警色，切换前就能看到哪个阶段需要处理 */
.ops-stage-tab.is-warn {
    color: var(--warning);
}

.ops-stage-tab.is-active.is-warn {
    border-bottom-color: var(--warning);
    color: var(--warning);
}

.ops-stage-stack {
    display: grid;
    gap: var(--space-3);
    padding: 0 var(--space-4) var(--space-6);
}

.ops-stage-block__head {
    position: sticky;
    z-index: 2;
    top: 64px;
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    padding: var(--space-2) 0;
}

.ops-stage-block__summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-3);
}

.ops-stage-block__head h3 {
    margin: 0;
    font-size: 15px;
}

.ops-stage-thresholds {
    display: grid;
    grid-template-columns: auto repeat(2, minmax(140px, 220px));
    align-items: center;
    gap: var(--space-3);
    justify-content: end;
    padding: var(--space-1) 0;
}

.ops-stage-thresholds > span {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 800;
}

.ops-stage-threshold-rule {
    display: grid;
    grid-column: 2 / -1;
    gap: 2px;
    min-width: 0;
    border-left: 3px solid var(--primary);
    background: var(--bg-card-strong, #f8fafc);
    padding: var(--space-2) var(--space-3);
}

.ops-stage-threshold-rule strong {
    color: var(--text-primary);
    font-size: 13px;
}

.ops-stage-threshold-rule small {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.ops-tier-table {
    display: grid;
    min-width: 0;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--bg-card);
}

.ops-tier-head,
.ops-tier-row {
    display: grid;
    box-sizing: border-box;
    min-width: 590px;
    grid-template-columns:
        minmax(100px, 1fr)
        minmax(124px, 1fr)
        96px
        64px
        56px;
    align-items: center;
    gap: var(--space-2);
}

.ops-tier-head {
    min-height: 34px;
    border-bottom: 1px solid var(--row-border);
    background: var(--bg-card-strong, #f8fafc);
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 900;
    padding: 0 var(--space-3);
}

.ops-tier-head span:nth-child(n + 3) {
    text-align: center;
}

/* 奖档表头允许自然换行，说明图标不会在窄弹窗中挤到相邻列。 */
.ops-tier-head .ops-field-label {
    justify-content: center;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

.ops-tier-row {
    border-bottom: 1px solid var(--row-border);
    padding: 6px var(--space-3);
}

.ops-tier-row:last-child {
    border-bottom: 0;
}

.ops-tier-cell {
    display: flex;
    min-width: 0;
    align-items: center;
}

.ops-tier-cell > .MuiFormControl-root {
    width: 100%;
}

.ops-tier-cell--center {
    justify-content: center;
}

.ops-config-dialog-actions {
    min-height: 60px;
    flex: 0 0 auto;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    padding: var(--space-2) var(--space-6);
}

/* ---- AB 实验 ---- */

/* 创建实验时叠加在配置表单顶部的实验字段区；固定高度不参与下方双栏布局的滚动。 */
.ops-experiment-setup {
    flex: 0 0 auto;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    padding: var(--space-3) var(--space-4);
}

.ops-experiment-setup__head {
    display: grid;
    gap: var(--space-1);
    margin-bottom: var(--space-3);
}

.ops-experiment-setup__head h3 {
    margin: 0;
    font-size: 14px;
}

.ops-experiment-setup__head span {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.ops-experiment-setup__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-experiment-title {
    display: grid;
    gap: var(--space-1);
}

.ops-experiment-title small {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 700;
}

.ops-experiment-content {
    display: grid;
    gap: var(--space-4);
    padding-top: var(--space-4) !important;
}

.ops-experiment-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: var(--space-3);
}

.ops-experiment-arms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.ops-experiment-arm {
    display: grid;
    align-content: start;
    gap: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: var(--space-3) var(--space-4);
}

.ops-experiment-arm--winner {
    border-color: var(--success-border);
    background: var(--success-surface);
}

.ops-experiment-arm__head {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ---- 用户画像：四个统计窗口在单元格内纵向收敛，横向只保留控制链路需要对比的维度 ---- */

.ops-user-profile-search {
    display: flex;
    min-width: 360px;
    align-items: center;
    gap: var(--space-2);
}

.ops-experiment-arm__head strong {
    font-size: 14px;
}

.ops-experiment-arm__head span {
    color: var(--text-tertiary);
    font-size: 12px;
    font-weight: 800;
}

.ops-experiment-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
    margin: 0;
}

.ops-experiment-stats dt {
    color: var(--text-tertiary);
    font-size: 11px;
    font-weight: 800;
}

.ops-experiment-stats dd {
    margin: 0;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
}

.ops-experiment-section h3 {
    margin: 0 0 var(--space-2);
    font-size: 13px;
}

.ops-experiment-controls {
    display: grid;
    gap: var(--space-3);
}

.ops-experiment-inline-form {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.ops-experiment-overrides ul {
    display: grid;
    gap: var(--space-1);
    margin: var(--space-2) 0 var(--space-3);
    padding: 0;
    list-style: none;
}

.ops-experiment-overrides li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    border: 1px solid var(--row-border, var(--border));
    border-radius: var(--radius-control);
    padding: var(--space-1) var(--space-3);
}

.ops-experiment-overrides li code {
    flex: 1 1 auto;
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-user-profile-search .search-box {
    flex: 1;
}

.ops-user-profile-table {
    min-height: 560px;
}

.ops-user-profile-grid {
    --table-row-height: 112px;
}

.ops-user-profile-row {
    transition:
        background var(--motion-fast) var(--ease-standard),
        box-shadow var(--motion-fast) var(--ease-standard);
}

.ops-user-profile-row:hover,
.ops-user-profile-row.is-expanded {
    background: var(--primary-surface);
}

.ops-user-profile-row:focus-visible {
    z-index: 2;
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.ops-profile-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-2);
}

.ops-profile-expand {
    display: inline-flex;
    flex: 0 0 22px;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
}

.ops-profile-internal,
.ops-profile-external {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-2);
}

.ops-profile-internal {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
}

.ops-profile-internal > small {
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 700;
    padding-left: 42px;
}

.ops-profile-external__icon {
    display: inline-flex;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--info-surface);
    color: var(--info);
}

.ops-profile-external > span:last-child {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.ops-profile-external strong,
.ops-profile-external small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-profile-external strong {
    color: var(--text-primary);
    font-size: 13px;
}

.ops-profile-external small {
    color: var(--text-tertiary);
    font-size: 10px;
}

.ops-profile-window {
    display: grid;
    min-width: 0;
    gap: var(--space-1);
}

.ops-profile-window__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
}

.ops-profile-window__head strong {
    color: var(--text-primary);
    font-size: 16px;
    font-variant-numeric: tabular-nums;
}

.ops-profile-window__head small {
    color: var(--text-tertiary);
    font-size: 10px;
    white-space: nowrap;
}

.ops-profile-window dl {
    display: grid;
    gap: 2px;
    margin: 0;
}

.ops-profile-window dl > div {
    display: flex;
    min-width: 0;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-2);
    color: var(--text-secondary);
    font-size: 11px;
}

.ops-profile-window dt,
.ops-profile-window dd {
    margin: 0;
}

.ops-profile-window dd {
    overflow: hidden;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-experiment-overrides li span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.ops-profile-window .is-profit dd {
    color: var(--success);
}

.ops-profile-window .is-loss dd {
    color: var(--danger);
}

.ops-profile-control,
.ops-profile-downweight,
.ops-profile-counts,
.ops-profile-time {
    display: grid;
    min-width: 0;
    align-content: center;
    gap: 3px;
}

.ops-profile-control > div {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-2);
}

.ops-profile-control > div > span:last-child,
.ops-profile-control small,
.ops-profile-downweight small,
.ops-profile-counts small,
.ops-profile-time small {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 10px;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.ops-profile-control strong,
.ops-profile-counts strong,
.ops-profile-time strong {
    color: var(--text-primary);
    font-size: 13px;
}

.ops-profile-control .is-warning {
    color: var(--warning);
    font-weight: 700;
}

.ops-profile-downweight > span,
.ops-profile-counts > span,
.ops-profile-time > span {
    color: var(--text-secondary);
    font-size: 11px;
}

.ops-user-profile-detail-row {
    min-height: 0;
    background: var(--fill-secondary);
}

.ops-user-profile-detail-cell {
    min-width: 0;
    grid-column: 1 / -1;
    padding: 0 var(--space-4) var(--space-4) 44px;
}

.ops-user-profile-detail {
    display: grid;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}

.ops-user-profile-detail__summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(140px, 1fr));
    border-bottom: 1px solid var(--border);
}

.ops-user-profile-detail__summary dl {
    min-width: 0;
    margin: 0;
    border-right: 1px solid var(--border);
    padding: var(--space-3);
}

.ops-user-profile-detail__summary dl:last-child {
    border-right: 0;
}

.ops-user-profile-detail__summary dt {
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 800;
}

.ops-user-profile-detail__summary dd {
    margin: var(--space-1) 0 0;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.45;
}

.ops-user-profile-detail__section {
    display: grid;
    min-width: 0;
    gap: var(--space-3);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) 0;
}

.ops-user-profile-detail__section:last-child {
    border-bottom: 0;
}

.ops-user-profile-detail__section > header {
    display: flex;
    min-width: 0;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 0 var(--space-3);
}

.ops-user-profile-detail__section h3,
.ops-user-profile-detail__section p {
    margin: 0;
}

.ops-user-profile-detail__section h3 {
    color: var(--text-primary);
    font-size: 13px;
}

.ops-user-profile-detail__section p,
.ops-user-profile-detail__section > header > span {
    color: var(--text-tertiary);
    font-size: 10px;
}

.ops-user-profile-detail__section p {
    margin-top: 2px;
}

.ops-profile-multiplier-table {
    display: grid;
    min-width: 820px;
    overflow: hidden;
    border-top: 1px solid var(--row-border);
    border-bottom: 1px solid var(--row-border);
}

.ops-profile-multiplier-row {
    display: grid;
    min-height: 34px;
    align-items: center;
    grid-template-columns: repeat(7, minmax(112px, 1fr));
    border-bottom: 1px solid var(--row-border);
    padding: 0 var(--space-3);
    color: var(--text-secondary);
    font-size: 11px;
}

.ops-profile-multiplier-row:last-child {
    border-bottom: 0;
}

.ops-profile-multiplier-row.is-head {
    background: var(--bg-card-strong);
    color: var(--text-tertiary);
    font-weight: 800;
}

.ops-profile-multiplier-row strong {
    color: var(--text-primary);
}

.ops-profile-jackpot-list {
    display: grid;
}

.ops-profile-jackpot-more {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--row-border);
    padding: var(--space-3);
}

.ops-profile-jackpot-hit {
    display: grid;
    min-width: 0;
    gap: var(--space-3);
    border-top: 1px solid var(--row-border);
    padding: var(--space-3);
}

.ops-profile-jackpot-hit__head,
.ops-profile-jackpot-hit__head > div,
.ops-profile-jackpot-hit footer {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: var(--space-3);
}

.ops-profile-jackpot-hit__head {
    justify-content: space-between;
}

.ops-profile-jackpot-hit__head strong {
    color: var(--text-primary);
    font-size: 15px;
}

.ops-profile-jackpot-hit__head > span,
.ops-profile-jackpot-hit__head div > span,
.ops-profile-jackpot-hit footer {
    color: var(--text-tertiary);
    font-size: 10px;
}

.ops-profile-jackpot-hit__reason {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    align-items: start;
    gap: var(--space-3);
    border-left: 3px solid var(--primary);
    background: var(--primary-surface);
    padding: var(--space-2) var(--space-3);
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.55;
}

.ops-profile-jackpot-hit__reason strong {
    color: var(--primary);
}

.ops-profile-jackpot-conditions {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 1px;
    margin: 0;
    background: var(--border);
}

.ops-profile-jackpot-conditions > div {
    min-width: 0;
    background: var(--bg-card);
    padding: var(--space-2) var(--space-3);
}

.ops-profile-jackpot-conditions dt {
    overflow: hidden;
    color: var(--text-tertiary);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-profile-jackpot-conditions dd {
    overflow: hidden;
    margin: 2px 0 0;
    color: var(--text-primary);
    font-size: 11px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-profile-jackpot-hit footer {
    flex-wrap: wrap;
}

.ops-profile-jackpot-hit__no-conditions,
.ops-user-profile-detail__empty {
    color: var(--text-tertiary);
    font-size: 11px;
    padding: var(--space-3);
}

.ops-user-profile-detail-skeleton {
    display: grid;
    gap: var(--space-3);
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    padding: var(--space-4);
}

.ops-user-profile-detail-skeleton > div {
    display: grid;
    grid-template-columns: repeat(6, minmax(120px, 1fr));
    gap: var(--space-2);
}

.ops-user-profile-detail-error {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    border-top: 1px solid var(--danger-border);
    background: var(--danger-surface);
    color: var(--danger);
    padding: var(--space-3) var(--space-4);
    font-size: 12px;
    font-weight: 700;
}

/* 结束实验的二次确认层：不可回滚的全量发布动作，用 danger 面板与普通操作区分。 */
.ops-experiment-confirm {
    display: grid;
    gap: var(--space-2);
    border: 1px solid var(--danger-border);
    border-radius: var(--radius-card);
    background: var(--danger-surface);
    color: var(--danger);
    padding: var(--space-3) var(--space-4);
}

.ops-experiment-confirm p {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.ops-experiment-confirm div {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-2);
}

/* ---- 响应式 ---- */

@media (max-width: 1279px) {
    .ops-config-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        row-gap: var(--space-2);
    }

    .ops-config-dialog-content {
        overflow-y: auto !important;
    }

    .ops-config-layout {
        height: auto;
        min-height: 100%;
        grid-template-columns: minmax(0, 1fr);
        overflow: visible;
    }

    .ops-config-params {
        min-height: auto;
        grid-template-columns: 112px minmax(0, 1fr);
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .ops-config-section-nav {
        position: sticky;
        top: 0;
        max-height: 100%;
        align-self: start;
    }

    .ops-config-section-list,
    .ops-stage-designer {
        min-height: auto;
        overflow: visible;
    }

    .ops-stage-designer {
        border-top: var(--space-2) solid var(--bg-page);
    }
}

@media (max-width: 960px) {
    .ops-shell {
        grid-template-columns: 1fr;
    }

    .ops-sidebar {
        min-height: auto;
    }

    .ops-nav,
    .ops-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .MuiDialog-paper.ops-config-dialog-paper {
        width: 100vw;
        max-width: none;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }

    .ops-config-title {
        padding: var(--space-3) var(--space-4) var(--space-2);
    }

    .ops-config-summary {
        display: flex;
        gap: 0;
        overflow-x: auto;
        padding: 0 var(--space-4) var(--space-2);
    }

    .ops-config-metric {
        min-width: 124px;
    }

    .ops-config-params {
        grid-template-columns: minmax(0, 1fr);
    }

    .ops-config-section-nav {
        z-index: 4;
        display: flex;
        max-width: 100vw;
        flex-direction: row;
        overflow-x: auto;
        border-right: 0;
        border-bottom: 1px solid var(--border);
        padding: var(--space-2);
    }

    .ops-config-section-nav strong {
        display: none;
    }

    .ops-config-section-nav button {
        min-width: 72px;
        flex: 0 0 auto;
        border-left: 0;
        border-bottom: 2px solid transparent;
        text-align: center;
    }

    .ops-config-section-nav button.is-active {
        border-bottom-color: var(--primary);
    }

    .ops-config-section-list {
        padding: var(--space-2) var(--space-3) var(--space-5);
    }

    .ops-form-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .ops-experiment-setup__grid,
    .ops-experiment-arms {
        grid-template-columns: minmax(0, 1fr);
    }

    .ops-experiment-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ops-jackpot-flow {
        grid-template-columns: minmax(0, 1fr);
    }

    .ops-stage-tabs {
        display: flex;
        max-width: 100vw;
        overflow-x: auto;
        padding: 0 var(--space-2);
    }

    .ops-stage-tab {
        min-width: 180px;
        flex: 1 0 180px;
    }

    .ops-stage-stack {
        padding: 0 var(--space-3) var(--space-5);
    }

    .ops-stage-block__head {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .ops-stage-block__summary {
        align-items: flex-start;
        flex-direction: column;
        gap: var(--space-1);
    }

    .ops-stage-thresholds {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
    }

    .ops-stage-thresholds > span {
        grid-column: 1 / -1;
    }

    .ops-stage-threshold-rule {
        grid-column: 1 / -1;
    }

    /* 小屏保留完整列头并让表格横向滚动，控件同时有阶段+行号标签，避免一列卡片失去字段关系。 */
    .ops-tier-head,
    .ops-tier-row {
        min-width: 600px;
    }

    .ops-config-dialog-actions {
        min-height: 56px;
        padding: var(--space-2) var(--space-4) max(var(--space-2), env(safe-area-inset-bottom));
    }
}

@media (max-width: 640px) {
    .ops-page {
        padding: var(--space-4);
    }

    .ops-nav,
    .ops-kpi-grid,
    .ops-pool-adjustment-metrics {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ops-nav button,
    .ops-config-section-nav button,
    .ops-stage-tab {
        transition: none;
    }

    .ops-config-section-list {
        scroll-behavior: auto;
    }
}
