/* ============================================================
   EOS 统一设计系统 - common.css
   布局：「厂」字结构 — 顶部导航栏 + 侧边栏 + 主内容区
   ============================================================ */

/* ----- CSS 变量（设计令牌）----- */
:root {
  --primary: #6b7280;
  --primary-dark: #4b5563;
  --primary-light: rgba(107,114,128,0.08);
  --accent: #9ca3af;
  --gradient: linear-gradient(135deg, var(--primary), var(--accent));

  --bg: #fafaf9;
  --card-bg: #ffffff;
  --text: #1c1917;
  --text-secondary: #78716c;
  --text-muted: #a8a29e;
  --border: #e7e5e4;
  --border-light: #f5f5f4;

  --success: #84cc16;
  --success-bg: #f7fee7;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --info: #3b82f6;
  --info-bg: #eff6ff;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);

  --topbar-h: 56px;
  --sidebar-w: 220px;

  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ----- 重置 & 基础 ----- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   「厂」字布局：顶部导航栏 + 侧边栏 + 主内容区
   ============================================================ */

/* 顶部导航栏 */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 200;
  gap: 16px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  min-width: var(--sidebar-w);
  margin-left: -2px;
}

.topbar-brand .brand-dot {
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  flex-shrink: 0;
}

.topbar-brand .brand-accent {
  color: var(--primary);
}

.topbar-spacer { flex: 1; }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 16px;
  transition: all .15s;
}

.topbar-btn:hover { background: var(--border-light); color: var(--text); }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  margin-left: 4px;
}

.topbar-user:hover { background: var(--border-light); }

.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.topbar-user-info { line-height: 1.3; }
.topbar-user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.topbar-user-role { font-size: 11px; color: var(--text-muted); }

.topbar-divider {
  width: 1px; height: 24px;
  background: var(--border);
  margin: 0 4px;
}

/* 侧边栏 */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  z-index: 100;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  padding: 12px 0;
  flex: 1;
}

/* 导航项 */
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-secondary);
  font-size: 13px;
  border-left: 3px solid transparent;
  margin: 1px 0;
  text-decoration: none;
}

.nav-item:hover { background: var(--primary-light); color: var(--text); }
.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

.nav-item-icon {
  width: 18px;
  text-align: center;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.6;
}
.nav-item.active .nav-item-icon { opacity: 1; }

/* 导航分组 */
.nav-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-secondary);
  font-size: 13px;
  border-left: 3px solid transparent;
  font-weight: 500;
}

.nav-group-label:hover { background: var(--primary-light); color: var(--text); }
.nav-group-label.active { color: var(--primary); border-left-color: var(--primary); font-weight: 600; }

.nav-group-arrow {
  font-size: 9px;
  opacity: 0.4;
  margin-left: auto;
  transition: transform .2s;
}
.nav-group.expanded .nav-group-arrow { transform: rotate(90deg); }

.nav-sub { display: none; }
.nav-group.expanded .nav-sub { display: block; }

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 20px 8px 44px;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-secondary);
  font-size: 13px;
  border-left: 3px solid transparent;
  text-decoration: none;
}

.nav-sub-item:hover { background: var(--primary-light); color: var(--text); }
.nav-sub-item.active {
  background: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}

/* 主内容区 */
.layout { min-height: calc(100vh - var(--topbar-h)); }

.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 24px;
  min-width: 0;
}

.container {
  width: 100%;
  margin: 0 auto;
}

.container-sm  { max-width: 900px; }
.container-md  { max-width: 1200px; }
.container-lg  { max-width: 1400px; }
.container-xl  { max-width: 1600px; }

/* ============================================================
   1. 页面标题栏（Page Header）
   ============================================================ */
