/*
  云帆全局视觉统一层
  ------------------------------------------------------------------
  只统一字号、行高、控件文字、对齐与对比度，不改动业务逻辑与布局结构。
  必须排在 workbench.css / black-left.css / black-left-ledger.css / admin.css 之后加载。
*/

/* 1. 字体与基准 ---------------------------------------------------- */
:root {
  --yf-font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC",
    "Hiragino Sans GB", "Segoe UI", system-ui, sans-serif;
  --yf-ink: #1b2942;
  --yf-ink-2: #4f5f76;
  --yf-muted: #6b7a90;
  --yf-faint: #8a97aa;
  --ink: var(--yf-ink);
  --muted: var(--yf-muted);
  --rules-label: var(--yf-ink-2);
  --rules-control-height: 36px;
  font-family: var(--yf-font);
}

html,
body {
  font-family: var(--yf-font);
}

body {
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

input,
select,
textarea,
button,
table {
  font-family: inherit;
}

/* 数字等宽，价格、重量、天数、计数在列里不再左右跳 */
input[type="number"],
output,
td,
.metric b,
.runtime b,
.cp-l1-cnt,
.cp-pane-cnt,
.category-count,
.pagination,
.black-table-pagination {
  font-variant-numeric: tabular-nums;
}

/* 2. 标题层级 ------------------------------------------------------ */
.topbar h1 {
  font-size: 22px;
  line-height: 1.3;
}

.setting-block h3,
.setting-card h3 {
  color: var(--yf-ink);
  font-size: 14px;
  line-height: 1.35;
}

.setting-title small,
.setting-block-head span,
.inquiry-head p {
  color: var(--yf-ink-2);
  font-size: 12px;
  line-height: 1.5;
}

/* 3. 说明、注释、表格正文：最小 12px ------------------------------- */
small {
  font-size: 12px;
  line-height: 1.5;
}

.auth-box small,
.collection-source-row small,
.collection-source-row b,
.product-cell small,
.product-cell b,
.category-source,
.category-browser .category-source,
.category-policy,
.category-lock,
.connection-note,
.metric-note,
.metric .metric-note,
.run-page .metric-note,
.field-range,
.field-max,
.field,
.field-range em,
.field-max em,
.helper,
.auth-state,
.rule-table,
.profit-placeholder,
.profit-placeholder b,
.segmented label,
.category-list label,
.category-count,
.category-legend,
.category-legend .text-button,
.category-browser .category-legend,
.category-browser .category-legend span,
.category-root,
.category-group h4,
.category-node,
.category-empty,
.auto-query,
.filter-tab,
.dialog-error,
.muted,
.modal-panel label,
.modal-copy,
.unavailable-box,
.unavailable-box b,
.unavailable-segment span,
.source-dialog dt,
.source-dialog dd,
.source-dialog p,
.task-summary,
.dialog-field small,
.dialog-note,
.store-warning,
.watermark-list-text,
.watermark-type-tag,
.text-button,
.table-empty,
.empty-large,
.black-table-empty p,
.black-table-pagination,
.inquiry-table th,
.inquiry-table td,
.product-table th,
.product-table td,
.black-table th,
.rule-table input,
.category-search input,
.search input,
.cp-l1-cnt,
.cp-pane-cnt,
.log-item,
.log-item time,
.log-empty span,
.connection-error,
.toast,
.runtime small,
.il-qa em,
.il-sub,
.il-pmeta,
.il-kv small,
.il-instr small,
.admin-map-hud span,
.admin-map-legend,
.quota-batch-item,
.quota-batch-help,
.account-table td small,
.account-muted,
.customer-service-quota-mini label,
.customer-service-quota-mini small,
.quota-card-form label,
.admin-order-detail-row span,
.sales-report-stack small,
.agent-invite-panel span {
  font-size: 12px;
  line-height: 1.5;
}

.il-table thead th,
.account-table th,
.account-table td {
  font-size: 12px;
  line-height: 1.45;
  letter-spacing: 0;
  vertical-align: middle;
}

/* 4. 交互控件：文字与框体成比例 -------------------------------------- */
button:disabled {
  opacity: 0.6;
}

button,
input,
select,
textarea,
.il-btn,
.table-link-button {
  font-size: 13px;
}

.small-button,
.text-button,
.top-logout,
.filter-tab,
.setting-segmented button,
.category-legend .text-button,
.card-quota-agent-row span em,
.card-quota-agent-row span small,
.card-quota-agent-row > div span {
  font-size: 12px;
}

/* 5. 标签类：11px 加粗，保留层次又能看清 ----------------------------- */
.cp-tag,
.cp-reason,
.log-item .tag,
.admin-badge,
.agent-quota-compact em,
.il-msg small {
  font-size: 11px;
  line-height: 1.4;
}

.cp-reason {
  flex-basis: 66px;
}

.badge,
.status,
.collector-node-status {
  font-size: 12px;
}

/* 6. 对齐 ---------------------------------------------------------- */
.inquiry-table th,
.inquiry-table td,
.product-table th,
.product-table td,
.black-table th,
.black-table td,
.account-table th,
.account-table td,
.il-table thead th,
.il-table td {
  vertical-align: middle;
}

.metric-head,
.auth-box,
.task-summary,
.connection-note,
.unavailable-box,
.admin-order-detail-row {
  align-items: center;
}

/* 表格里的“值 + 备注”分行显示，避免 permanent未设置到期时间 这类粘连 */
.directory-table td strong + small,
.account-table td strong + small {
  display: block;
  margin-top: 3px;
  color: var(--yf-muted);
  font-weight: 500;
}

/* 7. 对比度：过淡的说明文字提到可读灰阶 -------------------------------- */
.exchange small,
.log-empty,
.log-item time,
.field-range em,
.field-max em,
.category-search svg,
.category-root small,
.category-group h4 span,
.category-name small,
.category-empty,
.search svg,
.metric-head em,
.account-table td small,
.account-muted,
.quota-batch-help,
.customer-service-quota-mini small,
.admin-order-detail-row span,
.sales-report-stack small,
.il-kv small,
.il-pmeta,
.il-instr small {
  color: var(--yf-muted);
}

.cp-search input::placeholder {
  color: var(--yf-faint);
}

/* 8. 补齐历史遗留的小字规则 ------------------------------------------ */
.brand strong,
.auth-badge,
#logCount,
.cp-summary,
#categorySelectedCount,
#clearCategories,
.step,
#listingState,
.listing-metric small,
.listing-metric span,
.listing-panel-head small {
  font-size: 12px;
}

.newton-points span,
.number-unit,
.formula-line {
  color: var(--yf-muted);
  font-size: 12px;
}

/* 最大跟卖数 / 最大上架天数：单位原先只有 right 没有 top，会贴在顶部 */
.number-control.is-limit .number-unit {
  top: 50%;
  transform: translateY(-50%);
  line-height: 1;
}

/* 多个物流渠道在窄栏里放不下，改为两列自适应换行；仍是单选，功能不变 */
.shipping-panel .setting-segmented.four {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.shipping-panel .setting-segmented button {
  padding: 0 8px;
  font-size: 12px;
}
