/* 全局样式 */
:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --project-primary-color: var(--primary-color);
  --project-accent-color: #10b981;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-700: #374151;
  --gray-900: #111827;
  --sidebar-width: 250px;
  /* 明暗模式变量（默认亮色） */
  --bg-body: #f9fafb;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-input: #ffffff;
  --bg-sidebar: linear-gradient(180deg, #1e1b4b 0%, #312e81 100%);
  --bg-sidebar-item: rgba(255,255,255,0.08);
  --bg-sidebar-hover: rgba(255,255,255,0.15);
  --bg-sidebar-active: rgba(255,255,255,0.2);
  --text-body: #111827;
  --text-secondary: #6b7280;
  --text-sidebar: rgba(255,255,255,0.9);
  --text-sidebar-muted: rgba(255,255,255,0.45);
  --border-color: #e5e7eb;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
}

/* 暗色模式 — 手动切换 */
[data-theme="dark"] {
  /* 背景 */
  --bg-body: #1d2739;
  --bg-card: #26334a;
  --bg-header: #26334a;
  --bg-input: #3a4a66;
  --bg-sidebar: linear-gradient(180deg, #191930 0%, #232338 100%);
  --bg-sidebar-item: rgba(255,255,255,0.06);
  --bg-sidebar-hover: rgba(255,255,255,0.12);
  --bg-sidebar-active: rgba(79,70,229,0.4);
  /* 文字 */
  --text-body: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-sidebar: rgba(255,255,255,0.85);
  --text-sidebar-muted: rgba(255,255,255,0.4);
  /* 边框 */
  --border-color: #3a4a66;
  /* 灰色系统全部翻转 */
  --gray-50: #26334a;
  --gray-100: #26334a;
  --gray-200: #3a4a66;
  --gray-300: #4c5d7a;
  --gray-700: #cbd5e1;
  --gray-900: #f1f5f9;
  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.5);
}

/* 暗色模式 — 系统偏好（仅当未手动设置 data-theme 时生效）*/
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* 背景 */
    --bg-body: #1d2739;
    --bg-card: #26334a;
    --bg-header: #26334a;
    --bg-input: #3a4a66;
    --bg-sidebar: linear-gradient(180deg, #191930 0%, #232338 100%);
    --bg-sidebar-item: rgba(255,255,255,0.06);
    --bg-sidebar-hover: rgba(255,255,255,0.12);
    --bg-sidebar-active: rgba(79,70,229,0.4);
    /* 文字 */
    --text-body: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-sidebar: rgba(255,255,255,0.85);
    --text-sidebar-muted: rgba(255,255,255,0.4);
    /* 边框 */
    --border-color: #3a4a66;
    /* 灰色系统全部翻转 */
    --gray-50: #26334a;
    --gray-100: #26334a;
    --gray-200: #3a4a66;
    --gray-300: #4c5d7a;
    --gray-700: #cbd5e1;
    --gray-900: #f1f5f9;
    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.5);
  }
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-body);
  line-height: 1.6;
}

#app {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏外层 - 全高渐变背景 */
.sidebar-wrapper {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 10;
}

/* 侧边栏内层 - 内部滚动 */
.sidebar {
  color: white;
  padding: 1.5rem;
  max-height: 100vh;
  overflow-y: auto;
  position: sticky;
  top: 0;
}

.logo h1 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  font-weight: 700;
}

.project-logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 2rem;
}

.project-logo h1 {
  margin-bottom: 0;
  min-width: 0;
  word-break: break-word;
}

.project-logo-img,
.project-logo-fallback {
  width: 2rem;
  height: 2rem;
  flex: 0 0 2rem;
}

.project-logo-img {
  display: block;
  object-fit: contain;
}

.project-logo-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  line-height: 1;
}

.nav-menu {
  list-style: none;
}

.nav-menu > li {
  margin-bottom: 0.125rem;
}

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-sidebar-muted);
  cursor: pointer;
  border-radius: 0.5rem;
  transition: color 0.15s;
  user-select: none;
}

