/* ============================================================
 * 杩堥紟瑁呴グERP v4.0 - 鍏ㄥ眬鏍峰紡
 * Win妗岄潰椋庢牸(erp_preview涓婚)锛屼富鑹茶皟绾㈣壊 var(--primary)
 * ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== 全局基础样式 ===== */
html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: var(--font-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* 选中文本样式 */
::selection {
  background: var(--primary-100);
  color: var(--primary-700);
}
/* 焦点样式 */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-secondary);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
/* 减少动画支持 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 图片不超出容器 */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* 链接样式 */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--primary-dark);
}

/* 按钮基础样式 */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* 输入框基础样式 */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ---------- 表单组件系统 ---------- */
.form-group {
  margin-bottom: var(--space-4);
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-label {
  display: block;
  font-size: var(--font-sm);
  font-weight: var(--weight-medium);
  color: var(--text);
  margin-bottom: var(--space-2);
}
.form-label .required {
  color: var(--error);
  margin-left: 2px;
}
.form-label .optional {
  color: var(--text-muted);
  font-weight: var(--weight-normal);
  margin-left: 4px;
}

/* 输入框 */
.form-input,
.form-select,
.form-textarea {
  display: block;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-base);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--card-bg);
  border: 1px solid var(--border-secondary);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}
.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: var(--text-muted);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
  background: var(--card-bg);
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-disabled);
}
.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background: var(--bg-tertiary);
  color: var(--text-disabled);
  cursor: not-allowed;
  opacity: 0.7;
}
.form-input[readonly],
.form-textarea[readonly] {
  background: var(--bg-secondary);
  cursor: default;
}

/* 输入框尺寸 */
.form-input-sm,
.form-select-sm,
.form-textarea-sm {
  padding: var(--space-1) var(--space-2);
  font-size: var(--font-sm);
  border-radius: var(--radius-sm);
}
.form-input-lg,
.form-select-lg,
.form-textarea-lg {
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-md);
  border-radius: var(--radius-lg);
}

/* 文本域 */
.form-textarea {
  min-height: 80px;
  resize: vertical;
}

/* 选择器 */
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right var(--space-2) center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  padding-right: var(--space-8);
}

/* 表单验证状态 */
.form-group.success .form-input,
.form-group.success .form-select,
.form-group.success .form-textarea {
  border-color: var(--success);
}
.form-group.success .form-input:focus,
.form-group.success .form-select:focus,
.form-group.success .form-textarea:focus {
  box-shadow: 0 0 0 3px var(--success-bg);
}
.form-group.warning .form-input,
.form-group.warning .form-select,
.form-group.warning .form-textarea {
  border-color: var(--warning);
}
.form-group.warning .form-input:focus,
.form-group.warning .form-select:focus,
.form-group.warning .form-textarea:focus {
  box-shadow: 0 0 0 3px var(--warning-bg);
}
.form-group.error .form-input,
.form-group.error .form-select,
.form-group.error .form-textarea {
  border-color: var(--error);
}
.form-group.error .form-input:focus,
.form-group.error .form-select:focus,
.form-group.error .form-textarea:focus {
  box-shadow: 0 0 0 3px var(--error-bg);
}

/* 表单帮助文案 */
.form-help {
  font-size: var(--font-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
  line-height: var(--leading-normal);
}
.form-group.success .form-help {
  color: var(--success);
}
.form-group.warning .form-help {
  color: var(--warning);
}
.form-group.error .form-help {
  color: var(--error);
}

/* 表单错误信息 */
.form-error {
  font-size: var(--font-xs);
  color: var(--error);
  margin-top: var(--space-1);
  display: flex;
  align-items: center;
  gap: 4px;
}
.form-error::before {
  content: '⚠';
  font-size: 10px;
}

/* 输入框前缀/后缀 */
.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
}
.input-group .form-input,
.input-group .form-select {
  flex: 1;
  min-width: 0;
}
.input-group .input-group-prepend,
.input-group .input-group-append {
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  font-size: var(--font-sm);
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-secondary);
}
.input-group .input-group-prepend {
  border-right: none;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.input-group .input-group-append {
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.input-group .form-input:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.input-group .form-input:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.input-group .input-group-prepend + .form-input {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* 表单行 */
.form-row {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.form-row .form-group {
  flex: 1;
  min-width: 200px;
}

/* 复选框/单选框 */
.form-check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  user-select: none;
}
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}
.form-check .form-check-label {
  font-size: var(--font-sm);
  color: var(--text);
}
.form-check input:disabled + .form-check-label {
  color: var(--text-disabled);
  cursor: not-allowed;
}

/* 开关 */
.form-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.form-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.form-switch .switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--border-secondary);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}
.form-switch .switch-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}
.form-switch input:checked + .switch-slider {
  background: var(--primary);
}
.form-switch input:checked + .switch-slider::before {
  transform: translateX(18px);
}
.form-switch input:focus + .switch-slider {
  box-shadow: 0 0 0 3px var(--primary-100);
}

/* 表格基础样式 */
table {
  border-collapse: collapse;
  width: 100%;
}
:root {
  /* ===== 主色彩系统（唯一主色=品牌红/页头红 var(--primary)，全站统一；可在 系统设置-界面外观 改页头色全局更换） ===== */
  --primary: #c62828;
  --primary-dark: #ac2323;
  --primary-light: #cd4242;
  --primary-gradient: linear-gradient(135deg, #cd4242 0%, #c62828 100%);
  --primary-soft: #fbf0f0;
  --primary-50: #fbf0f0;
  --primary-100: #f5d8d8;
  --primary-200: #e9adad;
  --primary-300: #de8282;
  --primary-400: #d04f4f;
  --primary-500: #c62828;
  --primary-600: #ac2323;
  --primary-700: #961e1e;
  --primary-800: #831a1a;
  --primary-900: #6f1616;

  /* ===== 语义色系统 ===== */
  --success: #52c41a;
  --success-dark: #389e0d;
  --success-light: #95de64;
  --success-bg: #f6ffed;
  --success-border: #b7eb8f;

  --warning: #faad14;
  --warning-dark: #d48806;
  --warning-light: #ffc53d;
  --warning-bg: #fffbe6;
  --warning-border: #ffe58f;

  --error: #ff4d4f;
  --error-dark: #cf1322;
  --error-light: #ff7875;
  --error-bg: #fff2f0;
  --error-border: #ffccc7;

  --info: #1890ff;
  --info-dark: #096dd9;
  --info-light: #40a9ff;
  --info-bg: #e6f7ff;
  --info-border: #91d5ff;

  /* ===== 中性色系统 ===== */
  --bg: #f5f6fa;
  --bg-secondary: #fafafa;
  --bg-tertiary: #f0f0f0;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #595959;
  --text-muted: #8c8c8c;
  --text-disabled: #bfbfbf;
  --border: #f0f0f0;
  --border-secondary: #d9d9d9;
  --divider: #e8e8e8;
  --sidebar-bg: #ffffff;
  --sidebar-width: 220px;
  --topbar-height: 50px;

  /* ===== 悬停色规范 ===== */
  --hover-bg: #f0f0f0;
  --hover-text: #1a1a1a;
  --hover-border: #d9d9d9;

  /* ===== 圆角规范 ===== */
  --radius: 6px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* ===== 阴影规范 ===== */
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
  --shadow-inner: inset 0 2px 4px 0 rgba(0,0,0,0.06);

  /* ===== 8px基准栅格间距系统 ===== */
  --space-0: 0;
  --space-1: 4px;    /* 0.5x */
  --space-2: 8px;    /* 1x */
  --space-3: 12px;   /* 1.5x */
  --space-4: 16px;   /* 2x */
  --space-5: 20px;   /* 2.5x */
  --space-6: 24px;   /* 3x */
  --space-8: 32px;   /* 4x */
  --space-10: 40px;  /* 5x */
  --space-12: 48px;  /* 6x */
  --space-16: 64px;  /* 8x */

  /* ===== 字体层级规范 ===== */
  --font-xs: 11px;
  --font-sm: 12px;
  --font-base: 14px;
  --font-md: 15px;
  --font-lg: 16px;
  --font-xl: 18px;
  --font-2xl: 20px;
  --font-3xl: 24px;
  --font-4xl: 32px;
  --font-5xl: 40px;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* ===== 过渡动画规范 ===== */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 300ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* ===== 层级z-index规范 ===== */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: var(--font-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#app { display: flex; height: 100vh; }

/* ---------- 渚ц竟鏍?---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-right: none;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  z-index: 100;
  position: relative;
}
.sidebar-resize-handle {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
  background: transparent;
  z-index: 101;
  transition: background 0.2s;
}
.sidebar-resize-handle:hover,
.sidebar-resize-handle.active {
  background: rgba(198, 40, 40, 0.3);
}
body.sidebar-resizing {
  cursor: col-resize !important;
  user-select: none;
}
body.sidebar-resizing * {
  cursor: col-resize !important;
}
.sidebar-logo {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: none;
  background: var(--topbar-color, #c62828);
  color: #fff;
  flex-shrink: 0;
  transition: background-color 0.3s ease;
}
.logo-icon { font-size: 22px; margin-right: 8px; }
.logo-img { height: 30px; width: 30px; object-fit: contain; flex-shrink: 0; margin-right: 8px; position: relative; top: 2px; }
.logo-text { font-size: 16px; font-weight: 700; letter-spacing: 1px; color: #fff; }
.logo-version { font-size: 10px; font-weight: 300; color: rgba(255,255,255,0.55); letter-spacing: 0; margin-left: 4px; }
.sidebar-nav { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 0; }
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* 侧边栏菜单英文 */
.nav-en {
  font-size: 10px;
  font-weight: 400;
  color: #aaa;
  margin-left: 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  display: inline;
}
.nav-item.active .nav-en {
  color: var(--primary);
  opacity: 0.7;
}
/* 菜单英文：桌面默认显示完整版，精简版仅手机端显示（移动端切换见 responsive-enhanced.css） */
.nav-en .en-short { display: none; }
.nav-en .en-full { display: inline; }

.nav-group { margin-bottom: 2px; }
.nav-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: all 0.15s;
  user-select: none;
}
.nav-item:hover { background: #f5f5f5; color: var(--primary); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 500; border-right: 3px solid var(--primary); }
.nav-icon { width: 20px; margin-right: 10px; font-size: 16px; text-align: center; }
.nav-item > span:nth-child(2) { flex: 1; }
.nav-arrow { font-size: 14px; color: var(--text-muted); transition: transform 0.2s; }
.nav-group.open .nav-arrow { transform: rotate(90deg); }
.nav-sub { display: none; background: #fafafa; }
.nav-group.open .nav-sub { display: block; }
.nav-sub .nav-item { padding-left: 46px; font-size: 13px; }
.nav-sub .nav-item.active { background: var(--primary-soft); border-right: 3px solid var(--primary); }

/* ---------- 涓诲尯鍩?---------- */
.main-wrap { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 50px;
  background: var(--topbar-color, #c62828);
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  transition: background-color 0.3s ease;
}
.topbar-left { display: flex; align-items: center; }
.topbar-title { font-size: 16px; font-weight: 600; color: #fff; }
.topbar-right { display: flex; align-items: center; position: relative; }
.topbar-user {
  display: flex; align-items: center; cursor: pointer; padding: 4px 10px; border-radius: 4px;
}
.topbar-user:hover { background: rgba(255,255,255,0.15); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.2);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500; margin-right: 8px;
}
.user-info { display: flex; flex-direction: column; }
.user-info .un { font-size: 13px; font-weight: 500; color: #fff; }
.user-info .ur { font-size: 11px; color: rgba(255,255,255,0.7); }
.user-menu {
  display: none; position: absolute; top: 100%; right: 0; margin-top: 4px;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); min-width: 120px; z-index: 200;
}
.user-menu.show { display: block; }
.user-menu div { padding: 10px 16px; cursor: pointer; font-size: 13px; }
.user-menu div:hover { background: #f5f5f5; color: var(--primary); }

/* ---------- 内容区 ---------- */
.content {
  flex: 1; overflow-y: auto;
  padding: var(--space-4);
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* ===== 顶部加载进度条（NProgress风格）===== */
#nprogress {
  pointer-events: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 99999;
  overflow: hidden;
}
#nprogress .bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: var(--primary);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform 0.2s ease, opacity 0.3s ease;
  box-shadow: 0 0 10px rgba(229,57,53,0.5);
}
#nprogress .peg {
  position: absolute;
  top: 0;
  right: 0;
  width: 80px;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  opacity: 0.6;
  animation: nprogress-peg 1.5s ease-in-out infinite;
}
@keyframes nprogress-peg {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
#nprogress.show .bar {
  transform: scaleX(0.3);
}
#nprogress.progress-60 .bar {
  transform: scaleX(0.6);
}
#nprogress.progress-90 .bar {
  transform: scaleX(0.9);
}
#nprogress.done .bar {
  transform: scaleX(1);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.3s ease 0.1s;
}

/* ===== 页面转场动画 ===== */
.page-enter {
  animation: pageFadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* 卡片级联入场动画 */
.page-enter .card {
  animation: cardSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}
.page-enter .card:nth-child(1) { animation-delay: 0.05s; }
.page-enter .card:nth-child(2) { animation-delay: 0.1s; }
.page-enter .card:nth-child(3) { animation-delay: 0.15s; }
.page-enter .card:nth-child(4) { animation-delay: 0.2s; }
.page-enter .card:nth-child(5) { animation-delay: 0.25s; }
.page-enter .card:nth-child(n+6) { animation-delay: 0.3s; }
@keyframes cardSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== 微交互细节 ===== */
/* 按钮按压回弹 */
.btn:active {
  transform: scale(0.96) !important;
  transition: transform 0.1s ease !important;
}
.btn-primary:active {
  box-shadow: 0 1px 3px rgba(229,57,53,0.3) !important;
}

/* 卡片hover上浮 */
.card {
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(229,57,53,0.15);
}

/* 可点击元素hover */
a, button, .clickable {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
a:hover {
  opacity: 0.8;
}

/* 表格行hover */
table.data-table tbody tr {
  transition: background-color 0.15s ease;
}
table.data-table tbody tr:hover td {
  background-color: rgba(229,57,53,0.03);
}

/* ===== 系统管理页面组件样式 ===== */
/* 卡片内容区 */
.card-body {
  padding: 16px 20px;
}
.card-body.p-2 { padding: 8px; }

/* 分组标题 */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 4px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* 两列网格 */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 24px;
}

/* 提示框 */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 0;
}
.alert-info {
  background: #f0f7ff;
  border: 1px solid #d0e3ff;
  color: #1e5aa8;
}
.alert-success {
  background: #f0f9eb;
  border: 1px solid #c2e7b0;
  color: #529b2e;
}
.alert-warning {
  background: #fdf6ec;
  border: 1px solid #faecd8;
  color: #b88230;
}
.alert-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.alert-warn {
  margin-top: 8px;
  color: var(--primary);
}

/* 复选框/单选框标签 */
.checkbox-label, .radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}
.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* 按钮变体 */
.btn-success {
  background: #52c41a;
  border-color: #52c41a;
  color: #fff;
}
.btn-success:hover {
  background: #73d13d;
  border-color: #73d13d;
}
.btn-danger {
  background: #ff4d4f;
  border-color: #ff4d4f;
  color: #fff;
}
.btn-danger:hover {
  background: #ff7875;
  border-color: #ff7875;
}

