/* ========== Tesla Design System ========== */

:root {
  /* Modern E-commerce Palette */
  --edy-bg: #F7F8FA;
  --edy-surface: #FFFFFF;
  --edy-text-primary: #1A1D26;
  --edy-text-secondary: #4A5068;
  --edy-text-tertiary: #8B90A0;
  --edy-blue: #1D4ED8;
  --edy-blue-hover: #335FDC;
  --edy-blue-light: rgba(79,110,247,0.08);
  --edy-border: #E8ECF0;
  --edy-border-light: #F0F2F5;
  --edy-shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --edy-shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --edy-shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --edy-error: #EF4444;
  --edy-success: #22C55E;
  --edy-warning: #F59E0B;
  --edy-radius-xs: 4px;
  --edy-radius-sm: 6px;
  --edy-radius-md: 8px;
  --edy-radius-lg: 10px;
  --edy-radius-xl: 12px;
  --edy-radius-full: 20px;
  --edy-font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  --edy-font-text: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  --sidebar-width: 244px;
  --sidebar-rail-width: 100px;
  --sidebar-panel-width: 144px;
  --sidebar-collapsed-width: 100px;
  --topbar-height: 60px;
  --app-max-width: 1920px;
  --app-gutter: max(0px, calc((100vw - var(--app-max-width)) / 2));
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.4s ease;

  /* 兼容旧变量名 */
  --color-primary: #1D4ED8;
  --color-primary-light: #335FDC;
  --color-primary-dark: #2E47B5;
  --color-primary-bg: rgba(79,110,247,0.08);
  --color-secondary: #1D4ED8;
  --color-cta: #1D4ED8;
  --color-cta-light: #6B85F9;
  --color-bg: #F7F8FA;
  --color-surface: #FFFFFF;
  --color-text-primary: #1A1D26;
  --color-text-secondary: #4A5068;
  --color-text-tertiary: #8B90A0;
  --color-text-inverse: #ffffff;
  --color-border: #E8ECF0;
  --color-border-light: #F0F2F5;
  --color-success: #22C55E;
  --color-success-bg: rgba(34,197,94,0.08);
  --color-warning: #F59E0B;
  --color-warning-bg: rgba(245,158,11,0.08);
  --color-error: #EF4444;
  --color-error-bg: rgba(239,68,68,0.08);
  --color-info: #1D4ED8;
  --color-info-bg: rgba(79,110,247,0.08);
  --font-display: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-full: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-xl: 0 8px 24px rgba(0,0,0,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* 仿千牛后台：将整个应用（顶栏 + 侧栏 + 主区域）限制在 --app-max-width 内并在超宽屏上居中显示 */
html { background: #ffffff; }
body {
  font-family: var(--edy-font-text);
  font-size: 14px;
  line-height: 1.43;
  color: var(--edy-text-primary);
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: var(--app-max-width);
  min-width: 1036px;
  margin: 0 auto;
  position: relative;
  background: #ffffff;
}

a { color: var(--edy-blue); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--edy-blue-hover); }

/* ========== 主内容区最小宽度 + 白底（全局） ========== */
main { min-width: 1036px; background: #ffffff; }

/* ========== 全局 .primary-btn 字号 ========== */
.primary-btn { font-size: 12px !important; }

/* ========== Sidebar - Dual-Column Tesla Style ========== */
.sidebar {
  position: fixed;
  /* 锁在居中后的 body 左边缘（仿千牛后台居中布局） */
  left: var(--app-gutter);
  top: var(--topbar-height);
  bottom: 0;
  width: var(--sidebar-width);
  background: #FFFFFF;
  z-index: 90;
  display: flex;
  flex-direction: row;
  transition: width 0.3s ease;
  overflow: hidden;
  box-shadow: none;
}

.sidebar.collapsed { width: var(--sidebar-collapsed-width); }
.sidebar.collapsed .sidebar-panel { display: none; }

/* --- Icon Rail (Left primary category column — Qianniu style) --- */
.sidebar-icon-rail {
  width: var(--sidebar-rail-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: #FAFBFC;
  border-right: 1px solid #EEF0F3;
  padding: 12px 0 8px;
  gap: 10px;
}

.rail-logo {
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  background: #1D4ED8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--edy-font-display);
  font-weight: 600;
  font-size:14px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background-color 0.2s;
}
.rail-logo:hover { background: #335FDC; }
/* T-shape layout: logo moved to topbar; hide rail-logo */
.sidebar-icon-rail .rail-logo { display: none; }

.rail-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: #181818;
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
  position: relative;
  flex-shrink: 0;
  line-height: 1.2;
}
.rail-item .rail-icon {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
}
.rail-item .rail-icon svg {
  width: 16px; height: 16px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}
.rail-item:hover {
  background: #F9FAFB;
  color: #1A1D26;
}
.rail-item {
  margin: 0 8px;
  border-radius: 6px;
}
.rail-item.active {
  color: #181818;
  background: rgba(79,110,247,0.08);
  font-weight: 500;
}
.rail-item.active:hover {
  color: #181818;
  background: rgba(79,110,247,0.08);
}
.rail-item.active .rail-icon { width: 16px; height: 16px; color: #1D4ED8; }
.rail-item.active .rail-icon svg {
  width: 16px; height: 16px;
  fill: #1D4ED8;
  stroke-width: 1.5;
  stroke-linejoin: miter;
  stroke-linecap: square;
  shape-rendering: geometricPrecision;
}
/* 默认内部元素（线条、圆点等）白色描边 */
.rail-item.active .rail-icon svg > * {
  stroke: #FFFFFF;
}
/* 最外层第一个路径 + 所有 rect（通常是图标主体/容器）使用主题色描边 */
.rail-item.active .rail-icon svg > *:first-child,
.rail-item.active .rail-icon svg > rect {
  stroke: #1D4ED8;
}
/* 首页图标的 4 个格子都是"外形"的一部分，全部用主题色 */
.rail-item.active[href*="dashboard"] .rail-icon svg > * {
  stroke: #1D4ED8;
}
/* 交易图标的顶部夹头保留空心效果，不填充 */
.rail-item.active[href*="order-list"] .rail-icon svg > rect {
  fill: none;
}
/* 账号图标：选中时身体 + 头部 均为主题色实心 + 主题色描边（消除白色描边导致的"头部缩圈"） */
.rail-item.active.account-rail .rail-icon svg {
  fill: #1D4ED8 !important;
}
.rail-item.active.account-rail .rail-icon svg > * {
  stroke: #1D4ED8 !important;
  fill: #1D4ED8 !important;
}

.rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #EEF0F3;
}

.rail-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #1D4ED8;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  font-family: var(--edy-font-display);
  cursor: pointer;
  transition: background-color 0.2s;
  margin-top: 4px;
}
.rail-avatar:hover { background: #335FDC; }

/* --- Sidebar Panel (Right expanded area) --- */
.sidebar-panel {
  width: var(--sidebar-panel-width);
  display: flex;
  flex-direction: column;
  background: #FAFBFC;
  overflow: hidden;
  transition: width 0.3s ease, opacity 0.3s ease;
}

.panel-header {
  padding: 16px 16px;
  border-bottom: 1px solid #E8ECF0;
  flex-shrink: 0;
}

.panel-title {
  font-family: var(--edy-font-display);
  font-size:14px;
  font-weight: 500;
  color: #1A1D26;
  letter-spacing: normal;
}

.panel-search {
  position: relative;
}

.panel-search input {
  width: 100%;
  height: 32px;
  padding: 0 12px 0 32px;
  border: 1px solid #E8ECF0;
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--edy-font-text);
  color: #1A1D26;
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.33s;
  letter-spacing: normal;
}

.panel-search input:focus {
  border-color: #1D4ED8;
}

.panel-search input::placeholder {
  color: #8E8E8E;
}

.panel-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #8E8E8E;
  font-size: 14px;
  pointer-events: none;
}

/* --- Panel Body --- */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.panel-body::-webkit-scrollbar { width: 3px; }
.panel-body::-webkit-scrollbar-thumb { background: #D0D1D2; border-radius: 2px; }
.panel-body::-webkit-scrollbar-thumb:hover { background: #8E8E8E; }

/* Panel Group (collapsible nav sections) */
.panel-group {
  margin-bottom: 2px;
}

.panel-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 16px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: Arial;
  font-size: 14px;
  font-weight: 500;
  color: #181818;
  letter-spacing: normal;
  transition: color 0.33s, background-color 0.33s;
  text-align: left;
}

.panel-group-toggle:hover {
  background: #F2F4F7;
  color: #181818;
}

.panel-group-toggle .chevron {
  font-size: 10px;
  transition: transform 0.33s;
  color: #8E8E8E;
}

.panel-group.collapsed .chevron {
  transform: rotate(-90deg);
}

.panel-group.collapsed .panel-group-links {
  display: none;
}

/* Panel Links — Qianniu vertical list style */
.panel-group-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 2px 8px;
}

.panel-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: #333333;
  font-size: 14px;
  font-weight: 400;
  border-radius: 4px;
  background: transparent;
  transition: color 0.2s, background-color 0.2s;
  text-decoration: none;
  position: relative;
  cursor: pointer;
  line-height: 1.3;
  font-size: 12px;
}

.panel-link:hover {
  background: #F9FAFB;
  color: #1A1D26;
}

.panel-link.active {
  color: #1D4ED8;
  background: rgba(79,110,247,0.08);
  font-weight: 500;
}

.panel-link .link-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.panel-link .link-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  transition: stroke 0.2s;
}

