/* Tipsy AB-Config Console — minimal, dependency-free styling. */

:root {
  --fg: #1f2937;
  --muted: #6b7280;
  --bg: #ffffff;
  --card: #ffffff;
  --border: #e5e7eb;
  --primary: #2563eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Geometry mirrors the React ConsoleChrome header (minHeight 68px, px 24px,
   toolbar gap 16px, nav item px 12px / py 6px, gap 4px) so the pre-mount
   fallback paint does not visibly re-flow when React replaces it. Colors
   mirror the light antd-style header: white surface, #f0f0f0 bottom border. */
.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 0 24px;
  background: #ffffff;
  color: rgba(0,0,0,.88);
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 14px;
  color: inherit;
  text-decoration: none;
}

.brand::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #1677ff; flex-shrink: 0; }

.nav-main { display: flex; gap: 4px; flex: 1; }

.nav-item {
  text-decoration: none;
  color: rgba(0,0,0,.65);
  font-weight: 500;
  /* Nav pills: fixed 6-character width (Chinese "灰度白名单" = 6 chars is the
     widest label; English long labels extend past it rather than clipping),
     centered text, smaller than the page title. */
  font-size: 14px;
  min-width: 6em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  /* Match the React chrome's antd default borderRadius (6px) so the server
     fallback pill does not flash a different shape before React replaces it
     on tab navigation. */
  border-radius: 6px;
}

.nav-item:hover { background: rgba(0,0,0,.04); color: rgba(0,0,0,.88); }

.nav-item.is-active { background: #e6f4ff; color: #1677ff; font-weight: 600; }

.user-box { display: flex; gap: 12px; align-items: center; }

/* Fallback user-box controls (pre-mount paint): mirror the React chrome's
   LanguageToggle (two-segment pill), #user-sub chip slot, and logout button so
   the no-JS / pre-mount paint has the same silhouette as the mounted chrome —
   no shape or color jump on MPA navigation. The user id is unknown
   server-side, so #user-sub is a transparent width placeholder; the lang
   segment highlight is set by the translate script from localStorage. */
.lang-toggle-skeleton {
  display: flex;
  height: 38px;
  width: 112px;
  flex-shrink: 0;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  overflow: hidden;
}
.lang-seg {
  flex: 1 1 50%;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: rgba(0,0,0,.88);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  padding: 0 10px;
  white-space: nowrap;
  cursor: pointer;
}
.lang-seg.is-on { color: #fff; background: #1677ff; }
.lang-seg.is-on:hover { background: #4096ff; }

.user-sub {
  /* Reserve the width of a 19-digit uid (matches the React Chip's min/max) so
     the user box does not reflow — but keep it an invisible slot (transparent
     color, no pill background) so it never flashes as a stray "—" or pill
     before React replaces it with the real id chip. */
  display: inline-block;
  min-width: 144px;
  max-width: 180px;
  height: 24px;
  color: transparent;
  overflow: hidden;
  white-space: nowrap;
}

.logout-skeleton {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  color: rgba(0,0,0,.65);
  font: inherit;
  font-size: 0.9rem;
  padding: 4px 8px;
  cursor: pointer;
}
.logout-skeleton:hover { color: rgba(0,0,0,.88); }

/* Fallback nav pill (server-rendered) keeps the exact radius of the React
   chrome's antd button — see the radius comment next to .nav-item above. */


.language-toggle { font-weight: 600; min-width: 3.5em; }

/* Full-bleed content: only the 24px side padding separates the page from the
   viewport edges (no centered max-width column). */
.content { padding: 32px 24px 48px; }

.react-page-active .content { padding-top: 32px; }

.react-page-root { min-height: 420px; }

/* Modal 一级内容区块间距统一 32px；不要命中表单内部的嵌套 Flex，组件
   自己声明的 12/16px 字段间距必须保留。 */
.ant-modal-container .ant-modal-body > .ant-flex-vertical { gap: 32px !important; }

/* 所有 Modal 的标题与内容保持清晰分区，避免首个表单项紧贴标题。 */
.ant-modal-container .ant-modal-header { margin-bottom: 32px; }

/* 所有 Modal 弹窗（用户约定 2026-08-23）：垂直居中；整个 Dialog 限高
   80vh（上下各留约 10%）；内容过高时 body 出纵向滚动条。 */
/* 中心化走 ConfigProvider modal.centered（main.jsx）；此处只做限高 +
   内部纵向滚动——上下各留约 10%，过高时弹窗 body 出滚动条。 */
.ant-modal-container {
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ant-modal-container .ant-modal-header,
.ant-modal-container .ant-modal-footer {
  flex: 0 0 auto;
}

.ant-modal-container .ant-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  /* AntD leaves 24px at the container edge. Extend the body (and with it the
     scrollbar) 16px into that gutter so the scrollbar sits 8px from the Dialog
     edge (pinned by list-search-layout.spec.js). Content fills the body box
     all the way to its right edge (pinned by dialog-consistency.spec.js), so
     no compensating padding-right/scrollbar-gutter here: reserving them would
     shrink every dialog form by a phantom 31px even when nothing scrolls.
     When content does overflow, the docking scrollbar takes 15px from the
     content box and the content right edge lands back near the original 24px
     alignment. */
  margin-right: -16px;
}

/* Dialog sections use dividers for hierarchy instead of nested outlined cards.
   Keep this scoped to modal content so standalone pages can still use cards as
   visual containers where that context is useful. */
.ant-modal-container .ant-modal-body .ant-card {
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}
.ant-modal-container .ant-modal-body .ant-card + .ant-card {
  border-top: 1px solid #f0f0f0 !important;
  padding-top: 24px;
}

/* A few legacy detail previews still carry an inline outline.  They are
   sections inside a Dialog, so treat them the same as the borderless cards. */
.ant-modal-container .ant-modal-body #domain-parent-preview {
  border: 0 !important;
  border-radius: 0 !important;
  padding-inline: 0 !important;
}

/* Keep the section rhythm visible after removing card outlines. */
.ant-modal-container .ant-modal-body .dialog-section-divider {
  margin: 0;
}

/* Detail metadata uses the same horizontal KV rhythm as Dialog forms instead
   of a paragraph of bold labels followed by values. */
.info-fields-card .ant-card-body { padding: 0 0 0 28px; }
.info-field-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
}
.info-field-label {
  text-align: left;
  white-space: nowrap;
}
.info-field-value {
  min-width: 0;
  overflow-wrap: anywhere;
}
.ant-modal-container .ant-modal-body .table-slot-card .ant-card-body {
  padding: 0;
}

/* Dialog 表单统一左右 KV：标签列固定，控件列吃满剩余宽度。复杂表格/分组
   编辑器仍保留自身行结构，只给明确标记的字段行套用。
   实验独立页（/experiments/new、/experiments/:id，F3 后不再是列表弹窗）沿用
   同一套 KV 排版（D35）：页面根带 .exp-standalone-page（ExperimentNewPage /
   ExperimentDetailPage），故这里与 .ant-modal-body 并列。只加这一个页面作用域，
   不放开成全局 .dialog-form-row——其它独立页（/configs/new、combo 页等）依赖
   该类在页面上是普通块级（ComboCreateForm 的 inline-flex 列等）。 */
.ant-modal-body .dialog-form-row,
.exp-standalone-page .dialog-form-row {
  display: grid !important;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: start !important;
  gap: 16px !important;
  width: 100%;
}
.ant-modal-body .dialog-form-label,
.exp-standalone-page .dialog-form-label {
  padding-top: 8px;
  text-align: right;
}
.ant-modal-body .dialog-form-control,
.exp-standalone-page .dialog-form-control { min-width: 0; }

/* 管理员创建弹层字段较少：使用紧凑标签列，控件向右吃满 Dialog 内容区。 */
#admin-create-form .dialog-form-row {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 16px !important;
}
#admin-create-form .dialog-form-label {
  align-self: center;
  padding-top: 0;
  justify-self: end;
  white-space: nowrap;
}
#admin-create-form .dialog-form-control { grid-column: 2; }
#admin-create-form .admin-create-input {
  width: 100%;
  height: 32px;
  box-sizing: border-box;
}