.nav-group-header:hover {
  color: var(--text-sidebar);
}

.nav-group-arrow {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.nav-group-items {
  list-style: none;
  display: none;
  padding-left: 0.5rem;
  margin-bottom: 0.25rem;
}

.nav-group-items.open {
  display: block;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1rem;
  color: var(--text-sidebar);
  text-decoration: none;
  border-radius: 0.5rem;
  transition: all 0.2s;
  font-size: 0.875rem;
}

.nav-link .nav-icon {
  flex: 0 0 auto;
  opacity: 0.85;
}

.nav-link:hover,
.nav-link.active {
  background: var(--bg-sidebar-hover);
  color: #fff;
}

.nav-link.active {
  background: var(--bg-sidebar-active);
}

/* 主内容区 */
.content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.header {
  background: var(--bg-header);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header h2 {
  font-size: 1.5rem;
  font-weight: 600;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.main-content {
  padding: 2rem;
  flex: 1;
}

/* 按钮 */
.btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

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

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

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

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

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border-radius: 0.5rem;
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
}

/* 表格 */
.table-container {
  overflow-x: auto;
}

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

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

th {
  background: var(--bg-card);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
}

tr:hover {
  background: var(--bg-card);
}

/* 表单 */
.form-group {
  margin-bottom: 1rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  font-size: 0.875rem;
  transition: border-color 0.2s;
  background: var(--bg-input);
  color: var(--text-body);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--gray-700);
}

/* 徽章 */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-primary {
  background: #e0e7ff;
  color: #3730a3;
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: var(--bg-card);
  border-radius: 0.5rem;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray-700);
}

/* 工具类 */
.text-right {
  text-align: right;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.flex {
  display: flex;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-2 {
  gap: 0.5rem;
}

.hidden {
  display: none;
}

/* ===== Impeccable 风格扩展 ===== */

/* 筛选栏 */
.filter-bar {
  padding: 12px 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 16px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-input {
  width: 200px;
}

.filter-select {
  width: 140px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 0;
}

.pagination-btn {
  padding: 6px 12px;
  border: 1px solid var(--gray-200);
  background: var(--bg-card);
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-300);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.pagination-info {
  font-size: 13px;
  color: var(--gray-700);
  margin: 0 12px;
}

.filter-date {
  width: 140px;
}

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.data-table th {
  background: var(--bg-body);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.03em;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
  user-select: none;
}

.data-table th.sortable {
  cursor: pointer;
}

.data-table th.sortable:hover {
  background: var(--bg-card);
}

.data-table th.num,
.data-table td.num {
  text-align: right;
}

.sort-icon {
  font-size: 10px;
  opacity: 0.4;
  margin-left: 4px;
}

.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}

.data-table tr.data-row:hover {
  background: #f8fafc;
}

.data-table tr.data-row:hover td {
  background: transparent;
}

/* 骨架屏 */
.skeleton {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  width: 80%;
}

.skeleton-row td {
  padding: 14px 12px !important;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 空状态 */
.empty-state {
  text-align: center !important;
  padding: 48px 24px !important;
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.empty-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 4px;
}

.empty-desc {
  font-size: 13px;
  color: var(--gray-700);
  opacity: 0.6;
  margin-bottom: 16px;
}

/* 会员单元格 */
.member-cell {
  display: flex;
  flex-direction: column;
}

.member-name {
  font-weight: 500;
}

.member-sub {
  font-size: 12px;
  color: var(--gray-700);
  opacity: 0.7;
}

/* 徽章扩展 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.badge-default {
  background: var(--bg-card);
  color: var(--gray-700);
}

.badge-gold {
  background: #fef3c7;
  color: #92400e;
}

.badge-purple {
  background: #ede9fe;
  color: #5b21b6;
}

/* 金额文本 */
.amount-text {
  font-weight: 600;
  color: var(--gray-900);
}

/* 时间文本 */
.time-text {
  font-size: 13px;
  color: var(--gray-700);
}

/* 文字辅助 */
.mono-text {
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  font-size: 12px;
  color: var(--gray-700);
}

.text-muted {
  color: var(--gray-700);
  opacity: 0.5;
}

/* 操作按钮区 */
.action-cell {
  display: flex;
  gap: 4px;
  align-items: center;
}

.btn-icon {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: var(--bg-card);
  border-color: var(--gray-300);
}

.btn-icon-danger:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger-color);
}

/* 表格底部 */
.table-footer {
  padding: 10px 0 0;
  border-top: 1px solid var(--gray-100);
}

.table-count {
  font-size: 13px;
  color: var(--gray-700);
}

/* 弹窗表单 */
.required {
  color: var(--danger-color);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

/* ===== 结算报表专用 ===== */

/* 风险提示横幅 */
.risk-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  color: #92400e;
  line-height: 1.5;
}

.risk-icon {
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* KPI 卡片颜色 */
.stat-success { color: var(--success-color); }
.stat-warning { color: var(--warning-color); }
.stat-danger  { color: var(--danger-color);  }

/* 任务名称 */
.task-name {
  font-weight: 500;
}

/* 进度条 */
.progress-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--gray-200);
  border-radius: 3px;
  overflow: hidden;
  min-width: 80px;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-pending  { background: var(--warning-color); }
.progress-running  { background: var(--primary-color); }
.progress-completed { background: var(--success-color); }
.progress-failed   { background: var(--danger-color); }

.progress-label {
  font-size: 12px;
  color: var(--gray-700);
  white-space: nowrap;
  min-width: 40px;
  text-align: right;
}

/* ===== 仪表盘专用 ===== */

.stat-primary { color: var(--primary-color); }
.stat-success  { color: var(--success-color); }
.stat-warning  { color: var(--warning-color); }
.stat-danger   { color: var(--danger-color);  }

.dashboard-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-card {
  flex: 1;
}

/* 快捷操作 */
.quick-actions {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 16px 20px;
}

.quick-actions-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.quick-actions-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-body);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800);
  transition: all 0.15s;
  min-width: 120px;
}