.panel-link .link-icon svg .accent {
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  opacity: 0.7;
}

.panel-link.active .link-icon svg .accent,
.panel-link.active .link-icon svg {
  stroke: #1D4ED8;
}

/* 客服机器人 — 大标题（可点击，新开窗口） */
.panel-bot-title {
  display: flex; align-items: center; justify-content: space-between;
  margin: 4px 8px 8px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #EEF2FF 0%, #E8F0FF 100%);
  border: 1px solid #DCE3F5;
  border-radius: 6px;
  font-family: var(--edy-font-display);
  font-size: 14px;
  font-weight: 600;
  color: #1A1D26;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s;
}
.panel-bot-title:hover { background: linear-gradient(135deg, #E4EAFF 0%, #DCE6FF 100%); border-color: #B9C5EE; }
.panel-bot-title .bot-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: #1D4ED8; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  margin-right: 8px; flex-shrink: 0;
}
.panel-bot-title .bot-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-bot-title .bot-status {
  margin-left: 6px; font-size: 12px; font-weight: 400;
  color: #18A058; display: inline-flex; align-items: center; gap: 4px;
}
.panel-bot-title .bot-status::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%; background: #18A058;
}
.panel-bot-title .bot-status.off { color: #9CA3AF; }
.panel-bot-title .bot-status.off::before { background: #9CA3AF; }
.panel-bot-title .bot-newwin { margin-left: 6px; color: #8E8E8E; font-size: 12px; flex-shrink: 0; }

/* 二级分组小标题 */
.panel-subhead {
  padding: 12px 16px 4px;
  font-family: var(--edy-font-text);
  font-size: 12px;
  font-weight: 500;
  color: #8E8E8E;
  letter-spacing: 0.4px;
}

.panel-link .link-badge {
  margin-left: auto;
  background: #ff3b30;
  color: white;
  font-size: 10px;
  font-weight: 500;
  padding: 0 5px;
  border-radius: 8px;
  min-width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}


/* --- Flat SVG Icon Styles --- */
.icon-svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.kpi-icon svg,
.quick-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
}

.empty-icon svg {
  width: 48px;
  height: 48px;
  stroke: #8E8E8E;
  stroke-width: 1.5;
  fill: none;
}

.btn svg.icon-svg {
  margin-right: 4px;
}

.topbar-toggle svg,
.topbar-icon-btn svg,
.search-icon svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  vertical-align: middle;
}

/* Legacy classes for backward compat with page-level styles */
.nav-item {
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 36px;
  color: #8B90A0;
  cursor: pointer;
  transition: color 0.33s, background-color 0.33s;
  gap: 10px;
  white-space: nowrap;
  position: relative;
  margin: 1px 4px;
  border-radius: 4px;
  letter-spacing: normal;
  font-size: 14px;
  font-weight: 400;
}

.nav-item:hover { background: #F2F4F7; color: #1A1D26; }
.nav-item.active { background: #1D4ED8; color: white; font-weight: 500; }
.nav-item.active:hover { background: #335FDC; }
.nav-item .nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size:14px; }
.nav-item .nav-label { overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-weight: 400; }
.nav-item .nav-badge { margin-left: auto; background: #ff3b30; color: white; font-size: 10.5px; font-weight: 500; padding: 0 6px; border-radius: 4px; min-width: 17px; height: 17px; display: flex; align-items: center; justify-content: center; line-height: 1; }

/* ========== TopBar - Tesla Style ========== */
.topbar {
  position: fixed;
  top: 0;
  /* 顶栏背景占满整个视口宽度（width:100%） */
  left: 0;
  right: 0;
  max-width: none;
  height: var(--topbar-height);
  background: #FFFFFF;
  border-bottom: 1px solid #EEF0F3;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
  display: flex;
  align-items: center;
  /* 内容区域跟随下方主体宽度：内边距 = 超宽留白 + 24px 默认内边距，
     使 topbar-left / topbar-right 对齐到居中后的 body 边缘 */
  padding-left: calc(var(--app-gutter) + 24px);
  padding-right: calc(var(--app-gutter) + 24px);
  z-index: 100;
}

.topbar-logo {
  width: 36px;
  height: 36px;
  background: #1D4ED8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: var(--edy-font-display);
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s;
  margin-right: 4px;
}
.topbar-logo:hover { background: #335FDC; color: #fff; }

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-toggle {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--edy-radius-sm);
  color: var(--edy-text-secondary);
  transition: all var(--transition-fast);
  border: none;
  background: transparent;
  font-size: 16px;
}

.topbar-toggle:hover {
  background: #F2F4F7;
  color: #1D4ED8;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 1;
  height: var(--topbar-height);
}

.breadcrumb-item { color: var(--edy-text-tertiary); letter-spacing: -0.01em; display:inline-flex; align-items:center; line-height:1; }
.breadcrumb-item a { display:inline-flex; align-items:center; line-height:1; }
.breadcrumb-item a { color: var(--edy-text-secondary); }
.breadcrumb-item a:hover { color: var(--edy-blue); }
.breadcrumb-sep { color: var(--edy-text-tertiary); font-size: 12px; opacity: 0.6; }
.breadcrumb-item.current { color: var(--edy-text-primary); font-weight: 500; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-search {
  position: relative;
  width: 220px;
}

.topbar-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 38px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-family: var(--edy-font-text);
  background: #F2F4F7;
  color: #1A1D26;
  outline: none;
  transition: background 0.2s, box-shadow 0.2s;
  letter-spacing: normal;
}

.topbar-search input:focus {
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(79,110,247,0.2);
}

.topbar-search .search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--edy-text-tertiary);
  font-size: 14px;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--edy-radius-sm);
  cursor: pointer;
  color: var(--edy-text-secondary);
  transition: all var(--transition-fast);
  position: relative;
  border: none;
  background: transparent;
  font-size: 16px;
}

.topbar-icon-btn:hover {
  background: #F2F4F7;
  color: #1D4ED8;
}

.topbar-icon-btn .badge-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 8px;
  height: 8px;
  background: #ff3b30;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
}

