/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f0f2f5;
  color: #333;
  font-size: 14px;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
}

input, select, textarea {
  outline: none;
  border: none;
  font-family: inherit;
}

/* ========== 登录页样式 ========== */
.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  width: 960px;
  height: 560px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  display: flex;
  overflow: hidden;
}

.login-left {
  width: 52%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 60px 50px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.brand-logo {
  font-size: 80px;
  margin-bottom: 16px;
}

.brand-name {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 8px;
}

.brand-slogan {
  font-size: 18px;
  opacity: 0.85;
}

.login-features {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.feature-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.feature-desc {
  font-size: 13px;
  opacity: 0.8;
}

.login-right {
  width: 48%;
  padding: 60px 50px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form-container {
  width: 100%;
}

.login-title {
  font-size: 28px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.login-subtitle {
  font-size: 14px;
  color: #999;
  margin-bottom: 40px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 14px;
  font-weight: 500;
  color: #666;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  font-size: 16px;
  opacity: 0.6;
}

.form-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 44px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.3s;
  background: #fafafa;
}

.form-input:focus {
  border-color: #667eea;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.captcha-wrapper {
  display: flex;
  gap: 12px;
}

.captcha-input {
  flex: 1;
}

.captcha-img {
  width: 100px;
  height: 48px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 4px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #666;
  cursor: pointer;
}

.remember-me input {
  cursor: pointer;
}

.forgot-password {
  color: #667eea;
}

.forgot-password:hover {
  text-decoration: underline;
}

.login-btn {
  width: 100%;
  height: 48px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.3s;
  letter-spacing: 4px;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.login-footer {
  margin-top: 40px;
  text-align: center;
  font-size: 12px;
  color: #ccc;
}

/* ========== 后台布局样式 ========== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 240px;
  background: #1f2937;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-logo {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #374151;
  font-size: 20px;
  font-weight: 700;
}

.sidebar-logo .logo-icon {
  font-size: 28px;
  margin-right: 10px;
}

.sidebar-menu {
  padding: 16px 0;
}

.menu-group-title {
  padding: 12px 24px 8px;
  font-size: 12px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: #d1d5db;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.menu-item:hover {
  background: #374151;
  color: #fff;
}

.menu-item.active {
  background: #374151;
  color: #fff;
  border-left-color: #667eea;
}

.menu-item .menu-icon {
  font-size: 18px;
  margin-right: 12px;
  width: 24px;
  text-align: center;
}

.menu-item .menu-text {
  font-size: 14px;
}

.menu-item .menu-arrow {
  margin-left: auto;
  font-size: 12px;
  opacity: 0.5;
}

.submenu {
  background: #111827;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s;
}

.submenu.open {
  max-height: 500px;
}

.submenu-item {
  padding: 10px 24px 10px 60px;
  font-size: 13px;
  color: #9ca3af;
  cursor: pointer;
  transition: all 0.2s;
}

.submenu-item:hover {
  color: #fff;
  background: #1f2937;
}

.submenu-item.active {
  color: #667eea;
}

/* 主内容区 */
.main-content {
  margin-left: 240px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* 顶部导航栏 */
.header {
  height: 64px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.toggle-btn {
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.toggle-btn:hover {
  background: #f3f4f6;
}

.breadcrumb {
  font-size: 14px;
  color: #6b7280;
}

.breadcrumb .current {
  color: #111827;
  font-weight: 500;
}

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

.header-icon {
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  position: relative;
  transition: background 0.2s;
}

.header-icon:hover {
  background: #f3f4f6;
}

.badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.user-info:hover {
  background: #f3f4f6;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.user-name {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

/* 内容区 */
.content-wrapper {
  flex: 1;
  padding: 24px;
  background: #f0f2f5;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 24px;
}

/* 卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.card-body {
  padding: 24px;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-label {
  font-size: 14px;
  color: #6b7280;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #111827;
}

.stat-change {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-change.up {
  color: #10b981;
}

.stat-change.down {
  color: #ef4444;
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

.stat-icon.purple {
  background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
}

.stat-icon.blue {
  background: linear-gradient(135deg, #3b82f620 0%, #1d4ed820 100%);
}

.stat-icon.green {
  background: linear-gradient(135deg, #10b98120 0%, #05966920 100%);
}

.stat-icon.orange {
  background: linear-gradient(135deg, #f59e0b20 0%, #d9770620 100%);
}

.stat-icon.red {
  background: linear-gradient(135deg, #ef444420 0%, #dc262620 100%);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-success {
  background: #10b981;
  color: #fff;
}

.btn-success:hover {
  background: #059669;
}

.btn-warning {
  background: #f59e0b;
  color: #fff;
}

.btn-warning:hover {
  background: #d97706;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-default {
  background: #fff;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.btn-default:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

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

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

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

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

.table th {
  background: #f9fafb;
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}

.table td {
  padding: 14px 16px;
  font-size: 14px;
  color: #374151;
  border-bottom: 1px solid #f3f4f6;
}

.table tr:hover {
  background: #f9fafb;
}

.table .actions {
  display: flex;
  gap: 8px;
}

/* 标签/状态 */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

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

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

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

.tag-info {
  background: #dbeafe;
  color: #1e40af;
}

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

.tag-gray {
  background: #f3f4f6;
  color: #4b5563;
}

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

.page-btn {
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.page-btn.active {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}

.page-info {
  font-size: 13px;
  color: #6b7280;
  margin-right: 16px;
}

/* 表单 */
.form-row {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.form-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-item label {
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.form-item input,
.form-item select,
.form-item textarea {
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s;
}

.form-item textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
  min-height: 80px;
}

.form-item input:focus,
.form-item select:focus,
.form-item textarea:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-item .hint {
  font-size: 12px;
  color: #9ca3af;
}

/* 搜索栏 */
.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 12px;
  height: 40px;
  min-width: 200px;
}

.search-input input {
  flex: 1;
  height: 100%;
  font-size: 14px;
}

.search-input .search-icon {
  margin-right: 8px;
  opacity: 0.5;
}

/* 选项卡 */
.tabs {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin-bottom: 24px;
}

.tab-item {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-item:hover {
  color: #667eea;
}

.tab-item.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

/* 分销设置样式 */
.setting-section {
  margin-bottom: 32px;
}

.setting-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.commission-calculator {
  background: #f9fafb;
  border-radius: 12px;
  padding: 24px;
  margin-top: 20px;
}

.calc-title {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 16px;
}

.calc-formula {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.calc-item {
  background: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  text-align: center;
  min-width: 100px;
}

.calc-item .calc-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 4px;
}

.calc-item .calc-value {
  font-size: 18px;
  font-weight: 700;
  color: #667eea;
}

.calc-operator {
  font-size: 20px;
  color: #9ca3af;
  font-weight: 600;
}

.level-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.level-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.3s;
}

.level-card.level-1 {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fef2f2 0%, #fff 100%);
}

.level-card.level-2 {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #fff 100%);
}

.level-card.level-3 {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #f0fdf4 0%, #fff 100%);
}

.level-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
}

.level-card.level-1 .level-badge {
  background: linear-gradient(90deg, #ef4444 0%, #f97316 100%);
}

.level-card.level-2 .level-badge {
  background: linear-gradient(90deg, #3b82f6 0%, #06b6d4 100%);
}

.level-card.level-3 .level-badge {
  background: linear-gradient(90deg, #10b981 0%, #14b8a6 100%);
}

.level-name {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 8px;
}

.level-rate {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 4px;
}

.level-card.level-1 .level-rate {
  color: #ef4444;
}

.level-card.level-2 .level-rate {
  color: #3b82f6;
}

.level-card.level-3 .level-rate {
  color: #10b981;
}

.level-desc {
  font-size: 13px;
  color: #6b7280;
}

/* 图表容器 */
.chart-container {
  height: 300px;
  position: relative;
}

/* 模态框 */
.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;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 480px;
  max-width: 90%;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.modal-close {
  font-size: 20px;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
}

.modal-close:hover {
  color: #6b7280;
  background: #f3f4f6;
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e5e7eb;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 响应式 */
@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .level-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .login-container {
    flex-direction: column;
    width: 90%;
    height: auto;
  }
  
  .login-left, .login-right {
    width: 100%;
  }
  
  .login-left {
    padding: 40px 30px;
  }
  
  .login-right {
    padding: 40px 30px;
  }
}

/* ========== 新后台页面样式 ========== */
.topbar {
  height: 60px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left, .topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.menu-toggle:hover {
  background: #f3f4f6;
}

.topbar .breadcrumb {
  font-size: 14px;
  color: #6b7280;
}

.topbar-item {
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}

.topbar-item:hover {
  background: #f3f4f6;
}

.topbar .user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.topbar .user-info:hover {
  background: #f3f4f6;
}

.topbar .avatar {
  font-size: 20px;
}

.topbar .username {
  font-size: 14px;
  color: #374151;
  font-weight: 500;
}

.dropdown-arrow {
  font-size: 10px;
  color: #9ca3af;
}

.page-container {
  flex: 1;
  padding: 24px;
  background: #f0f2f5;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.page-header .page-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 6px 0;
}

.page-desc {
  font-size: 13px;
  color: #9ca3af;
  margin: 0;
}

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

/* 筛选栏 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-end;
}

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

.filter-item .form-input {
  width: 180px;
}

/* 批量操作栏 */
.batch-bar {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: #f0f7ff;
  border-radius: 8px;
  margin-bottom: 16px;
}

.batch-bar b {
  color: #667eea;
}

/* 表格 */
.table-wrapper {
  overflow-x: auto;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
}

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

.data-table th {
  background: #fafafa;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 1px solid #f0f0f0;
  white-space: nowrap;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #f5f5f5;
  color: #374151;
}

.data-table tr:hover td {
  background: #fafafa;
}

.empty-cell {
  text-align: center;
  padding: 40px !important;
  color: #9ca3af;
}

.text-primary {
  color: #667eea;
  font-weight: 600;
}

.text-success {
  color: #52c41a;
  font-weight: 600;
}

.text-warning {
  color: #fa8c16;
  font-weight: 600;
}

.text-danger {
  color: #ef4444;
  font-weight: 600;
}

.text-gray {
  color: #9ca3af;
  font-weight: 600;
}

.stock-warn {
  color: #ef4444;
  font-weight: 600;
}

/* 商品信息 */
.product-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-image {
  width: 48px;
  height: 48px;
  background: #f5f5f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.product-detail {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-weight: 500;
  color: #111827;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-sku {
  font-size: 12px;
  color: #9ca3af;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 18px;
}

.tag-success {
  background: #f6ffed;
  color: #52c41a;
}

.tag-warning {
  background: #fff7e6;
  color: #fa8c16;
}

.tag-danger {
  background: #fff1f0;
  color: #ef4444;
}

.tag-info {
  background: #e6f7ff;
  color: #1890ff;
}

.tag-gray {
  background: #f5f5f5;
  color: #9ca3af;
}

/* 表格操作 */
.table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.action-link {
  color: #1890ff;
  cursor: pointer;
  font-size: 13px;
}

.action-link:hover {
  color: #40a9ff;
}

.action-link.success {
  color: #52c41a;
}

.action-link.success:hover {
  color: #73d13d;
}

.action-link.danger {
  color: #ef4444;
}

.action-link.danger:hover {
  color: #ff7875;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  margin-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.pagination-info {
  font-size: 13px;
  color: #6b7280;
}

.pagination-buttons {
  display: flex;
  gap: 4px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d9d9d9;
  background: #fff;
  border-radius: 4px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
}

.page-btn.active {
  background: #667eea;
  border-color: #667eea;
  color: #fff;
}

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

.page-ellipsis {
  padding: 0 4px;
  color: #999;
  line-height: 32px;
}

/* 表单 */
.form-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  color: #333;
  background: #fff;
  transition: border-color 0.2s;
}

.form-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

textarea.form-input {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-item {
  flex: 1;
}

.form-item label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: #374151;
  font-weight: 500;
}

.form-tip {
  margin-top: 6px;
  font-size: 12px;
  color: #9ca3af;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #f0f0f0;
}

.input-group {
  display: flex;
  align-items: center;
}

.input-group .form-input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.input-suffix {
  height: 36px;
  padding: 0 12px;
  background: #f5f5f5;
  border: 1px solid #d9d9d9;
  border-left: none;
  border-radius: 0 6px 6px 0;
  display: flex;
  align-items: center;
  font-size: 13px;
  color: #666;
}

.switch-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
}

.switch-label input {
  cursor: pointer;
}

/* 按钮 */
.btn {
  height: 36px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-success {
  background: #52c41a;
  color: #fff;
  border: none;
}

.btn-success:hover {
  background: #73d13d;
}

.btn-warning {
  background: #fa8c16;
  color: #fff;
  border: none;
}

.btn-warning:hover {
  background: #ffa940;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
}

.btn-danger:hover {
  background: #ff7875;
}

.btn-outline {
  background: #fff;
  color: #667eea;
  border: 1px solid #667eea;
}

.btn-outline:hover {
  background: #f5f3ff;
}

.btn-sm {
  height: 28px;
  padding: 0 12px;
  font-size: 12px;
}

/* 弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal.show {
  display: flex;
}

.modal-dialog {
  background: #fff;
  border-radius: 12px;
  width: 640px;
  max-width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.modal-close {
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #374151;
}

.modal-body {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast */
.toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: rgba(82, 196, 26, 0.9);
}

.toast.error {
  background: rgba(239, 68, 68, 0.9);
}

.toast.warning {
  background: rgba(250, 140, 22, 0.9);
}

/* 设置页面 */
.setting-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #f0f0f0;
  margin-bottom: 20px;
}

.tab-item {
  padding: 12px 24px;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

.tab-item:hover {
  color: #667eea;
}

.tab-item.active {
  color: #667eea;
  border-bottom-color: #667eea;
  font-weight: 500;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* 佣金比例设置 */
.commission-rates {
  display: flex;
  gap: 20px;
  margin: 20px 0;
}

.commission-rate-item {
  flex: 1;
  background: #f9fafb;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.rate-level {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.rate-input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}

.rate-input .form-input {
  width: 80px;
  text-align: center;
  font-size: 18px;
  font-weight: 600;
}

.rate-unit {
  font-size: 16px;
  color: #6b7280;
}

.rate-desc {
  font-size: 12px;
  color: #9ca3af;
}

/* 等级卡片 */
.level-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.level-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 20px;
}

.level-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.level-icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.level-name {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.level-tag {
  font-size: 12px;
}

.level-rates {
  margin-bottom: 16px;
  padding: 12px;
  background: #f9fafb;
  border-radius: 6px;
}

.level-rate-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
}

.rate-label {
  color: #6b7280;
}

.rate-value {
  color: #667eea;
  font-weight: 600;
}

.level-upgrade {
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}

.upgrade-item {
  font-size: 12px;
  color: #6b7280;
  padding: 2px 0;
}

/* 会员信息 */
.user-info-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.user-name {
  font-weight: 500;
  color: #111827;
  margin-bottom: 2px;
}

.user-phone {
  font-size: 12px;
  color: #9ca3af;
}

.level-badge {
  display: inline-block;
  padding: 3px 10px;
  background: linear-gradient(135deg, #fff7e6 0%, #ffe7ba 100%);
  color: #d48806;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #666;
}

/* 佣金信息 */
.commission-info {
  font-size: 12px;
  color: #374151;
}

.level-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.level-1 {
  background: #fff7e6;
  color: #d48806;
}

.level-2 {
  background: #f6ffed;
  color: #52c41a;
}

.level-3 {
  background: #e6f7ff;
  color: #1890ff;
}

/* 会员详情弹窗 */
.member-detail-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 20px;
}

.member-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.member-name-lg {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
}

.member-sub {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #6b7280;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section h4 {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
}

.detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.detail-stat {
  background: #f9fafb;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.stat-val {
  font-size: 18px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: #9ca3af;
}

.detail-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.detail-status > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-label {
  font-size: 13px;
  color: #6b7280;
  width: 80px;
}

/* 图表 */
.chart-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.chart-card {
  min-height: 320px;
}

.chart-container {
  height: 250px;
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  padding: 20px 0;
  border-bottom: 1px solid #f0f0f0;
  position: relative;
}

.chart-bars {
  display: flex;
  width: 100%;
  justify-content: space-around;
  align-items: flex-end;
  height: 100%;
}

.chart-bar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 60%;
  max-width: 40px;
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px 4px 0 0;
  position: relative;
  transition: all 0.3s;
  min-height: 4px;
}

.chart-bar:hover {
  opacity: 0.8;
}

.chart-bar-tooltip {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: #111827;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.chart-bar:hover .chart-bar-tooltip {
  opacity: 1;
}

.chart-bar-label {
  margin-top: 8px;
  font-size: 12px;
  color: #6b7280;
}

/* 饼图 */
.pie-chart {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 0 auto 20px;
  position: relative;
}

.pie-chart-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pie-total {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
}

.pie-label {
  font-size: 12px;
  color: #9ca3af;
}

.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.pie-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.pie-legend-name {
  color: #6b7280;
  flex: 1;
}

.pie-legend-value {
  color: #111827;
  font-weight: 500;
}

/* 简单表格列表 */
.simple-table {
  display: flex;
  flex-direction: column;
}

.simple-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #f5f5f5;
}

.simple-row:last-child {
  border-bottom: none;
}

.simple-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-icon {
  font-size: 24px;
}

.order-no {
  font-weight: 500;
  color: #111827;
  font-size: 13px;
  margin-bottom: 2px;
}

.order-product {
  font-size: 12px;
  color: #9ca3af;
}

.simple-amount {
  color: #667eea;
  font-weight: 600;
}

/* 待办列表 */
.todo-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.todo-item:hover {
  background: #f9fafb;
}

.todo-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.todo-content {
  flex: 1;
}

.todo-title {
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 2px;
}

.todo-desc {
  font-size: 12px;
  color: #9ca3af;
}

.todo-arrow {
  color: #9ca3af;
  font-size: 14px;
}

/* 分类卡片 */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.category-card {
  background: #fff;
  border: 1px solid #f0f0f0;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
  transition: all 0.2s;
  cursor: pointer;
}

.category-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.category-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.category-name {
  font-size: 15px;
  font-weight: 500;
  color: #111827;
  margin-bottom: 8px;
}

.stat-card-sm {
  padding: 16px;
}

.stat-card-sm .stat-label {
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-card-sm .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
}

.card-more {
  font-size: 13px;
  color: #667eea;
  cursor: pointer;
}

.card-more:hover {
  color: #764ba2;
}

.card-desc {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
}

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

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