/* 白名单创建表单使用短标签，避免继承 120px 标签列后整体右移；同时恢复
   组件声明的表单行/键列表间距，避免 Modal 的 32px 区块间距误伤嵌套 Flex。 */
#wl-create-form > .ant-flex-vertical { gap: 16px !important; }
#wl-create-form .dialog-form-row {
  grid-template-columns: 40px minmax(0, 1fr);
}
#wl-create-form .dialog-form-label {
  justify-self: end;
  white-space: nowrap;
}
#wl-create-form .dialog-form-control.ant-flex-vertical { gap: 12px !important; }

/* 实验创建表单（F3 起在独立页 /experiments/new，KV 排版沿用原 Dialog，D35）：
   表单居中，使用能容纳中英文标签的紧凑 KV 列；字段间距走组件声明的 16px，
   不被 Modal 一级区块间距放大。 */
#exp-create-form {
  width: 100%;
  margin-inline: auto;
}
#exp-create-form > .ant-flex-vertical { gap: 16px !important; }
#exp-create-form > .ant-flex-vertical > .dialog-form-row {
  grid-template-columns: 48px minmax(0, 1fr);
}
#exp-create-form > .ant-flex-vertical > .dialog-form-row > .dialog-form-label {
  justify-self: end;
  white-space: nowrap;
}
#exp-create-form .experiment-section-row > .dialog-form-label { padding-top: 8px; }

/* 资源创建弹层不再套一层窄的内部 max-width；标签列按各表单实际文案
   收紧，让控件区在弹层左右获得对称、紧凑的留白。 */
#namespace-create-form,
#config-create-form,
#domain-create-form,
#layer-create-form {
  width: 100%;
  margin-inline: auto;
}