.topbar-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: var(--edy-radius-full);
  transition: background var(--transition-fast);
}

.topbar-user:hover { background: #F7F8FA; }

.topbar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--edy-text-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  font-family: var(--edy-font-display);
}

.topbar-user .user-info-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.topbar-user .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--edy-text-primary);
  letter-spacing: -0.01em;
}

.topbar-user .arrow {
  width: 16px;
  height: 16px;
  stroke: var(--edy-text-tertiary);
  stroke-width: 2;
  fill: none;
  transition: transform 0.2s ease;
}

.topbar-user.open .arrow {
  transform: rotate(180deg);
}

.topbar-user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 240px;
  background: #FFFFFF;
  border: 1px solid var(--edy-border);
  border-radius: var(--edy-radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  opacity: 0;
  visibility: hidden;
  transform: translateY(0);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1100;
  overflow: hidden;
  padding-top: 8px;
  margin-top: 0;
}

.topbar-user.open .topbar-user-dropdown {
  opacity: 1;
  visibility: visible;
}

.dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-bottom: 1px solid #F0F2F5;
}

.dropdown-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1D4ED8;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  font-family: var(--edy-font-display);
  flex-shrink: 0;
}

.dropdown-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.dropdown-shop-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--edy-text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-username {
  font-size: 14px;
  color: var(--edy-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-divider {
  height: 1px;
  background: #F0F2F5;
  margin: 4px 0;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
  color: var(--edy-text-primary);
  text-decoration: none;
  transition: background 0.15s;
}

.dropdown-item:hover {
  background: #F7F8FA;
}

.dropdown-item svg {
  width: 20px;
  height: 20px;
  stroke: var(--edy-text-secondary);
  stroke-width: 1.8;
  fill: none;
  flex-shrink: 0;
}

.dropdown-item:hover svg {
  stroke: #1D4ED8;
}

.dropdown-item span {
  flex: 1;
}

.dropdown-item.logout {
  color: var(--edy-error);
  margin-top: 4px;
  margin-bottom: 4px;
}

.dropdown-item.logout svg {
  stroke: var(--edy-error);
}

/* ========== Main Content ========== */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  min-height: calc(100vh - var(--topbar-height));
  padding: 24px;
  width: calc(100% - var(--sidebar-width));
  /* max-width: 1200px; */
  transition: margin-left var(--transition-normal);
}

.sidebar.collapsed ~ .main-content,
.main-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed-width); }

.page-header {
  margin-bottom: 16px;
}

.page-title {
  font-family: var(--edy-font-display);
  font-size: 20px;
  font-weight: 500;
  color: #1A1D26;
  margin-bottom: 6px;
  letter-spacing: normal;
  line-height: 1.2;
}

.page-desc {
  font-size: 14px;
  color: #4A5068;
  line-height: 1.43;
  letter-spacing: normal;
}

/* ========== Card — Modern E-commerce ========== */
.card {
  background: #FFFFFF;
  border-radius: 10px;
  border: none;
  box-shadow: none;
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: none;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--edy-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-family: var(--edy-font-display);
  font-size: 16px;
  font-weight: 500;
  color: #1A1D26;
  letter-spacing: normal;
}

.card-body { padding: 24px; }
.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--edy-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* ========== KPI Card ========== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.kpi-card {
  background: #FFFFFF;
  border-radius: 10px;
  border: none;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal), transform 0.2s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-card .kpi-label {
  font-size: 14px;
  color: var(--edy-text-secondary);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.kpi-card .kpi-value {
  font-family: var(--edy-font-display);
  font-size: 28px;
  font-weight: 500;
  color: #1A1D26;
  line-height: 1.2;
  letter-spacing: normal;
}

.kpi-card .kpi-value.amount::before {
  content: '¥';
  font-size: 18px;
  font-weight: 600;
  margin-right: 2px;
}

.kpi-card .kpi-footer {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 12px;
}

.kpi-card .kpi-trend {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: 600;
}

.kpi-card .kpi-trend.up { color: var(--edy-success); }
.kpi-card .kpi-trend.down { color: var(--edy-error); }

.kpi-card .kpi-compare { color: var(--edy-text-tertiary); }

/* ========== Status Badge - Tesla Style ========== */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  gap: 4px;
  letter-spacing: normal;
}
.status-badge svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.status-badge.pending { 
  background: rgba(255,204,0,0.15); 
  color: #c68400; 
}
.status-badge.processing { 
  background: var(--edy-blue-light); 
  color: var(--edy-blue); 
}
.status-badge.completed { 
  background: rgba(52,199,89,0.12); 
  color: var(--edy-success); 
}
.status-badge.cancelled { 
  background: rgba(142,142,147,0.12); 
  color: #8e8e93; 
}
.status-badge.rejected { 
  background: rgba(255,59,48,0.12); 
  color: var(--edy-error); 
}
.status-badge.exception { 
  background: rgba(255,59,48,0.12); 
  color: var(--edy-error); 
}

