@import url("tkx-theme-v2.css");

/* ============================================================
   推薪客 橙色主题统一系统 — theme-orange-unified.css v1.0
   全站CSS变量系统，覆盖所有非主题色，深色模式全覆盖
   ============================================================ */

/* ---------- CSS变量（橙色主题） ---------- */
:root {
  /* ---------- 全局排版 ---------- */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;

  /* ===== 品牌橙（主色 #FF6600） ===== */
  --primary: #FF6600;
  --primary-rgb: 255, 102, 0;
  --primary-light: #FF8533;
  --primary-dark: #E05500;
  --primary-darker: #CC4400;
  --primary-pale: #FFF5EB;
  --primary-bg: #FFF5EB;
  --primary-gradient: linear-gradient(135deg, #FF6600 0%, #E05500 100%);
  --primary-gradient-light: linear-gradient(135deg, #FF8533 0%, #FF6600 100%);

  /* ===== 状态功能色（保留） ===== */
  --success: #10B981;
  --success-light: #D1FAE5;
  --success-dark: #059669;
  --warning: #F59E0B;
  --warning-light: #FEF3C7;
  --warning-dark: #D97706;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --danger-dark: #DC2626;
  --info: #3B82F6;
  --info-light: #DBEAFE;
  --info-dark: #2563EB;

  /* ===== 中性色 ===== */
  --text: #1F2937;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-inverse: #FFFFFF;
  --bg: #F3F4F6;
  --bg-secondary: #F7F8FA;
  --bg-card: #FFFFFF;
  --bg-alt: #F9FAFB;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --border-color: #E5E7EB;

  /* ===== 阴影 ===== */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.1);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-orange: 0 4px 14px rgba(255,102,0,0.25);
  --shadow-orange-lg: 0 8px 24px rgba(255,102,0,0.3);

  /* ===== 圆角 ===== */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-pill: 9999px;

  /* ===== 字体 ===== */
  --font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-size: var(--font-size-base);
  --line-height: 1.6;
  --line-height-sm: 1.4;
  --line-height-lg: 1.8;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-size-xs: 12px;
  --font-size-sm: 13px;
  --font-size-base: 14px;
  --font-size-md: 15px;
  --font-size-lg: 16px;
  --font-size-xl: 18px;
  --font-size-2xl: 20px;
  --font-size-3xl: 24px;
  --font-size-4xl: 28px;
  --font-size-5xl: 36px;

  /* ===== 间距 ===== */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* ===== 布局 ===== */
  --header-height: 56px;
  --tabbar-height: 50px;
  --max-width: 1200px;
  --max-width-narrow: 800px;
  --max-width-wide: 1400px;
  --sidebar-width: 260px;

  /* ===== 暗黑模式变量（苹果深色风格） ===== */
  --dark-bg: #0f0f1a;
  --dark-bg-card: #1c1c2e;
  --dark-bg-alt: #26263a;
  --dark-text: #E8E8F0;
  --dark-text-secondary: #9E9EB0;
  --dark-text-muted: #6E6E80;
  --dark-border: #2E2E42;
  --dark-border-light: #26263a;
  --dark-shadow: 0 2px 12px rgba(0,0,0,0.3);
  --dark-shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --dark-primary-bg: rgba(255,102,0,0.12);
  --dark-primary-pale: rgba(255,102,0,0.08);
  --dark-overlay: rgba(0,0,0,0.6);
  --dark-input-bg: #1c1c2e;
  --dark-input-border: #3A3A50;
  --dark-hover: rgba(255,255,255,0.06);
  --dark-active: rgba(255,255,255,0.1);

  /* ===== 动画 ===== */
  --transition-fast: 0.15s ease;
  --transition: 0.25s ease;
  --transition-slow: 0.4s ease;

  /* ===== z-index ===== */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 500;
  --z-sidebar: 600;
  --z-overlay: 900;
  --z-modal: 1000;
  --z-toast: 2000;
  --z-tooltip: 3000;
}

/* ---------- 深色模式变量 ---------- */
[data-theme="dark"] {
  --primary-light: #FF8533;
  --primary-dark: #E05500;
  --primary-pale: #1C1917;
  --primary-bg: #2D1A0E;
  --primary-gradient: linear-gradient(135deg, #FF8533 0%, #FF6600 100%);
  --primary-gradient-light: linear-gradient(135deg, #FF6600 0%, #E05500 100%);

  --success: #4ADE80;
  --success-light: #052E16;
  --warning: #FBBF24;
  --warning-light: #1A0E00;
  --danger: #F87171;
  --danger-light: #1C0A0A;
  --info: #60A5FA;
  --info-light: #0A1A2E;

  --text: #E2E8F0;
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --bg: #0F172A;
  --bg-secondary: #1E293B;
  --bg-card: #1E293B;
  --bg-alt: #334155;
  --border: #334155;
  --border-light: #3B4A5A;
  --border-color: #334155;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-orange: 0 4px 14px rgba(255,102,0,0.3);
  --shadow-orange-lg: 0 8px 24px rgba(255,102,0,0.4);
}

/* ---------- 全局重置 ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-family);
  transition: background-color var(--transition), color var(--transition);
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }
svg { vertical-align: middle; }

/* ---------- 按钮系统（橙色） ---------- */
.btn, .tkx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--font-size-base);
  font-family: var(--font-family);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
  text-decoration: none;
  outline: none;
  touch-action: manipulation;
}
.btn:focus-visible, .tkx-btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(255,102,0,0.3);
}
.btn:hover, .tkx-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn:active, .tkx-btn:active { transform: translateY(0); }