/* 下载卡片样式 */
.download-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #e53e3e, #c53030);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.download-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.download-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
}
.download-meta span {
  display: inline-block;
  margin-right: 16px;
}

/* RBAC说明 */
.rbac-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 数据权限框 */
.data-scope-box {
  padding: 12px 16px;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

/* 左右分栏布局优化 */
.split-layout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.split-left {
  width: 280px;
  flex-shrink: 0;
  overflow: hidden;
}
.split-right {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* ===== 集成配置页面样式 ===== */
.page-header {
  margin-bottom: 20px;
}
.page-header h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 8px;
}
.page-header p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* ===== 无障碍访问 ===== */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  text-decoration: none;
  font-size: 14px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.integration-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--border);
}
.tab-btn {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab-btn:hover {
  color: var(--primary);
}
.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.integration-panel {
  display: none;
}
.integration-panel.active {
  display: block;
}
.config-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-bottom: 16px;
}
.config-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.config-card .form-group {
  margin-bottom: 16px;
}
.config-card .form-group:last-child {
  margin-bottom: 0;
}
.config-card .form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.config-card .form-group input[type="text"],
.config-card .form-group input[type="password"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
  background: var(--card-bg);
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.config-card .form-group input[type="text"]:focus,
.config-card .form-group input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229,57,53,0.1);
}
.config-card .form-row {
  display: flex;
  gap: 16px;
}
.config-card .form-row .form-group {
  flex: 1;
}
.config-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.btn-secondary {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

/* Toast通知动效 */
.toast {
  animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.toast.hide {
  animation: toastSlideOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}
@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px) scale(0.95);
  }
}

/* 标签hover */
.tag {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.tag:hover {
  transform: scale(1.05);
}

/* 输入框聚焦动画 */
.inp, input, select, textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* 下拉菜单动画 */
.dropdown-menu, .user-menu {
  animation: dropdownFadeIn 0.2s ease;
  transform-origin: top right;
}
@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* 模态框动画 */
.modal-box {
  animation: modalSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.modal-mask {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 侧边栏菜单项hover */
.nav-item {
  position: relative;
  overflow: hidden;
}
.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  transform: scaleY(0);
  transition: transform 0.2s ease;
}
.nav-item:hover::before,
.nav-item.active::before {
  transform: scaleY(1);
}

/* 数字变化动画 */
.stat-number {
  transition: color 0.3s ease;
}

/* 图片加载淡入 */
img {
  transition: opacity 0.3s ease;
}

/* ---------- 加载 ---------- */
.loading { display: flex; align-items: center; justify-content: center; height: 200px; color: var(--text-muted); }
.spinner {
  width: 24px; height: 24px; border: 3px solid #eee; border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite; margin-right: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border: 1px solid var(--border);
  transition: box-shadow var(--transition-normal), transform var(--transition-normal), border-color var(--transition-normal);
  position: relative;
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-secondary);
}

/* 卡片尺寸 */
.card-sm {
  padding: var(--space-3);
  border-radius: var(--radius-md);
}
.card-lg {
  padding: var(--space-6);
  border-radius: var(--radius-xl);
}

/* 卡片类型 */
.card-flat {
  box-shadow: none;
  border: 1px solid var(--border);
}
.card-flat:hover {
  box-shadow: var(--shadow-sm);
}
.card-bordered {
  box-shadow: none;
  border: 1px solid var(--border-secondary);
}
.card-shadow {
  box-shadow: var(--shadow-md);
}
.card-shadow:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.card-hoverable:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-200);
}