/* ========== DataTable - Tesla Style ========== */
.data-table-wrapper {
  overflow-x: auto;
  border-radius: 0;
  border: none;
  background: #FFFFFF;
  box-shadow: none;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: #FFFFFF;
}

.data-table th {
  background: #F9FAFB;
  padding: 12px 16px;
  text-align: left;
  font-weight: 500;
  color: var(--edy-text-primary);
  border-bottom: 1px solid #F3F4F6;
  white-space: nowrap;
  user-select: none;
  font-size: 14px;
  text-transform: none;
  letter-spacing: normal;
}

.data-table th.sortable { cursor: pointer; }
.data-table th.sortable:hover { color: var(--edy-blue); }

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--edy-border-light);
  color: var(--edy-text-primary);
  font-size: 14px;
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}
.data-table tbody tr:nth-child(even) { background: transparent; }
.data-table tbody tr:hover,
.data-table tbody tr:nth-child(even):hover { background: #EFF6FF; }

.data-table .cell-primary { font-weight: 500; }
.data-table .cell-secondary { color: var(--edy-text-secondary); }
.data-table .cell-amount {
  font-family: var(--edy-font-display);
  font-weight: 600;
  color: var(--edy-text-primary);
  letter-spacing: -0.02em;
}

.data-table .cell-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.data-table .cell-actions a,
.data-table .cell-actions button {
  font-size: 14px;
  color: var(--edy-blue);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--edy-font-text);
  font-weight: 500;
  transition: all var(--transition-fast);
}

.data-table .cell-actions a:hover,
.data-table .cell-actions button:hover {
  color: var(--edy-blue-hover);
  text-decoration: underline;
}

.data-table .checkbox-cell { width: 44px; text-align: center; }

/* ===== 全局表格样式规范 =====
   统一各页面表格外观（表头/正文字色、表头字重与底色、行 hover、容器边框）。
   用 body .<主容器> table 提升优先级以覆盖各页内联 <style> 中的自定义表格类。 */
body .main-content table th,
body .shop-main table th,
body .bill-main table th,
body .ps-main table th {
  font-weight: 500;
  color: var(--color-text-primary);
  background: #F9FAFB;
}
body .main-content table td,
body .shop-main table td,
body .bill-main table td,
body .ps-main table td {
  color: var(--color-text-primary);
}
body .main-content table tbody tr:hover,
body .shop-main table tbody tr:hover,
body .bill-main table tbody tr:hover {
  background: #EFF6FF;
}

.table-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 14px 0 0;
  border-top: none;
  font-size: 14px;
  color: var(--edy-text-secondary);
}

.pagination-info { display: inline-flex; align-items: center; gap: 4px; }

.pagination-pages {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pagination-pages button {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--edy-border);
  border-radius: var(--edy-radius-sm);
  background: var(--edy-surface);
  cursor: pointer;
  font-size: 14px;
  font-family: var(--edy-font-text);
  color: var(--edy-text-primary);
  transition: all var(--transition-fast);
}

.pagination-pages button:hover {
  border-color: #1D4ED8;
  color: #1D4ED8;
}

.pagination-pages button.active {
  background: var(--edy-blue);
  border-color: var(--edy-blue);
  color: white;
}

.pagination-pages button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pagination-size { display: inline-flex; align-items: center; gap: 6px; }
.pagination-size select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--edy-border);
  border-radius: var(--edy-radius-sm);
  background: var(--edy-surface);
  font-size: 14px;
  font-family: inherit;
  color: var(--edy-text-primary);
  outline: none;
}
.pagination-size select:focus { border-color: var(--edy-blue); }

/* ========== Tag Filter - Apple Style ========== */
.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tag-filter .tag {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: var(--edy-radius-full);
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--edy-border);
  background: var(--edy-surface);
  color: var(--edy-text-secondary);
  transition: all var(--transition-fast);
  gap: 6px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.tag-filter .tag:hover {
  border-color: #1D4ED8;
  color: #1D4ED8;
}

.tag-filter .tag.active {
  background: var(--edy-blue);
  border-color: var(--edy-blue);
  color: white;
}

.tag-filter .tag .tag-close {
  font-size: 14px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.tag-filter .tag .tag-close:hover { opacity: 1; }

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.selected-tags .selected-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--edy-radius-full);
  font-size: 12px;
  background: var(--edy-blue-light);
  color: var(--edy-blue);
  gap: 6px;
  font-weight: 500;
}

.selected-tags .selected-tag .remove {
  cursor: pointer;
  font-size: 14px;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.selected-tags .selected-tag .remove:hover { opacity: 1; }

.selected-tags .clear-all {
  font-size: 12px;
  color: var(--edy-text-tertiary);
  cursor: pointer;
  margin-left: 4px;
  font-weight: 500;
}

.selected-tags .clear-all:hover { color: var(--edy-error); }

/* ========== Progress Step - Apple Style ========== */
.progress-steps {
  display: flex;
  align-items: center;
  margin-bottom: 36px;
}

.progress-step {
  display: flex;
  align-items: center;
  flex: 1;
  position: relative;
}

.progress-step .step-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid var(--edy-border);
  background: var(--edy-surface);
  color: var(--edy-text-tertiary);
  transition: all var(--transition-normal);
  z-index: 1;
}

.progress-step.completed .step-circle {
  background: var(--edy-success);
  border-color: var(--edy-success);
  color: white;
}

.progress-step.active .step-circle {
  border-color: #1D4ED8;
  color: #1D4ED8;
  background: rgba(62,106,225,0.08);
  box-shadow: none;
}

.progress-step .step-label {
  margin-left: 10px;
  font-size: 14px;
  color: var(--edy-text-tertiary);
  white-space: nowrap;
  font-weight: 500;
}

.progress-step.completed .step-label { color: var(--edy-success); }
.progress-step.active .step-label { color: var(--edy-text-primary); font-weight: 600; }

.progress-step .step-line {
  flex: 1;
  height: 2px;
  background: var(--edy-border);
  margin: 0 14px;
  border-radius: 1px;
}

.progress-step.completed .step-line { background: var(--edy-success); }

/* Vertical Progress */
.progress-steps-vertical {
  display: flex;
  flex-direction: column;
}

.progress-step-v {
  display: flex;
  gap: 16px;
  position: relative;
  padding-bottom: 32px;
}

.progress-step-v:last-child { padding-bottom: 0; }

.progress-step-v .step-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-step-v .step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid var(--edy-border);
  background: var(--edy-surface);
  color: var(--edy-text-tertiary);
  flex-shrink: 0;
  z-index: 1;
}

.progress-step-v.completed .step-dot {
  background: var(--edy-success);
  border-color: var(--edy-success);
  color: white;
}