.btn-primary, .tkx-btn--primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover, .tkx-btn--primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  box-shadow: var(--shadow-orange);
  color: #fff;
}
.btn-primary:active, .tkx-btn--primary:active {
  background: var(--primary-darker);
}

.btn-secondary, .tkx-btn--ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-secondary:hover, .tkx-btn--ghost:hover {
  background: var(--primary-pale);
  color: var(--primary-dark);
  border-color: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-pale);
}

.btn-text {
  background: transparent;
  border: none;
  color: var(--primary);
  padding: 4px 8px;
}
.btn-text:hover {
  background: var(--primary-pale);
  color: var(--primary-dark);
}

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }

.btn:disabled, .tkx-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 成功/危险按钮保留功能色 */
.btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.btn-success:hover {
  background: var(--success-dark);
  border-color: var(--success-dark);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-dark);
  border-color: var(--danger-dark);
}

/* ---------- 表单 ---------- */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
textarea,
select {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255,102,0,0.15);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

label {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: block;
  font-weight: 500;
}

.form-group {
  margin-bottom: var(--space-md);
}

/* ---------- 卡片 ---------- */
.card, .tkx-card, .content-card, .stat-card, .form-card, .auth-card,
.profile-card, .info-card, .result-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}
.card + .card, .tkx-card + .tkx-card { margin-top: 12px; }

/* ---------- 导航栏 ---------- */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
  display: flex;
  align-items: center;
  padding: 0 var(--space-md);
  position: sticky;
  top: 0;
  z-index: var(--z-navbar);
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--text);
  text-decoration: none;
}
.navbar-brand:hover { color: var(--primary); }

.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.navbar-links a {
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
}
.navbar-links a:hover,
.navbar-links a.active {
  color: var(--primary);
  background: var(--primary-pale);
}

/* ---------- 表格 ---------- */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: var(--font-size-base);
}
th {
  background: var(--bg-alt);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: var(--font-size-sm);
  text-transform: none;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--primary-pale); }

/* ---------- 徽章/标签 ---------- */
.badge, .tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.badge-primary, .tag-orange {
  background: var(--primary-pale);
  color: var(--primary-dark);
}
.badge-success {
  background: var(--success-light);
  color: var(--success-dark);
}
.badge-danger, .tag-red {
  background: var(--danger-light);
  color: var(--danger-dark);
}
.badge-warning {
  background: var(--warning-light);
  color: var(--warning-dark);
}
.badge-info {
  background: var(--info-light);
  color: var(--info-dark);
}

/* ---------- 加载 ---------- */
.spin, .loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: tkx-spin 0.6s linear infinite;
}
@keyframes tkx-spin {
  to { transform: rotate(360deg); }
}
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  border-left: 4px solid var(--primary);
}
.toast--success { border-left-color: var(--success); }
.toast--error { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 24px;
  max-width: 90vw;
  width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: scaleIn 0.25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- 骨架屏 ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--border-light) 37%, var(--border) 63%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- 空状态 ---------- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
  gap: 12px;
}
.empty-state .empty-icon { font-size: 48px; opacity: 0.5; }
.empty-state .empty-text { font-size: var(--font-size-base); }
.empty-state .empty-sub { font-size: var(--font-size-sm); }
.empty-state .empty-btn {
  padding: 8px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: opacity .15s;
}
.empty-state .empty-btn:active { opacity: .8; }

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 0;
}
.pagination button,
.pagination a {
  min-width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.pagination button:hover,
.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.pagination button.active,
.pagination a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ---------- 标签页/选项卡 ---------- */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  gap: 0;
  margin-bottom: var(--space-md);
}
.tab {
  padding: 10px 20px;
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--primary); }
.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------- 进度条 ---------- */
.progress-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar .progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width var(--transition-slow);
}