/* 卡片结构 */
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.card-header .card-title {
  margin-bottom: 0;
  border-bottom: none;
  padding-bottom: 0;
}
.card-body {
  padding: 0;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.card-title {
  font-size: var(--font-md);
  font-weight: var(--weight-semibold);
  color: var(--text);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.card-subtitle {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-top: -8px;
  margin-bottom: var(--space-3);
}
.card-description {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* 卡片组 */
.card-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.card-group .card {
  margin-bottom: 0;
  border-radius: 0;
  border-bottom: none;
}
.card-group .card:first-child {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card-group .card:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border-bottom: 1px solid var(--border);
}
.card-group .card:only-child {
  border-radius: var(--radius-lg);
}

/* 卡片加载状态 */
.card.loading {
  pointer-events: none;
  opacity: 0.7;
}
.card.loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: card-shimmer 1.5s infinite;
}
@keyframes card-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ---------- 缁熻卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: #ffffff; border-radius: 12px; padding: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  display: flex; align-items: center; gap: 14px; border: 1px solid rgba(0,0,0,0.04);
  border-left: 3px solid var(--primary);
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); transform: translateY(-1px); }
/* 彩色左侧竖条（根据图标颜色），与 erp-stat-card 组件保持一致 */
.stat-card:has(.stat-icon.red) { border-left-color: var(--primary); }
.stat-card:has(.stat-icon.blue) { border-left-color: #1976d2; }
.stat-card:has(.stat-icon.green) { border-left-color: #43a047; }
.stat-card:has(.stat-icon.orange) { border-left-color: #ff9800; }
.stat-card:has(.stat-icon.yellow) { border-left-color: #ffc107; }
.stat-card:has(.stat-icon.purple) { border-left-color: #8e24aa; }
.stat-card:has(.stat-icon.teal) { border-left-color: #00897b; }
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.stat-icon.red { background: var(--primary); color: #fff; }
.stat-icon.blue { background: #1976d2; color: #fff; }
.stat-icon.green { background: #43a047; color: #fff; }
.stat-icon.orange { background: #ff9800; color: #fff; }
.stat-icon.yellow { background: #ffc107; color: #fff; }
.stat-icon.purple { background: #8e24aa; color: #fff; }
.stat-info { flex: 1; min-width: 0; }
.stat-info .stat-label { font-size: 13px; color: #666; margin-bottom: 4px; }
.stat-info .stat-value { font-size: 22px; font-weight: 700; color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- 表格 ---------- */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card-bg);
}
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-sm);
}
table.data-table th {
  background: var(--bg-secondary);
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: var(--font-sm);
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
  color: var(--text);
  vertical-align: middle;
}
table.data-table tbody tr:last-child td {
  border-bottom: none;
}
table.data-table tr:hover td {
  background: var(--bg-secondary);
}
table.data-table .actions {
  white-space: nowrap;
}
table.data-table .actions a {
  color: var(--primary);
  text-decoration: none;
  margin-right: var(--space-3);
  cursor: pointer;
  font-size: var(--font-sm);
  font-weight: var(--weight-medium);
  transition: color var(--transition-fast);
}
table.data-table .actions a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
table.data-table .actions a:last-child {
  margin-right: 0;
}

/* 表格尺寸 */
.table-sm table.data-table th,
.table-sm table.data-table td {
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-xs);
}
.table-lg table.data-table th,
.table-lg table.data-table td {
  padding: var(--space-4) var(--space-5);
  font-size: var(--font-base);
}

/* 表格类型 */
/* 斑马纹 */
.table-striped table.data-table tbody tr:nth-child(even) td {
  background: var(--bg-secondary);
}
.table-striped table.data-table tbody tr:nth-child(even):hover td {
  background: var(--bg-tertiary);
}
/* 边框表格 */
.table-bordered table.data-table {
  border: 1px solid var(--border);
}
.table-bordered table.data-table th,
.table-bordered table.data-table td {
  border: 1px solid var(--border);
}
/* 无边框表格 */
.table-borderless table.data-table th,
.table-borderless table.data-table td {
  border: none;
}
.table-borderless .table-wrap {
  border: none;
  background: transparent;
}
/* 紧凑表格 */
.table-compact table.data-table th,
.table-compact table.data-table td {
  padding: var(--space-1) var(--space-2);
}

/* 表格行状态 */
/* 选中行 */
table.data-table tr.selected td {
  background: var(--primary-50) !important;
}
table.data-table tr.selected:hover td {
  background: var(--primary-100) !important;
}
/* 禁用行 */
table.data-table tr.disabled td {
  opacity: 0.5;
  pointer-events: none;
}

/* 排序 */
table.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}
table.data-table th.sortable:hover {
  background: var(--bg-tertiary);
}
table.data-table th.sortable .sort-icon {
  display: inline-block;
  margin-left: var(--space-1);
  font-size: 10px;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
}
table.data-table th.sortable:hover .sort-icon {
  opacity: 0.8;
}
table.data-table th.sortable.asc .sort-icon,
table.data-table th.sortable.desc .sort-icon {
  opacity: 1;
  color: var(--primary);
}

/* 复选框列 */
table.data-table .col-checkbox {
  width: 40px;
  text-align: center;
}
table.data-table .col-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* 数字列右对齐 */
table.data-table .col-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 状态标签 */
table.data-table .status-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--font-xs);
  font-weight: var(--weight-medium);
}
.status-tag.success {
  background: var(--success-bg);
  color: var(--success-dark);
}
.status-tag.warning {
  background: var(--warning-bg);
  color: var(--warning-dark);
}
.status-tag.error {
  background: var(--error-bg);
  color: var(--error-dark);
}
.status-tag.info {
  background: var(--info-bg);
  color: var(--info-dark);
}
.status-tag.default {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* 分页器 */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.pagination-info {
  font-size: var(--font-sm);
  color: var(--text-secondary);
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-size: var(--font-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.pagination-btn:hover:not(:disabled):not(.active) {
  border-color: var(--primary);
  color: var(--primary);
}
.pagination-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.pagination-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: #e5e7eb;
  color: #9ca3af;
  border-color: #e5e7eb;
}
.pagination-size {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-sm);
  color: var(--text-secondary);
}
.pagination-size select {
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  font-size: var(--font-sm);
  cursor: pointer;
}

/* 表格空状态 */
.table-empty {
  padding: var(--space-12) var(--space-4);
  text-align: center;
  color: var(--text-muted);
}
.table-empty .empty-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
  opacity: 0.5;
}
.table-empty .empty-text {
  font-size: var(--font-base);
  margin-bottom: var(--space-2);
}
.table-empty .empty-desc {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-4);
}

/* 表格加载状态 */
.table-loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}
.table-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  margin: -16px 0 0 -16px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: table-spin 0.8s linear infinite;
}
@keyframes table-spin {
  to { transform: rotate(360deg); }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: #fff; color: var(--text);
  font-size: var(--font-sm);
  font-weight: var(--weight-medium);
  line-height: var(--leading-tight);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  user-select: none; -webkit-user-select: none;
  position: relative; overflow: hidden;
  min-height: 32px;
  gap: var(--space-1);
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-xs);
}
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.btn:disabled, .btn.disabled {
  cursor: not-allowed;
  opacity: 1;
  background: #e5e7eb !important;
  background-image: none !important;
  color: #9ca3af !important;
  border-color: #e5e7eb !important;
  transform: none !important;
  box-shadow: none !important;
}

/* 按钮尺寸 */
.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-xs);
  min-height: 28px;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: var(--space-3) var(--space-6);
  font-size: var(--font-base);
  min-height: 40px;
  border-radius: var(--radius-lg);
}
.btn-xl {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-md);
  min-height: 48px;
  border-radius: var(--radius-lg);
}

/* 主按钮 */
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(198, 40, 40, 0.3);
}
.btn-primary:active {
  background: var(--primary-800);
  border-color: var(--primary-800);
}

/* 次按钮（描边按钮） */
.btn-secondary {
  background: #fff;
  border-color: var(--border-secondary);
  color: var(--text);
}
.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-50);
}

/* 文字按钮 */
.btn-text {
  background: transparent;
  border-color: transparent;
  color: var(--primary);
  padding: var(--space-1) var(--space-2);
}
.btn-text:hover {
  background: var(--primary-50);
  color: var(--primary-dark);
  transform: none;
  box-shadow: none;
}

/* 危险按钮 */
.btn-danger {
  background: var(--error);
  border-color: var(--error);
  color: #fff;
}
.btn-danger:hover {
  background: var(--error-dark);
  border-color: var(--error-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 77, 79, 0.3);
}