.progress-step-v.active .step-dot {
  border-color: #1D4ED8;
  color: #1D4ED8;
  background: rgba(62,106,225,0.08);
  box-shadow: none;
}

.progress-step-v.rejected .step-dot {
  background: var(--edy-error);
  border-color: var(--edy-error);
  color: white;
}

.progress-step-v .step-connector {
  width: 2px;
  flex: 1;
  background: var(--edy-border);
  margin-top: 4px;
  border-radius: 1px;
}

.progress-step-v.completed .step-connector { background: var(--edy-success); }

.progress-step-v .step-content { padding-top: 2px; }

.progress-step-v .step-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--edy-text-tertiary);
  margin-bottom: 2px;
}

.progress-step-v.completed .step-title { color: var(--edy-text-primary); }
.progress-step-v.active .step-title { color: var(--edy-blue); }
.progress-step-v.rejected .step-title { color: var(--edy-error); }

.progress-step-v .step-desc {
  font-size: 12px;
  color: var(--edy-text-tertiary);
}

/* ========== Buttons — Modern E-commerce ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--edy-font-text);
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 22px;
  letter-spacing: normal;
  box-shadow: none;
  height: 32px;
  min-width: 60px;
  box-sizing: border-box;
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: #1d4ed8;
  color: white;
}

.btn-primary:hover {
  background: #1e40af;
  color: #fff;
}

/* ========== 统一蓝色主按钮别名（搜索/查询/确定/保存/提交 等） ==========
   将历史遗留的多种类名映射到 .btn-primary 视觉规格：
   高度 32px / 最小宽 60px / 圆角 4px / 内间距 4px 12px / 行高 22px / 字号 14px / 蓝底白字 */
.search-filter-row .sf-btn.primary,
.advanced-filter-panel .filter-actions .sf-btn.primary,
.sub-filter-bar .sf-btn:not(.ghost),
.brand-btn-primary,
.btn-export,
.rr-filter .btn-query,
.row-actions .act.primary-btn,
.og-acts .act.primary-btn,
.toolbar .search-box .search-btn,
.sku-presale-batch .batch-btn:not(.ghost),
.step2-batch .batch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-width: 60px;
  padding: 4px 12px;
  line-height: 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--edy-font-text);
  border-radius: 4px;
  border: none;
  background: #1d4ed8;
  color: #FFFFFF;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: none;
  transition: background 0.2s ease;
}
.search-filter-row .sf-btn.primary:hover,
.advanced-filter-panel .filter-actions .sf-btn.primary:hover,
.sub-filter-bar .sf-btn:not(.ghost):hover,
.brand-btn-primary:hover,
.btn-export:hover,
.rr-filter .btn-query:hover,
.row-actions .act.primary-btn:hover,
.og-acts .act.primary-btn:hover,
.toolbar .search-box .search-btn:hover,
.sku-presale-batch .batch-btn:not(.ghost):hover,
.step2-batch .batch-btn:hover {
  background: #1e40af;
  color: #FFFFFF;
}

/* ========== 统一次级（白底）按钮别名（重置/取消 等） ==========
   高度 32px / 最小宽 60px / 圆角 4px / 内间距 4px 12px / 行高 22px / 字号 14px
   白底 / 灰边 / 深色文字 */
.search-filter-row .sf-btn:not(.primary),
.advanced-filter-panel .filter-actions .sf-btn:not(.primary),
.inline-action-bar .ia-btn,
.sub-filter-bar .sf-btn.ghost,
.brand-btn-secondary,
.btn-reset,
.rr-filter .btn-reset,
.row-actions .act:not(.primary-btn),
.og-acts .act:not(.primary-btn),
.batch-bar .batch-btn,
.sku-presale-batch .batch-btn.ghost,
.rel-foot .batch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-width: 60px;
  padding: 4px 12px;
  line-height: 22px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--edy-font-text);
  border-radius: 4px;
  border: 1px solid #E8ECF0;
  background: #FFFFFF;
  color: #4A5068;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  box-shadow: none;
  transition: all 0.2s ease;
}
.search-filter-row .sf-btn:not(.primary):hover,
.advanced-filter-panel .filter-actions .sf-btn:not(.primary):hover,
.inline-action-bar .ia-btn:hover,
.sub-filter-bar .sf-btn.ghost:hover,
.brand-btn-secondary:hover,
.btn-reset:hover,
.rr-filter .btn-reset:hover,
.row-actions .act:not(.primary-btn):hover,
.og-acts .act:not(.primary-btn):hover,
.batch-bar .batch-btn:hover,
.sku-presale-batch .batch-btn.ghost:hover,
.rel-foot .batch-btn:hover {
  border-color: #1d4ed8;
  color: #1d4ed8;
  background: #FFFFFF;
}

.btn-secondary {
  background: #FFFFFF;
  color: #4A5068;
  border: 1px solid #E8ECF0;
  /* box-shadow: var(--shadow-sm); */
}

.btn-secondary:hover {
  background: #F7F8FA;
  border-color: #C8CDD5;
}