/* ---------- 列表项 ---------- */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
}
.list-item:hover { background: var(--primary-pale); }
.list-item:last-child { border-bottom: none; }

/* ---------- 分割线 ---------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-md) 0;
  border: none;
}

/* ---------- 工具类 ---------- */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-muted   { color: var(--text-muted) !important; }
.text-center  { text-align: center !important; }
.text-right   { text-align: right !important; }
.text-left    { text-align: left !important; }

.bg-pale    { background: var(--primary-pale) !important; }
.bg-card    { background: var(--bg-card) !important; }

.flex { display: flex !important; }
.flex-col { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.items-center { align-items: center !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.gap-xs  { gap: var(--space-xs) !important; }
.gap-sm  { gap: var(--space-sm) !important; }
.gap-md  { gap: var(--space-md) !important; }
.gap-lg  { gap: var(--space-lg) !important; }

.mt-sm { margin-top: var(--space-sm) !important; }
.mt-md { margin-top: var(--space-md) !important; }
.mt-lg { margin-top: var(--space-lg) !important; }
.mb-sm { margin-bottom: var(--space-sm) !important; }
.mb-md { margin-bottom: var(--space-md) !important; }
.mb-lg { margin-bottom: var(--space-lg) !important; }
.p-sm  { padding: var(--space-sm) !important; }
.p-md  { padding: var(--space-md) !important; }
.p-lg  { padding: var(--space-lg) !important; }

.hidden { display: none !important; }
.block { display: block !important; }
.inline-block { display: inline-block !important; }
.w-full { width: 100% !important; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 选中颜色覆盖（确保橙色） ---------- */
::selection {
  background: rgba(255,102,0,0.25);
  color: inherit;
}

/* ---------- 覆盖残留蓝色 ---------- */
:root {
  --blue: var(--primary);
  --blue-old: var(--primary);
  --blue-light: var(--primary-pale);
  --blue-dark: var(--primary-dark);
}

/* ---------- 全局 Logo 自适应规则 ---------- */
/* 所有logo图片统一：自动适应容器，保持比例 */
img[src*="logo.svg"],
img[src*="logo.png"],
img[src*="logo-white"],
.navbar-brand img,
.fb-logo img,
.logo-img {
  max-width: 100%;
  height: auto;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
}

/* 允许 .logo-auto 覆盖 navbar-brand img 的 height:auto */
.navbar-brand img.logo-auto,
.fb-logo img.logo-auto {
  height: 32px !important;
  width: auto !important;
  max-height: 32px !important;
  flex-shrink: 0 !important;
}

/* Logo响应式尺寸控制 */
@media (max-width: 480px) {
  .navbar-brand img,
  .logo-img,
  img[src*="logo"][height] {
    max-width: 120px !important;
    height: auto !important;
  }
}
@media (min-width: 481px) and (max-width: 768px) {
  .navbar-brand img,
  .logo-img,
  img[src*="logo"][height] {
    max-width: 150px !important;
    height: auto !important;
  }
}
@media (min-width: 769px) {
  .navbar-brand img,
  .logo-img,
  img[src*="logo"][height] {
    max-width: 180px !important;
    height: auto !important;
  }
}

/* ============================================================
   暗黑模式 [data-theme="dark"]
   苹果深色风格 — 暗底 #0f0f1a / 卡片 #1c1c2e
   ============================================================ */
[data-theme="dark"] {
  --text: #E8E8F0;
  --text-primary: #E8E8F0;
  --text-secondary: #9E9EB0;
  --text-muted: #6E6E80;
  --text-inverse: #1F2937;
  --bg: #0f0f1a;
  --bg-secondary: #1c1c2e;
  --bg-card: #1c1c2e;
  --bg-alt: #26263a;
  --border: #2E2E42;
  --border-light: #26263a;
  --border-color: #2E2E42;
  --primary-pale: rgba(255,102,0,0.08);
  --primary-bg: rgba(255,102,0,0.12);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow: 0 2px 8px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-orange: 0 4px 14px rgba(255,102,0,0.2);
  --shadow-orange-lg: 0 8px 24px rgba(255,102,0,0.25);
  --success-light: rgba(16,185,129,0.12);
  --warning-light: rgba(245,158,11,0.12);
  --danger-light: rgba(239,68,68,0.12);
  --info-light: rgba(59,130,246,0.12);
}

/* 暗黑全局body覆盖 */
[data-theme="dark"] body {
  background: #0f0f1a;
  color: #E8E8F0;
}

/* 暗黑SVG/图片微调 */
[data-theme="dark"] img, [data-theme="dark"] svg:not([fill]) {
  opacity: 0.92;
}

/* ===== Logo 自适应 ===== */
.logo-auto,
img.logo-auto,
.navbar-brand img.logo-auto {
  height: 32px !important;
  width: auto !important;
  vertical-align: middle;
  flex-shrink: 0;
  object-fit: contain;
}
@media (max-width: 768px) {
  .logo-auto,
  img.logo-auto,
  .navbar-brand img.logo-auto {
    height: 28px !important;
    width: auto !important;
  }
}
@media (max-width: 480px) {
  .logo-auto,
  img.logo-auto,
  .navbar-brand img.logo-auto {
    height: 24px !important;
    width: auto !important;
  }
}

/* 暗黑选中色 */
[data-theme="dark"] ::selection {
  background: rgba(255,102,0,0.35);
  color: #FFFFFF;
}


/* ===== 管理端旧版兼容样式（从admin-system.css迁移） ===== */
.admin-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--primary-gradient);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 12px rgba(249,115,22,0.3);
}

.admin-header .header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
}

