/* ============================================================
   靖羽 ERP · UI v2 品牌层 v1.0（2026-09-04）
   设计源：/root/erp-ui/design-v2/ 14 页原型（靖羽自有设计体系）
   定位：加载于 theme-light.css / theme-dark.css 之后的最终覆盖层
   ------------------------------------------------------------
   ① 浅色模式：科技蓝 → 靖羽青 #0E9F8C 品牌换装
      （变量级主换 + theme-light 硬编码蓝清剿）
   ② 双模式 v2 签名：状态徽标圆点 / 表格等宽数字 / 聚焦青色光环
   ③ 暗色模式：theme-dark 已与原型 #0B0F14/#2DD4BF 同源，仅补差量
   回退：base.html 删除本文件 link 行即 complete rollback，无副作用。
   ============================================================ */

/* ---------- ① 浅色：品牌变量换装 ---------- */
html:not([data-theme="dark"]) {
    --erp-primary:#0E9F8C;
    --erp-primary-grad:linear-gradient(135deg,#14B8A6,#0E9F8C);
    --erp-row-hover:#F3F8F7;
    --brand-primary:#0E9F8C;
    --brand-primary-dark:#0B8577;
    --shadow-float:0 4px 14px rgba(14,159,140,.18);
}
/* 画布微调（v2 更冷的浅灰） */
html:not([data-theme="dark"]) body { background: #F4F6F9 !important; }
/* 品牌渐变（靖 logo / 头像） */
html:not([data-theme="dark"]) .navbar-brand span,
html:not([data-theme="dark"]) .app-avatar { background: linear-gradient(135deg,#14B8A6,#2E6BE6) !important; }

/* ---------- ① theme-light 硬编码蓝清剿 ---------- */
html:not([data-theme="dark"]) code { background: rgba(14,159,140,.08); color: #0B8577; }
html:not([data-theme="dark"]) .badge.bg-primary { background: rgba(14,159,140,.10) !important; color: #0B8577 !important; }
html:not([data-theme="dark"]) .btn-primary, html:not([data-theme="dark"]) .btn-primary:focus {
  box-shadow: 0 1px 2px rgba(14,159,140,.35);
}
html:not([data-theme="dark"]) .btn-primary:hover { box-shadow: 0 4px 12px rgba(14,159,140,.28); }
html:not([data-theme="dark"]) .btn-primary:disabled { background: #8FCBC2 !important; }
html:not([data-theme="dark"]) .btn-outline-primary { border-color: rgba(14,159,140,.55) !important; }
html:not([data-theme="dark"]) .btn-outline-primary:hover { background: rgba(14,159,140,.06); color: #0B8577 !important; }
html:not([data-theme="dark"]) .btn-outline-secondary:hover { border-color: var(--erp-primary); color: var(--erp-primary); background: #EFF8F6; }
html:not([data-theme="dark"]) .form-control:focus, html:not([data-theme="dark"]) .form-select:focus {
  box-shadow: 0 0 0 3px rgba(14,159,140,.14) !important;
}
html:not([data-theme="dark"]) .form-check-input:checked { background-color: var(--erp-primary); border-color: var(--erp-primary); }
html:not([data-theme="dark"]) .nav-tabs .nav-link:hover { border-bottom-color: rgba(14,159,140,.45); }
html:not([data-theme="dark"]) .nav-pills .nav-link.active { background: rgba(14,159,140,.10) !important; color: #0B8577 !important; }
html:not([data-theme="dark"]) .table { --bs-table-hover-bg: #F3F8F7; }
html:not([data-theme="dark"]) .table-hover tbody tr:hover { background: #F3F8F7 !important; }
html:not([data-theme="dark"]) .accordion-button:not(.collapsed) { background: #EFF8F6 !important; color: #0B8577 !important; }
html:not([data-theme="dark"]) .login-card .brand-logo {
  background: linear-gradient(90deg,#14B8A6,#0E9F8C) !important; -webkit-background-clip: text !important;
}
html:not([data-theme="dark"]) .card:hover { border-color: #D9E2E0; }
html:not([data-theme="dark"]) .sidebar .nav-link.active,
html:not([data-theme="dark"]) .app-sidebar .nav-link.active {
  color: #0B8577 !important; background: rgba(14,159,140,.10) !important;
  border-left: 3px solid var(--erp-primary);
}
html:not([data-theme="dark"]) .pagination .page-item.active .page-link { background: var(--erp-primary); border-color: var(--erp-primary); }
html:not([data-theme="dark"]) .spinner-border, html:not([data-theme="dark"]) .spinner-grow { color: var(--erp-primary); }
html:not([data-theme="dark"]) .progress-bar { background: var(--erp-primary) !important; }
/* base.html 内联橙底残留兜底（!important 对 !important，本层更晚加载必胜） */
html:not([data-theme="dark"]) .app-sidebar .nav-link.active { background: rgba(14,159,140,.10) !important; }

/* ---------- ② v2 签名：状态徽标圆点（双模式通用） ---------- */
.badge { border-radius: 999px !important; }
.badge.bg-success::before, .badge.bg-warning::before, .badge.bg-danger::before,
.badge.bg-info::before, .badge.bg-primary::before, .badge.bg-secondary::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-right: .4em; vertical-align: .05em;
  opacity: .85;
}

/* ---------- ② v2 签名：表格数字等宽（对齐原型 tabular-nums） ---------- */
.table td, .table th { font-variant-numeric: tabular-nums; }
.mono, code { font-variant-numeric: tabular-nums; }

/* ---------- ② v2 签名：行内操作按钮收敛（更轻的分隔） ---------- */
.table .btn-sm { --bs-btn-padding-y: .15rem; --bs-btn-padding-x: .55rem; }

/* ---------- ③ 暗色：与原型对齐的差量（theme-dark 已同源） ---------- */
[data-theme="dark"] .badge.bg-primary { background: rgba(45,212,191,.13) !important; color: #5EEAD4 !important; }
[data-theme="dark"] .badge.bg-info { background: rgba(96,165,250,.13) !important; color: #93C5FD !important; }
[data-theme="dark"] .badge.bg-success { background: rgba(34,197,94,.14) !important; color: #4ADE80 !important; }
[data-theme="dark"] .badge.bg-warning { background: rgba(245,158,11,.15) !important; color: #FCD34D !important; }
[data-theme="dark"] .badge.bg-danger { background: rgba(239,68,68,.15) !important; color: #FCA5A5 !important; }
[data-theme="dark"] .badge.bg-secondary { background: rgba(139,152,171,.16) !important; color: #AAB6C8 !important; }
[data-theme="dark"] code { background: rgba(45,212,191,.10); color: #5EEAD4; }

/* ---------- 品牌交互色残留收编（indigo→青，全站生效） ---------- */
.fs-link:hover, .fs-copy:hover { color: var(--brand-primary-dark) !important; }
.wh-cell .wh { color: var(--brand-primary-dark); }
/* 范围/视图切换 active 态（btn-outline-secondary.active） */
html:not([data-theme="dark"]) .btn-outline-secondary.active,
html:not([data-theme="dark"]) .btn-outline-secondary:active {
  background: rgba(14,159,140,.10) !important; border-color: rgba(14,159,140,.45) !important; color: var(--brand-primary-dark) !important;
}

/* ---------- 紧凑行（2026-09-04 用户点单）：徽标横排 + 操作按钮单行 ---------- */
/* 跟卖池：可行性徽标不折行+缩小，行高立降 */
#fs-pre table tbody td:nth-child(11) { white-space: nowrap; }
#fs-pre table tbody td:nth-child(11) .badge { padding: .15em .5em; font-size: 10.5px; }
/* 跟卖池+竞价页：操作按钮单行小尺寸（Bootstrap 工具类 .flex-wrap 自带 !important，须同权重覆盖） */
#fs-pre table tbody td:last-child .d-flex,
#rp-manage table tbody td:last-child .d-flex,
.rp-acts { flex-wrap: nowrap !important; }
#fs-pre table td:last-child .btn,
#rp-manage table td:last-child .btn { padding: .1rem .4rem; font-size: 11.5px; white-space: nowrap; }
/* 操作列确定性保留宽度（auto 布局会把它挤没导致按钮被裁） */
#fs-pre table thead th:last-child { width: 235px; min-width: 235px; }
#rp-manage table thead th:last-child { width: 200px; min-width: 200px; }
#fs-pre table tbody td:nth-child(12) { white-space: nowrap; }
/* ★ flex 陷阱：main 无 min-width:0 时宽表把 min-content 撑爆→整页横向溢出→sticky 列跑到视口外 */
main.app-content, .app-shell > main { min-width: 0; }

/* ---------- 平台订单：订单组折叠行（Bootstrap collapse 对 tr 需 table-row 显示） ---------- */
tr.collapse.show { display: table-row; }
.fs-ghead { cursor: pointer; background: var(--erp-muted); }
.fs-ghead td { font-size: 12px; font-weight: 600; }
.fs-ghead:hover td { background: var(--erp-hover); }