.btn-cta {
  background: linear-gradient(135deg, #1E2742, #2D3A5C);
  color: #FFFFFF;
}

.btn-cta:hover {
  background: linear-gradient(135deg, #2D3A5C, #3D4E72);
}

.btn-success {
  background: linear-gradient(135deg, #22C55E, #16A34A);
  color: white;
  box-shadow: 0 2px 8px rgba(34,197,94,0.25);
}

.btn-danger {
  background: linear-gradient(135deg, #EF4444, #DC2626);
  color: white;
  box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}

.btn-ghost {
  background: transparent;
  color: #8B90A0;
  box-shadow: none;
}

.btn-ghost:hover {
  background: #F2F4F7;
  color: #1D4ED8;
}

.btn-sm { padding: 4px 16px; font-size: 14px; height: 32px; }
.btn-lg { padding: 12px 32px; font-size:14px; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ========== Form Elements - Tesla Style ========== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #1A1D26;
  margin-bottom: 8px;
  letter-spacing: normal;
}

.form-label .required {
  color: var(--edy-error);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #E8ECF0;
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--edy-font-text);
  color: #1A1D26;
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.33s;
  letter-spacing: normal;
  box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: #1D4ED8;
  box-shadow: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #8E8E8E;
}

.form-textarea { resize: vertical; min-height: 88px; line-height: 1.53; }

.form-hint {
  font-size: 12px;
  color: var(--edy-text-tertiary);
  margin-top: 6px;
  letter-spacing: -0.005em;
}

.form-error {
  font-size: 12px;
  color: var(--edy-error);
  margin-top: 6px;
  font-weight: 500;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

/* ========== Tabs - Tesla Style ========== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border);
}

.tab-item {
  padding: 12px 22px;
  font-size: 14px;
  font-weight: 400;
  color: #8B90A0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.33s, border-color 0.33s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--edy-font-text);
  letter-spacing: normal;
}

.tab-item:hover { color: #1A1D26; }

.tab-item.active {
  color: #1D4ED8;
  border-bottom-color: #1D4ED8;
  font-weight: 500;
}

.tab-item .tab-count {
  font-size: 12px;
  background: #F2F4F7;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 6px;
  color: #8B90A0;
  font-weight: 500;
}

.tab-item.active .tab-count {
  background: rgba(62,106,225,0.08);
  color: #1D4ED8;
}

/* ========== Modal - Tesla Style ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(128,128,128,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.33s;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #FFFFFF;
  border-radius: 4px;
  border: 1px solid #E8ECF0;
  box-shadow: none;
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(10px);
  transition: transform 0.33s;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 24px 28px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-family: var(--edy-font-display);
  font-size: 20px;
  font-weight: 500;
  color: #1A1D26;
  letter-spacing: normal;
}

.modal-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--edy-text-tertiary);
  border: none;
  background: transparent;
  font-size: 22px;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: #F2F4F7;
  color: #1A1D26;
}

.modal-body { 
  padding: 0 28px 24px; 
  overflow-y: auto; 
}

.modal-footer {
  padding: 18px 28px 24px;
  border-top: 1px solid var(--edy-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ========== Toast - Tesla Style ========== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: none;
  border: 1px solid #E8ECF0;
  min-width: 300px;
  max-width: 420px;
  animation: toastIn 0.33s cubic-bezier(0.5, 0, 0, 0.75);
  font-size: 14px;
  letter-spacing: normal;
}

.toast.success { border-left: 3px solid var(--edy-success); }
.toast.error { border-left: 3px solid var(--edy-error); }
.toast.warning { border-left: 3px solid var(--edy-warning); }
.toast.info { border-left: 3px solid var(--edy-blue); }

.toast .toast-icon { font-size: 18px; flex-shrink: 0; }
.toast.success .toast-icon { color: var(--edy-success); }
.toast.error .toast-icon { color: var(--edy-error); }
.toast.warning .toast-icon { color: var(--edy-warning); }
.toast.info .toast-icon { color: var(--edy-blue); }

.toast .toast-msg { flex: 1; color: var(--edy-text-primary); font-weight: 500; }

.toast .toast-close {
  cursor: pointer;
  color: var(--edy-text-tertiary);
  font-size: 16px;
  border: none;
  background: transparent;
  padding: 4px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}

.toast .toast-close:hover {
  background: var(--edy-bg);
  color: var(--edy-text-primary);
}

@keyframes toastIn {
  from { 
    opacity: 0; 
    transform: translateX(60px) translateY(-10px); 
  }
  to { 
    opacity: 1; 
    transform: translateX(0) translateY(0); 
  }
}

/* ========== Upload Area ========== */
.upload-area {
  border: 2px dashed var(--edy-border);
  border-radius: var(--edy-radius-lg);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--edy-bg);
}

.upload-area:hover {
  border-color: #1D4ED8;
  background: rgba(62,106,225,0.04);
}

.upload-area .upload-icon {
  font-size: 36px;
  color: var(--edy-text-tertiary);
  margin-bottom: 12px;
}

.upload-area .upload-text {
  font-size:14px;
  color: var(--edy-text-secondary);
  margin-bottom: 4px;
  font-weight: 500;
}

.upload-area .upload-hint {
  font-size: 14px;
  color: var(--edy-text-tertiary);
}

/* ========== Empty State - Apple Style ========== */
.empty-state {
  text-align: center;
  padding: 64px 24px;
}

.empty-state .empty-icon {
  font-size: 56px;
  color: var(--edy-text-tertiary);
  margin-bottom: 16px;
  opacity: 0.7;
}

.empty-state .empty-title {
  font-family: var(--edy-font-display);
  font-size:20px;
  font-weight: 500;
  color: #1A1D26;
  margin-bottom: 8px;
  letter-spacing: normal;
}

.empty-state .empty-desc {
  font-size:14px;
  color: var(--edy-text-secondary);
  margin-bottom: 20px;
  line-height: 1.53;
}

/* ========== Toolbar ========== */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 14px;
  flex-wrap: wrap;
}

.toolbar-left { display: flex; align-items: center; gap: 10px; }
.toolbar-right { display: flex; align-items: center; gap: 10px; }

/* ========== Search Bar - Tesla Style ========== */
.search-bar {
  position: relative;
  width: 320px;
}

.search-bar input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 40px;
  border: 1px solid #E8ECF0;
  border-radius: 4px;
  font-size: 14px;
  font-family: var(--edy-font-text);
  background: #FFFFFF;
  color: #1A1D26;
  outline: none;
  transition: border-color 0.33s;
  letter-spacing: normal;
  box-shadow: none;
}

.search-bar input:focus {
  border-color: #1D4ED8;
  box-shadow: none;
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--edy-text-tertiary);
  font-size:14px;
}