.quick-action:hover {
  background: var(--bg-card);
  border-color: var(--gray-300);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.quick-icon {
  font-size: 18px;
}

.quick-label {
  font-size: 13px;
}

/* ===== 规则配置专用 ===== */

.rule-card {
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
  transition: box-shadow 0.15s;
}

.rule-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.rule-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px;
  gap: 12px;
}

.rule-card-info {
  flex: 1;
  min-width: 0;
}

.rule-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.rule-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--gray-900);
}

.rule-meta {
  font-size: 13px;
  color: var(--gray-700);
}

.rule-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.rule-details {
  border-top: 1px solid var(--gray-100);
}

.rule-summary {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--primary-color);
  cursor: pointer;
  user-select: none;
  background: var(--bg-body);
}

.rule-summary:hover {
  background: var(--bg-card);
}

.rule-code {
  background: var(--bg-body);
  padding: 12px 16px;
  font-size: 12px;
  overflow-x: auto;
  margin: 0;
  line-height: 1.6;
  font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-700);
  margin-top: 4px;
  opacity: 0.6;
}

/* ===== 平台设置专用 ===== */

.settings-tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}

.settings-tab {
  padding: 8px 20px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
}

.settings-tab.active {
  background: var(--white);
  color: var(--gray-900);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ===== Tab 组件（payments.js）===== */
.tab-nav {
  display: flex;
  gap: 2px;
  background: var(--bg-card);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 20px;
  width: fit-content;
}

.tab-btn {
  padding: 8px 20px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn:hover {
  color: var(--gray-900);
  background: rgba(0,0,0,0.03);
}

.tab-btn.active {
  background: var(--white);
  color: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.settings-body {
  padding: 8px 20px 20px;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-700);
  margin: 16px 0 12px;
}

.settings-section-title:first-child {
  margin-top: 0;
}

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

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.settings-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-800);
}

