﻿/* LensCabin Merchant — 商家后台样式 (2026-08-15 editorial 黑金 V2)
 * 改动: 全站主色从 #4e73df 蓝 改为 #c8a96a 金 + #0a0a0a 墨黑, 衬线标题; 工具类保持向后兼容
 * 兼容: 所有 .card/.btn/.table/.badge/.alert/.modal/.kpi-card 等类名不变, 仅改变量和新增类
 */
:root {
  --ink:        #0a0a0a;
  --ink-soft:   #1c1c1c;
  --gilt:       #c8a96a;
  --gilt-dark:  #a8893f;
  --gilt-light: #e6d3a3;
  --cream:      #faf6ec;
  --paper:      #fdfbf6;
  --line:       #e8e2d3;
  --line-soft:  #f0ebdc;
  --muted:      #6b6357;
  --danger:     #b03434;
  --success:    #4a7c52;
  --warning:    #b3821a;
  --info:       #5b6f7c;
  --accent:        var(--gilt);
  --text:          var(--ink);
  --text-secondary:var(--muted);
  --border:        var(--line);
  --card-bg:       #ffffff;
  --content-bg:    var(--cream);
  --sidebar-w:     232px;
  --sidebar-bg:    #14130f;
  --sidebar-hover: #1f1d18;
  --sidebar-active:#2a2620;
  --sidebar-text:  #a89f8b;
  --sidebar-text-active:#f6e7c5;
  --radius:        8px;
  --radius-lg:     14px;
  --radius-pill:   999px;
  --shadow:        0 1px 3px rgba(0,0,0,.04);
  --shadow-lg:     0 12px 36px rgba(0,0,0,.12);
  --font:      'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif:'Playfair Display', 'Songti SC', 'STZhongsong', Georgia, serif;
}

* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; font-family:var(--font); font-size:14px; color:var(--ink); background:var(--content-bg); -webkit-font-smoothing:antialiased; }
a { color:inherit; text-decoration:none; }
ul { list-style:none; }
button { cursor:pointer; font-family:inherit; }
input, select, textarea { font-family:inherit; color:var(--ink); }

.font-serif { font-family: var(--font-serif); letter-spacing:.5px; }
.font-display { font-family: var(--font-serif); font-weight:700; letter-spacing:.8px; }

/* ==================== 布局 ==================== */
.admin-wrapper { display:flex; height:100vh; overflow:hidden; }
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column; flex-shrink: 0;
  overflow: hidden; z-index: 100;
  border-right: 1px solid #2a2620;
  transition: width .2s ease;
}
.admin-sidebar.collapsed { width: 60px; }
.admin-sidebar .brand {
  height: 60px; display:flex; align-items:center; gap:10px;
  color: #fff; font-size: 17px; font-weight: 700;
  font-family: var(--font-serif);
  letter-spacing: 1px;
  padding: 0 18px;
  border-bottom: 1px solid #2a2620;
  position: relative;
}
.admin-sidebar .brand::before {
  content:""; position:absolute; left:0; top:14px; bottom:14px; width:3px;
  background: linear-gradient(180deg, var(--gilt) 0%, var(--gilt-dark) 100%);
  border-radius:0 2px 2px 0;
}
.admin-sidebar .brand i { color: var(--gilt); }
.admin-sidebar .brand small { font-size:10px; color:var(--gilt); letter-spacing:2px; margin-left:auto; font-family:var(--font); }

.admin-sidebar nav { flex:1; overflow-y:auto; padding:8px 0 80px; }
.admin-sidebar nav::-webkit-scrollbar { width:4px; }
.admin-sidebar nav::-webkit-scrollbar-thumb { background:rgba(200,169,106,.18); border-radius:4px; }
.admin-sidebar nav::-webkit-scrollbar-track { background:transparent; }

.admin-sidebar .menu-group { margin: 2px 0; }