/* ========== Radio Card ========== */
.radio-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.radio-card {
  border: 2px solid var(--edy-border);
  border-radius: var(--edy-radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: center;
}

.radio-card:hover {
  border-color: #1D4ED8;
}

.radio-card.selected {
  border-color: var(--edy-blue);
  background: var(--edy-blue-light);
}

.radio-card .card-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

.radio-card .card-name {
  font-size:14px;
  font-weight: 600;
  color: var(--edy-text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.radio-card .card-desc {
  font-size: 14px;
  color: var(--edy-text-secondary);
}

.radio-card .card-amount {
  font-family: var(--edy-font-display);
  font-size: 18px;
  font-weight: 500;
  color: #1A1D26;
  margin-top: 10px;
  letter-spacing: normal;
}

/* ========== Radio Button ========== */
input[type="radio"] {
  accent-color: var(--edy-blue);
}

input[type="radio"]:hover {
  cursor: pointer;
}

/* ========== Checkbox：所有选中态统一使用主题色 #1D4ED8 ========== */
/* 用 !important 覆盖各模块内联 / 局部 accent-color 设置（如 var(--b-blue): #1D4ED8、var(--tb-orange) 等） */
input[type="checkbox"] {
  accent-color: #1D4ED8 !important;
}
input[type="checkbox"]:hover { cursor: pointer; }

/* ========== Filter Panel - Tesla Style ========== */
.filter-panel {
  background: #FFFFFF;
  border: 1px solid #E8ECF0;
  border-radius: 4px;
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: none;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.filter-row:last-child { margin-bottom: 0; }

.filter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--edy-text-secondary);
  min-width: 70px;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}

.filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-option {
  padding: 6px 16px;
  border-radius: var(--edy-radius-full);
  font-size: 14px;
  cursor: pointer;
  border: 1px solid var(--edy-border);
  background: var(--edy-surface);
  color: var(--edy-text-secondary);
  transition: all var(--transition-fast);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.filter-option:hover {
  border-color: #1D4ED8;
  color: #1D4ED8;
}

.filter-option.active {
  background: #1D4ED8;
  border-color: #1D4ED8;
  color: white;
  box-shadow: none;
}

/* ========== Batch Action Bar ========== */
.batch-bar {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  background: var(--edy-blue-light);
  border-radius: var(--edy-radius-md);
  margin-bottom: 16px;
  font-size: 14px;
}

.batch-bar.show { display: flex; }

.batch-bar .batch-count {
  font-weight: 600;
  color: var(--edy-blue);
}

/* ========== Progress Bar ========== */
.progress-bar {
  height: 6px;
  background: var(--edy-border);
  border-radius: var(--edy-radius-full);
  overflow: hidden;
}

.progress-bar .progress-fill {
  height: 100%;
  background: var(--edy-blue);
  border-radius: var(--edy-radius-full);
  transition: width var(--transition-normal);
}

/* ========== Section Divider ========== */
.section-divider {
  height: 1px;
  background: var(--edy-border);
  margin: 32px 0;
}

/* ========== Responsive ========== */
@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }
  .sidebar.mobile-open { transform: translateX(0); }
  .topbar { left: 0; }
  .main-content { margin-left: 0; }
}

@media (max-width: 767px) {
  .main-content { padding: 20px 16px; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .radio-cards { grid-template-columns: 1fr; }
  .search-bar { width: 100%; }
  .topbar-search { display: none; }
  .page-title { font-size: 20px; }
  .modal { width: 95%; max-width: none; margin: 16px; }
}

/* ========== Scrollbar - Tesla Style ========== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D0D1D2; border-radius:4px; }
::-webkit-scrollbar-thumb:hover { background: #8E8E8E; }

/* ========== Utility ========== */
.text-primary { color: var(--edy-blue) !important; }
.text-success { color: var(--edy-success) !important; }
.text-warning { color: var(--edy-warning) !important; }
.text-error { color: var(--edy-error) !important; }
.text-cta { color: var(--edy-cta) !important; }
.text-secondary { color: var(--edy-text-secondary) !important; }
.text-tertiary { color: var(--edy-text-tertiary) !important; }
.font-mono { font-family: var(--edy-font-display) !important; }
.font-bold { font-weight: 700 !important; }
.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: 8px !important; }
.mt-4 { margin-top: 16px !important; }
.mt-6 { margin-top: 24px !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: 8px !important; }
.mb-4 { margin-bottom: 16px !important; }
.mb-6 { margin-bottom: 24px !important; }
.gap-2 { gap: 8px !important; }
.gap-4 { gap: 16px !important; }
.flex { display: flex !important; }
.flex-center { display: flex !important; align-items: center !important; justify-content: center !important; }
.flex-between { display: flex !important; align-items: center !important; justify-content: space-between !important; }
.hidden { display: none !important; }

/* ========== Drawer - Notification ========== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.drawer-overlay.show {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 420px;
  max-width: 90vw;
  background: #FFFFFF;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 1001;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.drawer.show {
  transform: translateX(0);
}

.drawer-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--edy-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.drawer-title {
  font-family: var(--edy-font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--edy-text-primary);
  margin: 0;
}

.drawer-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  color: var(--edy-text-tertiary);
  border: none;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  transition: all 0.15s;
}

.drawer-close:hover {
  background: #F2F4F7;
  color: #1A1D26;
}

.drawer-body {
  padding: 20px 24px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ========== Notification List ========== */
.notification-search {
  margin-bottom: 16px;
  flex-shrink: 0;
}

.notification-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 16px;
}

.notification-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--edy-border-light);
  cursor: pointer;
  transition: background 0.15s;
  border-radius: 8px;
  margin-bottom: 8px;
}

.notification-item:hover {
  background: var(--edy-blue-light);
}

.notification-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.notification-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.notification-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
}