#namespace-create-form .dialog-form-row,
#layer-create-form .dialog-form-row {
  grid-template-columns: 56px minmax(0, 1fr);
}

#domain-create-form .dialog-form-row {
  grid-template-columns: 72px minmax(0, 1fr);
  padding-right: 16px;
}

#namespace-create-form .dialog-form-label,
#domain-create-form .dialog-form-label,
#layer-create-form .dialog-form-label {
  justify-self: end;
  white-space: nowrap;
}
#domain-create-form .dialog-form-control { grid-column: 2; }

/* ConfigCreateForm 为兼容独立 /configs/new 页面仍保留 120px inline 标签列；
   仅在 Modal 内覆盖为紧凑列，并统一使用 antd secondary 文本色。 */
.ant-modal-body #config-create-form .config-form-label { width: 56px !important; }
.ant-modal-body #config-create-form .config-form-control { min-width: 0; }

#domain-create-form > .ant-flex-vertical,
#layer-create-form > .ant-flex-vertical,
#namespace-create-form > .ant-flex-vertical { gap: 16px !important; }

#domain-create-form #parent-form-select .ant-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding-top: 6px;
}

#domain-create-form .domain-slot-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Combo 流量占比的重复项统一成逐行 KV。避免字段标题浮在输入框上方，
   并让重复项、新增按钮和 simple 余量使用同一套 antd 尺寸。 */