/* 顶级 nav-link (非子菜单, 如全渠道运营控制大屏) */
.admin-sidebar .nav-link-top {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 10px 16px;
  color: var(--sidebar-text); font-size: 13px;
  text-decoration: none; cursor: pointer;
  border-left: 3px solid transparent;
  white-space: normal; word-break: break-word; line-height: 1.35;
  transition: all .2s;
}
.admin-sidebar .nav-link-top:hover {
  color: var(--sidebar-text-active); background: var(--sidebar-hover);
}
.admin-sidebar .nav-link-top i { flex-shrink: 0; }
.admin-sidebar .nav-link-top span { white-space: normal; word-break: break-word; line-height: 1.35; }
.admin-sidebar.collapsed .nav-link-top span { display: none; }
.admin-sidebar.collapsed .nav-link-top { justify-content: center; padding: 10px 0; }
.admin-sidebar.collapsed .nav-link-top i { margin: 0 !important; }
.admin-sidebar .menu-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: none; border: none; color: var(--sidebar-text);
  padding: 10px 16px; font-size: 13px; text-align: left; cursor: pointer;
  transition: all .2s; border-left: 3px solid transparent;
  font-family: var(--font);
}
.admin-sidebar .menu-toggle:hover { color: var(--sidebar-text-active); background: var(--sidebar-hover); }
.admin-sidebar .menu-toggle .fa-chevron-down { margin-left:auto; font-size:11px; transition: transform .25s; opacity:.6; }
.admin-sidebar .menu-group.open > .menu-toggle .fa-chevron-down { transform: rotate(180deg); }
.admin-sidebar .menu-toggle .badge-counter {
  margin-left:auto; background: var(--gilt); color: var(--ink);
  font-size: 10px; padding: 1px 7px; border-radius: var(--radius-pill);
  font-weight: 700; min-width: 18px; text-align: center;
}
.admin-sidebar .menu-sub { display: block; padding: 4px 0 6px; background: rgba(0,0,0,.18); }
.admin-sidebar .menu-group.open > .menu-sub { display: block; }
.admin-sidebar .menu-sub .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 38px;
  color: var(--sidebar-text);
  font-size: 12.5px;
  transition: all .15s;
  border-left: 3px solid transparent;
}
.admin-sidebar .menu-sub .nav-link:hover {
  color: var(--sidebar-text-active); background: var(--sidebar-hover);
}
.admin-sidebar .menu-sub .nav-link.active {
  color: var(--gilt); background: var(--sidebar-active);
  border-left-color: var(--gilt);
}
.admin-sidebar .menu-sub .nav-link i { width: 16px; text-align: center; opacity: .8; }
.admin-sidebar .menu-sub .nav-link.active i { opacity: 1; color: var(--gilt); }
.admin-sidebar .menu-sub .menu-sub .nav-link { padding-left: 52px; font-size: 12px; }
.admin-sidebar .nav-link.text-danger { color: #d97a7a !important; }
.admin-sidebar .nav-link.text-danger:hover { color: #fff !important; background: rgba(176,52,52,.18); }

.admin-sidebar.collapsed .menu-toggle span,
.admin-sidebar.collapsed .menu-toggle .badge-counter,
.admin-sidebar.collapsed .menu-sub { display: none; }
.admin-sidebar.collapsed .menu-toggle { justify-content: center; padding: 10px 0; }
.admin-sidebar.collapsed .menu-toggle .fa-chevron-down { display: none; }
.admin-sidebar.collapsed .brand { justify-content: center; padding: 0; }
.admin-sidebar.collapsed .brand::before { display: none; }
.admin-sidebar.collapsed .brand small { display: none; }

.admin-main {
  flex: 1; display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}
/* ==================== Header (强化: 页面标题 + 门店切换 + 搜索 + 通知 + 用户) ==================== */
.admin-header {
  height: 60px; background: #ffffff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 24px;
  flex-shrink: 0;
  gap: 16px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.admin-header .page-title { font-size: 16px; font-weight: 700; color: var(--ink); font-family: var(--font-serif); letter-spacing:.5px; }
.admin-header .store-switch {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 13px; color: var(--ink);
  cursor: pointer; transition: all .15s;
}
.admin-header .store-switch:hover { border-color: var(--gilt); background: var(--cream); }
.admin-header .store-switch i { color: var(--gilt); }
.admin-header .global-search {
  flex: 1; max-width: 360px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--muted);
}
.admin-header .global-search input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 13px; color: var(--ink);
}
.admin-header .global-search:focus-within { border-color: var(--gilt); }
.admin-header .icon-btn {
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius);
  color: var(--muted); font-size: 16px; cursor: pointer; position: relative;
  transition: all .15s;
}
.admin-header .icon-btn:hover { background: var(--paper); color: var(--ink); }
.admin-header .icon-btn .badge-counter {
  position: absolute; top: 4px; right: 4px;
  background: var(--danger); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: var(--radius-pill);
  min-width: 16px; text-align: center; font-weight: 700;
  border: 2px solid #fff;
}
.admin-header .user-menu {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 12px 4px 4px; border-radius: var(--radius-pill);
  cursor: pointer; transition: all .15s;
  border: 1px solid transparent;
  position: relative;
}
.admin-header .user-menu:hover { background: var(--paper); border-color: var(--line); }
.admin-header .user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gilt) 0%, var(--gilt-dark) 100%);
  color: var(--ink); font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
}
.admin-header .user-info { display: flex; flex-direction: column; line-height: 1.15; }
.admin-header .user-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.admin-header .user-role { font-size: 11px; color: var(--gilt-dark); font-family: var(--font-serif); letter-spacing:.5px; }