.admin-header .header-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.admin-header .header-search {
  flex: 1;
  max-width: 400px;
  margin: 0 24px;
  position: relative;
}

.admin-header .header-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.15);
  color: white;
  font-size: 13px;
  outline: none;
  transition: background .2s;
}

.admin-header .header-search input::placeholder { color: rgba(255,255,255,0.6); }

.admin-header .header-search input:focus { background: rgba(255,255,255,0.25); }

.admin-header .header-search .search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 14px;
}

.admin-header .header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
}

.admin-header .header-right .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}

.admin-header .header-right .avatar:hover { background: rgba(255,255,255,0.3); }

.admin-header .header-right .notif-badge {
  position: relative;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.85;
}

.admin-header .header-right .notif-badge .dot {
  position: absolute;
  top: -2px;
  right: -4px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
}

.admin-header .menu-toggle-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  margin-right: 12px;
}

.admin-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  z-index: 999;
  overflow-y: auto;
  transition: transform .3s ease;
}

.admin-sidebar::-webkit-scrollbar { width: 4px; }

.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-section {
  padding: 12px 0;
}

.sidebar-section .section-title {
  padding: 8px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  letter-spacing: 1px;
}

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

.sidebar-nav-item:hover {
  background: var(--sidebar-hover);
  color: white;
}

.sidebar-nav-item.active {
  background: var(--sidebar-active);
  color: var(--primary);
  border-left-color: var(--primary);
}

.sidebar-nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.sidebar-nav-item .nav-badge {
  margin-left: auto;
  background: var(--primary);
  color: white;
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.admin-main {
  margin-left: var(--sidebar-width);
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  padding: 24px;
  transition: margin-left .3s ease;
}

.admin-main.collapsed { margin-left: 0; }

.page-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header .page-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header .page-actions {
  display: flex;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(249,115,22,0.3); }

.btn-outline {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover { opacity: 0.9; }

.btn-sm { padding: 6px 14px; font-size: 12px; }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 12px;
}

.btn-ghost:hover { background: var(--primary-50); color: var(--primary); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

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

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-card .stat-body { flex: 1; }

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

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

.stat-card .stat-trend {
  font-size: 11px;
  margin-top: 4px;
}

.stat-card .stat-trend.up { color: var(--success); }

.stat-card .stat-trend.down { color: var(--danger); }

.content-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
}

.content-card .card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.content-card .card-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.content-card .card-body { padding: 20px; }

.content-card .card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FAFAFA;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

table.data-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

table.data-table tbody tr:hover { background: var(--primary-50); }

table.data-table tbody tr:last-child td { border-bottom: none; }

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: #F1F5F9;
  color: var(--text-secondary);
}