.settings-hint {
  font-size: 12px;
  color: var(--gray-700);
  opacity: 0.6;
}

.settings-divider {
  height: 1px;
  background: var(--gray-200);
  margin: 20px 0;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-700);
}

.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-700);
  cursor: pointer;
}

.toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* 提现详情行 */
.withdraw-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 14px;
}

.withdraw-detail-label {
  color: var(--gray-700);
  font-weight: 500;
}

/* ===== 登录页 ===== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1d2739;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* 背景网格 */
.login-bg-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* 背景光球 */
.login-bg-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}
.login-bg-orb--1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.25) 0%, transparent 70%);
  top: -150px;
  right: -100px;
}
.login-bg-orb--2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
  bottom: -100px;
  left: -80px;
}
.login-bg-orb--3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(79, 70, 229, 0.15) 0%, transparent 70%);
  bottom: 20%;
  left: 30%;
}

/* 登录卡片 */
.login-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255,255,255,0.05);
}

/* 头部 */
.login-card__head {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo {
  display: inline-flex;
  margin-bottom: 16px;
  filter: drop-shadow(0 4px 16px rgba(99, 102, 241, 0.5));
}

.login-card__title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.login-card__sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.45);
}

/* 表单 */
.login-form__field {
  margin-bottom: 18px;
}

.login-form__label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.login-form__input-wrap {
  position: relative;
}

.login-form__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.login-form__input-wrap:focus-within .login-form__icon {
  color: #818cf8;
}

.login-form__input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  font-size: 15px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.login-form__input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.login-form__input:focus {
  border-color: rgba(129, 140, 248, 0.6);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

/* 错误 */
.login-form__error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: #fca5a5;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 按钮 */
.login-form__btn {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 1px;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.15s;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.login-form__btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

.login-form__btn:active:not(:disabled) {
  transform: translateY(0);
}

.login-form__btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.spin {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 底部 */
.login-card__hint {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 24px;
}

.login-card__hint code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: #a5b4fc;
}

/* 隐藏类 */
.hidden { display: none !important; }

/* ===== 分享设置预览 ===== */

.share-preview {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.share-preview-header {
  display: flex;
  gap: 12px;
  padding: 14px;
  align-items: flex-start;
}

.share-preview-app-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.share-preview-meta {
  flex: 1;
  min-width: 0;
}

.share-preview-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-preview-desc {
  font-size: 12px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.share-preview-image {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--bg-card);
  overflow: hidden;
}

.share-preview-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  opacity: 0.4;
}

/* ===== 短信记录 ===== */

.sms-content-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 图片预览 ===== */

.image-preview {
  padding: 12px;
  background: var(--bg-body);
  border-radius: 8px;
}

/* ===== 会员端购物链路样式 ===== */

/* 商品浏览网格 */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-color: var(--primary-color);
}

.skeleton-card .product-image {
  background: var(--bg-card);
  height: 180px;
  border-radius: 0;
}

.product-image {
  position: relative;
  width: 100%;
  height: 180px;
  background: var(--bg-body);
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.badge-hot {
  background: #fef3c7;
  color: #92400e;
}

.badge-new {
  background: #e0e7ff;
  color: #3730a3;
}

.product-info {
  padding: 12px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger-color);
  margin-bottom: 4px;
}

.product-sales {
  font-size: 12px;
  color: var(--gray-700);
  opacity: 0.7;
}

.catalog-load-more {
  text-align: center;
  padding: 20px 0;
}

/* 商品详情页 */
.detail-breadcrumb {
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--gray-700);
}

.detail-breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.detail-breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 8px;
  opacity: 0.5;
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.detail-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-main-image {
  width: 100%;
  background: var(--bg-body);
  border-radius: 12px;
  overflow: hidden;
}

.detail-main-image img {
  width: 100%;
  height: auto;
  max-height: 450px;
  object-fit: contain;
}