.combo-share-groups {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.combo-create-section { padding: 24px 40px 24px 24px; }
.combo-create-section + .combo-create-section { border-top: 1px solid #f0f0f0; }
.combo-modal-form .dialog-form-row { grid-template-columns: 88px minmax(0, 1fr); }
.combo-share-item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 0 24px;
  background: transparent;
}
.combo-share-item + .combo-share-item {
  padding-top: 24px;
  border-top: 1px solid #f0f0f0;
}
.combo-share-item-header { min-height: 32px; }
.combo-share-item .combo-share-field,
.combo-simple-pct {
  display: grid !important;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: center !important;
  gap: 16px !important;
  width: 100%;
}
.combo-share-item .combo-share-field .dialog-form-label,
.combo-simple-pct .dialog-form-label {
  justify-self: end;
  padding-top: 0;
  white-space: nowrap;
}
.combo-share-item .combo-share-field .dialog-form-control,
.combo-simple-pct .dialog-form-control { min-width: 0; }
.combo-share-add-actions { padding-left: 104px; }
.combo-simple-pct .ant-flex > .ant-input { flex: 1; }

.react-page-root { min-width: 0; }

/* 列表页固定视口布局（模板约定 2026-08-23）：带 .console-list-page 的列表
   页里 body/整个页面不滚，表格内容在 .console-table-host 内部滚动，分页器
   （ListTable 内 sticky bottom）始终钉在页面底部可见。非列表页（详情/表单）
   不受影响：仍旧整页滚动。 */
body:has(.console-list-page) {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
/* React 挂载点 #root 是 body 的直接子级，必须进 flex 链，否则 .content 的
   flex:1 无从继承（实测表格区只撑到内容高度、页面底部留白）。 */
#console-root:has(.console-list-page) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
body:has(.console-list-page) .content { padding-bottom: 24px; }
.content:has(.console-list-page) {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
#console-page-root:has(.console-list-page) {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}
.react-page-root.console-list-page {
  flex: 1;
  min-height: 0;
  /* 区块间距（用户约定 2026-08-23）：头部行/表格/分页之间的留白加大，
     antd Flex 的 gap 以 inline style 注入，此处用 !important 强制。 */
  gap: 32px !important;
}
.react-page-root.console-list-page > * { flex-shrink: 0; }
.react-page-root.console-list-page > .console-table-host {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.react-page-root.console-list-page .console-list-table {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.react-page-root.console-list-page .console-list-table-scroll {
  flex: 1;
  min-height: 0;
}
/* 边框已移到表格滚动区（ListTable 内），外层 host 不再画边框，
   分页器就不会贴着带边框盒子的底边。 */
.console-list-page .console-table-host { border: none !important; }

@media (max-width: 900px) {
  .content { padding: 24px 16px 36px; }
  .topbar { min-height: 60px; padding: 0 16px; }
  .nav-main { overflow-x: auto; padding-bottom: 2px; }
  .nav-item { white-space: nowrap; }
  .user-box { gap: 8px; }
}

@media (max-width: 640px) {
  .content { padding: 20px 12px 28px; }
  .user-sub { max-width: 132px; overflow: hidden; text-overflow: ellipsis; }
}

.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  padding: 6px 12px;
  border-radius: 9px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.95em;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

.btn:hover { background: #f3f4f6; transform: translateY(-1px); }

.btn-link { border: none; background: transparent; color: var(--primary); padding: 4px 8px; }

.btn-link:hover { text-decoration: underline; background: transparent; }

/* List identifiers remain clickable, but read as links rather than boxed
   controls. The detail action remains a regular button in the Actions column. */
.resource-id-link.ant-btn {
  height: auto;
  padding: 0;
  font-weight: 500;
}

.group-row.ant-card {
  margin-bottom: 0;
  padding: 0;
  border-color: var(--border);
  background: #fafafa;
}
.group-row.ant-card .ant-card-body { padding: 20px; }
.g-no-preview { display: block; font-size: 16px; }
#groups-container .group-kv-row {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
#groups-container .group-kv-label {
  padding-top: 5px;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}
#groups-container .group-kv-control { min-width: 0; }
#groups-container .group-id-control .ant-input { flex: 1 1 auto; min-width: 0; }

code { background: #f3f4f6; padding: 1px 6px; border-radius: 3px; font-family: ui-monospace, monospace; font-size: 0.9em; }

/* config_version key/version selector rows in the experiment group editor:
   each key + version antd Select plus its Remove button sit on ONE line
   (create page and detail edit mode render identically). Scoped strictly to
   .kv-* so other pages' selects are untouched. */

.kv-selector { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }

#groups-container .kv-row {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 12px !important;
  align-items: center;
}

.kv-row .ant-select { flex: 1 1 auto; min-width: 0; }
#groups-container .kv-row .kv-version { width: 100%; }
#groups-container .kv-row-actions {
  min-width: 168px;
  white-space: nowrap;
}
#groups-container .kv-selector > .kv-add { align-self: flex-end; }

/* One key-select + version-select + remove button per row (like .kv-row). */

.wl-key-row { display: flex; gap: 8px; align-items: center; }

/* key/version 选择器全部定宽（用户约定 2026-08-23：点「添加」后下拉宽度
   必须稳定——包括首次加行时 Remove 按钮出现引起的重排）。 */
.wl-key-row .ant-select { min-width: 0; }
.wl-key-row .wl-version { flex: 0 0 220px; }

/* Stacked (key → version) lines inside the list table's Keys cell. */

.wl-key-line { white-space: nowrap; line-height: 1.6; }

/* The newly created whitelist row the locate flow scrolled to (F10); the class
   is removed again after 3 s. Painted on the cells: antd colours the <td>s. */

#wl-table tr.wl-row-highlight > td { background: #fff7e6 !important; transition: background 0.3s; }

/* Version status-label badges (configs detail page). kind from
   /api/v1/configs/key-status drives the class: full/whitelist/ab/ab-paused/
   ab-draft. (The blue "published" fall-through badge was removed 2026-08-26 —
   it carried no signal and misread as "live".) */
.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.85em;
  background: #e5e7eb;
  color: var(--fg);
}
.status-full { background: #dcfce7; color: #166534; }
.status-whitelist { background: #ffedd5; color: #9a3412; }
.status-ab { background: #ede9fe; color: #5b21b6; }
.status-ab-paused { background: #fef9c3; color: #854d0e; }
.status-ab-draft { background: #e5e7eb; color: #4b5563; }

/* Per-version value cell in the Versions table: monospace, capped width,
   wrap long/multi-line values without blowing out the table layout. The
   wrapper stacks the value over the copy action; the <pre> fills the column
   width (min 120px) so short values like "true" render on one line instead
   of collapsing to one char per line when the column is narrow. */
.value-cell-wrap {
  max-width: 320px;
}
.value-cell {
  margin: 0;
  width: 100%;
  min-width: 120px;
  max-width: 320px;
  max-height: 6em;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
}

/* Compact inline row (experiments/new #slot-range, G5): controls sit on one
   row at content width; wraps on narrow viewports. */
.form.form-inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

/* Metric definition modal (MetricDefinitionModal, report page ⓘ). */
.defmodal-body { padding-top: 2px; }
.defmodal-row {
  display: grid; grid-template-columns: 76px 1fr; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #eef0f2;
  font-size: 13px; line-height: 1.7;
}
.defmodal-row:last-child { border-bottom: none; }
.defmodal-row__label { color: #8a8a93; font-weight: 600; }
.defmodal-row__value { color: #374151; word-break: break-word; overflow-wrap: anywhere; }

/* Empty-state note under a report trend chart (ReportChart). */
.axis-note { font-size: 11px; color: #9ca3af; margin-top: 8px; }

.namespace-detail-modal .dialog-form-row {
  grid-template-columns: 56px minmax(0, 1fr);
}
.namespace-detail-modal .dialog-form-label {
  justify-self: end;
  white-space: nowrap;
}
.namespace-detail-modal .desc-input {
  flex: 1;
  min-width: 0;
}

/* 全项目 textarea 固定尺寸: 禁止拖拽缩放; 高度由 rows 决定; 文案超出走内部滚动条. */
textarea,
textarea.ant-input {
  resize: none;
  overflow-y: auto;
}

/* Experiment report: scoped to the independent report page. */
.experiment-report {
  padding: 28px 32px 48px;
  color: #243746;
  max-width: 2400px;
  margin: 0 auto;
}
.experiment-report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.experiment-report-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #718595;
  font-weight: 600;
}
.experiment-report-header h1 {
  margin: 6px 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}
.experiment-report-header p {
  margin: 0;
  color: #718595;
}
.experiment-report-filters {
  padding: 22px;
  background: #f7fafb;
  border: 1px solid #e0e8ed;
  border-radius: 12px;
  margin: 20px 0;
}
.experiment-report-filters label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #657b8b;
  font-size: 12px;
  font-weight: 600;
  min-width: 0;
}
.experiment-report-filters .ant-select,
.experiment-report-filters .ant-picker {
  width: 100%;
  font-weight: 400;
}
.experiment-report-group-pickers {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.experiment-report-group-pickers .ant-select {
  min-height: 42px;
}
.experiment-report-group-pickers .experiment-report-warning {
  grid-column: 1 / -1;
  margin: 0;
}
.experiment-report-select-groups {
  margin: 32px 0;
}
.experiment-report-cap-info {
  color: #8c8c8c;
  cursor: help;
  margin: 0 2px;
}
.experiment-report-cap-head {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #657b8b;
  font-size: 12px;
}
.experiment-report-cap-tip > div + div {
  margin-top: 4px;
}
.experiment-report-filter-grid {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
}
.experiment-report-filter-grid label {
  min-width: 160px;
  flex: 1;
}
.experiment-report-filter-grid .experiment-report-date-picker {
  min-width: 280px;
  flex: 2;
}
.experiment-report-metric-pickers {
  display: flex;
  align-items: end;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #e0e8ed;
}
.experiment-report-metric-pickers .experiment-report-metric-picker {
  flex: 1;
}
.experiment-report-metric-pickers .experiment-report-category-picker {
  min-width: 170px;
}
.experiment-report-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 12px;
  color: #718595;
  margin: 20px 0 14px;
}
.experiment-report-meta button {
  margin-left: auto;
}
.experiment-report-table-wrap {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid #dce5eb;
  border-radius: 10px;
}
.experiment-report-table {
  width: 100%;
  min-width: 2250px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  background: white;
}
.experiment-report-table th {
  background: #eef4f5;
  padding: 15px 14px;
  text-align: left;
  color: #607d89;
  font-weight: 600;
  white-space: nowrap;
}
.experiment-report-table td {
  padding: 16px 14px;
  border-top: 1px solid #eef2f5;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}
.experiment-report-table td:not(:first-child) {
  white-space: nowrap;
}
.experiment-report-table td:first-child,
.experiment-report-table th:first-child {
  min-width: 200px;
  position: sticky;
  left: 0;
  z-index: 1;
  background: white;
}
.experiment-report-table th:first-child,
.experiment-report-table th:last-child {
  background: #eef4f5;
  z-index: 2;
}
.experiment-report-table td:last-child,
.experiment-report-table th:last-child {
  position: sticky;
  right: 0;
  background: white;
  box-shadow: -4px 0 8px #24374608;
}
.experiment-report-table th:last-child {
  background: #eef4f5;
}
.experiment-report-table small {
  display: block;
  font-size: 11px;
  color: #8394a2;
  margin-top: 5px;
  max-width: 220px;
  white-space: normal;
}
.experiment-report-table .experiment-report-block-start td {
  border-top: 2px solid #dce5eb;
}
.experiment-report-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
/* min-width: 0 lets the name shrink to the column instead of its longest
   word (a flex item's default min-width), so it wraps — at the <wbr> after
   each 「_」 first, anywhere as a last resort — rather than overlapping 对照值. */
.experiment-report-group-name {
  min-width: 0;
  overflow-wrap: anywhere;
}
.experiment-report-group i,
.experiment-report-trend-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.experiment-report-warning,
.experiment-report-table small.experiment-report-warning {
  color: #9a6c15;
}
.experiment-report-significant {
  font-weight: 600;
  color: #6750a4;
}
/* 原始/截断 SE 倍数 > 3（design-feedback-r1 §7） */
.experiment-report-se-flag {
  font-weight: 600;
  color: #be403d;
}
/* 显著的结果按差值方向着色（domain/report/tone.js）：差值 > 0 绿色加粗、
   差值 < 0 红色加粗；差值 / 相对差 / 95% CI / 显著性四格。#237804 / #cf1322 on
   white ≈ 5.6:1 (WCAG AA). The inner .experiment-report-significant span
   (purple) takes the tone too. */
.experiment-report-table td.experiment-report-sig-up,
.experiment-report-table td.experiment-report-sig-up .experiment-report-significant {
  color: #237804;
  font-weight: 700;
}
.experiment-report-table td.experiment-report-sig-down,
.experiment-report-table td.experiment-report-sig-down .experiment-report-significant {
  color: #cf1322;
  font-weight: 700;
}
/* A row-reading's chart (ReportTable.jsx): a full-width row right under the
   rows that open it. The cell is both first and last child, so it must not
   take their sticky columns; the chart itself stays at the left edge of the
   table's horizontal scroll. */
.experiment-report-table .experiment-report-trend-row > td {
  position: static;
  padding: 0;
  background: #fafcfd;
  box-shadow: none;
  white-space: normal;
}
.experiment-report-trend-row .experiment-report-expanded {
  position: sticky;
  left: 0;
  width: max-content;
  max-width: 100%;
  border: none;
  border-radius: 0;
}
.experiment-report-trend-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 120px;
  font-size: 12px;
  color: #607d89;
}
.experiment-report-trend {
  width: calc(100vw - 150px);
  max-width: 2100px;
  min-width: 550px;
  padding: 24px;
}
.experiment-report-trend .chart {
  height: 320px;
}
.experiment-report-trend-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 14px;
}
.experiment-report-trend-head > span {
  font-size: 12px;
  color: #8394a2;
}
.experiment-report-trend-legend {
  display: flex;
  gap: 22px;
  align-items: center;
  margin-bottom: 16px;
  font-size: 12px;
  flex-wrap: wrap;
}
.experiment-report-trend-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.experiment-report-window-note {
  color: #9a6c15;
}
.experiment-report-muted {
  color: #8394a2;
  font-size: 12px;
}
.experiment-report-loading {
  min-height: 180px;
  display: flex;
  justify-content: center;
  align-items: center;
}
@media (max-width: 800px) {
  .experiment-report {
    padding: 20px 16px;
  }
  .experiment-report-group-pickers {
    grid-template-columns: 1fr;
  }
  .experiment-report-metric-pickers {
    flex-wrap: wrap;
  }
  .experiment-report-metric-pickers .experiment-report-metric-picker {
    flex-basis: 100%;
  }
  .experiment-report-trend {
    width: calc(100vw - 60px);
    min-width: 0;
    padding: 16px;
  }
}

/* Shared experiment traffic allocation check. */
.traffic-balance {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--fg, #202636);
  min-width: 0;
}
.traffic-balance h3 {
  margin: 0 0 5px;
  font-size: 16px;
}
.traffic-balance h4 {
  margin: 20px 0 12px;
  font-size: 13px;
  font-weight: 500;
}
.traffic-balance-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.traffic-balance[data-collapsed='true'] {
  padding-top: 12px;
  padding-bottom: 12px;
}
.traffic-balance-heading {
  flex: 1;
  min-width: 0;
}
.traffic-balance-toggle {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.traffic-balance-toggle:disabled {
  cursor: default;
}
.traffic-balance-toggle .traffic-balance-action {
  margin-left: auto;
}
.traffic-balance-summary {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}
.traffic-balance-summary.traffic-balance-diff {
  color: #c3554c;
}
.traffic-balance-summary .anticon {
  margin-right: 4px;
}
.traffic-balance-description,
.traffic-balance-muted {
  color: var(--muted);
  font-size: 12px;
}
.traffic-balance-description {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.traffic-balance-description .ant-btn {
  color: var(--fg, #202636);
  font-size: 12px;
}
.traffic-balance-total {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
}
.traffic-balance-total strong {
  color: var(--fg, #202636);
  font-size: 24px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.traffic-balance-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 14px 0;
  font-size: 12px;
}
.traffic-balance-toolbar label,
.traffic-balance summary,
.traffic-balance-toolbar .ant-select-content {
  color: var(--fg, #202636);
  font-weight: 500;
}
.traffic-balance-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.traffic-balance-field label {
  flex-shrink: 0;
}
.traffic-balance-toolbar .ant-select {
  min-width: 0;
  max-width: 100%;
}
.traffic-balance-version-field .ant-select {
  width: 330px;
}
.traffic-balance-date-field .ant-select {
  width: 175px;
}
.traffic-balance-toolbar .ant-select-content {
  font-size: 12px;
}
.traffic-balance-history {
  margin-left: auto;
  min-width: 0;
}
.traffic-balance-history[open] {
  flex-basis: 100%;
}
.traffic-balance summary {
  cursor: pointer;
  width: fit-content;
}
.traffic-balance-result {
  width: 100%;
  display: flex;
  gap: 10px;
  align-items: center;
  border: 0;
  border-radius: 7px;
  padding: 14px;
  background: #f5f7fa;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.traffic-balance-result b {
  font-weight: 500;
  font-size: 14px;
}
.traffic-balance-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}
.traffic-balance-result small {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  color: var(--muted);
}
.traffic-balance-normal {
  background: #f0f7f3;
}
.traffic-balance-normal > .anticon,
.traffic-balance-normal b {
  color: #428268;
}
.traffic-balance-imbalance {
  background: #fff3f1;
}
.traffic-balance-imbalance > .anticon,
.traffic-balance-imbalance b {
  color: #c3554c;
}
.traffic-balance-stat {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.traffic-balance-stat > span {
  display: block;
}
.traffic-balance-stat > span + span {
  margin-top: 3px;
  color: var(--muted);
}
.traffic-balance-stat strong {
  font-weight: 500;
  font-size: 15px;
}
.traffic-balance-action {
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
}
.traffic-balance-details {
  padding-top: 16px;
}
.traffic-balance-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 14px;
}
.traffic-balance-section-head h4 {
  margin: 0;
}
.traffic-balance-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
}
.traffic-balance-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  margin-right: 6px;
}
.traffic-balance-comparison,
.traffic-balance-ranges {
  display: grid;
  gap: 12px;
}
.traffic-balance-bar-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.traffic-balance-stacked {
  display: flex;
  height: 32px;
  gap: 2px;
  overflow: hidden;
  border-radius: 5px;
  background: #f8f9fb;
}
.traffic-balance-segment {
  flex-basis: 0;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  color: var(--fg, #202636);
  background: color-mix(in srgb, var(--traffic-group-color) 15%, var(--card, #fff));
  font-weight: 500;
}
.traffic-balance-range-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 8px 14px;
  align-items: center;
  font-size: 12px;
}
.traffic-balance-range-track {
  position: relative;
  height: 16px;
  border-radius: 3px;
  background: #f8f9fb;
}
.traffic-balance-range-band,
.traffic-balance-range-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--traffic-group-color);
}
.traffic-balance-range-band {
  opacity: .24;
}
.traffic-balance-range-marker {
  width: 3px;
  top: -4px;
  bottom: -4px;
  margin-left: -1.5px;
}
.traffic-balance-range-values {
  grid-column: 2;
  color: var(--muted);
}
.traffic-balance-diff {
  color: #be403d;
  font-weight: 500;
}
.traffic-balance-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}
.traffic-balance-trend {
  border-bottom: 1px solid var(--border);
  margin: 16px 0;
  padding-bottom: 16px;
}
.traffic-balance-trend-toggle {
  display: flex;
  align-items: center;
  gap: 8px 14px;
  flex-wrap: wrap;
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  color: inherit;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.traffic-balance-trend-toggle .traffic-balance-action {
  margin-left: auto;
}
.traffic-balance-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  margin: 10px 0;
  color: var(--muted);
  font-size: 12px;
}
.traffic-balance-overview button,
.traffic-balance-trend td button {
  color: var(--fg, #202636);
  font: inherit;
  border: 0;
  background: none;
  padding: 0;
  text-decoration: underline;
  text-decoration-color: #d0d5dd;
  text-underline-offset: 3px;
  cursor: pointer;
}
.traffic-balance-chart-key {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
  align-self: center;
}
.traffic-balance-timeline {
  display: grid;
  grid-template-columns: repeat(var(--traffic-days), minmax(0, 1fr));
  gap: 3px;
  margin: 8px 22px 0 46px;
}
.traffic-balance-day {
  position: relative;
  min-width: 0;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}
.traffic-balance-day[aria-pressed='true'] {
  outline: 2px solid var(--fg, #202636);
  outline-offset: 2px;
}
.traffic-balance-day-normal { background: #9fc5af; }
.traffic-balance-day-imbalance { background: #d75f55; }
.traffic-balance-day-insufficient { background: #e1b15e; }
.traffic-balance-day-pending { background: #e4e7ec; }
/* untestable (combo holdout-opt phase with < 2 groups carrying traffic): a
   settled "not checked" — hatched light grey, distinguishable from pending. */
.traffic-balance-day-untestable {
  background: repeating-linear-gradient(135deg, #f2f3f5 0 3px, #c9ced6 3px 5px);
}
.traffic-balance-day-change::after {
  content: '';
  position: absolute;
  top: -3px;
  left: calc(50% - 1px);
  bottom: -3px;
  width: 2px;
  background: #202636;
}
.traffic-balance-timeline-labels {
  display: flex;
  justify-content: space-between;
  margin: 6px 22px 10px 46px;
  font-size: 11px;
  color: var(--muted);
}
.traffic-balance-timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 11px;
  color: var(--muted);
}
.traffic-balance-timeline-legend i {
  position: relative;
  display: inline-block;
  height: 8px;
  width: 12px;
  border-radius: 1px;
}
.traffic-balance-trend .traffic-balance-series {
  margin-top: 14px;
}
.traffic-balance-trend details {
  font-size: 12px;
}
.traffic-balance-table {
  overflow-x: auto;
  margin: 12px 0;
}
.traffic-balance table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.traffic-balance th,
.traffic-balance td {
  border-bottom: 1px solid var(--border);
  padding: 10px;
  text-align: right;
  white-space: nowrap;
}
.traffic-balance th {
  background: #f8f9fb;
  color: var(--muted);
  font-weight: 400;
}
.traffic-balance th:first-child,
.traffic-balance td:first-child {
  text-align: left;
}
.traffic-balance-series {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}
.traffic-balance-series button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  background: none;
  border: 0;
  padding: 3px 0;
  cursor: pointer;
}
.traffic-balance-series button[aria-pressed='false'] {
  text-decoration: line-through;
}
.traffic-balance-series i {
  position: relative;
  width: 17px;
  height: 2px;
  display: inline-block;
}
.traffic-balance-series i::after {
  content: '';
  position: absolute;
  left: 6px;
  top: -2px;
  width: 6px;
  height: 6px;
  background: inherit;
  border-radius: 50%;
}
.traffic-balance-series button[aria-pressed='false'] i {
  opacity: 0.3;
}
.traffic-balance .chart {
  height: 240px;
}
.traffic-balance-method {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 17px;
  font-size: 12px;
}
.traffic-balance-method li {
  margin: 7px 0;
  color: var(--muted);
}
@media (max-width: 560px) {
  .traffic-balance {
    padding: 14px 12px;
  }
  .traffic-balance-field {
    flex: 1 1 100%;
  }
  .traffic-balance-field label {
    width: 55px;
  }
  .traffic-balance-field .ant-select {
    flex: 1;
  }
  .traffic-balance-total {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
  .traffic-balance-result {
    flex-wrap: wrap;
  }
  .traffic-balance-stat {
    flex-basis: 100%;
    margin-left: 24px;
    text-align: left;
  }
  .traffic-balance-action {
    margin-left: auto;
  }
  .traffic-balance-history {
    margin-left: 0;
  }
}

/* Experiment report — fixed-caliber page (ab-report-fixed-caliber, lane C):
   header notes, per-metric blocks, cross-group card, two-pane trend. */
.experiment-report-notes {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: #718595;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.experiment-report-metric {
  margin-top: 22px;
}
.experiment-report-metric-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  /* The whole header toggles the block (ReportTable MetricBlock). */
  cursor: pointer;
}
.experiment-report-metric-head small {
  color: #8394a2;
  font-size: 12px;
}
.experiment-report-metric-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  margin-left: -4px;
  border: none;
  border-radius: 6px;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.experiment-report-metric-toggle:hover {
  background: #eef4f5;
}
.experiment-report-metric-toggle:focus-visible {
  outline: 2px solid #6750a4;
  outline-offset: 1px;
}
.experiment-report-metric-caret {
  color: #8394a2;
  font-size: 11px;
}
.experiment-report-blocks-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
/* No indent for 仅拆解 (conditional) blocks: every block table has the same
   left edge and width (2026-11-14; the 24px margin-left made ARPPU / 付费金额
   中位数 … narrower). The 「仅拆解」 tag marks them. */
.experiment-report-metric .experiment-report-table-wrap {
  margin-top: 8px;
}
/* Every block table: the same columns with the same widths
   (domain/report/columns.js — the <col> widths and the inline min-width come
   from there), so columns line up across blocks; below the minimum the table
   scrolls inside its own wrapper. Cells wrap instead of spilling into the
   next column. */
.experiment-report-metric .experiment-report-table {
  table-layout: fixed;
}
.experiment-report-metric .experiment-report-table th,
.experiment-report-metric .experiment-report-table td {
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
}
.experiment-report-cell-na {
  color: #a8b5bf;
}
.experiment-report-deleted-tag {
  margin-left: 6px;
}
.experiment-report-expanded {
  background: #fafcfd;
  border: 1px solid #dce5eb;
  border-top: none;
  border-radius: 0 0 10px 10px;
}
.experiment-report-trend .chart.experiment-report-trend-pane-delta,
.experiment-report-trend .chart-empty[data-trend-pane='delta'] {
  height: 220px;
}
.experiment-report-cross {
  margin: 16px 0;
  padding: 12px 18px;
  border: 1px solid #e0e8ed;
  border-radius: 12px;
  background: white;
}
.experiment-report-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.experiment-report-card-head small {
  color: #8394a2;
}
.experiment-report-cross-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}
.experiment-report-cross-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 12px;
}
.experiment-report-cross-groups {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
}
.experiment-report-cross .experiment-report-table {
  min-width: 0;
}
.experiment-report-cross-note {
  font-weight: 400 !important;
  color: #8394a2 !important;
}
.experiment-report-cross-highlight {
  background: #fff7e6 !important;
  font-weight: 600;
}
/* Rule-based conclusions (ConclusionCard / ConclusionNotes). */
.experiment-report-conclusions {
  margin: 16px 0;
  padding: 12px 18px;
  border: 1px solid #e0e8ed;
  border-radius: 12px;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.experiment-report-conclusion-arms {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.experiment-report-conclusion-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.experiment-report-conclusion-lines {
  margin: 4px 0 0 18px;
  padding: 0;
  font-size: 12px;
  color: #4a5a68;
}
.experiment-report-conclusion-note {
  margin: 0;
  font-size: 12px;
  color: #4a5a68;
}
.experiment-report-conclusion-foot {
  margin: 0;
  font-size: 12px;
  color: #8394a2;
}
.experiment-report-control-hint {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #8394a2;
}
.experiment-report-revenue-tag {
  margin-left: 6px;
  font-size: 11px;
}
