/*
 * P11-CONFIG-001 会员收费设置。全部收在 .mcfg- 作用域，不影响其他后台页面。
 * Token 沿用 DESIGN.md / styles.css：画布 #f3f5f7、面板白、主文字 #18202a、次文字 #6c7683、主操作 #2f64c8、边线 #dce3ea。
 * 参考 Linear 细边框层级、Stripe 金额等宽右对齐、Cal.com 留白；不引入外部字体或依赖。
 */
.mcfg-root { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; max-width: 1180px; color: var(--ink, #18202a); }
.mcfg-root > * { min-width: 0; }
.mcfg-header h3 { margin: 2px 0 4px; font-size: 22px; font-weight: 650; }
.mcfg-header p { margin: 0; color: var(--muted, #6c7683); font-size: 14px; }
.mcfg-eyebrow { margin: 0; color: var(--muted, #6c7683); font-size: 12px; }
.mcfg-boundary { margin: 0; padding: 10px 14px; border: 1px dashed #c3ccd6; border-radius: 8px; background: #fff; color: var(--muted-strong, #465160); font-size: 13px; }

.mcfg-panel { padding: 20px 22px; border: 1px solid var(--line, #dce3ea); border-radius: 12px; background: var(--panel, #fff); }
.mcfg-panel h4 { margin: 0; font-size: 16px; font-weight: 650; }
.mcfg-head-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; }
.mcfg-sub { margin: 4px 0 0; color: var(--muted, #6c7683); font-size: 13px; }
.mcfg-label { color: var(--muted, #6c7683); font-size: 13px; }
.mcfg-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mcfg-mono { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; font-size: 13px; }
.mcfg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mcfg-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.mcfg-card { display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line-soft, #e8edf2); border-radius: 10px; background: var(--panel-muted, #f7f9fb); }
.mcfg-amount { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mcfg-amount small { margin-left: 2px; color: var(--muted, #6c7683); font-size: 13px; font-weight: 500; }

.mcfg-notice { padding: 10px 14px; border: 1px solid; border-radius: 10px; font-size: 13px; }
.mcfg-panel .mcfg-notice { margin-top: 12px; }
.mcfg-notice.info { border-color: #cbd9f2; background: #eef3fc; color: #23457f; }
.mcfg-notice.ok { border-color: #bfdccb; background: #e9f5ee; color: #1f5a3f; }
.mcfg-notice.bad { border-color: #efc2c0; background: #fbeceb; color: #7c2626; }
.mcfg-notice.warn { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; border-color: #efd3ad; background: #fbf1e3; color: #6f420f; }
.mcfg-notice.warn p { margin: 4px 0 0; }

.mcfg-fields { display: grid; gap: 14px; margin: 16px 0 0; padding: 0; border: 0; min-width: 0; }
.mcfg-price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mcfg-field { display: grid; gap: 6px; font-size: 13px; color: var(--muted-strong, #465160); }
.mcfg-field > span { font-weight: 600; }
.mcfg-field small { color: var(--muted, #6c7683); font-size: 12px; }
.mcfg-field input[type="text"], .mcfg-field input[type="datetime-local"], .mcfg-field textarea, .mcfg-cancel input {
  min-height: 38px; padding: 8px 10px; border: 1px solid var(--line, #dce3ea); border-radius: 8px; background: #fff;
  color: var(--ink, #18202a); font: inherit; font-size: 14px;
}
.mcfg-field input[type="text"] { font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; }
.mcfg-field textarea { resize: vertical; }
.mcfg-field input:focus-visible, .mcfg-field textarea:focus-visible, .mcfg-cancel input:focus-visible { outline: none; border-color: var(--blue, #2f64c8); box-shadow: var(--focus, 0 0 0 3px rgba(47, 100, 200, 0.2)); }
.mcfg-fields:disabled { opacity: 0.6; }
.mcfg-radios { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; color: var(--ink, #18202a); font-weight: 400; }
.mcfg-radios label { display: inline-flex; align-items: center; gap: 6px; }
.mcfg-radios input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--blue, #2f64c8); }
.mcfg-radios input[type="datetime-local"] { width: auto; }
.mcfg-error { margin: 10px 0 0; color: var(--red, #b43d3d); font-size: 13px; }

.mcfg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.mcfg-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 16px; border: 1px solid var(--line, #dce3ea); border-radius: 8px; background: #fff; color: var(--ink, #18202a); font: inherit; font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.mcfg-btn:hover { border-color: #c6d0da; background: var(--panel-muted, #f7f9fb); }
.mcfg-btn.primary { border-color: var(--blue, #2f64c8); background: var(--blue, #2f64c8); color: #fff; font-weight: 600; }
.mcfg-btn.primary:hover { background: #244f9f; }
.mcfg-btn.danger { border-color: #e2b4b2; color: var(--red, #b43d3d); }
.mcfg-btn:disabled { cursor: not-allowed; border-color: var(--line, #dce3ea); background: #e9edf2; color: #8f99a5; }
.mcfg-btn:focus-visible, .mcfg-link:focus-visible { outline: none; box-shadow: var(--focus, 0 0 0 3px rgba(47, 100, 200, 0.2)); }
.mcfg-link { padding: 2px 0; border: 0; background: none; color: var(--blue, #2f64c8); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.mcfg-link:hover { text-decoration: underline; }

.mcfg-preview { margin-top: 18px; padding: 16px 18px; border: 1px solid #cbd9f2; border-radius: 10px; background: #f8fbff; }
.mcfg-preview.stale { border-color: var(--line, #dce3ea); background: var(--panel-muted, #f7f9fb); }
.mcfg-preview.stale table, .mcfg-preview.stale .mcfg-facts { opacity: 0.55; }
.mcfg-preview header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.mcfg-tag { padding: 2px 8px; border: 1px dashed #9aa7b5; border-radius: 999px; color: var(--muted-strong, #465160); font-size: 12px; }
.mcfg-stale-hint { margin: 10px 0 0; color: var(--amber, #a96318); font-size: 13px; font-weight: 600; }
.mcfg-facts { display: grid; gap: 6px; margin: 12px 0 0; font-size: 13px; }
.mcfg-facts div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
.mcfg-facts dt { color: var(--muted, #6c7683); }
.mcfg-facts dd { margin: 0; overflow-wrap: anywhere; }

.mcfg-table-wrap { margin-top: 12px; overflow-x: auto; }
.mcfg-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 13px; } /* 覆盖全局 table min-width:760px */
.mcfg-table-wrap > .mcfg-history { min-width: 760px; }
.mcfg-table th { padding: 9px 12px; background: var(--panel-muted, #f7f9fb); color: var(--muted-strong, #465160); font-weight: 600; text-align: left; border-bottom: 1px solid var(--line-soft, #e8edf2); white-space: nowrap; }
.mcfg-table td { padding: 10px 12px; border-bottom: 1px solid var(--line-soft, #e8edf2); vertical-align: top; }
.mcfg-table tbody tr:last-child td { border-bottom: 0; }
.mcfg-table tr.current td { background: #fbfdff; }
.mcfg-table td small { color: var(--muted, #6c7683); }
.mcfg-table td.up { color: var(--amber, #a96318); }
.mcfg-table td.down { color: var(--green, #2f7a57); }
.mcfg-reason { max-width: 260px; overflow-wrap: anywhere; }
.mcfg-table td.mcfg-mono, .mcfg-table .mcfg-link { white-space: nowrap; }
.mcfg-status { display: inline-flex; height: 22px; align-items: center; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; background: #eef1f4; color: var(--muted, #6c7683); }
.mcfg-status.effective { background: #e9f5ee; color: var(--green, #2f7a57); }
.mcfg-status.scheduled { background: #eef3fc; color: var(--blue, #2f64c8); }
.mcfg-status.cancelled { background: #fbeceb; color: var(--red, #b43d3d); }
.mcfg-cancel { display: grid; gap: 6px; min-width: 180px; }

.mcfg-state { display: grid; justify-items: start; gap: 8px; }
.mcfg-state strong { font-size: 16px; }
.mcfg-state span { color: var(--muted, #6c7683); }

@media (max-width: 1200px) {
  .mcfg-panel { padding: 18px; }
  .mcfg-amount { font-size: 22px; }
}
.mcfg-preview .mcfg-table { table-layout: fixed; }
.mcfg-preview .mcfg-table th, .mcfg-preview .mcfg-table td { padding-left: 8px; padding-right: 8px; }

/* 分区页签 */
.mcfg-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--line, #dce3ea); }
.mcfg-tab { position: relative; padding: 0 2px 10px; border: 0; background: none; color: var(--muted-strong, #465160); font: inherit; font-size: 15px; cursor: pointer; }
.mcfg-tab[aria-selected="true"] { color: var(--blue, #2f64c8); font-weight: 600; }
.mcfg-tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue, #2f64c8); }
.mcfg-tab:focus-visible { outline: none; box-shadow: var(--focus, 0 0 0 3px rgba(47, 100, 200, 0.2)); }
.mcfg-block { display: block; }

/* 账号搜索与选择 */
.mcfg-search { display: flex; gap: 10px; margin-top: 12px; max-width: 560px; }
.mcfg-search input { flex: 1; min-width: 0; min-height: 38px; padding: 8px 10px; border: 1px solid var(--line, #dce3ea); border-radius: 8px; font: inherit; font-size: 14px; }
.mcfg-search input:focus-visible { outline: none; border-color: var(--blue, #2f64c8); box-shadow: var(--focus, 0 0 0 3px rgba(47, 100, 200, 0.2)); }
.mcfg-accounts { display: grid; gap: 0; margin: 12px 0 0; padding: 0; list-style: none; border: 1px solid var(--line-soft, #e8edf2); border-radius: 10px; }
.mcfg-accounts li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line-soft, #e8edf2); }
.mcfg-accounts li:last-child { border-bottom: 0; }
.mcfg-accounts li > span { min-width: 0; overflow-wrap: anywhere; }
.mcfg-account { margin: 10px 0 0; font-size: 15px; overflow-wrap: anywhere; }

/* 优惠表单 */
.mcfg-offer-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.mcfg-field select, .mcfg-field input[type="date"] { min-height: 38px; padding: 8px 10px; border: 1px solid var(--line, #dce3ea); border-radius: 8px; background: #fff; color: var(--ink, #18202a); font: inherit; font-size: 14px; }
.mcfg-field select:focus-visible, .mcfg-field input[type="date"]:focus-visible { outline: none; border-color: var(--blue, #2f64c8); box-shadow: var(--focus, 0 0 0 3px rgba(47, 100, 200, 0.2)); }
.mcfg-field select { max-width: 420px; }
.mcfg-date input { max-width: 220px; }
.mcfg-field input:disabled { background: #f1f4f7; color: #8f99a5; }
.mcfg-h5 { margin: 14px 0 0; font-size: 13px; font-weight: 600; color: var(--muted-strong, #465160); }
.mcfg-preview .mcfg-notice { margin-top: 12px; }
.mcfg-phases { min-width: 220px; font-variant-numeric: tabular-nums; }
.mcfg-status.offer-scheduled { background: #eef3fc; color: var(--blue, #2f64c8); }
.mcfg-status.offer-in_period { background: #fbf1e3; color: var(--amber, #a96318); }
.mcfg-status.offer-expired { background: #eef1f4; color: var(--muted, #6c7683); }
.mcfg-status.offer-cancelled { background: #fbeceb; color: var(--red, #b43d3d); }

/* P11-INIT-001：活动方案阶段编辑、勾选确认、上线准备 */
.mcfg-phases-edit { display: grid; gap: 8px; }
.mcfg-phase { display: grid; grid-template-columns: 64px 104px minmax(0, 140px) minmax(0, 150px) auto; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line-soft, #e8edf2); border-radius: 8px; background: var(--panel-muted, #f7f9fb); }
.mcfg-phase-no { color: var(--muted-strong, #465160); font-size: 13px; font-weight: 600; }
.mcfg-phase select, .mcfg-phase input { min-height: 36px; padding: 6px 8px; border: 1px solid var(--line, #dce3ea); border-radius: 8px; background: #fff; color: var(--ink, #18202a); font: inherit; font-size: 14px; }
.mcfg-phase select:focus-visible, .mcfg-phase input:focus-visible { outline: none; border-color: var(--blue, #2f64c8); box-shadow: var(--focus, 0 0 0 3px rgba(47, 100, 200, 0.2)); }
.mcfg-phase input:disabled { background: #f1f4f7; color: #8f99a5; }
.mcfg-inline { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted-strong, #465160); }
.mcfg-inline input { width: 100%; min-width: 0; font-variant-numeric: tabular-nums; }
.mcfg-phase-tools { display: flex; gap: 10px; justify-content: flex-end; }
.mcfg-link:disabled { color: #a3adb8; cursor: not-allowed; text-decoration: none; }
.mcfg-check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--ink, #18202a); line-height: 1.5; }
.mcfg-check input { width: 16px; height: 16px; margin: 3px 0 0; flex: 0 0 16px; accent-color: var(--blue, #2f64c8); }
.mcfg-plan-form { margin-top: 16px; border-style: dashed; }
.mcfg-plan-history { margin-top: 12px; }
.mcfg-root [data-mcfg-plan] + [data-mcfg-plan] { margin-top: 0; }
@media (max-width: 1200px) {
  .mcfg-phase { grid-template-columns: 56px 92px minmax(0, 1fr) minmax(0, 1fr); }
  .mcfg-phase-tools { grid-column: 1 / -1; justify-content: flex-start; }
}
.mcfg-notice.mcfg-block { display: block; }
.mcfg-inline span { white-space: nowrap; }
.mcfg-tech { margin-top: 10px; font-size: 12px; color: var(--muted, #6c7683); }
.mcfg-tech summary { cursor: pointer; color: var(--muted-strong, #465160); }
.mcfg-tech p { margin: 6px 0 0; }

/* P11-DISTRIBUTE-001：优惠发放（固定名单批次） */
.mcfg-subtabs { display: inline-flex; gap: 4px; padding: 3px; border: 1px solid var(--line, #dce3ea); border-radius: 10px; background: var(--panel-muted, #f7f9fb); justify-self: start; }
.mcfg-subtab { min-height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: none; color: var(--muted-strong, #465160); font: inherit; font-size: 13px; cursor: pointer; }
.mcfg-subtab[aria-pressed="true"] { background: #fff; color: var(--blue, #2f64c8); font-weight: 600; box-shadow: 0 1px 2px rgba(18, 30, 42, 0.08); }
.mcfg-subtab:focus-visible { outline: none; box-shadow: var(--focus, 0 0 0 3px rgba(47, 100, 200, 0.2)); }
.mcfg-step { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; padding-top: 14px; border-top: 1px solid var(--line-soft, #e8edf2); }
.mcfg-step:first-child { padding-top: 0; border-top: 0; }
.mcfg-step-no { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #eef3fc; color: var(--blue, #2f64c8); font-size: 13px; font-weight: 700; }
.mcfg-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; }
.mcfg-filter input[type="search"], .mcfg-filter input[type="date"] { min-height: 38px; padding: 6px 10px; border: 1px solid var(--line, #dce3ea); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; }
.mcfg-filter input[type="search"] { flex: 1 1 220px; min-width: 0; }
.mcfg-filter input:focus-visible { outline: none; border-color: var(--blue, #2f64c8); box-shadow: var(--focus, 0 0 0 3px rgba(47, 100, 200, 0.2)); }
.mcfg-wizard td input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--blue, #2f64c8); }
.mcfg-counts { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.mcfg-count { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-soft, #e8edf2); border-radius: 10px; background: var(--panel-muted, #f7f9fb); }
.mcfg-count span { color: var(--muted, #6c7683); font-size: 12px; }
.mcfg-count strong { font-size: 20px; font-weight: 700; text-align: left; }
.mcfg-count.succeeded strong { color: var(--green, #2f7a57); }
.mcfg-count.failed strong, .mcfg-count.excluded strong { color: var(--red, #b43d3d); }
.mcfg-click { cursor: pointer; }
.mcfg-click:hover td { background: #f9fbfd; }
.mcfg-click:focus-visible { outline: 2px solid var(--blue, #2f64c8); outline-offset: -2px; }
.mcfg-actions .mcfg-sub { align-self: center; margin: 0; }
@media (max-width: 1200px) {
  .mcfg-counts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.mcfg-warn-text { color: var(--amber, #a96318); font-weight: 600; }

/* P11-MEMBERSHIP-UI-R1：长编号完整显示并在列内换行；核查说明 */
.mcfg-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.45; word-break: break-all; }
.mcfg-table td > .mcfg-id:only-child { display: inline-block; width: 19ch; }
.mcfg-reason { min-width: 150px; }
.mcfg-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted, #6c7683); }
.mcfg-method { min-width: 140px; }

/* P11-SCALE-SNAPSHOT：月末有效付费人数（沿用 mcfg 统计格、表格与提示条） */
.mcfg-scale-counts { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mcfg-count.included strong { color: var(--green, #2f7a57); }
.mcfg-count.review strong { color: var(--amber, #a96318); }
.mcfg-scale-result { margin: 14px 0 0; font-size: 15px; }
.mcfg-scale-result strong { font-size: 22px; font-variant-numeric: tabular-nums; margin: 0 2px; }
.mcfg-scale-reasons { margin-top: 6px; }
.mcfg-scale-dec { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; white-space: nowrap; background: #eef1f4; color: #465160; }
.mcfg-scale-dec.ok { background: #e9f5ee; color: #1f5a3f; }
.mcfg-scale-dec.warn { background: #fbf1e3; color: #6f420f; }
[data-mcfg-scale-preview] .mcfg-notice { display: block; margin-top: 12px; }
[data-mcfg-scale-preview] .mcfg-notice ul { margin: 6px 0 0; padding-left: 18px; }
[data-mcfg-scale-blockers] { color: var(--amber, #a96318); }
@media (max-width: 1180px) { .mcfg-scale-counts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mcfg-scale-counts .mcfg-count.excluded strong, .mcfg-scale-counts .mcfg-count.duplicates strong { color: inherit; } /* 排除/去重是正常统计结果，不用错误色 */
[data-mcfg-scale-preview] .mcfg-field { display: grid; gap: 6px; margin-top: 16px; } /* 标签在上、文本框占整行 */
[data-mcfg-scale-preview] .mcfg-field textarea { width: 100%; box-sizing: border-box; min-height: 72px; }
[data-mcfg-scale-blockers][hidden] { display: none; }
