/* ============================================================
   现代简约后台管理系统 - 全局样式
   ============================================================ */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-hover: #dc2626;

  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --text-4: #cbd5e1;

  --bg-body: #f5f7fa;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  --bg-active: #eff6ff;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.04);
  --shadow: 0 1px 3px 0 rgba(0,0,0,0.06), 0 1px 2px -1px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.05);

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --sidebar-w: 220px;
  --sidebar-w-collapsed: 64px;
  --header-h: 60px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }
input, textarea, select { font-family: inherit; outline: none; }

/* ============================================================
   登录页
   ============================================================ */
.login-page {
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f7fa 50%, #f0fdf4 100%);
  background-size: cover;
  background-position: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
/* 用户上传了登录页背景图时:用图片做底,加一层暗色叠加保证卡片对比度 */
.login-page.login-page--has-bg {
  background-color: #0f172a;
}
.login-page.login-page--has-bg::before,
.login-page.login-page--has-bg::after { display: none; }
.login-page.login-page--has-bg .login-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}
.login-page::before {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,0.10), transparent 70%);
  top: -150px; left: -150px;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(16,185,129,0.08), transparent 70%);
  bottom: -200px; right: -200px;
}

.login-card {
  position: relative;
  width: 400px;
  max-width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  z-index: 1;
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  margin: 0 auto 16px;
  font-size: 24px;
  font-weight: 700;
  overflow: hidden;
}
.login-logo.has-image { background: transparent; }
.login-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}
.login-sub {
  text-align: center;
  color: var(--text-3);
  margin-bottom: 28px;
  font-size: 13px;
}
.login-form .form-item { margin-bottom: 16px; }
.login-form .input { width: 100%; }
.login-form[hidden] { display: none; }

/* 登录方式 Tab */
.login-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-body);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.login-tab {
  flex: 1;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  background: transparent;
  cursor: pointer;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.login-tab:hover { color: var(--text-1); }
.login-tab.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 短信验证码输入行(输入框 + 发送按钮) */
.login-sms-row {
  display: flex;
  gap: 8px;
}
.login-sms-row .input {
  flex: 1;
  min-width: 0;
}
.login-sms-btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-width: 110px;
}
.login-sms-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.login-tips-sms { background: rgba(245, 158, 11, 0.08); }
.login-tips-sms b { color: var(--text-1); }
.login-tips {
  margin-top: 16px;
  padding: 12px;
  background: var(--primary-light);
  border-radius: var(--radius);
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ============================================================
   主框架
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: #fff;
  border-right: 1px solid var(--border);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  transition: width .25s ease;
}
.sidebar-logo {
  height: var(--header-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-light);
}
.sidebar-logo-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  overflow: hidden;
}
.sidebar-logo-icon.has-image { background: transparent; }
.sidebar-logo-icon img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.sidebar-logo-text {
  font-size: 15px; font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-menu { flex: 1; padding: 12px 8px; overflow-y: auto; }

/* 菜单分组(可折叠) */
.menu-group { margin-bottom: 2px; }
.menu-group-title {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-3);
  padding: 12px 12px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  transition: color .15s;
  text-align: left;
}
.menu-group-title:hover { color: var(--text-2); }
.menu-group-title:hover .menu-group-chevron { color: var(--primary); }
.menu-group-chevron {
  flex-shrink: 0;
  color: var(--text-4);
  transition: transform .2s ease, color .15s;
}
.menu-group.collapsed .menu-group-chevron { transform: rotate(-90deg); }

.menu-group-items {
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.menu-group.collapsed .menu-group-items {
  max-height: 0 !important;
}

.menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.menu-item:hover { background: var(--bg-hover); color: var(--text-1); }
.menu-item.active {
  background: var(--bg-active);
  color: var(--primary);
  font-weight: 500;
}
.menu-item .icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-user {
  position: relative;
  border-top: 1px solid var(--border-light);
  padding: 8px;
}
.user-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: background-color .15s;
  color: var(--text-1);
}
.user-trigger:hover { background: var(--bg-hover); }
.user-trigger.open { background: var(--bg-hover); }
.user-trigger-arrow {
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform .2s;
}
.user-trigger.open .user-trigger-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
  overflow: hidden;
}
.user-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.user-meta { flex: 1; min-width: 0; text-align: left; }
.user-name {
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.user-role {
  font-size: 11px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 弹出菜单 - 向上弹出 */
.user-popup {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 8px;
  right: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 4px;
  z-index: 110;
  animation: userPopupIn .15s ease-out;
}
.user-popup[hidden] { display: none; }
@keyframes userPopupIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.user-popup-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-1);
  font-size: 13px;
  cursor: pointer;
  transition: background-color .15s, color .15s;
  text-align: left;
}
.user-popup-item svg { color: var(--text-3); flex-shrink: 0; transition: color .15s; }
.user-popup-item:hover { background: var(--bg-hover); color: var(--primary); }
.user-popup-item:hover svg { color: var(--primary); }
.user-popup-item.danger:hover { background: rgba(239, 68, 68, 0.08); color: var(--danger); }
.user-popup-item.danger:hover svg { color: var(--danger); }
.user-popup-divider {
  height: 1px;
  background: var(--border-light);
  margin: 4px 6px;
}

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin-left .25s ease;
}
.topbar {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.topbar-collapse-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  transition: background-color .15s, color .15s;
  flex-shrink: 0;
}
.topbar-collapse-btn:hover { background: var(--bg-hover); color: var(--primary); }
.topbar-collapse-btn svg .collapse-arrow { transition: transform .25s ease; transform-origin: 12.5px 12px; }
body.sidebar-collapsed .topbar-collapse-btn svg .collapse-arrow { transform: rotate(180deg); }

.topbar-title { font-size: 16px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   侧边栏折叠态(桌面端 ≥ 769px)
   ============================================================ */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .main    { margin-left: var(--sidebar-w-collapsed); }

/* logo 文字隐藏,图标居中 */
body.sidebar-collapsed .sidebar-logo {
  justify-content: center;
  padding: 0 8px;
  gap: 0;
}
body.sidebar-collapsed .sidebar-logo-text { display: none; }

/* 菜单分组标题:icon-only 折叠后变成短分隔线 */
body.sidebar-collapsed .menu-group-title {
  font-size: 0;
  padding: 0;
  height: 1px;
  background: var(--border-light);
  margin: 8px 14px;
  letter-spacing: 0;
  cursor: default;
  pointer-events: none;
}
body.sidebar-collapsed .menu-group-chevron { display: none; }
/* icon-only 下,分组的折叠态被忽略,菜单项始终可见 */
body.sidebar-collapsed .menu-group.collapsed .menu-group-items {
  max-height: none !important;
}

/* 菜单项:仅图标 + 居中,文字隐藏 */
body.sidebar-collapsed .menu-item {
  justify-content: center;
  padding: 10px 8px;
  position: relative;
}
body.sidebar-collapsed .menu-item span { display: none; }

/* 折叠态悬浮 tooltip(右侧飞出) */
body.sidebar-collapsed .menu-item:hover::after {
  content: attr(data-title);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--text-1);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 200;
  pointer-events: none;
  animation: sbTipIn .12s ease-out;
}
body.sidebar-collapsed .menu-item:hover::before {
  content: '';
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: var(--text-1);
  z-index: 200;
  pointer-events: none;
}
@keyframes sbTipIn {
  from { opacity: 0; transform: translate(-4px, -50%); }
  to   { opacity: 1; transform: translate(0, -50%); }
}

/* 用户区:头像居中,昵称/角色/箭头隐藏 */
body.sidebar-collapsed .sidebar-user { padding: 8px; }
body.sidebar-collapsed .user-trigger {
  justify-content: center;
  padding: 6px;
  gap: 0;
}
body.sidebar-collapsed .user-meta,
body.sidebar-collapsed .user-trigger-arrow { display: none; }

/* 折叠态用户弹窗:不再向上铺满,改为向右飞出 */
body.sidebar-collapsed .user-popup {
  bottom: 8px;
  left: calc(100% + 8px);
  right: auto;
  width: 180px;
}

/* ============================================================
   全局搜索 (Global Search)
   ============================================================ */
.global-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-body);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 10px 0 12px;
  height: 36px;
  width: 280px;
  transition: background-color .15s, border-color .15s, box-shadow .15s, width .2s;
}
.global-search:hover { background: var(--bg-hover); }
.global-search.open,
.global-search:focus-within {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10);
  width: 360px;
}
.global-search .gs-icon {
  color: var(--text-3);
  flex-shrink: 0;
  transition: color .15s;
}
.global-search:focus-within .gs-icon { color: var(--primary); }
.gs-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  height: 100%;
  color: var(--text-1);
  min-width: 0;
}
.gs-input::placeholder { color: var(--text-3); }
.gs-shortcut {
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-3);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 1px 6px;
  border-radius: 5px;
  user-select: none;
}
.gs-clear {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--text-3);
  color: #fff;
  flex-shrink: 0;
  transition: background-color .15s;
}
.gs-clear:hover { background: var(--text-2); }
.gs-clear[hidden] { display: none; }

/* 下拉结果面板 */
.gs-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 460px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 70;
  animation: gsDropdownIn .15s ease-out;
}
.gs-dropdown[hidden] { display: none; }
@keyframes gsDropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.gs-section {
  padding: 4px 0;
}
.gs-section + .gs-section { border-top: 1px solid var(--border-light); }
.gs-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  padding: 6px 10px 2px;
  font-weight: 600;
}
.gs-section-count {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
  background: var(--bg-body);
  padding: 1px 6px;
  border-radius: 999px;
  text-transform: none;
  letter-spacing: 0;
}

.gs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .12s;
}
.gs-item.is-active,
.gs-item:hover {
  background: var(--primary-light);
}
.gs-item.is-disabled { opacity: 0.55; }

