/* ═══════════════════════════════════════════════════════════════
   闲鱼10%系统 v2.3.0 — Tabler 品牌薄层
   组件样式由 Tabler 提供（不再手写）；本层只保留品牌色与业务类
   ═══════════════════════════════════════════════════════════════ */
:root {
  --xy-yellow: #FFE411;
  --xy-yellow-ink: #141414;
  --xy-success: #15803D;
  --xy-danger: #B91C1C;
  --xy-warning: #B45309;
  --xy-link: #0050B3;
  --xy-cyan: #0891B2;
  --xy-text-2: #595959;
}

/* ── 品牌：主按钮黄底深字（Tabler 默认蓝 → 覆盖） ── */
.btn-primary {
  --tblr-btn-bg: var(--xy-yellow); --tblr-btn-border-color: var(--xy-yellow);
  --tblr-btn-color: var(--xy-yellow-ink);
  --tblr-btn-hover-bg: #FFD60A; --tblr-btn-hover-border-color: #FFD60A; --tblr-btn-hover-color: var(--xy-yellow-ink);
  --tblr-btn-active-bg: #F5C800; --tblr-btn-active-border-color: #F5C800; --tblr-btn-active-color: var(--xy-yellow-ink);
  font-weight: 600;
}
.btn-outline-primary { --tblr-btn-color: var(--xy-link); --tblr-btn-border-color: var(--xy-link); --tblr-btn-hover-bg: var(--xy-link); --tblr-btn-hover-color: #fff; }

/* ── 侧边栏：激活项黄底深字，未激活 65% 白 ── */
.xy-nav-sep { display: block; padding: 12px 16px 4px; font-size: 10.5px; letter-spacing: 1.5px; color: rgba(255, 255, 255, .45); text-transform: uppercase; }
.navbar-vertical .nav-link { color: rgba(255, 255, 255, .65); border-radius: 8px; margin: 1px 8px; }
.xy-nav-group-toggle { cursor: pointer; }
.xy-nav-group-toggle::after { content: "▾"; margin-left: auto; opacity: .6; font-size: 10px; }
.xy-nav-group-toggle[aria-expanded="false"]::after { content: "▸"; }
.xy-nav-sub { padding-left: 40px !important; font-size: 12.5px; margin: 0 8px !important; }
.navbar-vertical .xy-nav-sub.active { background: rgba(255, 228, 17, .14); color: var(--xy-yellow); font-weight: 600; }
.navbar-vertical .nav-link:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.navbar-vertical .nav-link.active { background: var(--xy-yellow); color: var(--xy-yellow-ink); font-weight: 600; }
.xy-badge-version { background: var(--xy-yellow); color: var(--xy-yellow-ink); font-size: 10px; border-radius: 99px; font-weight: 700; }
.xy-brand-text { color: #fff; font-weight: 700; font-size: 15px; }
.xy-logo { font-size: 22px; }
.xy-user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--xy-yellow); color: var(--xy-yellow-ink); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.xy-user-name { color: #dfe6f5; font-size: 12.5px; }
.xy-role-badge { background: rgba(255, 228, 17, .14); color: #fff; border: 1px solid rgba(255, 228, 17, .45); font-size: 10px; font-weight: 600; }
.xy-icon-btn { background: #1f2740; color: #cfd8ef; border: 1px solid rgba(255, 255, 255, .1); }
.xy-icon-btn:hover { color: #fff; border-color: var(--xy-yellow); }
.xy-biz-top { font-size: 12.5px; }

/* ── 页面骨架 ── */
.xy-body { background: #f4f6fb; }
[data-bs-theme="dark"] .xy-body { background: #10141f; }

/* ══ Tabler 布局系统（beta20 核心 CSS 未内置 layout-*，按官方规范补全） ══ */
.layout { display: flex; flex: 1; flex-direction: column; min-height: 100vh; }
.layout .layout-content { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.layout-fixed .layout-navbar { position: fixed; top: 0; right: 0; left: 0; z-index: 1030; min-height: 3.5rem; }
.layout-fixed .layout-sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1029; width: 15rem; }
.layout-fixed .layout-content { padding-left: 15rem; }
.layout-navbar-fixed .layout-content { padding-top: 3.5rem; }
@media (min-width: 992px) {
  .layout-navbar-fixed .layout-content { padding-top: 0; }
}
@media (max-width: 991.98px) {
  .layout-fixed .layout-sidebar { position: static; width: 100%; z-index: auto; }
  .layout-fixed .layout-content { padding-left: 0; }
  .layout-fixed .layout-sidebar .navbar-collapse { margin: 0; }
}
/* 垂直侧边栏结构（Tabler navbar-vertical 必备） */
.navbar-vertical { align-items: stretch; flex-direction: column; width: 15rem; padding: 0; justify-content: space-between; }
.navbar-vertical .navbar-collapse { align-items: stretch; flex-direction: column; flex: 1; }
.navbar-vertical .navbar-nav { flex-direction: column; padding-bottom: 1rem; }
.navbar-vertical .navbar-brand { margin: 0; padding: 16px; }
.navbar-vertical .navbar-footer { padding-top: 8px; }
@media (max-width: 991.98px) {
  .navbar-vertical { width: 100%; }
  .navbar-vertical .navbar-collapse { padding: 0 8px 8px; }
}

/* Tabler page 体系补全（核心 CSS 规则过简：header 无内边距/背景，actions 无样式） */
.page-header { padding: 1rem 1.5rem; margin: 0 0 1rem; background: var(--tblr-bg-surface); border-bottom: 1px solid var(--tblr-border-color); flex-direction: row; align-items: center; justify-content: space-between; min-height: 0; flex-wrap: wrap; gap: .5rem; }
.page-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: nowrap; }
.xy-kbd-hint { white-space: nowrap; }
.page-pretitle { font-size: .75rem; margin-bottom: .25rem; }
.page-title { font-size: 1.25rem; }
.page-body { padding: 1rem 1.5rem 3rem; margin: 0; }
.xy-kbd-hint kbd { background: var(--tblr-bg-surface); color: var(--tblr-secondary); border: 1px solid var(--tblr-border-color); border-radius: 5px; font-size: 11px; padding: 1px 6px; }

/* ── 文字/数字 ── */
.fw-bold { font-weight: 600; }
td.text-end, .text-end td, .fs-3, .fs-4 { font-variant-numeric: tabular-nums; }
.text-muted, .text-secondary { color: var(--tblr-secondary) !important; }
a { color: var(--xy-link); }

/* ── 语义色（文字级达标） ── */
.text-success { color: var(--xy-success) !important; }
.text-danger { color: var(--xy-danger) !important; }
.text-warning { color: var(--xy-warning) !important; }
.text-primary { color: var(--xy-link) !important; }
.text-info { color: var(--xy-cyan) !important; }

/* ── 状态按钮（颜色标在按钮上） ── */
.xy-status-btn { border-radius: 6px; font-weight: 600; font-size: 12.5px; }
.status-on_sale { background: rgba(21, 128, 61, .10); color: var(--xy-success); border: 1px solid rgba(21, 128, 61, .35); }
.status-pending_ship { background: rgba(0, 80, 179, .10); color: var(--xy-link); border: 1px solid rgba(0, 80, 179, .35); }
.status-sold, .status-confirmed { background: rgba(124, 58, 237, .10); color: #6d28d9; border: 1px solid rgba(124, 58, 237, .35); }
.status-cancelled { background: rgba(89, 89, 89, .10); color: var(--xy-text-2); border: 1px solid var(--tblr-border-color); }
.status-off_shelf { background: rgba(180, 83, 9, .10); color: var(--xy-warning); border: 1px solid rgba(180, 83, 9, .35); }

/* ── Toast（Tabler 基础 + 语义色） ── */
#toast-area .toast { border: 0; border-radius: 8px; font-size: 13.5px; }
#toast-area .toast-success { background: var(--xy-yellow); color: var(--xy-yellow-ink); font-weight: 600; }
#toast-area .toast-danger { background: #141414; color: #fff; border-left: 4px solid #F5222D; }
#toast-area .toast-info { background: #141414; color: #fff; }

/* ── 空状态引导 ── */
.xy-empty { text-align: center; padding: 48px 16px; color: var(--tblr-secondary); }
.xy-empty-ico { font-size: 40px; display: block; margin-bottom: 10px; opacity: .7; }
.xy-empty-title { font-size: 15px; font-weight: 600; color: var(--tblr-body-color); margin-bottom: 4px; }
.xy-empty-desc { font-size: 12.5px; margin-bottom: 14px; }

/* ── 确认弹窗 ── */
.xy-confirm-mask { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 1050; display: flex; align-items: center; justify-content: center; padding: 16px; }
.xy-confirm-card { background: var(--tblr-bg-surface); border-radius: 8px; box-shadow: var(--tblr-shadow-lg); max-width: 380px; width: 100%; padding: 20px; border: 1px solid var(--tblr-border-color); }
.xy-confirm-title { font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.xy-confirm-msg { font-size: 13px; color: var(--tblr-secondary); margin-bottom: 16px; word-break: break-all; }

/* ── 布局细节 ── */
.xy-col-title { min-width: 260px; }
.xy-col-title-sm { min-width: 190px; }
.xy-col-ops { white-space: nowrap; }
#pl-pagination, #sl-pagination, #mp-pagination, #lg-nav, #exp-pagination, #as-pagination { white-space: nowrap; }
.d-flex.justify-content-between.align-items-center.mt-1 { flex-wrap: nowrap; }
#lg-nav .btn { padding: 2px 10px; min-width: 64px; }

/* ══ v2.3.3d 分类树/产品树组件（Tabler 无此样式，v2.3.0 重写时遗漏，补回间距） ══ */
#cat-tree, #prod-list { list-style: none; padding-left: 0; margin-bottom: 8px; }
#cat-tree li, #prod-list li { padding: 5px 8px; border-radius: 6px; display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
#cat-tree li:hover, #prod-list li:hover { background: rgba(255, 228, 17, .06); }
#cat-tree .subs { list-style: none; padding-left: 18px; margin: 2px 0 4px; }
#cat-tree .subs li { padding: 4px 8px; }
.cat-name { flex: 1; cursor: pointer; min-width: 0; }
#cat-tree .fold { cursor: pointer; padding: 0 4px; color: var(--tblr-secondary); }
#cat-tree .sel > .cat-name, #cat-tree li.sel, #prod-list li.sel { font-weight: 600; color: var(--xy-link); }
button.mini {
  padding: 1px 10px; font-size: 12px; border: 1px solid var(--tblr-border-color);
  border-radius: 6px; background: transparent; color: var(--tblr-secondary);
  white-space: nowrap; margin-left: auto;
}
button.mini:hover { color: var(--xy-link); border-color: var(--xy-link); }

/* 滚动条统一 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--tblr-border-color); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--tblr-secondary); }