/* 成功按钮 */
.btn-success {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.btn-success:hover {
  background: var(--success-dark);
  border-color: var(--success-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(82, 196, 26, 0.3);
}

/* 警告按钮 */
.btn-warning {
  background: var(--warning);
  border-color: var(--warning);
  color: #fff;
}
.btn-warning:hover {
  background: var(--warning-dark);
  border-color: var(--warning-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(250, 173, 20, 0.3);
}

/* 信息按钮 */
.btn-info {
  background: var(--info);
  border-color: var(--info);
  color: #fff;
}
.btn-info:hover {
  background: var(--info-dark);
  border-color: var(--info-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

/* 图标按钮 */
.btn-icon {
  padding: var(--space-2);
  min-width: 32px;
  min-height: 32px;
  border-radius: var(--radius-md);
}
.btn-icon.btn-sm {
  padding: var(--space-1);
  min-width: 28px;
  min-height: 28px;
}
.btn-icon.btn-lg {
  padding: var(--space-3);
  min-width: 40px;
  min-height: 40px;
}

/* 按钮加载状态 */
.btn.loading {
  pointer-events: none;
  opacity: 0.7;
}
.btn.loading::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
  margin-right: var(--space-2);
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* 按钮组 */
.btn-group {
  display: inline-flex;
  gap: 0;
}
.btn-group .btn {
  border-radius: 0;
  margin-left: -1px;
}
.btn-group .btn:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  margin-left: 0;
}
.btn-group .btn:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.btn-group .btn:only-child {
  border-radius: var(--radius-md);
}

/* 块级按钮 */
.btn-block {
  display: flex;
  width: 100%;
}

/* ===== 中英文标题样式 ===== */
#topbarTitle {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
#topbarTitle .title-cn {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}
#topbarTitle .title-en {
  font-size: 12px;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
/* 卡片标题英文 */
.card-title {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.card-title .title-en {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
/* 分组标题英文 */
.section-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.section-title .title-en {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* ===== 通用页面组件样式 ===== */
.selected-count {
  font-size: 12px;
  color: #07c160;
  margin-left: 8px;
  display: none;
  font-weight: normal;
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}
.filter-input {
  min-width: 180px;
}
.btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(0.97); box-shadow: var(--shadow-xs); }
.btn:disabled, .btn.disabled { opacity: 1; cursor: not-allowed; transform: none !important; box-shadow: none !important; background:#e5e7eb !important; background-image:none !important; color:#9ca3af !important; border-color:#e5e7eb !important; }

/* ===== 骨架屏 ===== */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 4px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-line { height: 14px; margin-bottom: 10px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.skeleton-card { padding: 16px; border-radius: 12px; background: #fff; margin-bottom: 12px; }
.skeleton-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.skeleton-table { width: 100%; border-collapse: collapse; }
.skeleton-table td { padding: 12px; border-bottom: 1px solid #f0f0f0; }

/* ===== 空状态 ===== */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-10) var(--space-6); text-align: center; color: var(--text-muted);
}
.empty-state-icon {
  font-size: 56px; margin-bottom: var(--space-4);
  opacity: 0.6; line-height: 1;
  filter: grayscale(0.2);
}
.empty-state-title {
  font-size: var(--font-lg); font-weight: var(--weight-semibold);
  color: var(--text-secondary); margin-bottom: var(--space-2);
}
.empty-state-desc {
  font-size: var(--font-sm); color: var(--text-muted);
  margin-bottom: var(--space-5); line-height: var(--leading-relaxed);
  max-width: 320px;
}
.empty-state-action {
  display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: center;
}
/* 涟漪效果 */
.btn-ripple {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,0.4);
  transform: scale(0); animation: ripple-animation 0.6s linear; pointer-events: none;
}
@keyframes ripple-animation { to { transform: scale(4); opacity: 0; } }
.btn-primary {
  background: var(--primary-gradient);
  color: #fff; border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(198,40,40,0.25);
  transition: all .2s;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary) 0%, #a01818 100%);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(198,40,40,0.35);
}
.btn-sm { padding: 4px 10px; font-size: 12px; min-height: 28px; }
.btn-danger { color: var(--primary); border-color: var(--primary-soft); background: #fff; }
.btn-danger:hover { background: var(--primary-soft); }

/* ===== 10分按钮体系 ===== */
/* 尺寸变体 */
.btn-lg { padding: 10px 24px; font-size: 16px; min-height: 44px; border-radius: 8px; }
.btn-xs { padding: 2px 8px; font-size: 11px; min-height: 24px; border-radius: 4px; }

/* 颜色变体 */
.btn-success {
  background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
  color: #fff; border-color: #389e0d;
  box-shadow: 0 2px 8px rgba(56,158,13,0.25);
}
.btn-success:hover {
  background: linear-gradient(135deg, #389e0d 0%, #237804 100%);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(56,158,13,0.35);
}
.btn-warning {
  background: linear-gradient(135deg, #faad14 0%, #d48806 100%);
  color: #fff; border-color: #d48806;
  box-shadow: 0 2px 8px rgba(212,136,6,0.25);
}
.btn-warning:hover {
  background: linear-gradient(135deg, #d48806 0%, #ad6800 100%);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212,136,6,0.35);
}
.btn-info {
  background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
  color: #fff; border-color: #096dd9;
  box-shadow: 0 2px 8px rgba(9,109,217,0.25);
}
.btn-info:hover {
  background: linear-gradient(135deg, #096dd9 0%, #0050b3 100%);
  color: #fff; transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(9,109,217,0.35);
}
.btn-link {
  background: none; border: none; color: var(--primary);
  padding: 4px 8px; box-shadow: none;
}
.btn-link:hover {
  background: none; color: var(--primary-dark);
  text-decoration: underline; transform: none; box-shadow: none;
}
.btn-ghost {
  background: transparent; border: 1px solid var(--border);
  color: var(--text);
}
.btn-ghost:hover {
  background: var(--bg); border-color: var(--primary);
  color: var(--primary);
}

/* 填充变体（outline） */
.btn-outline-primary {
  background: #fff; color: var(--primary); border-color: var(--primary);
}
.btn-outline-primary:hover {
  background: var(--primary); color: #fff;
}
.btn-outline-success {
  background: #fff; color: #52c41a; border-color: #52c41a;
}
.btn-outline-success:hover {
  background: #52c41a; color: #fff;
}
.btn-outline-danger {
  background: #fff; color: #ff4d4f; border-color: #ff4d4f;
}
.btn-outline-danger:hover {
  background: #ff4d4f; color: #fff;
}

/* Loading状态 */
.btn.loading, .btn[data-loading="true"] {
  pointer-events: none;
  opacity: 0.8;
}
.btn.loading::before, .btn[data-loading="true"]::before {
  content: '';
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  margin-right: 8px;
  animation: btn-spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* Success状态 */
.btn.btn-success-state {
  background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%) !important;
  border-color: #389e0d !important;
  color: #fff !important;
}
.btn.btn-success-state::before {
  content: '✓';
  margin-right: 6px;
  font-weight: bold;
  animation: btn-check 0.3s ease;
}
@keyframes btn-check {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* 图标按钮 */
.btn-icon {
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
  font-size: 16px;
  line-height: 1;
}
.btn-icon.btn-sm { padding: 4px; min-width: 28px; min-height: 28px; font-size: 14px; }
.btn-icon.btn-lg { padding: 12px; min-width: 48px; min-height: 48px; font-size: 20px; }
.btn .btn-icon-left { margin-right: 6px; display: inline-flex; align-items: center; }
.btn .btn-icon-right { margin-left: 6px; display: inline-flex; align-items: center; }

/* 按钮组 */
.btn-group {
  display: inline-flex;
  position: relative;
  vertical-align: middle;
}
.btn-group .btn {
  border-radius: 0;
  margin-left: -1px;
}
.btn-group .btn:first-child {
  border-top-left-radius: var(--radius-md);
  border-bottom-left-radius: var(--radius-md);
  margin-left: 0;
}
.btn-group .btn:last-child {
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}
.btn-group .btn:hover,
.btn-group .btn:focus {
  z-index: 1;
}
.btn-group .btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* 块级按钮 */
.btn-block {
  display: flex;
  width: 100%;
}

/* 文字按钮 */
.btn-text {
  background: none;
  border: none;
  padding: 4px 8px;
  color: var(--primary);
  box-shadow: none;
  min-height: auto;
}
.btn-text:hover {
  background: rgba(229,57,53,0.08);
  color: var(--primary-dark);
  transform: none;
  box-shadow: none;
  border-radius: 4px;
}
.btn-text.danger { color: #ff4d4f; }
.btn-text.danger:hover { background: rgba(255,77,79,0.08); }

/* 按钮间距工具类 */
.btn + .btn { margin-left: 8px; }
.btn-group .btn + .btn { margin-left: -1px; }

/* 点击波纹效果增强 */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transform: scale(0);
  animation: ripple-effect 0.6s ease-out;
  pointer-events: none;
}
@keyframes ripple-effect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* 按钮焦点无障碍 */
.btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- 标签 ---------- */
.tag {
  display: inline-block; padding: 2px var(--space-2);
  border-radius: var(--radius-sm); font-size: var(--font-xs);
  line-height: var(--leading-tight); font-weight: var(--weight-medium);
}
.tag-green { background: #e8f5e9; color: #2e7d32; }
.tag-red { background: var(--primary-soft); color: var(--primary); }
.tag-blue { background: #e3f2fd; color: #1565c0; }
.tag-orange { background: #fff3e0; color: #e65100; }
.tag-gray { background: #f5f5f5; color: #757575; }
.tag-purple { background: #f3e5f5; color: #7b1fa2; }

/* ---------- 表单 ---------- */
.form-row { display: flex; margin-bottom: var(--space-4); align-items: center; }
.form-row label {
  width: 100px; text-align: right; padding-right: var(--space-3);
  color: var(--text-secondary); font-size: var(--font-sm);
  font-weight: var(--weight-medium); flex-shrink: 0;
}
.form-row input, .form-row select, .form-row textarea {
  flex: 1; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--font-sm); outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(229,57,53,0.12);
}
.inp, input.inp, select.inp, textarea.inp {
  width:100%; padding: var(--space-2) var(--space-3);
  border:1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--font-sm); outline:none; box-sizing:border-box;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.inp:focus { border-color:var(--primary); box-shadow: 0 0 0 2px rgba(229,57,53,0.12); }
.form-row textarea { min-height: 60px; resize: vertical; }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  margin-bottom: var(--space-4); align-items: center;
}
.filter-bar input, .filter-bar select {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: var(--font-sm); outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(229,57,53,0.12);
}

/* ---------- 分页 ---------- */
.pagination { display: flex; align-items: center; justify-content: flex-end; margin-top: 12px; gap: 6px; }
.pagination button {
  padding: 4px 10px; border: 1px solid var(--border); background: #fff; border-radius: 4px;
  cursor: pointer; font-size: 12px;
}
.pagination button.active { background: #fff; color: #222; border-color: var(--primary); }
.pagination button:disabled { opacity: 1; cursor: not-allowed; background:#e5e7eb; color:#9ca3af; border-color:#e5e7eb; }
.pagination .page-info { font-size: 12px; color: var(--text-muted); margin: 0 8px; display: none !important; }

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
  background: #fff; border-radius: 8px; width: 90%; max-width: 600px; max-height: 85vh;
  display: flex; flex-direction: column; box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.modal-header {
  padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex;
  align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; }
.modal-close { cursor: pointer; font-size: 20px; color: var(--text-muted); background: none; border: none; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Toast（页面上方居中横条：成功绿条/错误红条） ---------- */
.toast {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%);
  background: #1976d2; color: #fff; padding: 11px 26px; border-radius: 8px;
  z-index: 99999; font-size: 13px; line-height: 1.4; text-align: center;
  min-width: 180px; max-width: min(560px, 88vw); box-sizing: border-box;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
  animation: toastSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  word-break: break-word;
}
.toast.success { background: #43a047; }
.toast.error { background: var(--primary); }
.toast.warning { background: #fb8c00; }
.toast.info { background: #1976d2; }
@keyframes toastIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 空状态---------- */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .es-icon { font-size: 48px; margin-bottom: 12px; }

/* ---------- 杩涘害鏉?---------- */
.progress-bar { width: 100%; height: 6px; background: #eee; border-radius: 3px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: #fff; border-radius: 3px; transition: width 0.3s; }

/* ============================================================
 * v4.1 宸紓鍖栧竷灞€鏍峰紡
 * ============================================================ */

/* ---------- 鍥捐〃瀹瑰櫒 ---------- */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100% !important; }
.chart-grid { display: grid; gap: 16px; margin-top: 16px; }
.chart-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.chart-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ---------- 鐪嬫澘甯冨眬 ---------- */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { flex: 1; min-width: 260px; background: #f5f6f8; border-radius: 8px; padding: 12px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; font-weight: 600; font-size: 14px; }
.kanban-col-head .k-count { background: #e0e0e0; color: #555; font-size: 12px; padding: 1px 8px; border-radius: 10px; }
.kanban-card { background: #fff; border-radius: 6px; padding: 12px; margin-bottom: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); cursor: pointer; transition: box-shadow 0.2s; border-left: 3px solid var(--primary); }
.kanban-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.kanban-card .kc-title { font-weight: 600; font-size: 13px; margin-bottom: 6px; color: #333; }
.kanban-card .kc-meta { font-size: 12px; color: #888; display: flex; justify-content: space-between; margin-top: 6px; }
.kanban-card .kc-amount { font-size: 15px; font-weight: 700; color: var(--primary); margin: 4px 0; }
.kanban-card .kc-actions { margin-top: 8px; display: flex; gap: 6px; }
.kanban-card .kc-actions .btn { padding: 2px 10px; font-size: 12px; }

/* ---------- 鏃堕棿绾?---------- */
.timeline { position: relative; padding-left: 28px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 4px; bottom: 4px; width: 2px; background: #e0e0e0; }
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.timeline-item.done::before { background: #fff; }
.timeline-item.pending::before { border-color: #bbb; background: #f5f5f5; }
.timeline-item .ti-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.timeline-item .ti-title { font-weight: 600; font-size: 14px; }
.timeline-item .ti-time { font-size: 12px; color: #999; }
.timeline-item .ti-body { font-size: 13px; color: #666; }
.timeline-item .ti-meta { font-size: 12px; color: #999; margin-top: 4px; }

/* ---------- 卡片缃戞牸 ---------- */
.card-grid { display: grid; gap: 14px; }
.card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.card-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.info-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; transition: box-shadow 0.2s; }
.info-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.info-card .ic-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.info-card .ic-title { font-weight: 600; font-size: 14px; color: #333; }
.info-card .ic-body { font-size: 13px; color: #666; line-height: 1.8; }
.info-card .ic-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f0f0; display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #999; }
.info-card .ic-amount { font-size: 18px; font-weight: 700; color: var(--primary); }

/* ---------- 宸﹀彸鍒嗘爮 ---------- */
.split-layout { display: flex; gap: 16px; height: calc(100vh - 140px); }
.split-left { width: 280px; flex-shrink: 0; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow-y: auto; }
.split-right { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow-y: auto; padding: 16px; }
.split-list-item { padding: 12px 14px; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s; }
.split-list-item:hover { background: #f9f9f9; }
.split-list-item.active { background: #fff0f0; border-left: 3px solid var(--primary); }
.split-list-item .sli-title { font-weight: 600; font-size: 13px; }
.split-list-item .sli-sub { font-size: 12px; color: #999; margin-top: 2px; }

/* ---------- Tab鍒囨崲 ---------- */
.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid #f0f0f0; margin-bottom: 16px; }
.tab-item { padding: 8px 18px; cursor: pointer; font-size: 14px; color: #666; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.tab-item:hover { color: var(--primary); }
.tab-item.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab-item .tab-badge { display: inline-block; background: var(--primary); color: #222; font-size: 11px; min-width: 18px; height: 18px; line-height: 18px; border-radius: 9px; text-align: center; padding: 0 5px; margin-left: 4px; }

/* ---------- 鍒嗙被Tabv宸ヨ壓鏍囧噯绛夛級 ---------- */
.cat-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.cat-tab { padding: 6px 16px; border-radius: 16px; background: #f0f0f0; font-size: 13px; cursor: pointer; transition: all 0.2s; }
.cat-tab:hover { background: var(--primary-soft); }
.cat-tab.active { background: #fff; color: #222; }

/* ---------- 鐩戞帶鐢婚潰缃戞牸 ---------- */
.camera-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.camera-cell { background: #1a1a1a; border-radius: 8px; overflow: hidden; position: relative; aspect-ratio: 16/9; }
.camera-cell .cam-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; color: #555; font-size: 14px; flex-direction: column; gap: 8px; }
.camera-cell .cam-placeholder .cam-icon { font-size: 36px; }
.camera-cell .cam-overlay { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: center; }
.camera-cell .cam-name { color: #222; font-size: 13px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,0.5); }
.camera-cell .cam-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.camera-cell .cam-status.online { background: rgba(67,160,71,0.9); color: #222; }
.camera-cell .cam-status.offline { background: rgba(158,158,158,0.9); color: #222; }
.camera-cell .cam-actions { position: absolute; bottom: 8px; right: 8px; display: flex; gap: 6px; }
.camera-cell .cam-actions button { background: rgba(255,255,255,0.15); border: none; color: #222; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.camera-cell .cam-actions button:hover { background: rgba(255,255,255,0.3); }

/* ---------- 姝ラ鏉?---------- */
.steps { display: flex; align-items: flex-start; margin: 16px 0; padding: 10px 0; }
.step { flex: 1; text-align: center; position: relative; padding: 0 4px; }
.step::after { content: ''; position: absolute; top: 14px; left: 50%; right: -50%; height: 3px; background: #e8e8e8; z-index: 0; border-radius: 2px; }
.step:last-child::after { display: none; }
.step.done::after { background: linear-gradient(90deg, #52c41a, #73d13d); }
.step.active::after { background: linear-gradient(90deg, #52c41a, #e8e8e8); }
.step .step-dot { width: 28px; height: 28px; border-radius: 50%; background: #f0f0f0; color: #999; line-height: 28px; font-size: 13px; margin: 0 auto 8px; position: relative; z-index: 1; font-weight: 600; transition: all 0.3s ease; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.step.done .step-dot { background: linear-gradient(135deg, #52c41a, #73d13d); color: #fff; box-shadow: 0 2px 8px rgba(82,196,26,0.3); }
.step.active .step-dot { background: linear-gradient(135deg, #1890ff, #40a9ff); color: #fff; box-shadow: 0 2px 12px rgba(24,144,255,0.4); animation: pulse 2s infinite; }
.step.rejected .step-dot { background: linear-gradient(135deg, #ff4d4f, #ff7875); color: #fff; }
.step .step-label { font-size: 12px; color: #999; line-height: 1.4; word-break: break-all; }
.step.done .step-label, .step.active .step-label { color: #333; font-weight: 600; }
@keyframes pulse { 0%, 100% { box-shadow: 0 2px 12px rgba(24,144,255,0.4); } 50% { box-shadow: 0 2px 20px rgba(24,144,255,0.6); } }

/* ---------- 开关组件---------- */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background: #ccc; border-radius: 22px; transition: 0.3s; }
.switch .slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s; }
.switch input:checked + .slider { background: #fff; }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* ---------- 鐩稿唽缃戞牸 ---------- */
.photo-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.photo-item { border-radius: 6px; overflow: hidden; cursor: pointer; position: relative; aspect-ratio: 4/3; background: #f0f0f0; }
.photo-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.photo-item:hover img { transform: scale(1.05); }
.photo-item .photo-info { position: absolute; bottom: 0; left: 0; right: 0; background: linear-gradient(transparent, rgba(0,0,0,0.7)); color: #222; padding: 20px 8px 6px; font-size: 12px; }

/* ---------- 鏂囦欢鍒楄〃 ---------- */
.file-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.file-item { text-align: center; padding: 14px 8px; border: 1px solid var(--border); border-radius: 6px; cursor: pointer; transition: all 0.2s; }
.file-item:hover { border-color: var(--primary); background: #fff8f8; }
.file-item .file-icon { font-size: 36px; margin-bottom: 6px; }
.file-item .file-name { font-size: 12px; color: #333; word-break: break-all; }
.file-item .file-size { font-size: 11px; color: #999; margin-top: 2px; }

/* ---------- 鏉冮檺鐭╅樀 ---------- */
.perm-matrix { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-matrix th, .perm-matrix td { border: 1px solid var(--border); padding: 8px 10px; text-align: center; }
.perm-matrix th { background: #fafafa; font-weight: 600; }
.perm-matrix th:first-child, .perm-matrix td:first-child { text-align: left; background: #fafafa; font-weight: 600; }
.perm-matrix input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }

/* ---------- 缁熻卡片澧炲己 ---------- */
.stat-card .stat-trend { font-size: 12px; margin-top: 4px; }
.stat-card .stat-trend.up { color: #43a047; }
.stat-card .stat-trend.down { color: var(--primary); }

/* ---------- 搴撳瓨棰滆壊 ---------- */
.stock-ok { color: #43a047; font-weight: 600; }
.stock-warn { color: var(--primary); font-weight: 600; }

/* ---------- 娑堟伅鍒楄〃 ---------- */
.msg-item { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px solid #f0f0f0; cursor: pointer; transition: background 0.15s; }
.msg-item:hover { background: #f9f9f9; }
.msg-item.unread { background: #fff8f8; }
.msg-item .msg-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.msg-item .msg-body { flex: 1; }
.msg-item .msg-title { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.msg-item.unread .msg-title::after { content: ''; display: inline-block; width: 8px; height: 8px; background: #fff; border-radius: 50%; margin-left: 6px; vertical-align: middle; }
.msg-item .msg-content { font-size: 13px; color: #888; }
.msg-item .msg-time { font-size: 12px; color: #bbb; white-space: nowrap; }

/* ---------- 涓汉涓績 ---------- */
.profile-layout { display: flex; gap: 20px; }
.profile-side { width: 260px; flex-shrink: 0; text-align: center; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; background: #fff; color: #222; font-size: 36px; line-height: 96px; margin: 0 auto 12px; }
.profile-main { flex: 1; }

/* ---------- 鍙睍寮€琛?---------- */
.expand-row { cursor: pointer; }
.expand-row .expand-icon { display: inline-block; transition: transform 0.2s; margin-right: 4px; }
.expand-row.open .expand-icon { transform: rotate(90deg); }
.expand-detail { display: none; }
.expand-detail.show { display: table-row; }
.expand-detail td { background: #fafafa; padding: 12px 16px !important; }

/* ---------- 鍒嗙粍鏍囬 ---------- */
.group-title { font-size: 14px; font-weight: 600; color: #333; padding: 12px 0 8px; border-bottom: 2px solid var(--primary); margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }

/* ---------- 鏄熺骇璇勫垎 ---------- */
.stars { color: #ffb300; letter-spacing: 2px; }

/* ---------- 閲戦澧炲噺棰滆壊 ---------- */
.amount-up { color: var(--primary); font-weight: 600; }
.amount-down { color: #43a047; font-weight: 600; }

@media (min-width: 1025px) {
  .sidebar { position: relative; transform: none; z-index: 100; }
  .content { padding-bottom: 16px; }
  /* 鎭㈠琛ㄦ牸榛樿 */
  table.data-table { display: table; }
  table.data-table thead { display: table-header-group; }
  table.data-table tbody { display: table-row-group; }
  table.data-table tr { display: table-row; background: none; border-radius: 0; box-shadow: none; margin-bottom: 0; padding: 0; }
  table.data-table td { display: table-cell; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
  table.data-table td::before { display: none; }
  table.data-table .actions { display: table-cell; white-space: nowrap; padding-top: 10px; }
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
  .stat-card { flex-direction: row; align-items: center; border-radius: var(--radius); padding: 16px; }
  .stat-icon { margin-bottom: 0; margin-right: 12px; }
  .stat-info .stat-value { font-size: 22px; }
  .filter-bar { flex-direction: row; align-items: center; }
  .form-row { flex-direction: row; align-items: center; }
  .form-row label { width: 100px; text-align: right; padding-right: 12px; margin-bottom: 0; }
  .modal-box { width: 90%; max-width: 600px; height: auto; max-height: 85vh; border-radius: 8px; }
  .modal-body { padding: 20px; }
  .btn { min-height: auto; }
  .kanban { flex-direction: row; }
  .kanban-col { min-width: 260px; width: auto; }
  .split-layout { flex-direction: row; height: calc(100vh - 140px); }
  .split-left { width: 280px; max-height: none; }
  .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .card-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
  .chart-grid.cols-2 { grid-template-columns: 1fr 1fr; }
  .chart-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .camera-grid { grid-template-columns: repeat(2, 1fr); }
  .profile-layout { flex-direction: row; }
  .profile-side { width: 260px; }
  .topbar-user .user-info { display: flex; }
  .topbar-title { display: block; }
}

/* ============================================================
   v6.1 UI缁熶竴澧炲己 鈥?鏍囧噯鍖栭棿璺濄€佸渾瑙掋€佽繃娓°€佺劍鐐规€?
   ============================================================ */

/* 缁熶竴杩囨浮鍔ㄧ敾 */
.btn, .nav-item, .tag, .stat-card, .data-table tbody tr, .qq-package-card,
.filter-bar select, .filter-bar input, .form-row input, .form-row select, .form-row textarea {
  transition: all 0.2s ease;
}

/* 按钮增强 */
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 6px rgba(229,57,53,0.25);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
  box-shadow: 0 4px 12px rgba(229,57,53,0.35);
}

/* 杈撳叆妗嗙劍鐐规€佺粺涓€ */
.inp:focus, .form-row input:focus, .form-row select:focus, .form-row textarea:focus,
.filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(229,57,53,0.12) !important;
  outline: none;
}

/* 琛ㄦ牸琛屾偓鍋?*/
.data-table tbody tr:hover { background: #fff8f8 !important; }

/* 卡片鎮仠鏁堟灉 */
.stat-card { cursor: default; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }

/* 鏍囩缁熶竴鏍峰紡 */
.tag { font-weight: 500; letter-spacing: 0.3px; }

/* 鎿嶄綔閾炬帴缁熶竴涓嬪垝绾?*/
td.actions a:hover, .actions a:hover { text-decoration: underline; }

/* 寮圭獥澧炲己 */
.modal-content { border-radius: 10px !important; box-shadow: 0 20px 60px rgba(0,0,0,0.15) !important; }
.modal-header { font-weight: 600; }

/* 分页按钮 */
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; margin: 0 2px;
  border-radius: var(--radius); border: 1px solid var(--border);
  cursor: pointer; font-size: 13px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 寮€鍏崇粍浠剁編鍖?*/
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; inset: 0; background: #ccc; border-radius: 24px; transition: 0.3s; }
.slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(20px); }

/* 绌虹姸鎬佺編鍖?*/
.data-table td[colspan] { padding: 40px !important; color: var(--text-muted) !important; }

/* 婊氬姩鏉＄編鍖?*/
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* 鍔犺浇鍔ㄧ敾 */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.card { animation: fadeIn 0.25s ease; }

/* 璇︽儏椤甸潰鎻忚堪鍒楄〃 */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.detail-item { padding: 8px 0; border-bottom: 1px solid #f5f5f5; }
.detail-label { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.detail-value { font-size: 14px; font-weight: 500; }

/* 鎵撳嵃鏃舵仮澶嶆闈㈠竷灞€ */
@media print {
  body { overflow: visible; }
  #app { height: auto; display: block; }
  .sidebar, .topbar { display: none !important; }
  .main-wrap { display: block; }
  .content { padding: 0; overflow: visible; }
  .table-wrap { overflow: visible; margin: 0; padding: 0; }
  table.data-table { font-size: 10px; min-width: auto; }
  table.data-table th, table.data-table td { padding: 4px 6px; white-space: normal; }
  .modal-mask, .modal-box, .modal-content { display: none !important; }
}

/* ============================================================
 * AI鏅鸿兘鎶ヨ〃鐢熸垚鍣?
 * ============================================================ */
.ai-report-container { max-width: 1200px; margin: 0 auto; }
.report-input-card {
  background: #fff; border-radius: 8px; padding: 20px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.input-label { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 10px; }
.report-textarea {
  width: 100%; min-height: 80px; padding: 12px; border: 1px solid #e0e0e0;
  border-radius: 6px; font-size: 14px; resize: vertical; box-sizing: border-box;
  font-family: inherit;
}
.report-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(198,40,40,0.1); }
.input-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.generate-status { font-size: 13px; color: #888; }

.report-templates-card {
  background: #fff; border-radius: 8px; padding: 16px 20px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.template-title { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 12px; }
.template-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.template-item {
  padding: 12px; border: 1px solid #eee; border-radius: 6px; cursor: pointer;
  transition: all 0.2s;
}
.template-item:hover { border-color: var(--primary); background: #fef5f5; transform: translateY(-1px); }
.template-name { font-size: 13px; font-weight: 600; color: #333; margin-bottom: 4px; }
.template-desc { font-size: 12px; color: #888; line-height: 1.4; }

.report-result {
  background: #fff; border-radius: 8px; padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.report-title { font-size: 18px; font-weight: 600; color: #222; margin: 0; }
.report-actions { display: flex; gap: 8px; }
.report-meta { font-size: 12px; color: #888; margin-bottom: 16px; line-height: 1.6; }
.sql-toggle { color: var(--primary); cursor: pointer; text-decoration: underline; }
.chart-area { margin-bottom: 16px; padding: 12px; background: #fafafa; border-radius: 6px; }
.analysis-area {
  margin-top: 16px; padding: 16px; background: #f8f9fa; border-radius: 6px;
  border-left: 3px solid var(--primary);
}
.analysis-title { font-size: 14px; font-weight: 600; color: #333; margin-bottom: 8px; }
.analysis-content { font-size: 13px; color: #555; line-height: 1.8; }

.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-text { font-size: 15px; color: #666; margin-bottom: 8px; }
.empty-tips { font-size: 12px; color: #aaa; }

/* ============================================================
 * AI鏅鸿兘鍒嗘瀽涓績
 * ============================================================ */
.ai-center-container { max-width: 1200px; margin: 0 auto; }
.ai-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: #f5f5f5; padding: 4px; border-radius: 8px; overflow-x: auto; }
.ai-tab { padding: 10px 16px; cursor: pointer; border-radius: 6px; font-size: 13px; white-space: nowrap; transition: all 0.2s; color: #666; }
.ai-tab:hover { background: #fff; color: #333; }
.ai-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.ai-tab-content { background: #fff; border-radius: 8px; padding: 20px; min-height: 400px; }

/* 姒傝椤?*/
.ai-overview .overview-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-bottom: 24px; }
.overview-card { background: #fafafa; border: 1px solid #eee; border-radius: 8px; padding: 20px; cursor: pointer; transition: all 0.2s; }
.overview-card:hover { border-color: var(--primary); background: #fff; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.overview-card .card-icon { font-size: 32px; margin-bottom: 12px; }
.overview-card .card-title { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 8px; }
.overview-card .card-desc { font-size: 12px; color: #888; line-height: 1.6; margin-bottom: 12px; }
.overview-card .card-stats { font-size: 12px; color: var(--primary); font-weight: 500; }
.overview-tips { background: #f8f9fa; border-radius: 8px; padding: 20px; }
.overview-tips h3 { font-size: 15px; margin-bottom: 12px; color: #333; }
.overview-tips ul { margin: 0; padding-left: 20px; }
.overview-tips li { font-size: 13px; color: #666; line-height: 2; }
.overview-tips strong { color: #333; }

/* 棰勬祴椤甸€氱敤 */
.ai-predict-page .predict-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.ai-predict-page .predict-header h3 { margin: 0; font-size: 16px; }
.predict-stats { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; padding: 16px; background: #f8f9fa; border-radius: 8px; }
.stat-item { flex: 1; min-width: 120px; text-align: center; }
.stat-item .stat-label { display: block; font-size: 12px; color: #888; margin-bottom: 4px; }
.stat-item .stat-value { display: block; font-size: 20px; font-weight: 600; color: #333; }
.stat-item.high .stat-value { color: #e53e3e; }
.stat-item.medium .stat-value { color: #ed8936; }
.stat-item.low .stat-value { color: #38a169; }
.predict-list .table-wrap { overflow-x: auto; }

/* 椋庨櫓鏍囩 */
.risk-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.risk-badge.risk-high { background: #fed7d7; color: #c53030; }
.risk-badge.risk-medium { background: #feebc8; color: #c05621; }
.risk-badge.risk-low { background: #c6f6d5; color: #276749; }
.risk-high { color: #e53e3e; }
.risk-medium { color: #ed8936; }
.risk-low { color: #38a169; }

/* 璇煶鍔╂墜椤?*/
.ai-voice-page .voice-header { margin-bottom: 16px; }
.ai-voice-page .voice-header h3 { margin: 0 0 4px 0; font-size: 16px; }
.voice-subtitle { font-size: 12px; color: #888; }
.voice-warning { background: #fff3cd; color: #856404; padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 13px; }
.voice-area { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }

/* ===== 二维码长按识别支持（全局所有页面） ===== */
img[src^="data:image"],
#qrCodeImg, #custQrImg,
#shareQr img, #custQrArea img,
.qr-code img, .qrcode img, .qr-img, .qrcode-img,
[id*="qr"] img, [id*="Qr"] img,
[class*="qr"] img, [class*="Qr"] img {
  -webkit-touch-callout: default !important;
  -webkit-user-select: auto !important;
  user-select: auto !important;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: transparent;
}

/* ============================================================
 * 设计系统工具类（基于8px栅格）
 * ============================================================ */

/* ===== Margin ===== */
.m-0  { margin: 0 !important; }
.m-1  { margin: var(--space-1) !important; }
.m-2  { margin: var(--space-2) !important; }
.m-3  { margin: var(--space-3) !important; }
.m-4  { margin: var(--space-4) !important; }
.m-5  { margin: var(--space-5) !important; }
.m-6  { margin: var(--space-6) !important; }
.m-8  { margin: var(--space-8) !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-5 { margin-top: var(--space-5) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.mt-8 { margin-top: var(--space-8) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-5 { margin-bottom: var(--space-5) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }

.ml-0 { margin-left: 0 !important; }
.ml-2 { margin-left: var(--space-2) !important; }
.ml-3 { margin-left: var(--space-3) !important; }
.ml-4 { margin-left: var(--space-4) !important; }

.mr-0 { margin-right: 0 !important; }
.mr-2 { margin-right: var(--space-2) !important; }
.mr-3 { margin-right: var(--space-3) !important; }
.mr-4 { margin-right: var(--space-4) !important; }

.mx-auto { margin-left: auto !important; margin-right: auto !important; }

/* ===== Padding ===== */
.p-0  { padding: 0 !important; }
.p-1  { padding: var(--space-1) !important; }
.p-2  { padding: var(--space-2) !important; }
.p-3  { padding: var(--space-3) !important; }
.p-4  { padding: var(--space-4) !important; }
.p-5  { padding: var(--space-5) !important; }
.p-6  { padding: var(--space-6) !important; }
.p-8  { padding: var(--space-8) !important; }

.pt-0 { padding-top: 0 !important; }
.pt-2 { padding-top: var(--space-2) !important; }
.pt-3 { padding-top: var(--space-3) !important; }
.pt-4 { padding-top: var(--space-4) !important; }

.pb-0 { padding-bottom: 0 !important; }
.pb-2 { padding-bottom: var(--space-2) !important; }
.pb-3 { padding-bottom: var(--space-3) !important; }
.pb-4 { padding-bottom: var(--space-4) !important; }

/* ===== Gap ===== */
.gap-0 { gap: 0 !important; }
.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }
.gap-5 { gap: var(--space-5) !important; }
.gap-6 { gap: var(--space-6) !important; }

/* ===== Flex ===== */
.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.items-center { align-items: center !important; }
.items-start { align-items: flex-start !important; }
.items-end { align-items: flex-end !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.justify-start { justify-content: flex-start !important; }
.justify-end { justify-content: flex-end !important; }
.flex-1 { flex: 1 !important; }
.flex-shrink-0 { flex-shrink: 0 !important; }

/* ===== Text ===== */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-xs { font-size: var(--font-xs) !important; }
.text-sm { font-size: var(--font-sm) !important; }
.text-base { font-size: var(--font-base) !important; }
.text-lg { font-size: var(--font-lg) !important; }
.text-xl { font-size: var(--font-xl) !important; }
.text-2xl { font-size: var(--font-2xl) !important; }
.font-normal { font-weight: var(--weight-normal) !important; }
.font-medium { font-weight: var(--weight-medium) !important; }
.font-semibold { font-weight: var(--weight-semibold) !important; }
.font-bold { font-weight: var(--weight-bold) !important; }
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-muted { color: var(--text-muted) !important; }

/* ===== Width/Height ===== */
.w-full { width: 100% !important; }
.h-full { height: 100% !important; }
.min-h-0 { min-height: 0 !important; }

/* ===== Rounded ===== */
.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

/* ===== Shadow ===== */
.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-none { box-shadow: none !important; }

/* ===== Overflow ===== */
.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.overflow-visible { overflow: visible !important; }

/* ===== Position ===== */
.relative { position: relative !important; }
.absolute { position: absolute !important; }
.fixed { position: fixed !important; }
.sticky { position: sticky !important; }
.top-0 { top: 0 !important; }
.left-0 { left: 0 !important; }
.right-0 { right: 0 !important; }
.bottom-0 { bottom: 0 !important; }
.z-10 { z-index: 10 !important; }
.z-20 { z-index: 20 !important; }
.z-50 { z-index: 50 !important; }
.z-100 { z-index: 100 !important; }

/* ===== Display ===== */
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.hidden { display: none !important; }

/* ===== Cursor ===== */
.cursor-pointer { cursor: pointer !important; }
.cursor-not-allowed { cursor: not-allowed !important; }

/* ===== Transition ===== */
.transition { transition: all 0.2s ease !important; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease !important; }
.transition-shadow { transition: box-shadow 0.2s ease !important; }
.transition-transform { transition: transform 0.2s ease !important; }

/* ===== Opacity ===== */
.opacity-0 { opacity: 0 !important; }
.opacity-50 { opacity: 0.5 !important; }
.opacity-75 { opacity: 0.75 !important; }
.opacity-100 { opacity: 1 !important; }

/* ===== Border ===== */
.border { border: 1px solid var(--border) !important; }
.border-0 { border: 0 !important; }
.border-t { border-top: 1px solid var(--border) !important; }
.border-b { border-bottom: 1px solid var(--border) !important; }
.border-primary { border-color: var(--primary) !important; }

/* ===== Background ===== */
.bg-white { background: #fff !important; }
.bg-primary { background: var(--primary) !important; }
.bg-transparent { background: transparent !important; }

/* ============================================================
   全局基础样式
   ============================================================ */

/* 全局防溢出 */
* {
  box-sizing: border-box;
}
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
img, video, iframe, canvas, svg {
  max-width: 100%;
  height: auto;
}
table {
  max-width: 100%;
}

/* ===== 电脑端 (> 1024px) ===== */
@media (min-width: 1025px) {
  .content {
    padding: 24px;
  }
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .card {
    margin-bottom: 20px;
  }
}

/* ============================================================
   10分标准优化：页面过渡动画、空状态、微交互、安全区域
   ============================================================ */

/* ===== 页面过渡动画 ===== */
.page-enter {
  animation: pageFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 元素淡入动画 */
.fade-in {
  animation: fadeIn 0.3s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.4s ease forwards;
}
.fade-in-down {
  animation: fadeInDown 0.4s ease forwards;
}
.fade-in-left {
  animation: fadeInLeft 0.4s ease forwards;
}
.fade-in-right {
  animation: fadeInRight 0.4s ease forwards;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* 缩放动画 */
.zoom-in {
  animation: zoomIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

/* 延迟动画类 */
.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.delay-5 { animation-delay: 0.5s; opacity: 0; }

/* ===== 空状态组件 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
  text-align: center;
  color: var(--text-muted);
}
.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: var(--space-4);
  opacity: 0.4;
  line-height: 1;
}
.empty-state .empty-title {
  font-size: var(--font-lg);
  font-weight: var(--weight-semibold);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}
.empty-state .empty-desc {
  font-size: var(--font-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  max-width: 400px;
  line-height: var(--leading-relaxed);
}
.empty-state .empty-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

/* 错误状态 */
.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-4);
  text-align: center;
  color: var(--error);
}
.error-state .error-icon {
  font-size: 64px;
  margin-bottom: var(--space-4);
  opacity: 0.6;
  line-height: 1;
}
.error-state .error-title {
  font-size: var(--font-lg);
  font-weight: var(--weight-semibold);
  color: var(--error);
  margin-bottom: var(--space-2);
}
.error-state .error-desc {
  font-size: var(--font-sm);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  max-width: 400px;
  line-height: var(--leading-relaxed);
}
.error-state .error-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
}

/* ===== 微交互优化 ===== */
/* 点击波纹效果 */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  animation: rippleEffect 0.6s linear;
  pointer-events: none;
}
@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* 悬浮提升效果 */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* 悬浮缩放效果 */
.hover-scale {
  transition: transform var(--transition-fast);
}
.hover-scale:hover {
  transform: scale(1.05);
}

/* 悬浮发光效果 */
.hover-glow {
  transition: box-shadow var(--transition-normal);
}
.hover-glow:hover {
  box-shadow: 0 0 20px rgba(198, 40, 40, 0.3);
}

/* 按下效果 */
.press-effect {
  transition: transform var(--transition-fast);
}
.press-effect:active {
  transform: scale(0.97);
}

/* ===== 触控区域优化 ===== */
/* 最小触控区域44px */
.touch-target {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.touch-target-sm {
  min-width: 32px;
  min-height: 32px;
}
.touch-target-lg {
  min-width: 48px;
  min-height: 48px;
}

/* ===== 骨架屏加载动画 ===== */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-tertiary) 25%,
    var(--bg-secondary) 50%,
    var(--bg-tertiary) 75%
  );
  background-size: 200% 100%;
  animation: skeletonLoading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeletonLoading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 骨架屏元素 */
.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}
.skeleton-text:last-child {
  width: 80%;
  margin-bottom: 0;
}
.skeleton-title {
  height: 20px;
  width: 60%;
  margin-bottom: 12px;
}
.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

/* ===== 工具类：文本截断 ===== */
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.text-truncate-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== 工具类：flex布局 ===== */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

/* ===== 工具类：文字颜色 ===== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }

/* ============================================================
   模板四：分组卡片式菜单（顶部红色通栏 + 左侧白色分组菜单）
   ============================================================ */
/* 整体纵向布局：顶部通栏 + 下方(侧栏 + 内容) */
#app { flex-direction: column; }
.app-body { flex: 1; display: flex; min-height: 0; overflow: hidden; }

/* ===== 顶部红色通栏 ===== */
.topbar {
  height: 56px !important;
  background: var(--topbar-color, var(--primary)) !important;
  padding: 0 18px;
  gap: 16px;
  box-shadow: 0 2px 8px rgba(198,40,40,.18);
  position: relative;
  z-index: 50;
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 0; }
.topbar-brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-brand .logo-img { width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.topbar-brand .logo-text { color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.topbar-brand .logo-ver { color: rgba(255,255,255,.75); font-size: 10px; margin-left: 2px; white-space: nowrap; }

/* 顶栏搜索框 */
.topbar-search { position: relative; flex: 1; max-width: 380px; min-width: 120px; }
.topbar-search input {
  width: 100%; height: 36px; box-sizing: border-box;
  border: none; outline: none; border-radius: 20px;
  background: rgba(255,255,255,.2);
  color: #fff; font-size: 13px; padding: 0 34px;
  transition: background .2s;
}
.topbar-search input::placeholder { color: rgba(255,255,255,.78); }
.topbar-search input:focus { background: rgba(255,255,255,.3); }
.topbar-search .ts-ico { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .85; pointer-events: none; }
.topbar-search .ts-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 11px; color: rgba(255,255,255,.9); cursor: pointer; line-height: 1; }

/* 搜索结果下拉框 */
.search-dropdown {
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  z-index: 1000;
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #eee;
}
.search-results { padding: 8px 0; }
.search-group-title {
  padding: 8px 16px 4px;
  font-size: 11px;
  color: #999;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.search-item:hover { background: #f5f5f5; }
.search-item-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  background: #f5f5f5;
  flex-shrink: 0;
}
.search-item-info { flex: 1; min-width: 0; }
.search-item-title { font-size: 13px; color: #333; font-weight: 500; }
.search-item-desc { font-size: 11px; color: #999; margin-top: 2px; }
.search-item-type {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #e3f2fd;
  color: #1976d2;
  flex-shrink: 0;
}
.search-empty {
  padding: 30px 20px;
  text-align: center;
  color: #999;
  font-size: 13px;
}
.search-empty-icon { font-size: 32px; margin-bottom: 8px; opacity: 0.5; }

.topbar-right { gap: 14px; flex-shrink: 0; }
.topbar-title { color: #fff !important; font-size: 15px; font-weight: 600; margin-right: 4px; }
.msg-bell { position: relative; display: flex; align-items: center; }
.topbar-user:hover { background: rgba(255,255,255,.18) !important; }
.user-avatar { background: rgba(255,255,255,.22) !important; }
.user-info .un { color: #fff !important; }
.user-info .ur { color: rgba(255,255,255,.75) !important; }

/* ===== 左侧白色分组菜单 ===== */
.sidebar {
  background: #fff !important;
  border-right: 1px solid #eee;
  height: 100%;
  box-shadow: 1px 0 4px rgba(0,0,0,.03);
}
.sidebar-nav { padding: 10px 10px 24px; }
/* 侧边栏底部版本栏（固定在菜单底部，不随菜单滚动） */
.sidebar-footer {
  flex-shrink: 0;
  padding: 9px 14px 11px;
  border-top: 1px solid #f0f0f0;
  background: #fff;
  user-select: none;
}
.sidebar-footer .sf-row { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11px; line-height: 1.4; }
.sidebar-footer .sf-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.sidebar-footer .sf-name { font-weight: 600; color: #666; }
.sidebar-footer .sf-ver { font-weight: 600; color: var(--primary); }
.sidebar-footer .sf-copy { text-align: center; margin-top: 3px; font-size: 10px; color: #bbb; }
.sidebar-footer .sf-copy-gap { margin-left: 10px; letter-spacing: 0.5px; }
.nav-group-title {
  font-size: 11px; font-weight: 600; color: #9a9a9a;
  letter-spacing: 1px; padding: 14px 12px 6px;
  text-transform: uppercase; user-select: none;
}
.nav-group-title:first-child { padding-top: 6px; }

/* 菜单项：圆角卡片 */
.nav-item { border-radius: 8px; margin: 1px 0; padding: 9px 12px !important; font-size: 13px; }
.nav-item:hover { background: #fff5f5 !important; color: var(--primary) !important; }
.nav-item.active {
  background: linear-gradient(135deg, var(--primary-dark,var(--primary)), var(--primary)) !important;
  color: #fff !important; font-weight: 600;
  border-right: none !important;
  box-shadow: 0 3px 10px rgba(198,40,40,.32);
}
.nav-item.active .nav-icon,
.nav-item.active > span { color: #fff !important; }
.nav-item.active .nav-en { color: rgba(255,255,255,.82) !important; }
.nav-item.active .nav-arrow { color: rgba(255,255,255,.85) !important; }
.nav-icon { color: inherit; }
.nav-sub { background: transparent !important; }
.nav-sub .nav-item { font-size: 12.5px; padding-left: 38px !important; }
.nav-sub .nav-sub .nav-item { padding-left: 52px !important; font-size: 12px; }
.nav-sub .nav-item.active {
  background: linear-gradient(135deg, var(--primary-dark,var(--primary)), var(--primary)) !important;
}
.nav-search-empty { padding: 30px 16px; text-align: center; color: #bbb; font-size: 12px; }

/* 内容区撑满 */
.app-body > .content { height: 100%; }
.text-warning { color: var(--warning) !important; }
.text-error { color: var(--error) !important; }
.text-info { color: var(--info) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-secondary { color: var(--text-secondary) !important; }

/* ===== 工具类：字体粗细 ===== */
.font-normal { font-weight: var(--weight-normal) !important; }
.font-medium { font-weight: var(--weight-medium) !important; }
.font-semibold { font-weight: var(--weight-semibold) !important; }
.font-bold { font-weight: var(--weight-bold) !important; }

/* ===== 工具类：文字大小 ===== */
.text-xs { font-size: var(--font-xs) !important; }
.text-sm { font-size: var(--font-sm) !important; }
.text-base { font-size: var(--font-base) !important; }
.text-md { font-size: var(--font-md) !important; }
.text-lg { font-size: var(--font-lg) !important; }
.text-xl { font-size: var(--font-xl) !important; }
.text-2xl { font-size: var(--font-2xl) !important; }
.text-3xl { font-size: var(--font-3xl) !important; }

/* ============================================================
 * 通用卡片式模板样式（模板风格统一）
 * ============================================================ */

/* 搜索栏 */
.tpl-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.tpl-search-input {
  flex: 1;
  height: 42px;
  border: 1px solid #e8e8e8;
  border-radius: 21px;
  padding: 0 16px 0 40px;
  font-size: 14px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 14px center;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
}
.tpl-search-input:focus { border-color: var(--primary); }
.tpl-add-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: 400;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  line-height: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.2s;
}
.tpl-add-btn:hover { background: var(--primary-dark); transform: scale(1.05); }

/* 搜索按钮 */
.tpl-search-btn {
  height: 42px;
  padding: 0 20px;
  border: none;
  border-radius: 21px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  transition: all 0.2s;
  white-space: nowrap;
}
.tpl-search-btn:hover { background: var(--primary-dark); }
.tpl-search-btn:active { transform: scale(0.98); }

/* 搜索栏容器：输入框 + 搜索按钮 + 操作按钮 */
.tpl-search-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
}
.tpl-search-bar .tpl-search-input {
  flex: 1;
  min-width: 0;
}
.tpl-search-bar .tpl-search-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
/* 界面外观（主题颜色配置）为有效功能，在系统设置分页中正常显示；仅隐藏已废弃的旧明暗主题编辑区块 */
#hoverSection, #lightBgSection, #darkBgSection, #themePresetSection { display: none !important; }

/* 筛选标签 */
.tpl-filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 14px;
}
.tpl-filter-tabs::-webkit-scrollbar { display: none; }
.tpl-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 20px;
  background: #fff;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  border: 1px solid #e8e8e8;
  white-space: nowrap;
  font-weight: 500;
  transition: all 0.2s;
}
.tpl-tab:hover { border-color: var(--primary); color: var(--primary); }
.tpl-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}
.tpl-tab span { font-size: 11px; opacity: 0.75; margin-left: 2px; }

/* 卡片列表 */
.tpl-card-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.tpl-card {
  background: #fff;
  border-radius: 14px;
  padding: 16px;
  border: 1px solid #f0f0f0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.2s;
  cursor: pointer;
}
.tpl-card:hover {
  border-color: var(--primary-soft);
  box-shadow: 0 6px 16px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}
.tpl-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}
.tpl-card-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tpl-card-body {
  font-size: 13px;
  color: #666;
  line-height: 1.7;
  margin-bottom: 10px;
}
.tpl-card-body .row {
  display: flex;
  gap: 6px;
  margin-bottom: 2px;
}
.tpl-card-body .label { color: #999; flex-shrink: 0; }
.tpl-card-body .value { color: #333; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid #f5f5f5;
  font-size: 12px;
  color: #999;
}
.tpl-card-actions {
  display: flex;
  gap: 6px;
}

/* 圆形头像 */
.tpl-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.tpl-avatar.red { background: var(--primary); }
.tpl-avatar.blue { background: #1976d2; }
.tpl-avatar.green { background: #43a047; }
.tpl-avatar.orange { background: #ff9800; }
.tpl-avatar.purple { background: #8e24aa; }
.tpl-avatar.teal { background: #00897b; }

/* 进度条 */
.tpl-progress-bar {
  height: 6px;
  background: #eee;
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}
.tpl-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary));
  border-radius: 3px;
  transition: width 0.3s;
}

/* 标签 */
.tpl-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 4px;
}
.tpl-tag.red { background: var(--primary-soft); color: var(--primary); }
.tpl-tag.blue { background: #e3f2fd; color: #1976d2; }
.tpl-tag.green { background: #e8f5e9; color: #43a047; }
.tpl-tag.orange { background: #fff3e0; color: #ef6c00; }
.tpl-tag.purple { background: #f3e5f5; color: #8e24aa; }
.tpl-tag.gray { background: #f5f5f5; color: #757575; }

/* 空状态 */
.tpl-empty {
  text-align: center;
  padding: 48px 20px;
  color: #999;
}
.tpl-empty-icon { font-size: 48px; margin-bottom: 12px; }
.tpl-empty-title { font-size: 15px; color: #666; margin-bottom: 6px; }
.tpl-empty-desc { font-size: 12px; color: #999; margin-bottom: 16px; }

/* 统计摘要行 */
.tpl-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.tpl-summary-item {
  background: #fff;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tpl-summary-label { font-size: 12px; color: #999; }
.tpl-summary-value { font-size: 22px; font-weight: 700; color: #333; }
.tpl-summary-value.red { color: var(--primary); }
.tpl-summary-value.blue { color: #1976d2; }
.tpl-summary-value.green { color: #43a047; }
.tpl-summary-value.orange { color: #ef6c00; }

/* AI悬浮球触摸优化 */
.ai-fab {
  touch-action: none !important;
  -webkit-user-drag: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

/* ===== 全局修复：圆形按钮文字居中（增强版） ===== */
/* 匹配所有通过style属性设置border-radius的可点击元素；
   但排除已隐藏（hidden 属性 /.is-hidden / 内联 display:none）的元素，避免强制 inline-flex 导致无法隐藏 */
button[style*='border-radius']:not([hidden]):not(.is-hidden):not([style*='display: none']):not([style*='display:none']),
[style*='border-radius'][onclick]:not([hidden]):not(.is-hidden):not([style*='display: none']):not([style*='display:none']),
[style*='border-radius'][class*='btn']:not([hidden]):not(.is-hidden):not([style*='display: none']):not([style*='display:none']),
[style*='border-radius'][class*='add']:not([hidden]):not(.is-hidden):not([style*='display: none']):not([style*='display:none']),
[style*='border-radius'][role='button']:not([hidden]):not(.is-hidden):not([style*='display: none']):not([style*='display:none']) {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  line-height: 1 !important;
  vertical-align: middle !important;
}

/* 修复所有圆形元素中的文字居中 */
[style*='border-radius'] {
  line-height: 1;
}

/* 特别修复：圆形按钮中的+号字符 */
button[style*='border-radius']::first-letter,
[style*='border-radius'][onclick]::first-letter {
  line-height: 1 !important;
}