.gs-item-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center; justify-content: center;
  color: #fff;
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(15, 23, 42, 0.08);
}
.gs-item-icon--avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.gs-item-text {
  flex: 1;
  min-width: 0;
}
.gs-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gs-item-sub {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.gs-item-tag {
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg-body);
  padding: 2px 8px;
  border-radius: 4px;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gs-item-tag--module {
  font-family: inherit;
  background: var(--primary-light);
  color: var(--primary);
}
.gs-item-flag {
  display: inline-block;
  font-size: 10.5px;
  color: var(--danger);
  background: rgba(239, 68, 68, 0.10);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 500;
}
.gs-item-arrow {
  color: var(--text-3);
  font-size: 12px;
  opacity: 0;
  transition: opacity .15s;
  flex-shrink: 0;
}
.gs-item.is-active .gs-item-arrow,
.gs-item:hover .gs-item-arrow {
  opacity: 1;
  color: var(--primary);
}

.gs-hl {
  background: rgba(245, 158, 11, 0.20);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  font-weight: 600;
}

.gs-empty {
  text-align: center;
  padding: 28px 16px 22px;
  color: var(--text-3);
}
.gs-empty-icon {
  font-size: 28px;
  margin-bottom: 4px;
  opacity: 0.4;
}
.gs-empty-text {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.gs-empty-tip {
  font-size: 11.5px;
  margin-top: 4px;
  color: var(--text-3);
}

.gs-foot {
  display: flex;
  gap: 14px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--border-light);
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}
.gs-foot kbd {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  padding: 0 4px;
  border-radius: 3px;
  margin-right: 4px;
}

@media (max-width: 768px) {
  .global-search { width: 200px; }
  .global-search.open,
  .global-search:focus-within { width: 240px; }
  .gs-dropdown { width: 92vw; right: -8px; }
  .gs-shortcut { display: none; }
}

/* ============================================================
   多页签栏 (Tag-View)
   ============================================================ */
.tabs-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 49;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 1px 0 0 rgba(15, 23, 42, 0.02);
}
.tabs-bar-scroll {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tabs-bar-scroll::-webkit-scrollbar { display: none; }
.tabs-bar-list {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  white-space: nowrap;
}
.tab-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 6px 0 11px;
  border-radius: 999px;
  background: var(--bg-body);
  border: 1px solid transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, box-shadow .15s;
  user-select: none;
}
.tab-chip:hover {
  background: var(--bg-hover);
  color: var(--text-1);
  border-color: var(--border-light);
}
.tab-chip.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.18);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.10);
}
.tab-chip.active::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.16);
  margin-right: 2px;
}
.tab-chip .tab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: currentColor;
}
.tab-chip .tab-icon svg {
  width: 14px !important;
  height: 14px !important;
}
.tab-chip .tab-label {
  display: inline-block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tab-chip .tab-close {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 14px;
  line-height: 1;
  transition: background-color .15s, color .15s;
}
.tab-chip:hover .tab-close { color: var(--text-2); }
.tab-chip .tab-close:hover {
  background: var(--danger);
  color: #fff;
}
.tab-chip.is-fixed { padding-right: 12px; }
.tab-chip.is-fixed .tab-close { display: none; }

.tabs-bar-actions {
  position: relative;
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  border-left: 1px solid var(--border-light);
  padding-left: 8px;
  height: 28px;
  align-items: center;
}
.tabs-bar-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--text-3);
  transition: background-color .15s, color .15s;
}
.tabs-bar-btn:hover { background: var(--bg-hover); color: var(--primary); }
.tabs-bar-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 140px;
  padding: 4px;
  z-index: 60;
}
.tabs-bar-menu[hidden] { display: none; }
.tabs-menu-item {
  padding: 7px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-1);
}
.tabs-menu-item:hover { background: var(--bg-hover); color: var(--primary); }

.content { padding: 20px 24px; flex: 1; }
.page { display: none; }
.page.active { display: block; animation: fadeIn .2s; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   通用组件
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 20px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  background: #fff;
  color: var(--text-1);
  border: 1px solid var(--border);
  transition: all .15s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--text-3); background: var(--bg-hover); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger {
  background: #fff; color: var(--danger); border-color: #fecaca;
}
.btn-danger:hover { background: #fef2f2; border-color: var(--danger); }
.btn-text {
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 13px;
}
.btn-text:hover { color: var(--primary-hover); background: var(--primary-light); }
.btn-text.danger { color: var(--danger); }
.btn-text.danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* 输入框 */
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-1);
  transition: all .15s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.10);
}
.input::placeholder { color: var(--text-4); }
.textarea { resize: vertical; min-height: 80px; }