.detail-thumbnails {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.thumb-item {
  width: 60px;
  height: 60px;
  border: 2px solid var(--gray-200);
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s;
}

.thumb-item:hover,
.thumb-item.active {
  border-color: var(--primary-color);
}

.thumb-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-product-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1.4;
}

.detail-current-price {
  font-size: 32px;
  font-weight: 700;
  color: var(--danger-color);
}

.detail-original-price {
  font-size: 16px;
  color: var(--gray-700);
  text-decoration: line-through;
  opacity: 0.6;
  margin-top: -8px;
}

.detail-meta {
  display: flex;
  gap: 24px;
  padding: 12px 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
}

.detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.detail-meta-item span:first-child {
  color: var(--gray-700);
  opacity: 0.7;
}

.detail-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
  margin-right: 12px;
}

.detail-sku-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sku-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.sku-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sku-option {
  padding: 6px 16px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  background: var(--bg-card);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.sku-option:hover {
  border-color: var(--primary-color);
}

.sku-option.selected {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
}

.detail-quantity-section {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
}

.quantity-control {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  overflow: hidden;
}

.qty-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg-body);
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.qty-btn:hover {
  background: var(--bg-card);
}

.qty-input {
  width: 50px;
  height: 36px;
  border: none;
  border-left: 1px solid var(--gray-300);
  border-right: 1px solid var(--gray-300);
  text-align: center;
  font-size: 14px;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.qty-input-sm {
  width: 40px;
  height: 28px;
  font-size: 13px;
}

.qty-btn-sm {
  width: 28px;
  height: 28px;
  font-size: 14px;
}

.detail-stock {
  font-size: 13px;
  color: var(--gray-700);
}

.detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.detail-btn {
  flex: 1;
  height: 48px;
  font-size: 16px;
  font-weight: 600;
}

.btn-lg {
  height: 48px;
  font-size: 16px;
  font-weight: 600;
  padding: 0 32px;
}

/* 商品详情 Tabs */
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 20px;
}

.detail-tab {
  padding: 12px 24px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.detail-tab:hover {
  color: var(--primary-color);
}

.detail-tab.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.product-detail-html {
  line-height: 1.8;
  color: var(--gray-700);
}

.product-detail-html img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
}

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

/* 图片预览弹窗 */
.image-preview-container {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.image-preview-container img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 8px;
}

/* 购物车页 */
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-body);
  border-radius: 10px;
  transition: background 0.15s;
}

.cart-item:hover {
  background: var(--bg-card);
}

.skeleton-item {
  min-height: 80px;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-sku {
  font-size: 12px;
  color: var(--gray-700);
  opacity: 0.7;
}

.cart-item-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  width: 80px;
  text-align: right;
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
}

.cart-item-quantity .qty-btn {
  width: 28px;
  height: 28px;
  background: var(--bg-body);
}

.cart-item-quantity .qty-input {
  width: 36px;
  height: 28px;
  border: none;
  border-left: 1px solid var(--gray-300);
  border-right: 1px solid var(--gray-300);
  font-size: 13px;
}

.cart-item-subtotal {
  font-size: 16px;
  font-weight: 700;
  color: var(--danger-color);
  width: 90px;
  text-align: right;
}

.cart-item-delete {
  padding: 4px 8px;
}

.cart-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--gray-700);
}

.cart-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-body);
  border-radius: 10px;
  border: 1px solid var(--gray-200);
}

.cart-footer-left {
  display: flex;
  align-items: center;
}

.cart-footer-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.cart-summary {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  font-size: 14px;
  color: var(--gray-700);
}

.cart-total {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger-color);
}

.cart-empty {
  padding: 60px 0;
}

/* 结算页 */
.checkout-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 0;
  margin-bottom: 20px;
}

.checkout-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  transition: opacity 0.3s;
}

.checkout-step.active {
  opacity: 1;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gray-300);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.checkout-step.active .step-num {
  background: var(--primary-color);
}

.step-label {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-700);
}

.step-line {
  width: 80px;
  height: 2px;
  background: var(--gray-200);
  margin: 0 16px;
}