.page-header {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-header-left h1 {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 2px;
}

.page-header-left p {
  color: var(--text-muted);
  font-size: 13px;
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ============================================================
   2. 核心数据栏（Stats Bar）
   ============================================================ */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: box-shadow .15s;
}

.stat-card:hover { box-shadow: var(--shadow); }

.stat-card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.stat-card-icon.blue   { background: #eef2ff; color: #4f6ef7; }
.stat-card-icon.green  { background: #ecfdf5; color: #10b981; }
.stat-card-icon.orange { background: #fff7ed; color: #f59e0b; }
.stat-card-icon.purple { background: #f5f3ff; color: #8b5cf6; }
.stat-card-icon.red    { background: #fef2f2; color: #ef4444; }

.stat-card-body { flex: 1; min-width: 0; }

.stat-card-value {
  font-size: 20px; font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.stat-card-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.stat-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--primary-light);
  border-radius: 16px;
  font-size: 12px; color: var(--primary); font-weight: 500;
}

.stat-badge strong { font-size: 14px; }

/* ============================================================
   3. 筛选条件栏（Filter Bar）
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.filter-bar select,
.filter-bar input[type="text"],
.filter-bar input[type="search"] {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}

.filter-bar select { cursor: pointer; }

.filter-bar select:focus,
.filter-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.1);
}

/* ============================================================
   4. 按钮
   ============================================================ */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1.4;
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover:not(:disabled) { background: #059669; }

.btn-danger  { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled)  { background: #dc2626; }

.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover:not(:disabled) { background: #d97706; }

.btn-info    { background: #06b6d4; color: #fff; }
.btn-info:hover:not(:disabled)    { background: #0891b2; }

.btn-purple  { background: var(--purple); color: #fff; }
.btn-purple:hover:not(:disabled)  { background: #7c3aed; }

.btn-outline {
  background: #fff; color: var(--primary);
  border: 1px solid var(--border);
}
.btn-outline:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-light); }

.btn-default {
  background: var(--bg); color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-default:hover:not(:disabled) { background: var(--border); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 5px; }
.btn-xs { padding: 3px 8px; font-size: 11px; border-radius: 4px; }
.btn-lg { padding: 10px 22px; font-size: 15px; }

.btn-edit   { background: var(--primary); color: #fff; }
.btn-edit:hover   { background: var(--primary-dark); }
.btn-preview { background: #eef2ff; color: #4f46e5; }
.btn-preview:hover { background: #e0e7ff; }
.btn-delete { background: var(--danger-bg); color: #b91c1c; }
.btn-delete:hover { background: #fecaca; }
.btn-deep-orange { background: #ea580c; color: #fff; }
.btn-deep-orange:hover:not(:disabled) { background: #c2410c; }
.btn-slate { background: #64748b; color: #fff; }
.btn-slate:hover:not(:disabled) { background: #475569; }

.btn-group {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin-bottom: 12px;
}

/* ============================================================
   5. 数据列表（Table）
   ============================================================ */
.table-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-wrapper { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th, td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

td { font-size: 13px; vertical-align: middle; text-align: center; }

th {
  background: #fafbfc;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
  text-align: center;
  position: sticky; top: 0; z-index: 2;
  border-bottom: 1px solid var(--border);
}

tbody tr:nth-child(even) { background: #fafbfc; }
tbody tr:hover { background: #f0f3ff; }

.table-center th, .table-center td { text-align: center; }

.td-actions { display: flex; gap: 4px; white-space: nowrap; justify-content: center; }

.sort-arrows {
  display: inline-flex; align-items: center; gap: 2px;
  margin-right: 4px; padding-right: 6px;
  border-right: 1px solid var(--border-light);
}
.sort-col .sort-arrows {
  margin-right: 0; padding-right: 0;
  border-right: none;
}
.sort-arrows .btn-xs { padding: 2px 5px; font-size: 11px; line-height: 1.2; min-width: auto; }
.sort-num { font-size: 12px; color: var(--text-muted); font-weight: 600; min-width: 18px; text-align: center; }

/* 表格工具栏 */
.table-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-bottom: 1px solid var(--border-light);
  background: #fafbfc; gap: 12px;
}
.toolbar-left { display: flex; align-items: center; gap: 8px; }
.toolbar-left select,
.toolbar-left input[type="text"],
.toolbar-left input[type="search"] {
  padding: 6px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 13px; background: #fff;
  color: var(--text); outline: none; transition: border-color .15s;
}
.toolbar-left select:focus,
.toolbar-left input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,.1);
}
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.toolbar-checked-info { font-size: 13px; color: var(--text-secondary); }
.toolbar-checked-info strong { color: var(--primary); }
.toolbar-page-size select {
  padding: 4px 8px; font-size: 12px; border: 1px solid var(--border);
  border-radius: 4px; background: #fff; color: var(--text-secondary);
}
.td-checkbox { width: 40px; text-align: center; }

.amount { color: #e53e3e; font-weight: 700; font-variant-numeric: tabular-nums; }

.cell-link { color: var(--primary); cursor: pointer; font-weight: 500; }
.cell-link:hover { text-decoration: underline; }

.cell-truncate {
  display: block; max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================================================
   6. 分页
   ============================================================ */
.pagination-wrap {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--border-light); background: #fafbfc;
}

.pagination-info { font-size: 13px; color: var(--text-secondary); }
.pagination-info strong { color: var(--text); }

.pagination { display: flex; align-items: center; gap: 4px; }

.pagination button {
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--border); background: #fff;
  border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--text-secondary);
  transition: all .15s;
}

.pagination button:hover:not(:disabled):not(.active) {
  border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}

.pagination button.active {
  background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600;
}

.pagination button:disabled { opacity: .4; cursor: not-allowed; }

.pagination .page-ellipsis { padding: 0 4px; color: #9ca3af; font-size: 13px; user-select: none; }

.pagination-controls { display: flex; align-items: center; gap: 8px; }
.pagination-controls select {
  padding: 5px 8px; font-size: 12px; border: 1px solid var(--border);
  border-radius: 6px; background: #fff; color: var(--text-secondary);
}

/* ============================================================
   7. 模态框（Modal）
   ============================================================ */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.45); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; opacity: 0; visibility: hidden; transition: all .2s;
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 24px; width: 90%; max-width: 500px;
  transform: translateY(-12px); transition: transform .2s;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,.15);
}

.modal-overlay.active .modal { transform: translateY(0); }

.modal-lg { max-width: 640px; }
.modal-act { max-width: 680px; }
.modal-act-wide { max-width: 920px; }
.modal-sm { max-width: 380px; }

.modal h2 { color: var(--text); font-size: 17px; margin-bottom: 18px; font-weight: 700; }

.modal-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border-light);
  display: flex; justify-content: space-between; align-items: center;
  position: sticky; top: 0; background: var(--card-bg); z-index: 1;
}

.modal-header h3 { font-size: 15px; color: var(--text); font-weight: 600; }

.modal-close-btn {
  background: none; border: none; font-size: 18px; cursor: pointer;
  color: var(--text-muted); padding: 4px 8px; border-radius: 4px; transition: all .15s;
}

.modal-close-btn:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: 16px 0; }

.modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border-light);
}

/* ============================================================
   8. 表单
   ============================================================ */
.form-group { margin-bottom: 14px; }

.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 5px;
}
.char-count {
  font-weight: 400; font-size: 12px; color: #94a3b8; margin-left: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-family: inherit;
  transition: all .15s; background: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,110,247,.1);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form-fieldset { border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px 16px 4px; margin-bottom: 14px; }
.form-fieldset legend { font-size: 13px; font-weight: 600; color: #6b7280; padding: 0 6px; }

.form-section { margin: 18px 0 10px; padding-top: 14px; border-top: 1px solid var(--border-light); }
.form-section-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 10px; }
.form-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.error-message {
  display: none; padding: 8px 12px;
  background: var(--danger-bg); color: #dc2626;
  border-radius: 6px; font-size: 12px; margin-bottom: 12px;
}
.error-message.show { display: block; }

/* ============================================================
   9. 标签 & 徽章
   ============================================================ */
.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }

.tag-blue   { background: var(--info-bg); color: #1d4ed8; }
.tag-green  { background: var(--success-bg); color: #047857; }
.tag-red    { background: var(--danger-bg); color: #b91c1c; }
.tag-orange { background: var(--warning-bg); color: #c2410c; }
.tag-purple { background: var(--purple-bg); color: #6d28d9; }
.tag-gray   { background: #f3f4f6; color: #6b7280; }

.status-badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}

.status-admin    { background: var(--purple-bg); color: #7c3aed; }
.status-user     { background: var(--info-bg); color: #2563eb; }
.status-active   { background: var(--success-bg); color: #059669; }
.status-inactive { background: var(--danger-bg); color: #dc2626; }
.status-draft   { background: #f3f4f6; color: #6b7280; }
.status-deal     { background: var(--purple-bg); color: #7c3aed; }
.status-signed   { background: var(--success-bg); color: #059669; }
.status-refunded { background: #f3f4f6; color: #6b7280; }
.status-shipped  { background: var(--warning-bg); color: #ea580c; }
.status-approved { background: #fce7f3; color: #db2777; }
.status-reconciled { background: #e0e7ff; color: #4f46e5; }
.status-rejected { background: #fee2e2; color: #dc2626; }
.status-returned { background: #fef3c7; color: #b45309; }

.disabled-badge {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 11px; background: #fef2f2; color: #b91c1c; margin-left: 6px;
}

/* ============================================================
   10. 空状态 / 加载 / 头像 / Tab …（压缩区）
   ============================================================ */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state h3 { font-size: 16px; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p { font-size: 13px; }

.avatar-img { width: 36px; height: 36px; border-radius: 4px; object-fit: cover; background: #e8e8e8; flex-shrink: 0; }
.avatar-cell { display: flex; align-items: center; gap: 8px; white-space: normal; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.tab-item {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 16px;
  cursor: pointer; font-size: 13px; background: #fff; transition: all .15s; user-select: none;
}
.tab-item:hover { border-color: var(--primary); color: var(--primary); }
.tab-item.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.loading { text-align: center; padding: 32px; color: var(--text-muted); }

tr.deleted-row { background: #fef2f2 !important; opacity: .85; }
tr.deleted-row td { color: var(--text-muted); text-decoration: line-through; }
tr.disabled-row { background: #fef2f2; }
tr.disabled-row td { color: var(--text-muted); }

/* 详情卡片 */
.info-card {
  background: var(--card-bg); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  padding: 20px 24px; margin-bottom: 14px;
}
.info-card:hover { box-shadow: var(--shadow); }

.info-card-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  margin-bottom: 14px; padding-left: 10px;
  border-left: 3px solid var(--primary); display: flex; align-items: center; gap: 8px;
}

.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }

.info-item { display: flex; align-items: baseline; gap: 8px; padding: 5px 0; font-size: 14px; }
.info-label { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.info-value { color: var(--text); word-break: break-all; }

.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 14px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--text-secondary); transition: all .15s;
}
.back-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* 复选列表 */
.checkbox-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  max-height: 180px; overflow-y: auto; padding: 8px;
  border: 1px solid var(--border); border-radius: 6px;
}
.checkbox-item {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  padding: 4px 10px; border-radius: 4px; background: #f8f9fa; cursor: pointer;
}
.checkbox-item:hover { background: #eef2ff; }
.checkbox-item input[type="checkbox"] { width: auto; cursor: pointer; }

/* 带搜索下拉 */
.select-wrap { position: relative; min-width: 200px; }
.select-wrap input {
  padding: 9px 14px; border: 1px solid var(--border); border-radius: 6px 6px 0 0;
  font-size: 13px; outline: none; width: 100%; background: #fff;
}
.select-wrap input:focus { border-color: var(--primary); }
.select-wrap .dropdown-list {
  display: none; position: absolute; top: 100%; left: 0; right: 0;
  max-height: 240px; overflow-y: auto; background: #fff;
  border: 1px solid var(--primary); border-top: none;
  border-radius: 0 0 6px 6px; z-index: 100; box-shadow: 0 6px 16px rgba(0,0,0,.1);
}
.select-wrap .dropdown-list.show { display: block; }
.select-wrap .dropdown-item {
  padding: 9px 14px; cursor: pointer; font-size: 13px;
  border-bottom: 1px solid var(--border-light); display: flex; justify-content: space-between; align-items: center;
}
.select-wrap .dropdown-item:hover { background: #f0f3ff; }
.select-wrap .dropdown-item.active { background: #eef2ff; font-weight: 600; color: var(--primary); }

/* ============================================================
   辅助类
   ============================================================ */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.text-primary{ color: var(--primary); }
.fw-bold     { font-weight: 600; }
.no-wrap     { white-space: nowrap; }
.mt-0 { margin-top: 0; }  .mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-4 { margin-bottom: 16px; }

/* ============================================================
   消息通知栏 msg-bar
   ============================================================ */
.msg-bar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  max-width: 500px;
  word-break: break-word;
}
.msg-bar.show { opacity: 1; visibility: visible; }
.msg-bar.msg-info    { background: #3b82f6; }
.msg-bar.msg-success { background: #10b981; }
.msg-bar.msg-warning { background: #f59e0b; }
.msg-bar.msg-danger  { background: #ef4444; }

/* ============================================================
   八点课堂专用样式
   ============================================================ */
.product-img { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: #e8e8e8; }
.lessons-expand { cursor: pointer; user-select: none; }
.lessons-expand:hover { color: var(--primary); }
.lesson-table { margin: 0 0 12px 0; }
.lesson-table th { background: #f0f3ff; }
.promotion-tree { margin-top: 16px; }
.promotion-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.search-select-wrap { position: relative; }
.search-select-wrap .dropdown { display: none; position: absolute; top: 100%; left: 0; right: 0; max-height: 200px; overflow-y: auto; background: #fff; border: 1px solid var(--primary); border-radius: 0 0 6px 6px; z-index: 50; }
.search-select-wrap .dropdown.show { display: block; }
.search-select-wrap .dropdown-item { padding: 8px 12px; cursor: pointer; font-size: 13px; }
.search-select-wrap .dropdown-item:hover { background: #f0f3ff; }
.toggle-wrap { display: flex; align-items: center; gap: 8px; }
.toggle-switch { position: relative; width: 40px; height: 22px; background: #ccc; border-radius: 11px; cursor: pointer; transition: background .2s; }
.toggle-switch.on { background: var(--primary); }
.toggle-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .2s; }
.toggle-switch.on::after { left: 20px; }
.cover-input-wrap { display: flex; gap: 8px; align-items: center; }
.cover-input-wrap input { flex: 1; }
.cover-input-wrap .btn-upload { flex-shrink: 0; padding: 6px 12px; font-size: 12px; border-radius: 6px; border: 1px dashed var(--primary); color: var(--primary); background: #f0f3ff; cursor: pointer; transition: all .2s; white-space: nowrap; }
.cover-input-wrap .btn-upload:hover { background: var(--primary); color: #fff; }
.cover-preview { margin-top: 8px; max-width: 200px; max-height: 120px; border-radius: 8px; overflow: hidden; border: 1px solid var(--gray-100); display: none; }
.cover-preview.show { display: block; }
.cover-preview img { width: 100%; height: auto; display: block; }
.upload-progress { display: none; height: 4px; background: var(--primary); border-radius: 2px; width: 0%; transition: width .3s; margin-top: 6px; }
.upload-progress.active { display: block; }
.material-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-height: 400px; overflow-y: auto; padding: 4px; }
.material-item { border-radius: 8px; overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: all .2s; position: relative; aspect-ratio: 16/10; background: #f5f5f5; }
.material-item:hover { border-color: var(--primary); }
.material-item.selected { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79,70,229,0.3); }
.material-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.material-item .m-name { position: absolute; bottom: 0; left: 0; right: 0; padding: 3px 6px; background: rgba(0,0,0,0.55); color: #fff; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.material-empty { text-align: center; padding: 40px; color: var(--gray-400); grid-column: 1 / -1; }
.material-search { margin-bottom: 12px; display: flex; gap: 8px; }
.material-search input { flex: 1; }
.material-toolbar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.material-toolbar .btn-upload { flex-shrink: 0; }
.selected-info { padding: 8px 12px; background: #f0fdf4; border-radius: 8px; color: #059669; font-size: 13px; display: none; margin-top: 10px; }
.selected-info.show { display: block; }


/* ========== 素材管理页面 ========== */
.material-page-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.material-page-toolbar .group-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.group-pill { padding: 4px 12px; border-radius: 14px; font-size: 12px; cursor: pointer; border: 1px solid #e5e7eb; background: #fff; color: #6b7280; transition: all .2s; white-space: nowrap; }
.group-pill:hover { border-color: var(--primary); color: var(--primary); }
.group-pill.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.material-grid-page { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.material-card { border-radius: 10px; overflow: hidden; border: 2px solid transparent; cursor: pointer; transition: all .2s; background: #f5f5f5; position: relative; }
.material-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.material-card.selected { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,0.2); }
.material-card .mc-img { width: 100%; aspect-ratio: 16/10; overflow: hidden; }
.material-card .mc-img img { width: 100%; height: 100%; object-fit: cover; }
.material-card .mc-info { padding: 6px 8px; }
.material-card .mc-name { font-size: 11px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.material-card .mc-meta { font-size: 10px; color: #9ca3af; }
.material-card .mc-check { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid #d1d5db; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.material-card.selected .mc-check { background: var(--primary); border-color: var(--primary); }

/* 素材库弹窗分组标签 */
.lib-group-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; padding-bottom: 10px; border-bottom: 1px solid #f3f4f6; }
.lib-group-tab { padding: 4px 14px; border-radius: 20px; font-size: 12px; cursor: pointer; border: 1px solid #e5e7eb; background: #fff; color: #6b7280; transition: all .2s; }
.lib-group-tab:hover,.lib-group-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ============================================================
   课程列表 - 专辑展开展示卡片
   ============================================================ */
.expand-trigger { cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; }
.expand-arrow { display: inline-block; font-size: 10px; color: var(--primary); transition: transform .2s; }


.groups-panel { margin: 10px 16px 12px; border-left: 3px solid var(--primary); border-radius: 0 6px 6px 0; background: var(--card-bg); box-shadow: 0 1px 3px rgba(0,0,0,.05); overflow: hidden; }

.groups-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--border-light); }
.groups-panel-title { font-size: 13px; font-weight: 600; color: var(--text); }

.groups-empty { text-align: center; padding: 32px 16px; color: var(--text-muted); font-size: 13px; }

.groups-table { width: 100%; border-collapse: collapse; }
.groups-table thead th { background: #fafbfc; font-size: 12px; font-weight: 600; color: var(--text-secondary); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: center; }
.groups-table tbody td { padding: 10px 14px; font-size: 13px; color: var(--text); border-bottom: 1px solid var(--border-light); vertical-align: middle; text-align: center; }
.groups-table tbody tr:nth-child(even) td { background: #fafbfc; }
.groups-table tbody tr:hover td { background: #f0f3ff; }
.groups-table tbody tr:last-child td { border-bottom: none; }

[data-nt-align="right"] .groups-panel { max-width: 520px; }

.groups-pagination { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--border-light); background: #fafbfc; font-size: 13px; color: var(--text-secondary); }

.groups-tag { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; padding: 2px 10px; border-radius: 12px; background: #eff6ff; color: #3b82f6; font-size: 12px; font-weight: 600; user-select: none; transition: background .15s; }
.groups-tag:hover { background: #dbeafe; }
.groups-tag-arrow { font-size: 10px; transition: transform .2s; }
.groups-tag-expanded .groups-tag-arrow { transform: rotate(90deg); }

.group-card { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; transition: box-shadow .15s; }
.group-card:last-child { margin-bottom: 0; }
.group-card:hover { box-shadow: 0 1px 6px rgba(0,0,0,.06); border-color: #c7d2fe; }

.group-card-main { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; flex: 1; min-width: 0; }
.group-card-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.group-card-id { font-size: 11px; color: #9ca3af; font-family: monospace; background: #f3f4f6; padding: 1px 6px; border-radius: 4px; }
.group-card-name { font-size: 14px; font-weight: 600; color: #1f2937; text-decoration: none; }
.group-card-name:hover { color: var(--primary); }
.group-card-meta { display: flex; align-items: center; gap: 10px; }

.group-card-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: 12px; }


/* ============================================================
   系统参考样式：图片编辑框（Cover / Poster Editor）
   来源：activity-editor.css  活动卡片编辑弹窗
   用途：封面上传预览 + 操作按钮行
   可复用于任何需要图片上传编辑的弹窗或表单
   ============================================================ */

/* 封面上传预览区  虚线边框 + 空状态 */
.ref-cover-preview {
  width: 100%; height: 160px; border-radius: 10px; overflow: hidden;
  border: 2px dashed #d1d5db; display: flex; align-items: center; justify-content: center;
  background: #f9fafb; position: relative; cursor: pointer; transition: border .2s;
}
.ref-cover-preview:hover { border-color: var(--primary); }
.ref-cover-preview img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; }

/* 空状态提示 */
.ref-cover-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; color: #9ca3af; font-size: 12px; }
.ref-cover-empty .icon { font-size: 28px; }

/* 上传/素材库 操作按钮行 */
.ref-cover-btns { display: flex; gap: 6px; }
.ref-cover-btns .btn-sm { flex: 1; font-size: 11px; padding: 5px 4px; border-radius: 6px; text-align: center; cursor: pointer; }
.ref-cover-btns .btn-upload { border: 1px solid var(--primary); color: var(--primary); background: #f0f3ff; }
.ref-cover-btns .btn-library { border: 1px solid #6366f1; color: #6366f1; background: #eef2ff; }
.ref-cover-url { width: 100%; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 11px; }

/* 海报预览（高级版  hover 光泽 + 蒙层） */
.ref-poster {
  width: 100%; height: 100%; min-height: 160px; position: relative; overflow: hidden; cursor: pointer;
  background: linear-gradient(150deg, #fafaf9 0%, #ffffff 40%, #f5f5f4 100%);
  border-radius: 10px; transition: background .4s ease;
}
.ref-poster:hover { background: linear-gradient(150deg, #f5f5f4 0%, #fafaf9 40%, #ffffff 100%); }
.ref-poster img {
  width: 100%; height: 100%; object-fit: contain; position: absolute; top: 0; left: 0;
  transition: transform .5s cubic-bezier(0.2,0,0,1);
}
.ref-poster:hover img { transform: scale(1.04); }

/* 海报对角光 */
.ref-poster::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,0.25) 0%, transparent 50%);
  opacity: 0; transition: opacity .3s ease;
}
.ref-poster:hover::before { opacity: 1; }

/* 海报 hover 蒙层  半透明暗底 + 白色文字 */
.ref-poster-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(75,85,99,0.85), rgba(55,65,81,0.80));
  color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: 0.6px;
  opacity: 0; transition: opacity .35s cubic-bezier(0.2,0,0,1); z-index: 2;
  text-align: center;
}
.ref-poster:hover .ref-poster-overlay { opacity: 1; }
.ref-poster-overlay .overlay-icon { font-size: 28px; line-height: 1; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1)); }
.ref-poster-overlay .overlay-text { font-size: 13px; opacity: 0.95; }

/* 海报空状态 */
.ref-poster-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: #a8a29e; font-size: 12px; gap: 8px;
  transition: color .35s ease, transform .35s ease;
}
.ref-poster:hover .ref-poster-empty { color: var(--primary); transform: scale(1.03); }
.ref-poster-empty .empty-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(107,114,128,0.05), rgba(107,114,128,0.03));
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  transition: background .35s ease, box-shadow .35s ease;
  border: 1.5px dashed rgba(107,114,128,0.15);
}
.ref-poster:hover .ref-poster-empty .empty-icon {
  background: linear-gradient(135deg, rgba(107,114,128,0.10), rgba(107,114,128,0.06));
  border-color: rgba(107,114,128,0.28);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* 海报底部：URL 输入 + 操作按钮 */
.ref-poster-meta {
  padding: 10px 10px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,0.5), rgba(107,114,128,0.02));
  border-top: 1px solid var(--border-light);
  border-radius: 0 0 10px 10px;
}
.ref-poster-meta input {
  width: 100%; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 11px; background: rgba(255,255,255,0.8); font-family: var(--font);
  transition: all .25s ease; box-sizing: border-box;
}
.ref-poster-meta input:focus {
  border-color: var(--primary); outline: none;
  box-shadow: 0 0 0 4px rgba(107,114,128,0.05); background: #fff;
}
.ref-poster-meta input::placeholder { color: var(--text-muted); font-size: 10px; }

.ref-poster-btns { display: flex; gap: 6px; }
.ref-poster-btns button {
  flex: 1; padding: 6px 6px; font-size: 11px; border-radius: 8px; cursor: pointer; font-weight: 500;
  border: none; color: var(--text-secondary); background: rgba(107,114,128,0.06);
  white-space: nowrap; transition: all .25s cubic-bezier(0.2,0,0,1); letter-spacing: 0.02em;
}
.ref-poster-btns button:hover {
  background: var(--primary); color: #fff;
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(107,114,128,0.25);
}
.ref-poster-btns button:active { transform: translateY(0) scale(0.97); }

/* ============================================================
   系统参考样式：双选/三选切换按钮组（Pill Toggle Group）
   来源：activity-editor.css  活动卡片编辑弹窗
   用途：将 radio 渲染为药丸式按钮组，替代原生 radio
   支持 2 选、3 选等任意数量选项
   ============================================================ */

/* 药丸容器（包装层） */
.pill-toggle {
  display: flex; gap: 3px; padding: 3px; width: fit-content;
  background: var(--border-light); border-radius: 10px;
}

/* 单个药丸按钮  隐藏原始 input */
.pill-radio {
  display: flex; align-items: center; gap: 2px;
  padding: 4px 12px; border-radius: 8px;
  font-size: 12px; color: var(--text-muted); cursor: pointer; white-space: nowrap;
  border: none; background: var(--card-bg);
  transition: all .25s cubic-bezier(0.2,0,0,1);
  user-select: none; font-weight: 500;
}
.pill-radio:hover { color: var(--text); background: var(--bg); }
.pill-radio input { display: none; }

/* 选中态 */
.pill-radio.active {
  color: #fff; background: #8faa94; font-weight: 600;
  box-shadow: 0 1px 4px rgba(143,170,148,0.3);
}

/* 按下的反馈 */
.pill-radio:active { transform: scale(0.95); }

/* === 大小变体 === */

/* 活动编辑  自定义行内 DateInput 撑满 */
.row-cus-wrap > div { width: 100% !important; }
.row-cus-wrap > div > input[type="text"] { box-sizing: border-box; }
.pill-toggle-sm { gap: 2px; padding: 2px; border-radius: 8px; }
.pill-toggle-sm .pill-radio { padding: 3px 8px; font-size: 11px; border-radius: 6px; }




/* ===== 活动管理表格新样式 ===== */
.act-info-cell { text-align: left !important; white-space: normal !important; min-width: 280px; }
.act-info-row { display: flex; align-items: flex-start; gap: 12px; }
.act-info-row .product-img { width: 52px; height: 52px; border-radius: 8px; flex-shrink: 0; }
.act-txt-wrap { flex: 1; min-width: 0; }
.act-txt-title { font-weight: 700; color: var(--text); font-size: 14px; line-height: 1.4; word-break: break-all; }
.act-txt-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Key-Value: 标签在上，值在下 */
.act-kv { margin: 4px 0; }
.act-kv + .act-kv { margin-top: 8px; }
.act-kv-label { display: block; font-size: 11px; color: var(--text-muted); font-weight: 500; margin-bottom: 2px; text-align: center; }
.act-kv-val { display: block; font-size: 13px; color: var(--text); font-weight: 600; text-align: center; }
.act-status-cell { display: flex !important; justify-content: center; }