.notification-type.appeal { background: rgba(139, 92, 246, 0.1); color: #8B5CF6; }
.notification-type.punishment { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.notification-type.infringement { background: rgba(239, 68, 68, 0.1); color: #EF4444; }
.notification-type.warning { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }
.notification-type.stock { background: rgba(255, 107, 53, 0.1); color: #FF6B35; }
.notification-type.product { background: rgba(59, 130, 246, 0.1); color: #3B82F6; }
.notification-type.finance { background: rgba(34, 197, 94, 0.1); color: #22C55E; }
.notification-type.activity { background: rgba(251, 191, 36, 0.1); color: #FBBF24; }

.notification-time {
  font-size: 12px;
  color: var(--edy-text-tertiary);
}

.notification-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--edy-text-primary);
  margin-bottom: 6px;
}

.notification-content {
  font-size: 14px;
  color: var(--edy-text-secondary);
  line-height: 1.6;
}

.notification-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--edy-text-tertiary);
}

.notification-pagination {
  flex-shrink: 0;
}

.notification-pagination .table-pagination {
  padding: 0;
  border-top: none;
}

/* ========== pdd-sb 统一侧边栏 ========== */
#sidebar.pdd-sb { width:220px; flex-direction:column; overflow-y:auto; padding:10px 12px 24px; background: #F9FAFB; }
#sidebar.pdd-sb .sidebar-icon-rail,
#sidebar.pdd-sb .sidebar-panel { display:none; }
#sidebar.pdd-sb ~ .main-content { margin-left:220px; }
#sidebar.pdd-sb ~ .shop-main  { margin-left:220px; }
#sidebar.pdd-sb ~ .bill-main  { margin-left:220px; }
.pdd-home { display:block; padding:12px 4px; font-size:14px; color:var(--edy-text-primary); text-decoration:none; border-bottom:1px solid #E5E7EB; }
.pdd-home:hover { color:var(--edy-blue); }
.pdd-home.active { color:var(--edy-blue); font-weight:500; }
.pdd-section { background:transparent; padding:6px 4px 8px; border-bottom:1px solid #E5E7EB; }
.pdd-section:last-child { border-bottom:0; }
.pdd-section-head { display:flex; align-items:center; padding:6px 0; line-height:1; }
.pdd-section-head .ic { display:inline-flex; width:16px; height:16px; align-items:center; justify-content:center; color:var(--color-text-tertiary); margin-right:6px; flex-shrink:0; }
.pdd-section-head .ic svg { width:15px; height:15px; display:block; stroke:currentColor; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.pdd-section-head .ttl { font-size:14px; font-weight:400; color:var(--edy-text-primary); flex:1; line-height:16px; }
.pdd-section-head .ch { color:var(--edy-text-tertiary); cursor:pointer; transition:transform 0.2s; font-size:12px; margin-left:6px; }
.pdd-section.collapsed .ch { transform:rotate(-90deg); }
.pdd-section.collapsed .pdd-grid { display:none; }
.pdd-grid { display:grid; grid-template-columns:1fr 1fr; gap:0; padding:2px 0; }
.pdd-grid a { display:block; font-size:12px; color:var(--edy-text-primary); text-decoration:none; border-radius:4px; line-height:28px; padding:0 4px; }
.pdd-grid a:hover { background:#EFF6FF; color:var(--edy-blue); }
.pdd-grid a.active { background:#EFF6FF; color:var(--edy-blue); font-weight:500; }
/* 常用功能 */
.fav-count-info { font-size:12px; color:#4b5563; margin-left:auto; margin-right:5px; }
.fav-count-info strong { color:var(--edy-blue); }
.fav-save-btn { font-size:12px; color:var(--edy-blue); background:#EEF3FF; border:1px solid #C7D9F8; border-radius:4px; padding:1px 7px; cursor:pointer; font-family:inherit; white-space:nowrap; }
.fav-save-btn:hover { background:#DBEAFE; }
.fav-hint { font-size:12px; color:#9CA3AF; text-align:center; padding:5px 0 2px; }
.fav-empty { font-size:12px; color:#9CA3AF; padding:6px 0 2px; text-align:center; }
.pdd-edit .pdd-grid { gap:0 12px; }
.pdd-edit .pdd-grid a { display:flex !important; align-items:center; height:28px; }
.pdd-tb { display:inline-flex; align-items:center; justify-content:center; width:15px; height:15px; border-radius:50%; font-size:14px; font-weight:400; line-height:28px; align-self:center; cursor:pointer; margin-left:auto; flex-shrink:0; transition:opacity .15s; }
.pdd-tb:hover { opacity:.7; }
.pdd-tb.tb-add { color:#1D4ED8; }
.pdd-tb.tb-rm  { color:#EF4444; }
.w-full { width: 100% !important; }

/* ========== 全局：所有输入框 / 按钮统一 border-radius: 4px ========== */
/* 排除 radio/checkbox/file/range/color（保留浏览器原生样式） */
/* 排除 .keep-radius / 显式 border-radius:50% 的圆形按钮（关闭按钮等） */
input:not([type="radio"]):not([type="checkbox"]):not([type="file"]):not([type="range"]):not([type="color"]),
textarea,
select,
button:not([style*="border-radius:50%"]):not([style*="border-radius: 50%"]):not(.keep-radius) {
  border-radius: 4px !important;
}
.btn,
.f-input, .f-select, .f-textarea,
.form-input, .form-select, .form-textarea,
.fm-input, .fm-select { border-radius: 4px !important; }

/* ========== 统一表格分页（参考 merchant/ship/index.html）========== */
.pager,
.pagination,
.pg,
.pg-bar,
.tk-pager,
.vio-pager,
.lg-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 20px;
  font-size: 14px;
  color: var(--edy-text-secondary, #4b5563);
}
.pg-btn,
.pager .pg-btn,
.pager .pager-btn,
.pagination .pg-btn,
.pagination button,
.pg .pg-btn,
.pg-bar .pg-btn,
.tk-pager .pg-btn,
.pagination .pn,
.pager .pn {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--edy-border, #E8ECF0);
  border-radius: 6px;
  background: #FFFFFF;
  cursor: pointer;
  font-size: 14px;
  color: var(--edy-text-primary, #171A20);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, color .15s, background .15s;
}
.pg-btn:hover:not(:disabled),
.pager .pg-btn:hover:not(:disabled),
.pager .pager-btn:hover:not(:disabled),
.pagination .pg-btn:hover:not(:disabled),
.pagination button:hover:not(:disabled),
.pg .pg-btn:hover:not(:disabled),
.pg-bar .pg-btn:hover:not(:disabled),
.tk-pager .pg-btn:hover:not(:disabled),
.pagination .pn:hover:not(.disabled),
.pager .pn:hover:not(.disabled) {
  border-color: var(--edy-blue, var(--edy-blue));
  color: var(--edy-blue, var(--edy-blue));
}
.pg-btn.active,
.pager .pg-btn.active,
.pager .pager-btn.active,
.pagination .pg-btn.active,
.pagination button.active,
.pg .pg-btn.active,
.pg-bar .pg-btn.active,
.tk-pager .pg-btn.active,
.pagination .pn.active,
.pager .pn.active {
  background: var(--edy-blue, var(--edy-blue));
  border-color: var(--edy-blue, var(--edy-blue));
  color: #FFFFFF;
}
.pg-btn:disabled,
.pg-btn.disabled,
.pager .pg-btn:disabled,
.pager .pager-btn:disabled,
.pagination .pg-btn:disabled,
.pagination button:disabled,
.pg .pg-btn:disabled,
.pg-bar .pg-btn:disabled,
.tk-pager .pg-btn:disabled,
.pagination .pn.disabled,
.pager .pn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pager select,
.pagination select,
.pg select,
.pg-bar select,
.tk-pager select {
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--edy-border, #E8ECF0);
  border-radius: 6px;
  font-size: 14px;
  background: #FFFFFF;
  font-family: inherit;
  color: var(--edy-text-primary, #171A20);
  outline: none;
}
.pager select:focus,
.pagination select:focus,
.pg select:focus,
.pg-bar select:focus,
.tk-pager select:focus { border-color: var(--edy-blue, var(--edy-blue)); }
/* ========== 统一悬浮提示卡（EDY风格白底卡片） ========== */
.q-tip { position: relative; }
.q-tip:hover { color: var(--edy-blue); }

/* 由 _shared.js 注入到 body 下的全局浮层 */
.q-tip-pop {
  position: fixed; z-index: 9999;
  background: #fff; color: #393C41;
  padding: 10px 14px;
  border: 1px solid #E5E7EB; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15,23,42,0.12);
  font-size: 12px; line-height: 1.65; font-weight: 400; font-style: normal;
  white-space: normal; text-align: left;
  min-width: 160px; max-width: 280px;
  pointer-events: none;
  opacity: 0; visibility: hidden;
  transition: opacity .15s, visibility .15s, transform .15s;
  transform: translateY(-2px);
}
.q-tip-pop.show { opacity: 1; visibility: visible; transform: translateY(0); }
.q-tip-pop strong { color: #171A20; font-weight: 600; }
.q-tip-pop .q-tip-arrow {
  position: absolute; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border: 7px solid transparent;
}
.q-tip-pop[data-pos="top"] .q-tip-arrow {
  top: 100%; border-top-color: #fff; filter: drop-shadow(0 1px 0 #E5E7EB);
}
.q-tip-pop[data-pos="bottom"] .q-tip-arrow {
  bottom: 100%; border-bottom-color: #fff; filter: drop-shadow(0 -1px 0 #E5E7EB);
}