.checkout-section {
  padding: 20px 0;
}

.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-200);
}

.checkout-step-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}

/* 地址列表 */
.address-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.address-card {
  padding: 16px;
  border: 2px solid var(--gray-200);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.address-card:hover {
  border-color: var(--primary-color);
}

.address-card.selected {
  border-color: var(--primary-color);
  background: rgba(79, 70, 229, 0.04);
}

.address-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.address-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
}

.address-phone {
  font-size: 14px;
  color: var(--gray-700);
}

.address-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--gray-700);
  margin-bottom: 12px;
}

.address-card-actions {
  display: flex;
  gap: 8px;
}

.address-form-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}

.address-form {
  max-width: 600px;
}

/* 订单确认 */
.order-confirm-address {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  background: var(--bg-body);
  border-radius: 8px;
  margin-bottom: 20px;
}

.confirm-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  flex-shrink: 0;
  width: 70px;
}

.confirm-value {
  font-size: 14px;
  color: var(--gray-900);
}

.checkout-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checkout-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  background: var(--bg-body);
  border-radius: 8px;
}

.checkout-item-image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  object-fit: cover;
}

.checkout-item-info {
  flex: 1;
  min-width: 0;
}

.checkout-item-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--gray-900);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkout-item-sku {
  font-size: 12px;
  color: var(--gray-700);
  opacity: 0.7;
}

.checkout-item-qty {
  font-size: 14px;
  color: var(--gray-700);
  width: 50px;
  text-align: center;
}

.checkout-item-price {
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-900);
  width: 80px;
  text-align: right;
}

/* 订单汇总 */
.order-summary-card {
  max-width: 400px;
  margin: 0 auto;
  padding: 20px;
  background: var(--bg-body);
  border-radius: 10px;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  color: var(--gray-700);
}

.order-summary-total {
  border-top: 1px solid var(--gray-200);
  margin-top: 10px;
  padding-top: 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--danger-color);
}

/* 响应式 */
@media (max-width: 768px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .detail-content {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .cart-item {
    flex-wrap: wrap;
  }

  .cart-item-price,
  .cart-item-subtotal {
    width: auto;
  }

  .cart-footer {
    flex-direction: column;
    gap: 16px;
  }

  .cart-footer-right {
    width: 100%;
    justify-content: space-between;
  }

  .checkout-steps {
    flex-wrap: wrap;
    gap: 12px;
  }

  .step-line {
    display: none;
  }
}

/* ===== 全局暗色模式覆盖 ===== */
[data-theme="dark"] body {
  background: var(--bg-body);
  color: var(--text-body);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body {
    background: var(--bg-body);
    color: var(--text-body);
  }
}

/* 覆盖所有残留的灰色背景 */
[data-theme="dark"] .data-table th,
[data-theme="dark"] .table-container,
[data-theme="dark"] .image-preview,
[data-theme="dark"] .btn.btn-default,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .modal,
[data-theme="dark"] .card-header,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .toast,
[data-theme="dark"] .tag,
[data-theme="dark"] .badge,
[data-theme="dark"] .select-option:hover,
[data-theme="dark"] .tab-btn,
[data-theme="dark"] .settings-tab,
[data-theme="dark"] .modal-body,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer,
[data-theme="dark"] .form-row,
[data-theme="dark"] .form-group,
[data-theme="dark"] .table-footer,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .skeleton,
[data-theme="dark"] .skeleton-line,
[data-theme="dark"] .settings-body,
[data-theme="dark"] .settings-section,
[data-theme="dark"] .settings-item,
[data-theme="dark"] .tab-content,
[data-theme="dark"] .stat-row,
[data-theme="dark"] .info-row,
[data-theme="dark"] .info-label,
[data-theme="dark"] .timeline-item,
[data-theme="dark"] .tree-node,
[data-theme="dark"] .tree-node:hover,
[data-theme="dark"] .tree-node.active {
  background: var(--bg-card);
}

[data-theme="dark"] .data-table tr.data-row:hover td,
[data-theme="dark"] .data-table tr.data-row:nth-child(even) {
  background: var(--bg-body);
}

[data-theme="dark"] .data-table th {
  background: var(--bg-card);
}

[data-theme="dark"] .btn-default {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-body);
}