.tag-success { background: rgba(16,185,129,0.1); color: #059669; }

.tag-warning { background: rgba(245,158,11,0.1); color: #B45309; }

.tag-danger { background: rgba(239,68,68,0.1); color: #DC2626; }

.tag-primary { background: rgba(249,115,22,0.1); color: #EA580C; }

.tag-info { background: rgba(59,130,246,0.1); color: #2563EB; }

.filter-bar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
  padding: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.filter-bar .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-bar .field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.filter-bar .field input,

.filter-bar .field select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-width: 140px;
  outline: none;
  transition: border .2s;
}

.filter-bar .field input:focus,

.filter-bar .field select:focus { border-color: var(--primary); }

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 20px;
  align-items: center;
}

.pagination button {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}

.pagination button:hover { border-color: var(--primary); color: var(--primary); }

.pagination button.active { background: var(--primary); color: white; border-color: var(--primary); }

.pagination button:disabled { opacity: .4; cursor: default; }

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 90%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,

.form-group select,

.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border .2s;
  box-sizing: border-box;
  outline: none;
}

.form-group input:focus,

.form-group select:focus,

.form-group textarea:focus { border-color: var(--primary); }

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

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }

.empty-state .empty-text { font-size: 15px; margin-bottom: 6px; color: var(--text-secondary); }

.empty-state .empty-sub { font-size: 13px; }

.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--primary-100);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 13px;
}

.batch-bar .selected-count { font-weight: 600; color: var(--primary); }

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 998;
}

@media(max-width:1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-header .header-search { max-width: 280px; }
}

@media(max-width:768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.open { display: block; }
  .admin-main {
    margin-left: 0;
    padding: 16px;
  }
  .admin-header .menu-toggle-btn { display: block; }
  .admin-header .header-search { display: none; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .data-grid { grid-template-columns: 1fr; }
  .filter-bar .field input,
  .filter-bar .field select { min-width: 100px; }
}

@media(max-width:480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
/* ===== tkx 布局系统（标准化 v2） ===== */
/* 使用方式: class="tkx-layout tkx-sidebar tkx-main tkx-topbar tkx-content" */
/* 替代旧版 admin-layout / admin-sidebar / admin-main / admin-topbar / admin-content */

.tkx-layout{display:flex;min-height:100vh}
.tkx-sidebar{width:var(--sidebar-w,220px);background:var(--bg-secondary,#1E293B);position:fixed;left:0;top:0;bottom:0;z-index:100;display:flex;flex-direction:column;transition:transform .3s;overflow-y:auto}
.tkx-sidebar .sidebar-logo{padding:16px 20px;border-bottom:1px solid rgba(255,255,255,0.1);display:flex;align-items:center;gap:10px}
.tkx-sidebar .sidebar-logo img{height:28px}
.tkx-sidebar .sidebar-logo span{color:#fff;font-weight:600;font-size:15px}
.tkx-sidebar .sidebar-nav{padding:12px 0;flex:1}
.tkx-sidebar .sidebar-nav .nav-group{padding:8px 20px 4px;font-size:9px;text-transform:uppercase;letter-spacing:2px;color:rgba(255,255,255,0.3);font-weight:600}
.tkx-sidebar .sidebar-nav a{display:flex;align-items:center;gap:10px;padding:10px 20px;color:rgba(255,255,255,0.6);text-decoration:none;font-size:13px;transition:all .15s;border-left:3px solid transparent}
.tkx-sidebar .sidebar-nav a:hover,.tkx-sidebar .sidebar-nav a.active{background:rgba(255,255,255,0.08);color:#fff;border-left-color:var(--primary,#FF6600)}
.tkx-main{flex:1;margin-left:var(--sidebar-w,220px);display:flex;flex-direction:column;min-height:100vh}
.tkx-topbar{height:var(--topbar-h,56px);background:var(--bg-card,#FFF);border-bottom:1px solid var(--border);display:flex;align-items:center;justify-content:space-between;padding:0 24px;position:sticky;top:0;z-index:50}
.tkx-topbar .menu-toggle{display:none;background:none;border:none;font-size:22px;color:var(--text);cursor:pointer}
.tkx-topbar .topbar-right{display:flex;align-items:center;gap:16px}
.tkx-content{padding:24px;flex:1;max-width:1400px;width:100%;margin:0 auto}
.tkx-content .page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;flex-wrap:wrap;gap:12px}
.tkx-content .page-header h2{font-size:18px;font-weight:700;color:var(--text);margin:0}

/* tkx布局系统 - 响应式 */
@media(max-width:768px){
  .tkx-sidebar{transform:translateX(-100%)}
  .tkx-sidebar.show{transform:translateX(0)}
  .tkx-main{margin-left:0}
  .tkx-topbar .menu-toggle{display:block}
  .tkx-content{padding:16px}
}