.admin-header .user-menu-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 160px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(10,10,10,.12);
  padding: 6px; display: none; z-index: 1050;
}
.admin-header .user-menu.open .user-menu-dropdown { display: block; }
.admin-header .user-menu-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius);
  color: var(--ink); font-size: 13px; text-decoration: none;
  transition: all .15s;
}
.admin-header .user-menu-item:hover { background: var(--cream); color: var(--gilt-dark); }
.admin-header .user-menu-item i { width: 16px; text-align: center; color: var(--gilt-dark); }


.admin-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ==================== Cards ==================== */
.card { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card-body { padding: 1.25rem; }
.card-header { padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--border); display:flex; align-items:center; justify-content:space-between; gap:10px; }
.card-title { font-size: 14px; font-weight: 600; color: var(--ink); display:flex; align-items:center; gap:8px; }
.card-title i { color: var(--gilt); }
.shadow-sm { box-shadow: var(--shadow); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.border-0 { border: none; }
.border-start { border-left: 3px solid var(--border); }
.border-4 { border-width: 4px !important; }
.border-primary { border-color: var(--gilt) !important; }
.border-info { border-color: var(--info) !important; }

/* ==================== KPI 卡片 (黑金版) ==================== */
.kpi-card {
  background: linear-gradient(135deg, #1a1814 0%, #2a2620 100%);
  border-radius: var(--radius-lg); color: #fff;
  padding: 1.5rem; position: relative; overflow: hidden;
  border: 1px solid #3a352c;
}
.kpi-card::after {
  content:""; position:absolute; right:-30px; top:-30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,169,106,.18) 0%, transparent 70%);
  pointer-events: none;
}
.kpi-card .stat {
  background: rgba(255,255,255,.06); border-radius: 10px;
  padding: 12px 14px; backdrop-filter: blur(4px);
}
.kpi-card .stat .k { font-size: 11.5px; opacity: .7; letter-spacing: .5px; text-transform: uppercase; }
.kpi-card .stat .v { font-size: 22px; font-weight: 700; font-family: var(--font-serif); color: var(--gilt-light); margin-top: 2px; }
.kpi-card .stat .v .unit { font-size: 13px; opacity: .6; margin-left: 4px; font-family: var(--font); color: #f6e7c5; font-weight: 400; }
.kpi-card .stat .delta { font-size: 11px; margin-top: 4px; }
.kpi-card .stat .delta.up { color: #87c08f; }
.kpi-card .stat .delta.down { color: #d97a7a; }
.kpi-card .btn-light {
  background: rgba(200,169,106,.16); color: var(--gilt-light); border: 1px solid rgba(200,169,106,.3);
  backdrop-filter: blur(4px);
}
.kpi-card .btn-light:hover { background: rgba(200,169,106,.28); border-color: var(--gilt); }

.kpi-card-light {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex; align-items: center; gap: 16px;
}
.kpi-card-light .icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gilt) 0%, var(--gilt-dark) 100%);
  color: var(--ink); display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.kpi-card-light .k { font-size: 12px; color: var(--muted); letter-spacing: .3px; }
.kpi-card-light .v { font-size: 24px; font-weight: 700; color: var(--ink); font-family: var(--font-serif); margin-top: 2px; }
/* ==================== 表格 ==================== */
.table { width:100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left; padding: 11px 14px; font-weight: 600;
  color: var(--muted); border-bottom: 1px solid var(--line);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px;
  background: var(--paper);
  position: sticky; top: 0; z-index: 1;
}
.table thead th.sortable { cursor: pointer; user-select: none; }
.table thead th.sortable:hover { color: var(--gilt-dark); }
.table thead th .sort-icon { margin-left: 4px; opacity: .4; font-size: 10px; }
.table thead th.sort-asc .sort-icon,
.table thead th.sort-desc .sort-icon { opacity: 1; color: var(--gilt-dark); }
.table thead th.sort-asc .sort-icon::after { content: "\25B2"; }
.table thead th.sort-desc .sort-icon::after { content: "\25BC"; }
.table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover { background: var(--cream); }
.table tbody tr.selected { background: rgba(200,169,106,.08); }
.table tbody tr.row-warn { background: rgba(179,130,26,.06); }
.table tbody tr.row-warn:hover { background: rgba(179,130,26,.12); }
.table-checkbox { width: 36px; padding-left: 14px; }
.table-actions { white-space: nowrap; }
.table-responsive { overflow-x: auto; }
.admin-table thead th { background: var(--paper); }

/* ==================== Badge & Tag ==================== */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
}
.bg-primary, .badge.bg-primary { background: rgba(200,169,106,.16); color: var(--gilt-dark); }
.bg-success, .badge.bg-success { background: rgba(74,124,82,.14); color: var(--success); }
.bg-warning, .badge.bg-warning { background: rgba(179,130,26,.14); color: var(--warning); }
.bg-danger, .badge.bg-danger { background: rgba(176,52,52,.12); color: var(--danger); }
.bg-info, .badge.bg-info { background: rgba(91,111,124,.12); color: var(--info); }
.bg-secondary, .badge.bg-secondary { background: #f0ebdc; color: var(--muted); }
.bg-ink { background: var(--ink); color: #fff; }
.bg-gilt { background: var(--gilt); color: var(--ink); }

.status-tag { font-size: 11px; padding: 3px 10px; border-radius: var(--radius-pill); font-weight: 600; }
.st-ACTIVE   { background: rgba(74,124,82,.14); color: var(--success); }
.st-INACTIVE { background: rgba(107,99,87,.12); color: var(--muted); }
.type-tag { font-size: 11px; padding: 3px 10px; border-radius: var(--radius-pill); font-weight: 600; }
.tt-FRAME      { background: rgba(200,169,106,.16); color: var(--gilt-dark); }
.tt-LENS       { background: rgba(91,111,124,.16); color: var(--info); }
.tt-SUNGLASSES { background: rgba(179,130,26,.16); color: var(--warning); }
.tt-KIDS       { background: rgba(176,52,52,.12); color: var(--danger); }
.tt-SPORTS     { background: rgba(74,124,82,.14); color: var(--success); }
.tt-READING    { background: rgba(28,28,28,.1); color: var(--ink); }
.tt-OTHER      { background: #f0ebdc; color: var(--muted); }

/* ==================== 按钮 (黑金版) ==================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer;
  transition: all .18s; white-space: nowrap;
  font-family: var(--font);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink); color: #fff;
  border-color: var(--ink);
}
.btn-primary:hover { background: #2a2620; border-color: var(--gilt); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.btn-gilt {
  background: linear-gradient(135deg, var(--gilt) 0%, var(--gilt-dark) 100%);
  color: var(--ink); border: 1px solid var(--gilt-dark);
  font-weight: 600;
}
.btn-gilt:hover { background: linear-gradient(135deg, var(--gilt-light) 0%, var(--gilt) 100%); border-color: var(--gilt-dark); }
.btn-outline-primary { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline-primary:hover { background: var(--ink); color: #fff; }
.btn-outline-secondary { border-color: var(--line); color: var(--muted); background: transparent; }
.btn-outline-secondary:hover { border-color: var(--gilt); color: var(--ink); background: var(--paper); }
.btn-outline-info { border-color: var(--info); color: var(--info); background: transparent; }
.btn-outline-info:hover { background: var(--info); color: #fff; }
.btn-outline-danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn-outline-danger:hover { background: var(--danger); color: #fff; }
.btn-outline-warning { border-color: var(--warning); color: var(--warning); background: transparent; }
.btn-outline-warning:hover { background: var(--warning); color: #fff; }
.btn-outline-success { border-color: var(--success); color: var(--success); background: transparent; }
.btn-outline-success:hover { background: var(--success); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--paper); }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-icon { padding: 6px 8px; }
.btn-block { width: 100%; justify-content: center; }

/* ==================== 表单 ==================== */
.form-control, .form-select {
  display: block; width: 100%;
  padding: 7px 12px; font-size: 13px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink);
  transition: all .15s;
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--gilt);
  box-shadow: 0 0 0 3px rgba(200,169,106,.18);
}
.form-control::placeholder { color: #a89f8b; }
.form-control-sm, .form-select-sm { padding: 5px 10px; font-size: 12.5px; }
.form-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; display: block; font-weight: 500; }
.form-label .text-danger { color: var(--danger); }
.input-group-text {
  display: flex; align-items: center;
  padding: 7px 12px; background: var(--paper);
  border: 1px solid var(--line); border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 13px; color: var(--muted);
}
.input-group .form-control { border-radius: 0 var(--radius) var(--radius) 0; }
/* ==================== Alert ==================== */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-success { background: rgba(74,124,82,.08); color: var(--success); border-color: rgba(74,124,82,.2); }
.alert-danger  { background: rgba(176,52,52,.08); color: var(--danger); border-color: rgba(176,52,52,.2); }
.alert-warning { background: rgba(179,130,26,.08); color: var(--warning); border-color: rgba(179,130,26,.2); }
.alert-info    { background: rgba(91,111,124,.08); color: var(--info); border-color: rgba(91,111,124,.2); }
.alert-gilt    { background: var(--paper); color: var(--ink); border-color: var(--gilt); border-left: 3px solid var(--gilt); }
.alert-gilt i  { color: var(--gilt); }

/* ==================== Toast ==================== */
.toast-stack {
  position: fixed; top: 16px; right: 16px; z-index: 1100;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast-item {
  background: var(--ink); color: #fff;
  border-radius: var(--radius);
  padding: 10px 16px; min-width: 240px; max-width: 360px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  border-left: 3px solid var(--gilt);
  pointer-events: auto;
  animation: toastIn .25s cubic-bezier(.16,.84,.44,1);
}
.toast-item.toast-success { border-left-color: var(--success); }
.toast-item.toast-success i { color: var(--success); }
.toast-item.toast-error { border-left-color: var(--danger); }
.toast-item.toast-error i { color: var(--danger); }
.toast-item i { color: var(--gilt); font-size: 16px; }
.toast-item .toast-msg { flex: 1; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ==================== Skeleton (骨架屏) ==================== */
.skeleton {
  background: linear-gradient(90deg, var(--paper) 0%, var(--line-soft) 50%, var(--paper) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.4s ease-in-out infinite;
  border-radius: var(--radius);
  color: transparent;
}
@keyframes skeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ==================== Empty state (空状态插画) ==================== */
.empty-state {
  text-align: center; padding: 48px 24px; color: var(--muted);
}
.empty-state .empty-icon {
  width: 80px; height: 80px; margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px dashed var(--line);
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; color: var(--gilt);
}
.empty-state .empty-title { font-size: 15px; font-weight: 600; color: var(--ink); margin-bottom: 6px; font-family: var(--font-serif); }
.empty-state .empty-desc { font-size: 13px; margin-bottom: 16px; }

/* ==================== Misc ==================== */
.progress { height: 8px; background: var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.progress-bar { height: 100%; border-radius: var(--radius); transition: width .3s; }
.progress-gilt { background: linear-gradient(90deg, var(--gilt) 0%, var(--gilt-dark) 100%); }

.row { display: flex; flex-wrap: wrap; margin-left: -12px; margin-right: -12px; }
.col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-8, .col-md-12 { padding-left: 12px; padding-right: 12px; }
.col-md-2 { width: 16.66%; }
.col-md-3 { width: 25%; }
.col-md-4 { width: 33.33%; }
.col-md-5 { width: 41.67%; }
.col-md-6 { width: 50%; }
.col-md-8 { width: 66.67%; }
.col-md-12 { width: 100%; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; }
.my-3 { margin-top: 1rem; margin-bottom: 1rem; }
.ms-1 { margin-left: .25rem; }
.ms-2 { margin-left: .5rem; }
.me-1 { margin-right: .25rem; }
.me-2 { margin-right: .5rem; }
.p-0 { padding: 0; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.mx-3 { margin-left: 1rem; margin-right: 1rem; }
.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: var(--muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-primary { color: var(--gilt-dark); }
.text-info { color: var(--info); }
.text-gilt { color: var(--gilt-dark); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fs-3 { font-size: 1.5rem; }
.fs-5 { font-size: 1.1rem; }
.small { font-size: 12px; }
.d-flex { display: flex; }
.d-none { display: none; }
.d-block { display: block; }
.justify-content-between { justify-content: space-between; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.top-0 { top: 0; }
.start-100 { left: 100%; }
.translate-middle { transform: translate(-50%, -50%); }
.rounded-pill { border-radius: 50px; }
.bg-transparent { background: transparent; }
.border-secondary { border-color: var(--line); }
/* ==================== 详情抽屉 (侧滑) ==================== */
.drawer-overlay {
  display: none; position: fixed; inset: 0; z-index: 1050;
  background: rgba(20,19,15,.5);
  animation: fadeIn .15s;
}
.drawer-overlay.show { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 560px; max-width: 100vw;
  background: #fff;
  box-shadow: -16px 0 40px rgba(0,0,0,.18);
  z-index: 1060;
  display: flex; flex-direction: column;
  animation: drawerIn .25s cubic-bezier(.16,.84,.44,1);
}
@keyframes drawerIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
.drawer-header {
  padding: 18px 24px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  background: var(--paper);
}
.drawer-header h5 {
  font-size: 16px; font-weight: 700; margin: 0;
  font-family: var(--font-serif); letter-spacing: .5px;
  display: flex; align-items: center; gap: 8px;
}
.drawer-header h5 i { color: var(--gilt); }
.drawer-close { background: none; border: none; font-size: 22px; color: var(--muted); cursor: pointer; padding: 0 4px; line-height: 1; }
.drawer-close:hover { color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 24px; }
.drawer-footer { padding: 14px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; background: var(--paper); }
.info-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; height: 100%; background: var(--paper); }
.info-block .small { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.info-block .fw-semibold { font-size: 15px; color: var(--ink); margin-top: 2px; font-family: var(--font-serif); }

/* 兼容旧 modal */
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 1050;
  background: rgba(20,19,15,.55);
  align-items: flex-start; justify-content: center;
  padding: 8vh 16px 16px; overflow-y: auto;
}
.modal-overlay.show { display: flex; }
.modal-content {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 460px; animation: modalIn .2s cubic-bezier(.16,.84,.44,1);
  border-top: 3px solid var(--gilt);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.modal-header h5 { font-size: 15px; font-weight: 700; margin: 0; font-family: var(--font-serif); }
.modal-close {
  background: none; border: none; font-size: 22px; line-height: 1;
  color: var(--muted); padding: 0 4px; cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--line);
}

/* ==================== 视图切换 (列表/卡片) ==================== */
.view-toggle {
  display: inline-flex; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2px;
}
.view-toggle button {
  background: transparent; border: none;
  padding: 5px 12px; font-size: 12.5px; color: var(--muted);
  border-radius: calc(var(--radius) - 2px); cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.view-toggle button.active { background: var(--ink); color: var(--gilt-light); }

/* 商品卡片视图 */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column;
}
.product-card:hover { border-color: var(--gilt); box-shadow: 0 8px 24px rgba(0,0,0,.08); transform: translateY(-2px); }
.product-card .card-img {
  width: 100%; aspect-ratio: 4/3;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  color: var(--gilt); font-size: 36px;
  position: relative;
}
.product-card .card-img img { width: 100%; height: 100%; object-fit: cover; }
.product-card .card-img .type-tag { position: absolute; top: 10px; left: 10px; }
.product-card .card-img .status-tag { position: absolute; top: 10px; right: 10px; }
.product-card .card-body { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.product-card .card-name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.3; }
.product-card .card-brand { font-size: 12px; color: var(--muted); }
.product-card .card-price { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.product-card .card-price .retail { font-size: 16px; font-weight: 700; color: var(--ink); font-family: var(--font-serif); }
.product-card .card-price .supply { font-size: 12px; color: var(--muted); text-decoration: line-through; }
.product-card .card-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.product-card .card-meta .low-stock { color: var(--danger); font-weight: 700; }

/* ==================== 批量操作条 ==================== */
.batch-bar {
  background: var(--ink); color: var(--gilt-light);
  border-radius: var(--radius);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  font-size: 13px;
  border-left: 3px solid var(--gilt);
  margin-bottom: 12px;
}
.batch-bar .count { font-weight: 700; font-family: var(--font-serif); }
.batch-bar .btn { background: rgba(200,169,106,.16); color: var(--gilt-light); border-color: rgba(200,169,106,.3); }
.batch-bar .btn:hover { background: rgba(200,169,106,.28); border-color: var(--gilt); color: #fff; }
.batch-bar .btn-outline-danger { background: transparent; color: #ff8a8a; border-color: rgba(255,138,138,.3); }
.batch-bar .btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* ==================== 筛选栏 ==================== */
.filter-bar { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }

/* SKU id 样式 */
.sku-id { font-family: 'JetBrains Mono', Consolas, Menlo, monospace; font-size: 12px; color: var(--muted); }

.prod-img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); }

.product-row:hover { background: var(--cream); cursor: pointer; }
.low-stock { color: var(--danger); font-weight: 700; }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .admin-sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); z-index: 1000; }
  .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-8 { width: 100%; }
  .admin-content { padding: 12px; }
  .modal-overlay { padding: 4vh 12px 12px; align-items: flex-start; }
  .drawer { width: 100vw; }
  .admin-header { padding: 0 12px; gap: 8px; }
  .admin-header .global-search { display: none; }
}

/* ==================== 布局修复 (2026-08-03) ==================== */
body { display: flex; }
body > div:first-child { flex-shrink: 0; }
.admin-sidebar { height: 100vh; }
.merchant-main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.merchant-content { flex: 1; overflow-y: auto; padding: 24px; }

/* ==================== 列控制弹窗 ==================== */
.col-control-popup {
  position: absolute; top: 100%; right: 0;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 180px; padding: 8px 0; z-index: 50;
  margin-top: 4px;
}
.col-control-popup label {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; font-size: 13px; cursor: pointer;
}
.col-control-popup label:hover { background: var(--paper); }
.col-control-popup input[type=checkbox] { accent-color: var(--gilt); }

/* ==================== 导出下拉 ==================== */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  min-width: 180px; padding: 6px 0; z-index: 50;
  display: none;
}
.dropdown.open .dropdown-menu { display: block; animation: dropIn .15s; }
@keyframes dropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 13px; cursor: pointer;
  color: var(--ink);
}
.dropdown-item:hover { background: var(--paper); }
.dropdown-item i { color: var(--gilt); width: 16px; text-align: center; }
.dropdown-divider { height: 1px; background: var(--line); margin: 4px 0; }

/* 分页 */
.pagination { display: flex; gap: 4px; align-items: center; justify-content: flex-end; padding: 12px 16px; }
.pagination button {
  min-width: 32px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line); background: #fff;
  border-radius: var(--radius); cursor: pointer;
  font-size: 13px; color: var(--ink);
}
.pagination button:hover { border-color: var(--gilt); color: var(--gilt-dark); }
.pagination button.active { background: var(--ink); color: var(--gilt-light); border-color: var(--ink); }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* MERCH-PRODUCT-TIG-002: 缩略图 + 状态开关 (黑金风) */
.td-thumb { width: 64px; padding: 6px 8px; }
.prod-thumb { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: #1a1a1a; border: 1px solid rgba(201,162,77,.3); display: flex; align-items: center; justify-content: center; }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.td-status { white-space: nowrap; }
.status-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; font-size: 12px; line-height: 1; }
.status-switch .status-toggle { position: absolute; opacity: 0; width: 0; height: 0; }
.status-switch .status-slider { position: relative; width: 36px; height: 20px; background: #4a4a4a; border-radius: 999px; transition: background .15s ease; box-shadow: inset 0 1px 2px rgba(0,0,0,.5); }
.status-switch .status-slider::before { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; background: #f5e6c8; border-radius: 50%; transition: transform .15s ease; box-shadow: 0 1px 2px rgba(0,0,0,.6); }
.status-switch .status-toggle:checked + .status-slider { background: linear-gradient(135deg, #c9a24d, #8a6a1f); }
.status-switch .status-toggle:checked + .status-slider::before { transform: translateX(16px); }
.status-switch .status-toggle:focus + .status-slider { box-shadow: 0 0 0 2px rgba(201,162,77,.4); }
.status-switch .status-text { font-size: 12px; color: #d9d9d9; min-width: 28px; }
.status-switch.st-INACTIVE .status-text { color: #9a9a9a; }
.status-switch.st-INACTIVE .status-slider { background: #2a2a2a; }