[data-theme="dark"] .filter-bar {
  background: var(--bg-card);
  border-color: var(--border-color);
}

[data-theme="dark"] .filter-input,
[data-theme="dark"] .filter-select {
  background: var(--bg-input);
  border-color: var(--border-color);
  color: var(--text-body);
}

[data-theme="dark"] .card {
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .card-title {
  color: var(--text-body);
}

[data-theme="dark"] .table-count {
  color: var(--text-secondary);
}

[data-theme="dark"] .data-table td {
  color: var(--text-body);
  border-color: var(--border-color);
}

[data-theme="dark"] .modal {
  background: var(--bg-card);
}

[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-body {
  border-color: var(--border-color);
}

[data-theme="dark"] .modal-title,
[data-theme="dark"] .form-label {
  color: var(--text-body);
}

[data-theme="dark"] .empty-state {
  color: var(--text-secondary);
}

[data-theme="dark"] .empty-state p {
  color: var(--text-secondary);
}

[data-theme="dark"] .form-group {
  color: var(--text-body);
}

[data-theme="dark"] .table-footer {
  color: var(--text-secondary);
}

[data-theme="dark"] .form-select option {
  background: var(--bg-card);
  color: var(--text-body);
}

[data-theme="dark"] .tab-btn.active,
[data-theme="dark"] .settings-tab.active {
  background: var(--bg-card);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

[data-theme="dark"] .tag,
[data-theme="dark"] .badge {
  color: var(--text-body);
}

[data-theme="dark"] .toast {
  color: var(--text-body);
}

/* 暗色模式切换按钮 */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.2s;
  margin-left: 12px;
}

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

.theme-toggle-btn .icon {
  font-size: 16px;
  line-height: 1;
}

/* ===== 文件存储组件样式 ===== */
.code-inline {
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
  font-size: 12px;
  background: var(--bg-card);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--primary-color);
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-hover);
  border-radius: 6px;
  margin-left: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.upload-progress .progress-bar {
  flex: 1;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  min-width: 120px;
}

.upload-progress .progress-fill {
  height: 100%;
  background: var(--primary-color);
  border-radius: 2px;
  transition: width 0.3s;
}

.upload-progress .progress-text {
  white-space: nowrap;
  min-width: 80px;
}

.copy-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  background: var(--primary-color);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: opacity 0.3s;
  pointer-events: none;
}

.file-name-cell {
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-icon {
  font-size: 16px;
}

.file-name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.file-previewable {
  cursor: pointer;
  color: var(--primary-color);
}

.file-previewable:hover {
  text-decoration: underline;
}

.remark-text {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ===== P2-1 修复：从 bonus-plans.js 抽离的内嵌 CSS ===== */
.bonus-plan-form {
  max-width: 800px;
}
.bonus-plan-section {
  margin-bottom: 24px;
}
.bonus-plan-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}
.bonus-plan-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}
.bonus-plan-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bonus-plan-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}
.bonus-plan-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.bonus-plan-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.bonus-plan-hint {
  font-size: 12px;
  color: var(--gray-700);
  opacity: 0.6;
}
.bonus-plan-array {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.bonus-plan-array-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.bonus-plan-array-item input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 13px;
  text-align: center;
}
.bonus-plan-array-item span {
  font-size: 12px;
  color: var(--gray-700);
}
.bonus-plan-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: 8px;
}
.bonus-plan-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-200);
}
.save-indicator {
  font-size: 12px;
  color: var(--success-color);
  opacity: 0;
  transition: opacity 0.3s;
}
.save-indicator.show {
  opacity: 1;
}
.active-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  background: #d1fae5;
  color: #065f46;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
/* ===== /P2-1 ===== */