/* 表单 */
.form-item { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.form-label .req { color: var(--danger); margin-left: 2px; }
.form-tip { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.form-row .form-item { flex: 1; min-width: 200px; margin-bottom: 0; }

/* 工具栏 */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.toolbar .input, .toolbar .select { width: 200px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}
.table th {
  background: #fafbfc;
  color: var(--text-2);
  font-weight: 500;
  font-size: 13px;
}
.table tbody tr:hover { background: var(--bg-hover); }
.table .actions { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.table-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.table-empty .icon { font-size: 40px; margin-bottom: 8px; opacity: .4; }

/* 标签 */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.tag-success { background: #d1fae5; color: #065f46; }
.tag-warning { background: #fef3c7; color: #92400e; }
.tag-danger  { background: #fee2e2; color: #991b1b; }
.tag-info    { background: #dbeafe; color: #1e40af; }
.tag-gray    { background: #f1f5f9; color: #475569; }

/* 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 38px; height: 20px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0;
  background: #cbd5e1;
  border-radius: 20px;
  cursor: pointer;
  transition: .2s;
}
.switch .slider::before {
  content: '';
  position: absolute;
  height: 16px; width: 16px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: .2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* 复选框组(权限) */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafbfc;
}
.checkbox-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}
.checkbox-item input { accent-color: var(--primary); }

/* ============================================================
   Tab 标签页
   ============================================================ */
.tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  gap: 4px;
  background: #fff;
}
.tab-item {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s;
  user-select: none;
}
.tab-item:hover { color: var(--text-1); }
.tab-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ============================================================
   树形表格(权限管理)
   ============================================================ */
.tree-cell { display: flex; align-items: center; }
.tree-toggle {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  flex-shrink: 0;
  transition: transform .15s;
  user-select: none;
}
.tree-toggle.expanded { transform: rotate(90deg); color: var(--primary); }
.tree-toggle.leaf { visibility: hidden; }
.tree-icon {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 4px;
  color: var(--text-3);
  flex-shrink: 0;
}
.tree-icon.menu { color: #f59e0b; }
.tree-icon.action { color: #10b981; }
.tree-name { font-weight: 500; }
.tree-name.menu { font-weight: 600; color: var(--text-1); }
.tree-row.hidden { display: none; }

/* ============================================================
   树形权限选择(角色编辑器)
   ============================================================ */
.perm-tree {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fafbfc;
  max-height: 380px;
  overflow-y: auto;
  padding: 8px 0;
}
.perm-tree-actions {
  display: flex; gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 6px;
  background: #f1f5f9;
}
.perm-tree-actions .link {
  font-size: 12px; color: var(--primary);
  cursor: pointer; user-select: none;
  padding: 2px 8px; border-radius: 4px;
}
.perm-tree-actions .link:hover { background: var(--primary-light); }
.perm-tree ul {
  list-style: none; margin: 0; padding: 0;
}
.perm-tree li { padding: 0; }
.perm-tree-node {
  display: flex; align-items: center;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  border-radius: 4px;
  margin: 0 6px;
}
.perm-tree-node:hover { background: var(--bg-hover); }
.perm-tree-node .tree-toggle {
  margin-right: 4px;
}
.perm-tree-node input[type=checkbox] {
  margin: 0 6px 0 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.perm-tree-node .node-key {
  margin-left: 8px;
  font-size: 11px;
  color: var(--text-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.perm-tree-children { padding-left: 22px; }
.perm-tree-children.collapsed { display: none; }

/* 分页 */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-3);
  flex-wrap: wrap; gap: 10px;
}
.pager { display: flex; gap: 4px; }
.pager-btn {
  min-width: 32px; height: 32px;
  padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-2);
  font-size: 13px;
}
.pager-btn:hover { border-color: var(--primary); color: var(--primary); }
.pager-btn.active {
  background: var(--primary);
  color: #fff; border-color: var(--primary);
}
.pager-btn:disabled { opacity: .5; cursor: not-allowed; }

/* 弹窗 */
.modal-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.40);
  z-index: 200;
  align-items: center; justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; animation: fadeIn .15s; }
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%; max-width: 540px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal.large { max-width: 720px; }
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-close {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.modal-close:hover { background: var(--bg-hover); color: var(--text-1); }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex; justify-content: flex-end; gap: 8px;
}

/* 消息提示 */
.toast-container {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 10px 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border-left: 3px solid var(--primary);
  font-size: 14px;
  min-width: 200px;
  animation: slideIn .25s;
  display: flex; align-items: center; gap: 8px;
}
.toast.success { border-left-color: var(--success); }
.toast.error   { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast .icon {
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
  flex-shrink: 0;
}
.toast.success .icon { background: var(--success); }
.toast.error .icon   { background: var(--danger); }
.toast.warning .icon { background: var(--warning); }
.toast .icon-default { background: var(--primary); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 确认对话框 */
.confirm-text { font-size: 14px; color: var(--text-2); line-height: 1.6; }

/* 仪表盘 */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  display: flex; align-items: center; gap: 14px;
}
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #dbeafe; color: #2563eb; }
.stat-icon.green  { background: #d1fae5; color: #059669; }
.stat-icon.orange { background: #fed7aa; color: #ea580c; }
.stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-label { color: var(--text-3); font-size: 13px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text-1); margin-top: 2px; }

/* loading */
.loading {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 多行信息单元格 - 对象存储/短信模板共用 */
.s3-table td, .tpl-table td, .user-table td, .role-table td { vertical-align: middle; }
.s3-info, .tpl-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.s3-info-row, .tpl-info-row {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  min-width: 0;
}
.s3-info-label, .tpl-info-label {
  color: var(--text-3);
  font-size: 11px;
  letter-spacing: 0.3px;
  background: var(--bg-2, #f8fafc);
  padding: 2px 8px;
  border-radius: 4px;
  text-align: center;
  white-space: nowrap;
}
.s3-info-value, .tpl-info-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: transparent;
  color: var(--text-1, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.s3-info-muted, .tpl-info-muted { color: var(--text-2, #475569); font-size: 12px; }
.s3-info-link {
  color: var(--primary);
  text-decoration: none;
}
.s3-info-link:hover { text-decoration: underline; }
.s3-info-copy {
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-3);
  width: 24px; height: 24px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: all .15s;
  padding: 0;
}
.s3-info-copy:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* 模板信息列: 名称用更大字号且非等宽 */
.tpl-info-name {
  font-family: inherit;
  font-size: 14px;
  color: var(--text-1, #0f172a);
}
.tpl-content {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-1, #0f172a);
  white-space: normal;
  word-break: break-all;
  max-width: 460px;
}
.tpl-params {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

/* 用户列表: 头像+昵称单元格 */
.user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.user-avatar-mini {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.08);
}
.user-avatar-mini img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 头像上传卡片(用户表单顶部) */
.avatar-uploader {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: 8px;
  margin-bottom: 16px;
}
.avatar-uploader-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  font-weight: 600;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.12);
}
.avatar-uploader-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.avatar-uploader-letter { line-height: 1; }
.avatar-uploader-meta { flex: 1; min-width: 0; }
.avatar-uploader-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1, #0f172a);
  margin-bottom: 4px;
}
.avatar-uploader-tip {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.avatar-uploader-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 角色管理 - 卡片式行 */
.role-table tbody tr { transition: background-color .15s ease; }
.role-table tbody tr:hover { background-color: rgba(99, 102, 241, 0.04); }

.role-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding: 4px 0;
}
.role-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 4px 10px rgba(99, 102, 241, 0.18);
}
.role-icon--super  { background: linear-gradient(135deg, #f59e0b, #ef4444); box-shadow: 0 4px 10px rgba(239, 68, 68, 0.22); }
.role-icon--blue   { background: linear-gradient(135deg, #3b82f6, #06b6d4); box-shadow: 0 4px 10px rgba(14, 165, 233, 0.22); }
.role-icon--green  { background: linear-gradient(135deg, #10b981, #14b8a6); box-shadow: 0 4px 10px rgba(16, 185, 129, 0.22); }
.role-icon--purple { background: linear-gradient(135deg, #8b5cf6, #d946ef); box-shadow: 0 4px 10px rgba(139, 92, 246, 0.22); }
.role-icon--orange { background: linear-gradient(135deg, #f59e0b, #fb923c); box-shadow: 0 4px 10px rgba(251, 146, 60, 0.22); }
.role-icon--pink   { background: linear-gradient(135deg, #ec4899, #f43f5e); box-shadow: 0 4px 10px rgba(236, 72, 153, 0.22); }

.role-card-body { flex: 1; min-width: 0; }
.role-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.role-card-title strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1, #0f172a);
  letter-spacing: 0.2px;
}
.role-card-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--bg-2, #f1f5f9);
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.role-card-desc {
  font-size: 12.5px;
  color: var(--text-2, #475569);
  line-height: 1.5;
  white-space: normal;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 权限列 - 数字 + 副标 / 全权限药丸 */
.role-perms { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.role-perms-num {
  font-size: 11px;
  color: var(--text-3);
  display: inline-flex; align-items: baseline; gap: 2px;
}
.role-perms-num strong {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  font-feature-settings: "tnum";
}
.role-perms-num .muted { font-size: 12px; color: var(--text-3); margin-left: 2px; }
.role-perms-sub {
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--bg-2, #f1f5f9);
  padding: 2px 8px;
  border-radius: 4px;
  align-self: center;
}
.role-perm-pill--all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #ec4899, #8b5cf6);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.2);
  letter-spacing: 0.3px;
}

/* 创建时间 - 双行 */
.role-time { display: flex; flex-direction: column; gap: 2px; line-height: 1.4; }
.role-time-date {
  font-size: 13px;
  color: var(--text-1, #0f172a);
  font-weight: 500;
  font-feature-settings: "tnum";
}
.role-time-clock {
  font-size: 11px;
  color: var(--text-3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.user-cell-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.user-cell-name {
  font-weight: 600;
  color: var(--text-1, #0f172a);
  font-size: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.user-cell-nick {
  color: var(--text-3);
  font-size: 12px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 联系方式 - 邮箱/手机 双行 */
.contact-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2, #475569);
  line-height: 1.7;
  min-width: 0;
}
.contact-line .contact-ico {
  color: var(--text-3);
  width: 14px;
  flex-shrink: 0;
  display: inline-flex;
  justify-content: center;
}

/* 时间 双行 */
.time-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  line-height: 1.6;
}
.time-stack-row { color: var(--text-2, #475569); white-space: nowrap; }
.time-stack-label {
  color: var(--text-3);
  font-size: 11px;
  margin-right: 6px;
  background: var(--bg-2, #f8fafc);
  padding: 1px 6px;
  border-radius: 3px;
  display: inline-block;
  min-width: 32px;
  text-align: center;
}

/* 多个表 - 操作按钮胶囊化(共用) */
.s3-table td.actions,
.tpl-table td.actions,
.user-table td.actions,
.role-table td.actions,
.shop-table td.actions {
  display: table-cell;     /* 覆盖全局 .table .actions 的 flex,恢复表格单元格语义 */
  vertical-align: middle;  /* 多行内容时按钮垂直居中 */
  white-space: normal;
}
.s3-actions-inner,
.tpl-actions-inner,
.user-actions-inner,
.role-actions-inner,
.shop-actions-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.s3-table .actions .btn-text,
.tpl-table .actions .btn-text,
.user-table .actions .btn-text,
.role-table .actions .btn-text,
.shop-table .actions .btn-text {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.4;
  transition: all .15s ease;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}
.s3-table .actions .btn-text:hover,
.tpl-table .actions .btn-text:hover,
.user-table .actions .btn-text:hover,
.role-table .actions .btn-text:hover,
.shop-table .actions .btn-text:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}
/* 主操作按钮(每页"主要动作"用蓝底高亮) */
.s3-table .actions .btn-text[data-act="files"],
.s3-table .actions .btn-text[data-act="set-default"],
.tpl-table .actions .btn-text[data-act="edit"],
.user-table .actions .btn-text[data-act="edit"],
.role-table .actions .btn-text[data-act="edit"],
.shop-table .actions .btn-text[data-act="edit"] {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}
.s3-table .actions .btn-text[data-act="files"]:hover,
.s3-table .actions .btn-text[data-act="set-default"]:hover,
.tpl-table .actions .btn-text[data-act="edit"]:hover,
.user-table .actions .btn-text[data-act="edit"]:hover,
.role-table .actions .btn-text[data-act="edit"]:hover,
.shop-table .actions .btn-text[data-act="edit"]:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.s3-table .actions .btn-text.danger,
.tpl-table .actions .btn-text.danger,
.user-table .actions .btn-text.danger,
.role-table .actions .btn-text.danger,
.shop-table .actions .btn-text.danger {
  color: var(--danger);
  border-color: #fecaca;
  background: #fff;
}
.s3-table .actions .btn-text.danger:hover,
.tpl-table .actions .btn-text.danger:hover,
.user-table .actions .btn-text.danger:hover,
.role-table .actions .btn-text.danger:hover,
.shop-table .actions .btn-text.danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* ============================================================
   样式管理页(Logo / 登录背景)
   ============================================================ */
.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 20px;
}
.style-section {
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.style-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin: 0 0 4px;
}
.style-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
}
.style-section-desc {
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.6;
  margin: 0 0 14px;
}

/* 通用预览卡片框架 */
.style-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

/* 侧边栏 logo 预览 */
.style-preview--sidebar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 60px;
}
.style-preview--sidebar .style-preview-icon {
  width: 36px; height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}
.style-preview--sidebar .style-preview-icon.has-image { background: transparent; }
.style-preview--sidebar .style-preview-icon img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.style-preview--sidebar .style-preview-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-1);
}

/* 登录页预览(微缩) */
.style-preview--login {
  height: 240px;
  background: linear-gradient(135deg, #eef2ff 0%, #f5f7fa 50%, #f0fdf4 100%);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.style-preview--login.has-bg { background-color: #0f172a; }
.style-preview--login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.15));
  pointer-events: none;
}
.style-preview-login-card {
  position: relative;
  background: rgba(255,255,255,0.96);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 18px 24px;
  text-align: center;
  width: 240px;
  backdrop-filter: saturate(180%) blur(6px);
  -webkit-backdrop-filter: saturate(180%) blur(6px);
}
.style-preview-login-logo {
  width: 38px; height: 38px;
  margin: 0 auto 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
}
.style-preview-login-logo.has-image { background: transparent; }
.style-preview-login-logo img { width: 100%; height: 100%; object-fit: cover; }
.style-preview-login-title { font-size: 15px; font-weight: 600; color: var(--text-1); }
.style-preview-login-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* 上传操作行 */
.style-upload-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.form-tip-inline { font-size: 11px; color: var(--text-3); font-weight: 400; margin-left: 6px; }
.style-url {
  margin-top: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--bg-card);
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.style-meta {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-3);
  text-align: right;
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: #cbd5e1; border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* 响应式 */
@media (max-width: 768px) {
  :root { --sidebar-w: 200px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: var(--sidebar-w); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .content { padding: 14px; }
  .toolbar .input, .toolbar .select { width: 100%; }
  .form-row .form-item { min-width: 100%; }

  /* 移动端不应用桌面折叠样式(回滑式抽屉) */
  body.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
  body.sidebar-collapsed .main { margin-left: 0; }
  body.sidebar-collapsed .sidebar-logo-text,
  body.sidebar-collapsed .menu-item span,
  body.sidebar-collapsed .user-meta,
  body.sidebar-collapsed .user-trigger-arrow { display: revert; }
  body.sidebar-collapsed .menu-item { justify-content: flex-start; padding: 10px 12px; }
  body.sidebar-collapsed .menu-item:hover::after,
  body.sidebar-collapsed .menu-item:hover::before { content: none; display: none; }
  body.sidebar-collapsed .menu-group-title {
    font-size: 11px; height: auto; background: transparent;
    padding: 12px 12px 6px; margin: 0; letter-spacing: 0.5px;
  }
  body.sidebar-collapsed .user-popup { bottom: calc(100% + 4px); left: 8px; right: 8px; width: auto; }
}

/* ============================================================
   商城 - 店铺管理
   ============================================================ */
.shop-thumb {
  width: 64px; height: 64px;
  border-radius: var(--radius);
  background: var(--bg-hover);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-light);
}
.shop-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-thumb--empty,
.shop-thumb--broken {
  color: var(--text-3);
  font-size: 11px;
  background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 6px, #f1f5f9 6px, #f1f5f9 12px);
}

.shop-cell { display: flex; flex-direction: column; gap: 2px; }
.shop-cell strong { font-size: 14px; color: var(--text-1); }
.shop-cell-id { font-size: 11px; color: var(--text-3); font-family: ui-monospace, Menlo, Consolas, monospace; }

.shop-addr {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 13px; color: var(--text-2);
  min-width: 0;
}
.shop-addr-text {
  word-break: break-all;
}
.shop-geo { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shop-geo code {
  font-size: 11px;
  color: var(--text-2);
  background: var(--bg-hover);
  padding: 1px 6px;
  border-radius: 4px;
}
.shop-desc {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  word-break: break-all;
}

/* 经营设置(起送 / 自动接单)标签 */
.shop-biz {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.shop-min-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #fcd34d;
}
.shop-min-tag--off {
  color: var(--text-3);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  font-weight: 500;
}
.shop-auto-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
}
.shop-auto-tag.on {
  color: #166534;
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border: 1px solid #86efac;
}
.shop-auto-tag.off {
  color: var(--text-3);
  background: var(--bg-hover);
  border: 1px solid var(--border);
  font-weight: 500;
}

/* 表单内行内开关(店铺自动接单等) */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
  margin-top: 4px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #cbd5e1;
  transition: background-color .25s;
  border-radius: 26px;
}
.switch .slider::before {
  content: "";
  position: absolute;
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background: #fff;
  transition: transform .25s;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.switch input:checked + .slider {
  background: linear-gradient(135deg, #f59e0b, #f97316);
}
.switch input:checked + .slider::before {
  transform: translateX(22px);
}

/* ============================================================
   商城 - 商品分类管理(店铺手风琴)
   ============================================================ */
.cat-shoplist {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  padding-top: 0;
}

.cat-shop-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  transition: box-shadow .15s, border-color .15s;
}
.cat-shop-card:hover { border-color: var(--text-4); }
.cat-shop-card.is-open {
  box-shadow: var(--shadow-md);
  border-color: #bfdbfe;
}

.cat-shop-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background-color .15s;
}
.cat-shop-header:hover { background: var(--bg-hover); }
.cat-shop-card.is-open .cat-shop-header {
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
  border-bottom: 1px solid var(--border-light);
}

.cat-shop-chevron {
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform .2s ease;
}
.cat-shop-card.is-open .cat-shop-chevron {
  transform: rotate(90deg);
  color: var(--primary);
}

.cat-shop-thumb {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}
.cat-shop-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-shop-thumb--empty,
.cat-shop-thumb--broken {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
}

.cat-shop-meta {
  flex: 1;
  min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.cat-shop-name {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px;
  color: var(--text-1);
  flex-wrap: wrap;
}
.cat-shop-sub {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cat-shop-count {
  flex-shrink: 0;
  display: flex; align-items: baseline; gap: 4px;
  font-size: 13px;
  color: var(--text-2);
  padding: 2px 10px;
  background: var(--bg-body);
  border-radius: 999px;
}
.cat-shop-count strong {
  font-size: 16px;
  color: var(--text-1);
  font-weight: 700;
}
.cat-shop-count span { color: var(--text-3); font-size: 12px; }

/* 折叠/展开主体 */
.cat-shop-body {
  display: none;
  padding: 4px 16px 16px;
  animation: fadeIn .18s;
}
.cat-shop-card.is-open .cat-shop-body { display: block; }

.cat-empty {
  padding: 36px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
}

/* 分类内表格 */
.cat-table { font-size: 13px; }
.cat-name-cell {
  display: inline-flex; align-items: center; gap: 8px;
}
.cat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
  font-size: 16px;
}
.cat-icon--empty { color: var(--text-4); font-weight: 600; }
.cat-id {
  font-size: 11px;
  color: var(--text-3);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.cat-actions-inner {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}

/* 表单 - 一行一项的纵向布局 */
.cat-form { display: flex; flex-direction: column; gap: 14px; }
.cat-form .form-item { width: 100%; }
.cat-form-shop {
  padding: 8px 12px;
  background: var(--primary-light);
  border-radius: 6px;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-2);
}
.cat-form-shop strong { color: var(--primary); font-size: 14px; }
.cat-form-shop span {
  color: var(--text-3);
  font-size: 12px;
}

/* 表单 - 图标输入 + emoji 选择器 */
.cat-icon-field {
  display: flex; align-items: center; gap: 8px;
}
.cat-icon-field .input { flex: 1; }
.cat-icon-preview {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 22px;
  line-height: 1;
}
.cat-icon-preview.is-empty {
  color: var(--text-4);
  font-size: 16px;
  font-weight: 600;
}
.emoji-picker {
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 12px;
  background: var(--bg-body);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.emoji-picker::-webkit-scrollbar { width: 8px; }
.emoji-picker::-webkit-scrollbar-thumb {
  background: var(--border); border-radius: 999px;
}
.emoji-group + .emoji-group { margin-top: 10px; }
.emoji-group-title {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 4px;
  letter-spacing: .5px;
}
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(34px, 1fr));
  gap: 4px;
}
.emoji-cell {
  height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  line-height: 1;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  transition: all .12s;
}
.emoji-cell:hover {
  background: var(--primary-light);
  transform: scale(1.1);
}
.emoji-cell.is-active {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 6px rgba(59,130,246,.4);
}

/* 分类表 - 复用胶囊化操作按钮(对齐其他模块) */
.cat-table td.actions {
  display: table-cell;
  vertical-align: middle;
  white-space: normal;
}
.cat-table .actions .btn-text {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.4;
  transition: all .15s ease;
}
.cat-table .actions .btn-text:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}
.cat-table .actions .btn-text[data-act="edit"] {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #bfdbfe;
}
.cat-table .actions .btn-text[data-act="edit"]:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.cat-table .actions .btn-text.danger {
  color: var(--danger);
  border-color: #fecaca;
}
.cat-table .actions .btn-text.danger:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

.shop-image-uploader {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px;
  background: var(--bg-hover);
  border-radius: var(--radius);
  border: 1px dashed var(--border);
}
.shop-image-preview {
  width: 140px; height: 140px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-light);
}
.shop-image-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-image-empty { color: var(--text-3); font-size: 12px; }
.shop-image-meta { flex: 1; min-width: 0; }
.shop-image-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

/* ============================================================
   库存中心 - 库存管理(双面板:左树 + 右商品)
   ============================================================ */
.inv-layout {
  display: flex;
  min-height: 600px;
  background: #fff;
}
.inv-sider {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-body);
  display: flex; flex-direction: column;
}
.inv-sider-tools { padding: 12px; border-bottom: 1px solid var(--border-light); }
.input-sm { height: 32px; font-size: 13px; }
.inv-tree { flex: 1; overflow-y: auto; padding: 6px; }
.inv-tree-empty { padding: 24px 12px; color: var(--text-3); font-size: 13px; text-align: center; }

.inv-tree-shop { margin-bottom: 4px; }
.inv-tree-shop-header {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  transition: background-color .12s;
}
.inv-tree-shop-header:hover { background: var(--bg-hover); }
.inv-tree-shop-header .chevron {
  flex-shrink: 0;
  color: var(--text-3);
  transition: transform .15s ease;
}
.inv-tree-shop.is-open .inv-tree-shop-header .chevron { transform: rotate(90deg); color: var(--primary); }
.inv-tree-shop-header .shop-thumb {
  width: 22px; height: 22px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.inv-tree-shop-header .shop-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inv-tree-shop-header .shop-thumb--empty { background: linear-gradient(135deg, var(--primary), #8b5cf6); }
.inv-tree-shop-header .shop-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-tree-shop-header .shop-count {
  flex-shrink: 0; font-size: 11px;
  color: var(--text-3);
  background: var(--bg-card);
  padding: 1px 8px; border-radius: 999px;
  border: 1px solid var(--border);
}
.inv-tree-cats { display: none; padding: 4px 0 8px 22px; }
.inv-tree-shop.is-open .inv-tree-cats { display: block; }
.inv-tree-cat {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  transition: all .12s;
}
.inv-tree-cat:hover { background: var(--bg-hover); }
.inv-tree-cat.is-active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}
.inv-tree-cat.is-active .cat-count {
  background: rgba(255,255,255,.25);
  color: #fff;
  border-color: transparent;
}
.inv-tree-cat .cat-emoji { width: 18px; text-align: center; }
.inv-tree-cat .cat-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-tree-cat .cat-count {
  flex-shrink: 0; font-size: 11px;
  color: var(--text-3);
  background: var(--bg-card);
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  line-height: 16px;
}
.inv-tree-cat-empty {
  padding: 6px 10px;
  font-size: 12px;
  color: var(--text-4);
  font-style: italic;
}

.inv-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.inv-cur {
  font-size: 13px;
  color: var(--text-3);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 4px;
}
.inv-bc { color: var(--text-2); }
.inv-bc-sep { color: var(--text-4); }
.inv-bc.current { color: var(--primary); font-weight: 600; }

.inv-low {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px;
  color: var(--text-2);
  padding: 0 4px;
  cursor: pointer;
  user-select: none;
}
.inv-low input { cursor: pointer; }
.inv-low:has(input:disabled) { opacity: .5; cursor: not-allowed; }

/* 右侧表格 */
.inv-cover {
  width: 60px; height: 60px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center;
}
.inv-cover img { width: 100%; height: 100%; object-fit: cover; }
.inv-cover-fallback { font-size: 26px; opacity: .5; }
.inv-name { display: flex; align-items: baseline; gap: 8px; }
.inv-id { color: var(--text-3); font-size: 11px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.inv-imgs { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.inv-desc {
  font-size: 12px; color: var(--text-3);
  margin-top: 4px;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.inv-price {
  display: flex; align-items: baseline; gap: 4px;
  font-size: 15px; font-weight: 700; color: var(--text-1);
}
.inv-cost {
  display: flex; align-items: baseline; gap: 4px;
  font-size: 12px; color: var(--text-2);
  margin-top: 1px;
}
.inv-cost i { color: var(--text-4); font-style: normal; font-size: 12px; }
.inv-price .lbl, .inv-cost .lbl {
  display: inline-block;
  min-width: 28px;
  font-size: 10px;
  color: var(--text-3);
  background: var(--bg-body);
  padding: 0 5px;
  border-radius: 3px;
  font-weight: 500;
  line-height: 16px;
  text-align: center;
}
.inv-cost .lbl { background: #fef3c7; color: #b45309; }
.inv-unit { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.inv-stock { display: flex; align-items: baseline; gap: 4px; }
.inv-stock strong { font-size: 18px; color: var(--success); font-weight: 700; }
.inv-stock span { font-size: 11px; color: var(--text-3); }
.inv-stock--low strong { color: var(--warning); }
.inv-stock--zero strong { color: var(--danger); }
.inv-total { display: flex; align-items: baseline; gap: 4px; }
.inv-total strong { font-size: 14px; color: var(--text-2); }
.inv-total span { font-size: 11px; color: var(--text-4); }

/* 库存表 - 复用胶囊化操作按钮(对齐其他模块) */
.inv-table td.actions {
  display: table-cell;
  vertical-align: middle;
  white-space: normal;
}
.inv-actions-inner {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
}
.inv-table .actions .btn-text {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.4;
  transition: all .15s ease;
}
.inv-table .actions .btn-text:hover {
  background: var(--primary-light); color: var(--primary); border-color: #bfdbfe;
}
.inv-table .actions .btn-text.inv-in {
  background: #dcfce7; color: var(--success); border-color: #bbf7d0;
}
.inv-table .actions .btn-text.inv-in:hover { background: var(--success); color: #fff; border-color: var(--success); }
.inv-table .actions .btn-text.inv-out {
  background: #fef3c7; color: #b45309; border-color: #fde68a;
}
.inv-table .actions .btn-text.inv-out:hover { background: var(--warning); color: #fff; border-color: var(--warning); }
.inv-table .actions .btn-text[data-act="edit"] {
  background: var(--primary-light); color: var(--primary); border-color: #bfdbfe;
}
.inv-table .actions .btn-text[data-act="edit"]:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.inv-table .actions .btn-text.danger { color: var(--danger); border-color: #fecaca; }
.inv-table .actions .btn-text.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* 商品表单 */
.inv-form { display: flex; flex-direction: column; gap: 14px; }
.inv-form .form-row { display: flex; gap: 14px; }
.inv-form .form-row .form-item { flex: 1; }
.inv-form-cur {
  padding: 8px 12px;
  background: var(--primary-light);
  border-radius: 6px;
  font-size: 13px; color: var(--text-2);
  display: flex; align-items: center; gap: 6px;
}
.inv-form-cur strong { color: var(--primary); font-size: 14px; }
.inv-form-cur span { color: var(--text-3); }
.inv-input-with-suffix { position: relative; }
.inv-input-with-suffix .input { padding-right: 36px; }
.inv-input-with-suffix .suffix {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); font-size: 13px; pointer-events: none;
}

/* 多图上传 */
.inv-uploader {
  display: grid;
  grid-template-columns: repeat(auto-fill, 90px);
  gap: 10px;
  padding: 10px;
  background: var(--bg-body);
  border-radius: 8px;
  border: 1px dashed var(--border);
  min-height: 110px;
}
.inv-up-item {
  position: relative;
  width: 90px; height: 90px;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--border);
}
.inv-up-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.inv-up-cover {
  position: absolute; top: 0; left: 0;
  background: var(--primary); color: #fff;
  font-size: 10px; padding: 2px 6px;
  border-bottom-right-radius: 6px;
}
.inv-up-mask {
  position: absolute; inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center; gap: 6px;
  opacity: 0; transition: opacity .15s;
}
.inv-up-item:hover .inv-up-mask { opacity: 1; }
.inv-up-mask button {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.95);
  color: var(--text-1);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.inv-up-mask button:hover { background: #fff; transform: scale(1.1); }
.inv-up-add {
  width: 90px; height: 90px;
  border-radius: 6px;
  border: 1px dashed var(--border);
  background: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-3);
  font-size: 12px;
  transition: all .15s;
}
.inv-up-add:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.inv-up-add > span:first-of-type { font-size: 24px; line-height: 1; margin-bottom: 4px; }

/* 库存调整弹窗 */
.inv-stock-form { display: flex; flex-direction: column; gap: 14px; }
.inv-stock-info {
  padding: 10px 12px;
  background: var(--bg-body);
  border-radius: 6px;
  display: flex; flex-direction: column; gap: 4px;
}
.inv-stock-info .line { display: flex; gap: 8px; font-size: 13px; }
.inv-stock-info .line span { color: var(--text-3); }
.inv-stock-info .line strong { color: var(--text-1); }
.inv-stock-after {
  padding: 10px 12px;
  background: var(--primary-light);
  border-radius: 6px;
  font-size: 13px; color: var(--text-2);
  display: flex; flex-direction: column; gap: 4px;
}
.inv-stock-after .line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.inv-stock-after .line span:first-child { color: var(--text-3); }
.inv-stock-after strong { color: var(--primary); font-size: 16px; padding: 0 4px; font-weight: 700; }
.inv-stock-after .line:first-child strong { font-size: 18px; }

.inv-form-readonly {
  padding: 10px 12px;
  background: var(--bg-body);
  border-radius: 6px;
  font-size: 13px; color: var(--text-2);
  display: flex; flex-direction: column; gap: 4px;
}
.inv-form-readonly .line {
  display: flex; align-items: baseline; gap: 8px;
}
.inv-form-readonly .line span { color: var(--text-3); min-width: 110px; }
.inv-form-readonly .line strong { color: var(--text-1); }

/* ============================================================
   配置中心 - 易联云打印机
   ============================================================ */
.yily-token-card {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-body);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
}
.yily-token-card .line {
  display: flex; gap: 10px; padding: 3px 0;
  align-items: baseline;
}
.yily-token-card .line span:first-child { color: var(--text-3); min-width: 110px; }
.yily-token-card .line strong { color: var(--text-1); }

.yily-shop-cell { display: flex; align-items: center; gap: 8px; }
.yily-shop-thumb {
  width: 28px; height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-hover);
  display: inline-flex; align-items: center; justify-content: center;
}
.yily-shop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.yily-shop-letter {
  width: 100%; height: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: #fff; font-size: 12px; font-weight: 700;
}
.yily-name { font-weight: 600; color: var(--text-1); }
.yily-mc, .yily-msign {
  font-size: 12px; color: var(--text-3); margin-top: 2px;
}
.yily-mc code, .yily-msign code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.yily-test-time { font-size: 12px; color: var(--text-2); }
.yily-test-result { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.yily-test-empty { font-size: 12px; color: var(--text-4); }

.yily-table td.actions { display: table-cell; vertical-align: middle; white-space: normal; }
.yily-actions-inner { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.yily-table .actions .btn-text {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px; line-height: 1.4;
  transition: all .15s ease;
}
.yily-table .actions .btn-text:hover {
  background: var(--primary-light); color: var(--primary); border-color: #bfdbfe;
}
.yily-table .actions .btn-text.yily-print {
  background: #dcfce7; color: var(--success); border-color: #bbf7d0;
}
.yily-table .actions .btn-text.yily-print:hover {
  background: var(--success); color: #fff; border-color: var(--success);
}
.yily-table .actions .btn-text[data-act="edit"] {
  background: var(--primary-light); color: var(--primary); border-color: #bfdbfe;
}
.yily-table .actions .btn-text[data-act="edit"]:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.yily-table .actions .btn-text.danger { color: var(--danger); border-color: #fecaca; }
.yily-table .actions .btn-text.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ============================================================
   配置中心 - 微信支付
   ============================================================ */
.wxp-key-area {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.6;
  resize: vertical; min-height: 110px;
}
.wxp-warn {
  margin-top: 8px; padding: 10px 12px;
  font-size: 12px; line-height: 1.7; color: #92400e;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1px solid #fde68a; border-left: 3px solid #f59e0b;
  border-radius: 6px;
}
.wxp-warn strong { color: #78350f; }
.wxp-warn u { text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================
   配置中心 - 小程序基础(AppID + AppSecret)
   ============================================================ */
.mp-intro {
  padding: 16px 18px;
  margin-bottom: 18px;
  font-size: 13px; line-height: 1.8; color: #334155;
  background: linear-gradient(135deg, #f0f9ff, #ecfeff);
  border: 1px solid #bae6fd; border-radius: 8px;
}
.mp-intro strong { color: #0c4a6e; }
.mp-feat {
  display: inline-block; margin: 0 6px; padding: 2px 10px;
  font-size: 12px; color: #0369a1;
  background: #fff; border: 1px solid #bae6fd; border-radius: 999px;
}
.mp-tip-line { color: #64748b; font-size: 12px; }

.mp-help {
  margin-top: 10px; padding: 14px 18px;
  background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.mp-help-title { font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 8px; }
.mp-help-list { margin: 0; padding-left: 22px; font-size: 12px; line-height: 1.9; color: #475569; }
.mp-help-list strong { color: #0f172a; }
.mp-help-list a { color: #0369a1; text-decoration: underline; }

.mp-status-bar {
  margin-top: 16px; padding: 12px 16px;
  font-size: 13px; line-height: 1.6; border-radius: 8px;
}
.mp-status-bar strong { font-weight: 700; }
.mp-status-ok {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  color: #15803d; border: 1px solid #bbf7d0;
}
.mp-status-warn {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  color: #92400e; border: 1px solid #fde68a;
}

/* mp 自检结果弹窗 */
.mp-test-result { font-size: 13px; line-height: 1.8; }
.mp-test-row {
  display: flex; padding: 8px 0;
  border-bottom: 1px dashed #e5e7eb;
}
.mp-test-row .lbl { width: 130px; color: #64748b; }
.mp-test-row .val {
  flex: 1; color: #0f172a; font-family: ui-monospace, Menlo, Consolas, monospace;
  word-break: break-all;
}
.mp-test-tip {
  margin-top: 12px; padding: 10px 12px; font-size: 12px;
  border-radius: 6px;
}
.mp-test-tip-ok { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.mp-test-tip-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; font-weight: 600; }
.mp-test-tip code {
  background: rgba(0,0,0,.06); padding: 1px 6px;
  border-radius: 4px; font-size: 12px;
}

/* ============================================================
   会员管理(小程序注册用户)
   ============================================================ */
.wxu-summary { padding: 8px 4px 14px; font-size: 13px; color: #64748b; }
.wxu-table th, .wxu-table td { vertical-align: middle; }
.wxu-table .col-actions { white-space: nowrap; }
.wxu-table .col-actions .btn { margin-right: 4px; }

.wxu-avatar { width: 40px; height: 40px; border-radius: 50%;
  object-fit: cover; background: #f1f5f9; }
.wxu-avatar-empty { display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; color: #94a3b8; }
.wxu-nick { font-weight: 600; color: #0f172a; }
.wxu-phone { font-family: ui-monospace, Menlo, Consolas, monospace; color: #0f172a; }
.wxu-no-phone { color: #94a3b8; font-size: 12px; }
.wxu-openid { font-size: 11px; color: #475569;
  background: #f1f5f9; padding: 2px 8px; border-radius: 4px; }
.wxu-meta-sub { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.wxu-remark { display: inline-block; max-width: 220px;
  font-size: 12px; line-height: 1.4; color: #334155;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #fffbeb; padding: 3px 8px; border-radius: 4px;
  border: 1px solid #fde68a; }

/* 详情弹窗 */
.wxu-detail .wxu-d-head { display: flex; gap: 16px; align-items: flex-start;
  padding-bottom: 18px; border-bottom: 1px solid #f1f5f9; margin-bottom: 18px; }
.wxu-d-avatar { width: 88px; height: 88px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0; background: #f1f5f9;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #94a3b8; }
.wxu-d-base { flex: 1; min-width: 0; }
.wxu-d-nick { font-size: 20px; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.wxu-d-line { font-size: 13px; color: #334155; line-height: 1.9; }
.wxu-d-line .muted { color: #94a3b8; }
.wxu-d-line code { background: #f1f5f9; padding: 1px 6px; border-radius: 4px;
  font-size: 12px; color: #475569; }

.wxu-d-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-bottom: 16px; }
.wxu-stat-card { padding: 16px; border-radius: 10px;
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0; text-align: center; }
.wxu-stat-card.success {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5); border-color: #bbf7d0; }
.wxu-stat-card .num { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.1; }
.wxu-stat-card.success .num { color: #15803d; }
.wxu-stat-card .lbl { font-size: 12px; color: #64748b; margin-top: 6px; }

.wxu-d-buckets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.wxu-stat-pill { font-size: 12px; padding: 4px 10px;
  background: #f1f5f9; color: #334155; border-radius: 999px; }
.wxu-stat-pill strong { color: #0f172a; margin-right: 4px; }

.wxu-d-section-title { font-size: 14px; font-weight: 600; color: #334155;
  margin-bottom: 10px; }
.wxu-d-table th, .wxu-d-table td { font-size: 12px; padding: 8px 10px; }
.wxu-d-table code { font-size: 11px; }

/* 滤板 */
.filter-bar { display: flex; gap: 10px; align-items: center; padding: 6px 4px 14px;
  flex-wrap: wrap; }
.filter-bar .filter-input { width: 220px; height: 34px; }
.wxp-token-card {
  margin-top: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  font-size: 13px;
}
.wxp-token-card .line {
  display: flex; gap: 10px; padding: 3px 0; align-items: baseline;
}
.wxp-token-card .line span:first-child { color: var(--text-3); min-width: 140px; }
.wxp-token-card .line strong {
  color: var(--text-1);
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
}

.wxp-shop-cell { display: flex; align-items: center; gap: 8px; }
.wxp-shop-thumb {
  width: 28px; height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-hover);
  display: inline-flex; align-items: center; justify-content: center;
}
.wxp-shop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.wxp-shop-letter {
  width: 100%; height: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff; font-size: 12px; font-weight: 700;
}
.wxp-mch { font-weight: 600; color: var(--text-1); font-family: ui-monospace, Menlo, Consolas, monospace; }
.wxp-mch-name { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.wxp-appid { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--text-2); }
.wxp-mode-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: #ecfdf5; color: #059669; border: 1px solid #bbf7d0;
  margin-left: 8px; vertical-align: middle;
}
.wxp-mode-pill.sp { background: #eff6ff; color: #2563eb; border-color: #bfdbfe; }

.wxp-table td.actions { display: table-cell; vertical-align: middle; white-space: normal; }
.wxp-actions-inner { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.wxp-table .actions .btn-text {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px; line-height: 1.4;
  transition: all .15s ease;
}
.wxp-table .actions .btn-text:hover {
  background: var(--primary-light); color: var(--primary); border-color: #bfdbfe;
}
.wxp-table .actions .btn-text[data-act="edit"] {
  background: var(--primary-light); color: var(--primary); border-color: #bfdbfe;
}
.wxp-table .actions .btn-text[data-act="edit"]:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.wxp-table .actions .btn-text.danger { color: var(--danger); border-color: #fecaca; }
.wxp-table .actions .btn-text.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ============================================================
   订单管理
   ============================================================ */
.ord-stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px; padding: 16px; background: linear-gradient(135deg, #f0f9ff, #f5f3ff);
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px;
}
.ord-stat-cell {
  display: flex; flex-direction: column; gap: 4px;
  background: #fff; padding: 12px 14px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
}
.ord-stat-cell span { color: var(--text-3); font-size: 12px; }
.ord-stat-cell strong { font-size: 22px; font-weight: 700; color: var(--text-1); }
.ord-stat-cell strong.ord-stat-todo { color: var(--warning); }

.ord-tabs {
  display: flex; gap: 4px; border-bottom: 1px solid var(--border);
  margin-bottom: 12px; padding: 0 4px;
}
.ord-tab {
  padding: 10px 16px; cursor: pointer; color: var(--text-2);
  font-size: 14px; border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s ease;
}
.ord-tab:hover { color: var(--primary); }
.ord-tab.active {
  color: var(--primary); border-bottom-color: var(--primary); font-weight: 600;
}
.ord-tab .cnt {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 18px; padding: 0 6px;
  background: #fee2e2; color: var(--danger); font-size: 11px; font-weight: 600;
  border-radius: 9px;
}
.ord-tab.active .cnt { background: var(--primary-light); color: var(--primary); }

/* 列表表格 */
.ord-table { font-size: 13px; }
.ord-table th { background: var(--bg-hover); }
.ord-table td { vertical-align: middle; }
.ord-no { font-weight: 600; color: var(--text-1); }
.ord-no code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; background: var(--bg-hover); padding: 2px 6px; border-radius: 4px;
}
.ord-time { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.ord-shop { font-weight: 600; color: var(--text-1); margin-bottom: 4px; }
.ord-items { color: var(--text-1); line-height: 1.5; }
.ord-qty { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.ord-phone { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.ord-amt { font-weight: 700; color: var(--text-1); font-size: 15px; }
.ord-paid { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* 状态徽标 */
.ord-status {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
.ord-status--warn { background: #fef3c7; color: #92400e; }
.ord-status--todo { background: #fef3c7; color: #b45309; box-shadow: 0 0 0 2px rgba(245,158,11,0.15); animation: ord-todo-pulse 2s ease-in-out infinite; }
.ord-status--info { background: #dbeafe; color: #1e40af; }
.ord-status--success { background: #d1fae5; color: #047857; }
.ord-status--mute { background: #f1f5f9; color: var(--text-3); }
.ord-status--danger { background: #fee2e2; color: var(--danger); }

@keyframes ord-todo-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(245,158,11,0.15); }
  50% { box-shadow: 0 0 0 6px rgba(245,158,11,0.05); }
}

/* 整行可点击进详情(空白处兜底) */
.ord-table .ord-row { cursor: pointer; }
.ord-table .ord-row td { transition: background-color .12s ease; }

/* 操作按钮 - 紧凑且大点击区,事件委托保证 gap 不再是死区 */
.ord-table td.actions {
  display: table-cell; vertical-align: middle; white-space: normal;
  padding: 8px 12px;
}
.ord-actions-inner {
  display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
  /* 让 inner 占满 td,gap 区域也能落在 inner 上,事件委托能命中最近按钮 */
}
.ord-table .actions .btn-text {
  padding: 5px 11px;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-2);
  font-size: 12px; line-height: 1.4;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  cursor: pointer;
  /* 阻断行 click 由按钮直接处理(委托用 closest 仍能命中) */
}
.ord-table .actions .btn-text:hover {
  background: var(--primary-light); color: var(--primary); border-color: #bfdbfe;
}
.ord-table .actions .btn-text:active { transform: translateY(0.5px); }
.ord-table .actions .btn-text.ord-accept {
  background: #fef3c7; color: #92400e; border-color: #fde68a;
}
.ord-table .actions .btn-text.ord-accept:hover {
  background: var(--warning); color: #fff; border-color: var(--warning);
}
.ord-table .actions .btn-text.ord-ready {
  background: var(--primary-light); color: var(--primary); border-color: #bfdbfe;
}
.ord-table .actions .btn-text.ord-ready:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
}
.ord-table .actions .btn-text.ord-success {
  background: #dcfce7; color: var(--success); border-color: #bbf7d0;
}
.ord-table .actions .btn-text.ord-success:hover {
  background: var(--success); color: #fff; border-color: var(--success);
}
.ord-table .actions .btn-text.danger { color: var(--danger); border-color: #fecaca; }
.ord-table .actions .btn-text.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* 详情弹窗 */
.ord-detail { padding-top: 4px; }
.ord-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0 16px; border-bottom: 1px dashed var(--border);
}
.ord-detail-no code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 14px; font-weight: 600;
  background: var(--bg-hover); padding: 4px 10px; border-radius: var(--radius-sm);
}
.ord-detail-meta { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.ord-detail-status { display: flex; align-items: center; gap: 8px; }

/* 时间线 */
.ord-timeline {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 0; padding: 28px 12px 12px; position: relative;
}
.ord-tl-step { position: relative; text-align: center; padding: 0 6px; }
.ord-tl-step .dot {
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2px solid var(--border);
  margin: 0 auto 8px;
  position: relative; z-index: 2;
}
.ord-tl-step::before {
  content: ''; position: absolute; top: 6px; left: -50%; right: 50%; height: 2px;
  background: var(--border); z-index: 1;
}
.ord-tl-step:first-child::before { display: none; }
.ord-tl-step.is-reached .dot { background: var(--success); border-color: var(--success); }
.ord-tl-step.is-reached + .ord-tl-step::before,
.ord-tl-step.is-reached::before { background: var(--success); }
.ord-tl-step .label { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.ord-tl-step.is-reached .label { color: var(--text-1); }
.ord-tl-step .time { font-size: 11px; color: var(--text-3); }

.ord-timeline.is-cancel .ord-tl-step.is-reached .dot { background: var(--text-3); border-color: var(--text-3); }
.ord-timeline.is-cancel .ord-tl-step.is-reached::before,
.ord-timeline.is-cancel .ord-tl-step.is-reached + .ord-tl-step::before { background: var(--text-3); }
.ord-timeline.is-refund .ord-tl-step.is-reached .dot { background: var(--danger); border-color: var(--danger); }
.ord-timeline.is-refund .ord-tl-step.is-reached::before,
.ord-timeline.is-refund .ord-tl-step.is-reached + .ord-tl-step::before { background: var(--danger); }

.ord-banner {
  margin: 12px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px;
}
.ord-banner--cancel { background: #f1f5f9; color: var(--text-2); border-left: 3px solid var(--text-3); }
.ord-banner--refund { background: #fee2e2; color: #b91c1c; border-left: 3px solid var(--danger); }

.ord-section { margin-top: 18px; }
.ord-section-title {
  font-size: 13px; font-weight: 700; color: var(--text-1);
  margin-bottom: 10px; padding-left: 10px; border-left: 3px solid var(--primary);
}

.ord-customer-card {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px;
  padding: 12px 16px; background: var(--bg-hover); border-radius: var(--radius-sm);
  font-size: 13px;
}
.ord-customer-card span { color: var(--text-3); margin-right: 6px; }
.ord-customer-card code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  background: #fff; padding: 1px 6px; border-radius: 4px;
}

.ord-it-table th { background: var(--bg-hover); font-size: 12px; }
.ord-it-table td { padding: 10px 12px; }
.ord-it-img {
  width: 44px; height: 44px; border-radius: 6px; object-fit: cover; display: block;
}
.ord-it-img--empty {
  width: 44px; height: 44px; border-radius: 6px; background: var(--bg-hover);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.ord-it-name { font-weight: 600; color: var(--text-1); }
.ord-it-spec { font-size: 11px; color: var(--text-3); margin-top: 2px; }

.ord-amount-card {
  background: var(--bg-hover); border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 13px;
}
.ord-amount-card .line {
  display: flex; justify-content: space-between; padding: 5px 0;
}
.ord-amount-card .line span { color: var(--text-3); }
.ord-amount-card .line code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
  background: #fff; padding: 1px 6px; border-radius: 4px;
}
.ord-amount-card .line.is-total {
  border-top: 1px dashed var(--border); margin-top: 4px; padding-top: 10px;
}
.ord-amount-card .line.is-total span { color: var(--text-1); font-weight: 600; }
.ord-amount-card .line.is-total strong {
  font-size: 18px; color: var(--danger);
}

.ord-remark-card {
  background: var(--bg-hover); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px;
}
.ord-remark-card .line { display: flex; gap: 8px; margin-bottom: 6px; }
.ord-remark-card .line span { color: var(--text-3); flex-shrink: 0; min-width: 70px; }
.ord-remark-card .line div { color: var(--text-1); flex: 1; word-break: break-all; }

.ord-logs {
  background: var(--bg-hover); border-radius: var(--radius-sm); padding: 8px 14px; font-size: 12px;
  max-height: 200px; overflow-y: auto;
}
.ord-log-item { padding: 4px 0; color: var(--text-2); display: flex; flex-wrap: wrap; gap: 6px; }
.ord-log-item .t { color: var(--text-3); }
.ord-log-item .a { color: var(--primary); font-weight: 600; }
.ord-log-item .o { color: var(--text-1); }
.ord-log-item .r { color: var(--text-2); flex-basis: 100%; padding-left: 86px; }

/* 模拟下单弹窗 */
.ord-sim .form-row {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
}
.ord-sim .form-row > .form-item:only-child { grid-column: 1 / -1; }
.ord-sim-products {
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  padding: 8px; background: var(--bg-hover); min-height: 80px;
}
.ord-sim-empty {
  text-align: center; color: var(--text-3); font-size: 13px; padding: 20px;
}
.ord-sim-item {
  display: grid; grid-template-columns: 1fr auto auto auto auto; align-items: center;
  gap: 10px; padding: 8px 12px; background: #fff; border-radius: 6px; margin-bottom: 6px;
  font-size: 13px;
}
.ord-sim-item:last-child { margin-bottom: 0; }
.ord-sim-price { font-size: 12px; color: var(--text-3); }
.ord-sim-subtotal { font-weight: 700; color: var(--danger); min-width: 70px; text-align: right; }
.ord-sim-summary {
  margin-top: 10px; text-align: right; font-size: 13px; color: var(--text-2);
}
.ord-sim-summary strong { color: var(--danger); font-size: 18px; }

.ord-sim-picker {
  margin-top: 8px; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #f8fafc;
}
.ord-sim-picker-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--border);
}
.ord-sim-picker-head strong { font-size: 13px; color: var(--text-1); }
.ord-sim-picker-actions { display: flex; gap: 6px; }
.ord-sim-pickwrap {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; max-height: 280px; overflow-y: auto;
}
.ord-sim-pick {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; cursor: pointer; transition: all .15s ease;
}
.ord-sim-pick:hover { border-color: var(--primary); background: var(--primary-light); }
.ord-sim-pick.is-in-cart { background: #f1f5f9; opacity: 0.8; cursor: not-allowed; }
.ord-sim-pick-name { flex: 1; font-weight: 500; color: var(--text-1); }
.ord-sim-pick-meta { font-size: 11px; color: var(--text-3); }

.input.input-sm { padding: 4px 8px; font-size: 13px; height: 30px; }
.btn.btn-sm { padding: 4px 12px; font-size: 12px; height: 28px; }

/* 全局搜索结果中订单条目 */
.gs-result-item code { font-family: ui-monospace, Menlo, Consolas, monospace; }

@media (max-width: 1100px) {
  .ord-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ord-customer-card { grid-template-columns: 1fr; }
}

/* ============================================================
   通用 Badge
   ============================================================ */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; line-height: 1.3; font-weight: 600; }
.badge-success { background: #DDF7E6; color: #1F8A3E; }
.badge-warning { background: #FFF3D6; color: #C68A00; }
.badge-danger  { background: #FDE2E5; color: #C0392B; }
.badge-info    { background: #E6F0FF; color: #2C7BE5; }
.badge-primary { background: #EAE7FE; color: #4f46e5; }
.badge-muted   { background: #f0f0f2; color: #777; }

/* ============================================================
   退款管理 (refunds) - 高级感重构
   ============================================================ */
.rfd-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.rfd-tab {
  padding: 10px 22px;
  border-radius: 999px;
  background: #F4F5F7;
  color: #475569;
  font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer; transition: all .18s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.rfd-tab:hover { background: #E8EAEE; color: #1E293B; }
.rfd-tab.active {
  background: linear-gradient(135deg, #4F46E5, #6366F1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}
.rfd-tab-cnt {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rfd-tab.active .rfd-tab-cnt { background: rgba(255, 255, 255, 0.28); color: #fff; }

/* 列表卡片化 */
.rfd-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.rfd-table thead th {
  background: #F8FAFC;
  font-size: 12px; font-weight: 600;
  color: #64748B;
  letter-spacing: .3px;
  padding: 12px 14px;
  border-bottom: 1px solid #E2E8F0;
}
.rfd-table tbody td {
  padding: 14px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
}
.rfd-table tbody tr { transition: background .12s ease; }
.rfd-table tbody tr:hover { background: #FAFBFC; }

.rfd-table .rfd-no {
  font-size: 13px; font-weight: 700; color: #0F172A;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.2px;
}
.rfd-table .rfd-order-no { font-size: 11.5px; color: #94A3B8; margin-top: 4px; }
.rfd-items-line { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.rfd-item-pill {
  display: inline-block;
  padding: 3px 10px;
  background: #F1F5F9;
  color: #475569;
  font-size: 11px; border-radius: 999px;
  border: 1px solid #E2E8F0;
}
.rfd-item-more { color: #94A3B8; font-size: 11px; padding: 3px 6px; }
.rfd-reason { margin-top: 6px; font-size: 12px; color: #64748B; }
.rfd-amt {
  font-size: 17px; font-weight: 700; color: #DC2626;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}
.rfd-via {
  display: inline-block;
  font-size: 10.5px; font-weight: 600;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #DBEAFE; color: #1D4ED8;
}
.rfd-via.muted { background: #F1F5F9; color: #94A3B8; }
.rfd-audit { font-size: 11px; color: #94A3B8; margin-top: 4px; }

/* 详情弹窗 */
.rfd-detail-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid #E2E8F0;
}
.rfd-detail-no {
  font-size: 18px; font-weight: 700; color: #0F172A;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.5px;
}
.rfd-detail-sub { font-size: 13px; color: #64748B; margin-top: 6px; }

.rfd-detail-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 28px; padding: 4px 0 12px;
}
.rfd-d-cell {
  padding: 12px 14px;
  background: #F8FAFC;
  border-radius: 10px;
  border: 1px solid #F1F5F9;
}
.rfd-d-cell .lbl {
  font-size: 11px; color: #94A3B8;
  text-transform: uppercase; letter-spacing: .5px;
  font-weight: 600;
}
.rfd-d-cell .val {
  font-size: 14px; color: #0F172A; margin-top: 6px; word-break: break-all;
  font-weight: 500;
}
.rfd-d-cell .val.rfd-d-amt {
  color: #DC2626; font-weight: 800; font-size: 22px;
  font-variant-numeric: tabular-nums; letter-spacing: -0.5px;
}
.rfd-d-section { margin-top: 22px; }
.rfd-d-stitle {
  font-size: 13px; font-weight: 700; color: #334155;
  padding: 12px 0 10px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.3px;
}
.rfd-d-stitle::before {
  content: ''; display: inline-block;
  width: 4px; height: 16px;
  background: linear-gradient(to bottom, #6366F1, #4F46E5);
  border-radius: 2px;
}
.rfd-d-text {
  font-size: 13.5px; color: #334155;
  padding: 14px 16px; line-height: 1.7; white-space: pre-wrap;
  background: #F8FAFC;
  border-radius: 10px;
  border-left: 3px solid #6366F1;
}

.btn-link {
  background: transparent; color: var(--primary, #4F46E5);
  padding: 4px 10px; border: none;
  font-weight: 500; font-size: 13px;
}
.btn-link:hover { background: rgba(79, 70, 229, 0.08); border-radius: 4px; }

/* ============================================================
   店铺配送区域管理(modal 内)
   ============================================================ */
.shop-addr-mgr { padding: 4px 0; }
.sam-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid #E2E8F0;
  gap: 16px;
}
.sam-shop { font-size: 18px; font-weight: 700; color: #0F172A; }
.sam-tip { font-size: 12px; color: #64748B; margin-top: 6px; line-height: 1.5; max-width: 480px; }
.sam-list { display: flex; flex-direction: column; gap: 10px; }
.sam-empty {
  padding: 60px 20px; text-align: center;
  color: #94A3B8; font-size: 14px;
  background: #F8FAFC; border-radius: 12px;
}
.sam-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 12px;
  transition: all .15s ease;
}
.sam-row:hover { border-color: #C7D2FE; box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08); }
.sam-row.is-disabled { opacity: 0.6; }
.sam-main { flex: 1; min-width: 0; }
.sam-title {
  font-size: 14.5px; color: #0F172A;
  display: flex; align-items: center; gap: 4px;
}
.sam-title strong { font-weight: 700; }
.sam-sub { font-size: 12.5px; color: #475569; margin-top: 6px; }
.sam-meta { font-size: 12px; color: #94A3B8; margin-top: 6px; }
.sam-acts { display: flex; gap: 4px; flex-shrink: 0; }
.sam-acts .btn-text {
  padding: 6px 10px; font-size: 12px;
  border-radius: 6px;
}
.sam-group { margin-bottom: 8px; }
.sam-group-tit {
  font-size: 13px; font-weight: 700; color: #475569;
  padding: 10px 4px 8px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.3px;
}
.sam-group-cnt {
  font-size: 11px; color: #94A3B8;
  background: #F1F5F9;
  padding: 2px 8px; border-radius: 999px;
  font-weight: 500;
}
.sam-pill {
  display: inline-block;
  font-size: 11px; color: #4F46E5; font-weight: 600;
  padding: 2px 8px;
  background: #EEF2FF;
  border-radius: 4px;
  margin-left: 6px;
  letter-spacing: 0.2px;
}
.sa-tip {
  padding: 12px 14px;
  background: linear-gradient(135deg, #FFFBEC, #FFF7CC);
  border: 1px solid #FDE68A;
  border-radius: 10px;
  font-size: 12.5px; color: #92400E;
  margin-bottom: 18px; line-height: 1.6;
}
.sa-tip b { color: #78350F; font-weight: 700; }

/* 楼层布局编辑 */
.sa-layout-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.sa-layout-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
}
.sa-layout-row .input { width: 90px; padding: 6px 10px; font-size: 13px; }
.sa-layout-sep { font-size: 12px; color: #64748B; padding: 0 4px; flex-shrink: 0; }
.sa-layout-row .btn-text { margin-left: auto; padding: 4px 10px; font-size: 12px; }
.sam-pill-warn { color: #7C3AED !important; background: #F3E8FF !important; }

/* ============================================================
   会员管理 - 高级感重构
   ============================================================ */
.wxu-summary {
  padding: 4px 0 18px;
  font-size: 13px; color: #64748B; font-weight: 500;
}
.wxu-table { border-collapse: separate; border-spacing: 0; width: 100%; }
.wxu-table thead th {
  background: #F8FAFC;
  font-size: 12px; font-weight: 600;
  color: #64748B;
  letter-spacing: .3px;
  padding: 12px 14px;
  border-bottom: 1px solid #E2E8F0;
}
.wxu-table tbody td {
  padding: 14px;
  border-bottom: 1px solid #F1F5F9;
  vertical-align: middle;
  font-size: 13px;
}
.wxu-table tbody tr:hover { background: #FAFBFC; }
.wxu-table .col-actions { white-space: nowrap; }
.wxu-table .col-actions .btn { margin-right: 4px; }

.wxu-avatar {
  width: 44px; height: 44px;
  border-radius: 50%; object-fit: cover;
  background: #F1F5F9;
  border: 2px solid #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.wxu-avatar-empty {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 20px; color: #94A3B8;
  background: linear-gradient(135deg, #F1F5F9, #E2E8F0);
}
.wxu-nick { font-weight: 700; color: #0F172A; font-size: 14px; }
.wxu-phone {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  color: #0F172A; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.wxu-no-phone { color: #CBD5E1; font-size: 12px; font-style: italic; }
.wxu-openid {
  display: inline-block;
  font-size: 11px; color: #6366F1;
  background: #EEF2FF;
  padding: 3px 10px; border-radius: 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 0.3px;
}
.wxu-meta-sub { font-size: 11px; color: #94A3B8; margin-top: 3px; }
.wxu-remark {
  display: inline-block; max-width: 220px;
  font-size: 12px; line-height: 1.4; color: #92400E;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #FEF3C7;
  padding: 4px 10px; border-radius: 6px;
  border: 1px solid #FDE68A;
  font-weight: 500;
}

/* 详情弹窗 */
.wxu-detail .wxu-d-head {
  display: flex; gap: 20px; align-items: flex-start;
  padding: 20px;
  background: linear-gradient(135deg, #F8FAFC, #F1F5F9);
  border-radius: 14px;
  margin-bottom: 20px;
}
.wxu-d-avatar {
  width: 96px; height: 96px;
  border-radius: 50%; object-fit: cover;
  flex-shrink: 0;
  background: #F1F5F9;
  border: 4px solid #FFFFFF;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; color: #94A3B8;
}
.wxu-d-base { flex: 1; min-width: 0; }
.wxu-d-nick {
  font-size: 22px; font-weight: 800; color: #0F172A;
  margin-bottom: 10px; letter-spacing: -0.3px;
}
.wxu-d-line { font-size: 13px; color: #475569; line-height: 2; }
.wxu-d-line .muted { color: #94A3B8; font-weight: 500; }
.wxu-d-line code {
  background: #FFFFFF; padding: 2px 8px; border-radius: 5px;
  font-size: 12px; color: #6366F1;
  border: 1px solid #E2E8F0;
}

.wxu-d-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin-bottom: 20px;
}
.wxu-stat-card {
  padding: 20px 18px; border-radius: 14px;
  background: linear-gradient(135deg, #FFFFFF, #F8FAFC);
  border: 1px solid #E2E8F0;
  text-align: center;
  position: relative; overflow: hidden;
  transition: all .2s ease;
}
.wxu-stat-card::before {
  content: ''; position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), transparent);
}
.wxu-stat-card.success::before {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), transparent);
}
.wxu-stat-card.success {
  background: linear-gradient(135deg, #F0FDF4, #ECFDF5);
  border-color: #BBF7D0;
}
.wxu-stat-card .num {
  font-size: 26px; font-weight: 800; color: #0F172A;
  line-height: 1.1; letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  position: relative; z-index: 1;
}
.wxu-stat-card.success .num { color: #15803D; }
.wxu-stat-card .lbl {
  font-size: 12px; color: #64748B;
  margin-top: 8px; font-weight: 500;
  position: relative; z-index: 1;
}

.wxu-d-buckets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.wxu-stat-pill {
  font-size: 12px; padding: 6px 12px;
  background: #F1F5F9; color: #334155;
  border-radius: 999px;
  border: 1px solid #E2E8F0;
  font-weight: 500;
}
.wxu-stat-pill strong { color: #0F172A; margin-right: 4px; font-weight: 700; }

.wxu-d-section-title {
  font-size: 14px; font-weight: 700; color: #334155;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: 0.3px;
}
.wxu-d-section-title::before {
  content: ''; display: inline-block;
  width: 4px; height: 16px;
  background: linear-gradient(to bottom, #6366F1, #4F46E5);
  border-radius: 2px;
}
.wxu-d-table th, .wxu-d-table td { font-size: 12px; padding: 10px 12px; }
.wxu-d-table code { font-size: 11px; }

/* ============================================================
   工作台 (Workbench) - 订单管理全流程
   ============================================================ */
.wb-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.wb-greet-title {
  font-size: 22px; font-weight: 700; color: var(--text-1);
  letter-spacing: 0.3px;
}
.wb-greet-sub { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.wb-toolbar { display: flex; gap: 10px; align-items: center; }
.wb-toolbar .select { min-width: 160px; }
.wb-toolbar .btn svg { vertical-align: -2px; margin-right: 4px; }

/* KPI 卡片 */
.wb-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.wb-kpi {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.wb-kpi:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
}
.wb-kpi::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px; border-radius: 4px 0 0 4px;
}
.wb-kpi--blue::before   { background: linear-gradient(180deg, #60a5fa, #3b82f6); }
.wb-kpi--green::before  { background: linear-gradient(180deg, #34d399, #10b981); }
.wb-kpi--orange::before { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.wb-kpi--purple::before { background: linear-gradient(180deg, #a78bfa, #8b5cf6); }
.wb-kpi-label {
  font-size: 13px; color: var(--text-3); font-weight: 500;
  letter-spacing: 0.5px;
}
.wb-kpi-value {
  font-size: 30px; font-weight: 800; color: var(--text-1);
  line-height: 1.1; margin-top: 8px;
  font-family: -apple-system, "DIN Alternate", sans-serif;
  letter-spacing: -0.5px;
}
.wb-kpi-value .cur { font-size: 18px; font-weight: 700; margin-right: 2px; }
.wb-kpi-value .suf { font-size: 16px; font-weight: 600; color: var(--text-2); margin-left: 2px; }
.wb-kpi-sub { font-size: 12px; color: var(--text-3); margin-top: 6px; font-weight: 500; }
.wb-delta-up   { color: #16a34a !important; }
.wb-delta-down { color: #ef4444 !important; }
.wb-delta-flat { color: var(--text-3) !important; }

/* 流转图图例 */
.wb-legend {
  display: flex; align-items: center; gap: 14px;
  font-size: 12px; color: var(--text-3);
}
.wb-legend .lg {
  display: inline-block; width: 12px; height: 12px;
  border-radius: 4px; margin-right: 4px; vertical-align: -1px;
}
.wb-legend .lg-todo  { background: linear-gradient(135deg, #fef3c7, #fbbf24); }
.wb-legend .lg-doing { background: linear-gradient(135deg, #dbeafe, #3b82f6); }
.wb-legend .lg-done  { background: linear-gradient(135deg, #dcfce7, #16a34a); }
.wb-legend .lg-bad   { background: linear-gradient(135deg, #fee2e2, #ef4444); }

/* 流程图主体 */
.wb-flow {
  display: flex; flex-direction: column; gap: 24px;
  padding: 8px 0 4px;
}
.wb-flow-main {
  display: flex; align-items: stretch; gap: 0;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.wb-flow-side {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px dashed var(--border);
}
.wb-flow-arrow {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  width: 28px;
  position: relative;
  color: #cbd5e1;
}
.wb-flow-arrow::after {
  content: '';
  width: 0; height: 0;
  border-left: 10px solid #cbd5e1;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.05));
}
.wb-node {
  flex: 1 1 140px;
  min-width: 140px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 16px 14px 14px;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
  position: relative;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
}
.wb-node:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.10);
  border-color: transparent;
}
.wb-node-emo {
  font-size: 28px; line-height: 1;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
}
.wb-node-title {
  font-size: 14px; color: var(--text-1); font-weight: 700;
  margin-top: 8px;
}
.wb-node-cnt {
  font-size: 28px; font-weight: 800; color: var(--text-1);
  font-family: -apple-system, "DIN Alternate", sans-serif;
  letter-spacing: -1px; line-height: 1.1;
  margin-top: 4px;
}
.wb-node-tip {
  font-size: 11px; color: var(--text-3); margin-top: 4px;
  line-height: 1.4;
}

/* 流程图状态颜色 */
.wb-node--todo {
  background: linear-gradient(180deg, #fffbeb 0%, #fff 100%);
  border-color: #fde68a;
}
.wb-node--todo:hover { border-color: #f59e0b; box-shadow: 0 12px 28px rgba(245, 158, 11, 0.20); }
.wb-node--todo .wb-node-cnt { color: #b45309; }

.wb-node--doing {
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
  border-color: #bfdbfe;
}
.wb-node--doing:hover { border-color: #3b82f6; box-shadow: 0 12px 28px rgba(59, 130, 246, 0.18); }
.wb-node--doing .wb-node-cnt { color: #1d4ed8; }

.wb-node--done {
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
  border-color: #bbf7d0;
}
.wb-node--done:hover { border-color: #16a34a; box-shadow: 0 12px 28px rgba(22, 163, 74, 0.18); }
.wb-node--done .wb-node-cnt { color: #15803d; }

.wb-node--bad {
  background: linear-gradient(180deg, #fef2f2 0%, #fff 100%);
  border-color: #fecaca;
  flex: 0 0 180px;
}
.wb-node--bad:hover { border-color: #ef4444; box-shadow: 0 12px 28px rgba(239, 68, 68, 0.18); }
.wb-node--bad .wb-node-cnt { color: #b91c1c; font-size: 22px; }
.wb-node--bad { padding: 12px; }
.wb-node--bad .wb-node-emo { font-size: 22px; }

/* 待接单脉冲动画 */
@keyframes wb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.5); }
  50%      { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0); }
}
.wb-node-pulse { animation: wb-pulse 2s ease-out infinite; }

@media (max-width: 1100px) {
  .wb-flow-arrow { width: 100%; height: 22px; transform: rotate(90deg); }
  .wb-flow-main { flex-direction: column; gap: 8px; }
  .wb-node { flex: 1 1 100%; }
}

/* 待办列表 */
.wb-todo-tabs {
  display: flex; gap: 4px;
  background: var(--bg-2);
  padding: 4px; border-radius: 12px;
}
.wb-todo-tab {
  padding: 7px 14px;
  font-size: 13px; color: var(--text-2);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.wb-todo-tab:hover { color: var(--text-1); background: rgba(255, 255, 255, 0.5); }
.wb-todo-tab.active {
  background: #fff; color: var(--text-1); font-weight: 700;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}
.wb-todo-tab .cnt {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--bg-hover); color: var(--text-3);
  font-size: 11px; font-weight: 700;
  border-radius: 9px;
}
.wb-todo-tab.active .cnt {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
}

.wb-todo-list {
  display: flex; flex-direction: column;
  gap: 10px;
}
.wb-todo-empty {
  text-align: center; padding: 40px 20px;
  color: var(--text-3); font-size: 14px;
}
.wb-todo-row {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: all .15s;
}
.wb-todo-row:hover {
  border-color: #93c5fd;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.10);
}
.wb-todo-main { flex: 1; min-width: 0; }
.wb-todo-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.wb-todo-no {
  font-size: 13px; font-weight: 700; color: var(--text-1);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.wb-todo-time { font-size: 12px; color: var(--text-3); }
.wb-todo-line {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-2);
}
.wb-todo-shop { font-weight: 500; color: var(--text-2); }
.wb-todo-type { color: var(--text-3); }
.wb-todo-cust { color: var(--text-3); }
.wb-todo-amt {
  font-size: 18px; font-weight: 800; color: #ef4444;
  font-family: -apple-system, "DIN Alternate", sans-serif;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}
.wb-todo-acts {
  display: flex; gap: 6px;
  flex-shrink: 0;
}
.wb-todo-acts .btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}
@media (max-width: 800px) {
  .wb-todo-row { flex-wrap: wrap; }
  .wb-todo-acts { width: 100%; justify-content: flex-end; }
}
