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

:root {
  --primary: #409eff;
  --primary-light: #ecf5ff;
  --primary-dark: #337ecc;
  --success: #67c23a;
  --success-light: #f0f9eb;
  --warning: #e6a23c;
  --warning-light: #fdf6ec;
  --danger: #f56c6c;
  --danger-light: #fef0f0;
  --info: #909399;
  --info-light: #f4f4f5;

  --text-primary: #303133;
  --text-regular: #606266;
  --text-secondary: #909399;
  --text-placeholder: #c0c4cc;

  --border-base: #dcdfe6;
  --border-light: #e4e7ed;
  --border-lighter: #ebeef5;
  --border-extra-light: #f2f6fc;

  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --bg-sidebar: #1d2433;
  --bg-sidebar-hover: #2c3446;
  --bg-sidebar-active: #409eff;

  --shadow-light: 0 1px 4px rgba(0, 21, 41, 0.06);
  --shadow-base: 0 2px 12px rgba(0, 0, 0, 0.06);
  --shadow-popup: 0 4px 20px rgba(0, 0, 0, 0.12);

  --radius-sm: 4px;
  --radius-base: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
}

body {
  font-family: "Microsoft YaHei", "微软雅黑", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
}

/* ===== 登录页 ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  top: -200px;
  left: -200px;
}
.login-wrap::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.06);
  border-radius: 50%;
  bottom: -100px;
  right: -100px;
}
.login-card {
  background: #fff;
  padding: 44px 48px;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  width: 420px;
  position: relative;
  z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 12px;
}
.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.login-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 32px;
}

/* ===== 通用按钮 ===== */
.btn {
  width: 100%;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-base);
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  user-select: none;
  white-space: nowrap;
  height: 38px;
}
.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}
.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(64, 158, 255, 0.2);
}
.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-default { background: #fff; color: var(--text-regular); border: 1px solid var(--border-light); }
.btn-default:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-light); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #57af2d; border-color: #57af2d; box-shadow: 0 4px 12px rgba(103, 194, 58, 0.3); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #cf9236; border-color: #cf9236; box-shadow: 0 4px 12px rgba(230, 162, 60, 0.3); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dd6161; border-color: #dd6161; box-shadow: 0 4px 12px rgba(245, 108, 108, 0.3); }
.btn-small { padding: 6px 16px; font-size: 13px; width: auto; height: 32px; line-height: 1; }
.btn-link {
  background: transparent;
  color: var(--primary);
  border: none;
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
  width: auto;
  height: auto;
  box-shadow: none;
}
.btn-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
  background: transparent;
  transform: none;
  box-shadow: none;
}
.btn-link.btn-danger { color: var(--danger); background: transparent; }
.btn-link.btn-danger:hover {
  color: #dd6161;
  background: transparent;
  transform: none;
  box-shadow: none;
}

.login-hint {
  text-align: center;
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 16px;
}

/* ===== 表单 ===== */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-regular);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-base);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  color: var(--text-primary);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
}
.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
  background: var(--info-light);
  color: var(--text-placeholder);
  cursor: not-allowed;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}
.form-row .form-item { flex: 1; }
.form-actions { margin-top: 24px; text-align: right; }
.form-actions .btn { width: auto; padding: 10px 24px; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-regular);
  cursor: pointer;
}
.checkbox-label input[type="checkbox"] { width: 14px; height: 14px; cursor: pointer; }

/* ===== 主布局 ===== */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
  width: 210px;
  background: var(--bg-sidebar);
  color: #bfcbd9;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.sidebar-logo {
  padding: 18px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  letter-spacing: 0.5px;
  height: 60px;
}
.sidebar-logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #667eea, #409eff);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.sidebar-logo-text {
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(90deg, #fff, #b3d8ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.menu-list { padding: 8px 0; flex: 1; }

.menu-item {
  padding: 0 16px;
  height: 44px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
  color: #bfcbd9;
  margin: 2px 8px;
  border-radius: 6px;
}
.menu-item:hover { background: var(--bg-sidebar-hover); color: #fff; }
.menu-item.active {
  background: linear-gradient(90deg, rgba(64, 158, 255, 0.2), rgba(64, 158, 255, 0.05));
  color: #fff;
}
.menu-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--primary);
  border-radius: 0 2px 2px 0;
}
.menu-icon { font-size: 16px; width: 18px; text-align: center; }
.menu-badge {
  background: var(--danger);
  color: #fff;
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
  margin-left: auto;
  font-weight: 500;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  text-align: center;
}

/* 主内容区 */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-left: 210px;
}

/* 顶部导航 */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--border-lighter);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-title::before {
  content: '';
  width: 3px;
  height: 18px;
  background: var(--primary);
  border-radius: 2px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-regular);
  font-size: 13px;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea, #409eff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.logout-btn {
  background: #fff;
  color: var(--text-regular);
  border: 1px solid var(--border-base);
  padding: 6px 16px;
  border-radius: var(--radius-base);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.logout-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-light);
}

/* 内容区 */
.content {
  padding: 20px;
  flex: 1;
  overflow-y: auto;
}

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  padding: 20px 24px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-light);
  margin-bottom: 16px;
  border: 1px solid var(--border-extra-light);
  transition: box-shadow 0.2s;
}
.card:hover {
  box-shadow: var(--shadow-base);
}

/* 功能横幅 */
.feature-banner-card {
  padding: 24px;
}
.feature-banner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.feature-banner-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border-radius: 12px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #e9ecef;
}
.feature-banner-item:hover {
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.feature-banner-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  flex-shrink: 0;
}
.feature-banner-info {
  flex: 1;
  min-width: 0;
}
.feature-banner-title {
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}
.feature-banner-desc {
  font-size: 12px;
  color: #999;
  line-height: 1.4;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-extra-light);
}
.card-title-text {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title-icon {
  width: 28px;
  height: 28px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.card-header .card-title {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.stat-card {
  background: #fff;
  padding: 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-extra-light);
  position: relative;
  overflow: hidden;
  transition: all 0.3s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-base);
}
.stat-card.primary { border-top: 3px solid var(--primary); }
.stat-card.success { border-top: 3px solid var(--success); }
.stat-card.warning { border-top: 3px solid var(--warning); }
.stat-card.danger { border-top: 3px solid var(--danger); }
.stat-card.info { border-top: 3px solid var(--info); }

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  position: absolute;
  right: 16px;
  top: 16px;
  opacity: 0.8;
}
.stat-card.primary .stat-icon { background: var(--primary-light); color: var(--primary); }
.stat-card.success .stat-icon { background: var(--success-light); color: var(--success); }
.stat-card.warning .stat-icon { background: var(--warning-light); color: var(--warning); }
.stat-card.danger .stat-icon { background: var(--danger-light); color: var(--danger); }
.stat-card.info .stat-icon { background: var(--info-light); color: var(--info); }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 4px;
}
.stat-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ===== 标签 ===== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}
.tag-primary { background: var(--primary-light); color: var(--primary); }
.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); }
.tag-danger { background: var(--danger-light); color: var(--danger); }
.tag-info { background: var(--info-light); color: var(--info); }

/* ===== 表格 ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead th {
  background: #fafafa;
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-regular);
  border-bottom: 1px solid var(--border-lighter);
  white-space: nowrap;
}
.data-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-extra-light);
  color: var(--text-regular);
  vertical-align: middle;
}
.data-table tbody tr {
  transition: background 0.15s;
}
.data-table tbody tr:hover {
  background: #f5f7fa;
}
.data-table tbody tr:last-child td { border-bottom: none; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 13px;
}
.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 16px 0 4px;
}
.page-info {
  font-size: 12px;
  color: var(--text-secondary);
}
.page-btn {
  padding: 5px 12px;
  border: 1px solid var(--border-base);
  background: #fff;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-regular);
  transition: all 0.2s;
}
.page-btn:hover:not(:disabled) {
  color: var(--primary);
  border-color: var(--primary);
}
.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ===== 弹窗 ===== */
.modal {
  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;
  animation: fadeIn 0.2s ease;
}
/* 兼容旧版类名 */
.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;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-content {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-popup);
  animation: slideUp 0.25s ease;
}
/* 兼容旧版弹窗内部容器 */
.modal-overlay .modal {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  background: #fff;
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-popup);
  animation: slideUp 0.25s ease;
  overflow: hidden;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-lighter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: #fff;
}
.modal-header span:first-child,
.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.modal-close {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 20px;
  transition: all 0.2s;
  line-height: 1;
  border: none;
  background: transparent;
}
.modal-close:hover {
  background: var(--info-light);
  color: var(--text-primary);
}
.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-lighter);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: #fafbfc;
}
.modal-footer .btn {
  width: auto;
  padding: 8px 24px;
  height: 34px;
  font-size: 13px;
}
.btn-secondary {
  background: #fff;
  color: var(--text-regular);
  border: 1px solid var(--border-base);
}
.btn-secondary:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ===== 表单行布局（旧页面兼容） ===== */
.form-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
  gap: 12px;
}
.form-row > label {
  width: 90px;
  flex-shrink: 0;
  text-align: right;
  padding-top: 8px;
  font-size: 13px;
  color: var(--text-regular);
  font-weight: 500;
  line-height: 1.5;
}
.form-row > input,
.form-row > select,
.form-row > textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-base);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  color: var(--text-primary);
  min-width: 0;
}
.form-row > input:focus,
.form-row > select:focus,
.form-row > textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
}
.form-row textarea {
  resize: vertical;
  min-height: 60px;
}
.form-switch {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}
.form-switch input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* 文件上传区域 */
.upload-preview {
  margin-top: 10px;
}
.upload-preview img {
  max-width: 120px;
  max-height: 80px;
  border-radius: var(--radius-base);
  border: 1px solid var(--border-lighter);
  object-fit: cover;
}
.uploaded-url {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  word-break: break-all;
}
.uploaded-url a {
  color: var(--primary);
  text-decoration: none;
}
.uploaded-url a:hover {
  text-decoration: underline;
}

/* 文件上传输入框美化 */
input[type="file"] {
  font-size: 12px;
  color: var(--text-secondary);
}
input[type="file"]::file-selector-button {
  padding: 6px 14px;
  margin-right: 10px;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--text-regular);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
input[type="file"]::file-selector-button:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

/* 弹窗内的内联输入框 */
.modal-body input[type="text"][style*="width"],
.modal-body input[type="text"][style*="margin-left"] {
  padding: 6px 10px !important;
  border: 1px solid var(--border-base) !important;
  border-radius: var(--radius-base) !important;
  font-size: 12px !important;
  outline: none;
}
.modal-body input[type="text"][style*="width"]:focus,
.modal-body input[type="text"][style*="margin-left"]:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1) !important;
}

/* 弹窗内的区域分隔 */
.modal-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-lighter);
}
.modal-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 表单分组标题 */
.form-group-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 12px;
  padding-left: 10px;
  border-left: 3px solid var(--primary);
}

/* 操作按钮 */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 18px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--text-regular);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  height: 34px;
  gap: 4px;
}
.action-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}
.action-btn-success {
  background: var(--success);
  color: #fff;
  border-color: var(--success);
}
.action-btn-success:hover {
  background: #57af2d;
  border-color: #57af2d;
  color: #fff;
}
.action-btn-warning {
  background: var(--warning);
  color: #fff;
  border-color: var(--warning);
}
.action-btn-warning:hover {
  background: #cf9236;
  border-color: #cf9236;
  color: #fff;
}
.action-btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.action-btn-danger:hover {
  background: #dd6161;
  border-color: #dd6161;
  color: #fff;
}
.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 6px;
}
.link-btn:hover {
  text-decoration: underline;
}
.link-btn-danger {
  color: var(--danger);
}
.mt-10 { margin-top: 10px; }

/* ===== 筛选区 ===== */
.filter-section {
  background: #fff;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-extra-light);
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px 16px;
  margin-bottom: 14px;
}
.filter-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.filter-item label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.filter-item input,
.filter-item select {
  padding: 7px 10px;
  border: 1px solid var(--border-base);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
}
.filter-item input:focus,
.filter-item select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
}
.filter-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}
.filter-btns .btn {
  width: auto;
  padding: 7px 18px;
  height: 32px;
  font-size: 13px;
}

/* ===== Tab 切换 ===== */
.tab-container {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
  background: var(--info-light);
  padding: 4px;
  border-radius: var(--radius-base);
  width: 100%;
}
.tab-item {
  padding: 8px 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-regular);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
}
.tab-item:hover { color: var(--primary); }
.tab-item.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-light);
}

/* ===== 权限树 ===== */
.perm-tree { padding: 4px 0; }
.perm-group { margin-bottom: 16px; }
.perm-group-title {
  padding: 10px 14px;
  background: var(--bg-page);
  border-radius: var(--radius-base);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.perm-group-title input[type="checkbox"] {
  width: 15px;
  height: 15px;
  cursor: pointer;
}
.perm-group-title strong {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 600;
}
.perm-children {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
  padding: 4px 10px;
}
.perm-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  color: var(--text-regular);
  transition: background 0.15s;
}
.perm-item:hover { background: var(--primary-light); color: var(--primary); }
.perm-item input[type="checkbox"] { width: 13px; height: 13px; cursor: pointer; }

/* ===== 详情弹窗 ===== */
.detail-item { padding: 4px 0; }
.detail-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-extra-light);
  font-size: 13px;
}
.detail-label {
  width: 90px;
  color: var(--text-secondary);
  flex-shrink: 0;
  font-weight: 500;
}
.detail-value {
  flex: 1;
  color: var(--text-primary);
  word-break: break-all;
}
.detail-section { margin-top: 16px; }
.detail-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  padding-left: 8px;
  border-left: 3px solid var(--primary);
}
.detail-pre {
  background: var(--bg-page);
  padding: 12px;
  border-radius: var(--radius-base);
  font-size: 12px;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 220px;
  overflow-y: auto;
  color: var(--text-regular);
  line-height: 1.6;
}

/* ===== 通用工具类 ===== */
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--text-secondary); font-size: 12px; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-primary { color: var(--primary); }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

.hint {
  background: var(--primary-light);
  padding: 10px 14px;
  border-radius: var(--radius-base);
  color: var(--primary);
  font-size: 12px;
  margin-bottom: 12px;
  border-left: 3px solid var(--primary);
  line-height: 1.6;
}
.hint-warning {
  background: var(--warning-light);
  color: var(--warning);
  border-left-color: var(--warning);
}

/* 确认对话框 */
.confirm-box {
  background: #fff;
  padding: 24px;
  border-radius: var(--radius-lg);
  max-width: 400px;
  text-align: center;
  box-shadow: var(--shadow-popup);
}
.confirm-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}
.confirm-msg {
  color: var(--text-regular);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.6;
}
.confirm-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
}
.confirm-buttons button {
  min-width: 90px;
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-base);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.btn-cancel {
  background: #fff;
  color: var(--text-regular);
  border: 1px solid var(--border-base) !important;
}
.btn-cancel:hover {
  color: var(--primary);
  border-color: var(--primary) !important;
  background: var(--primary-light);
}

/* pdf list */
.pdf-item {
  background: var(--bg-page);
  padding: 12px 14px;
  border-radius: var(--radius-base);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.15s;
}
.pdf-item:hover { background: var(--primary-light); }
.pdf-item-title {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
  font-size: 13px;
}
.pdf-item-url {
  font-size: 11px;
  color: var(--text-secondary);
  word-break: break-all;
}
.pdf-item-url a { color: var(--primary); text-decoration: none; }
.pdf-item-url a:hover { text-decoration: underline; }

/* ===== 课程卡片列表 ===== */
.course-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.course-card {
  background: #fff;
  border: 1px solid var(--border-extra-light);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  gap: 16px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-light);
}
.course-card:hover {
  box-shadow: var(--shadow-base);
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.course-cover {
  width: 180px;
  height: 120px;
  flex-shrink: 0;
  border-radius: var(--radius-base);
  overflow: hidden;
  background: var(--info-light);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.course-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.course-cover-placeholder {
  font-size: 36px;
  opacity: 0.3;
}
.course-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.course-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.course-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}
.course-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.course-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  font-size: 12px;
  color: var(--text-secondary);
}
.course-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}
.course-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
  white-space: nowrap;
}
.course-price.free {
  color: var(--success);
}
.course-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-extra-light);
}
.course-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.course-actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 工具栏 */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}
.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.search-input,
.select-input {
  padding: 8px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-base);
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
  background: #fff;
  height: 34px;
  color: var(--text-primary);
  box-sizing: border-box;
}
.search-input:focus,
.select-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
}
.search-input { width: 200px; }
.select-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='%23909399' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}
.select-input:hover {
  border-color: var(--primary);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="email"],
textarea,
select {
  padding: 8px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-base);
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
  background: #fff;
  color: var(--text-primary);
  box-sizing: border-box;
  font-family: inherit;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="email"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
}
input[type="date"],
input[type="datetime-local"] {
  cursor: pointer;
}
textarea {
  resize: vertical;
  min-height: 80px;
}
.td-img {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: 4px;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.toast {
  padding: 10px 20px;
  border-radius: var(--radius-base);
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-popup);
  min-width: 200px;
  text-align: center;
  animation: toastIn 0.25s ease;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warning); }
.toast-info { background: var(--info); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 首页配置美化 ===== */
.home-config-card {
  background: #fff;
}
.home-config-card .card-title {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-lighter);
  margin-bottom: 24px;
}
.card-title-sub {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: normal;
  margin-top: 4px;
}
.config-section {
  margin-bottom: 28px;
}
.config-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-left: 12px;
  border-left: 3px solid var(--primary);
  line-height: 1.4;
}

/* 开关按钮 */
.switch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.switch-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-page);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-lighter);
  transition: all 0.2s;
}
.switch-item:hover {
  border-color: var(--primary-light);
  background: #f0f7ff;
}
.switch-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.switch-info {
  flex: 1;
  min-width: 0;
}
.switch-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.switch-desc {
  font-size: 12px;
  color: var(--text-secondary);
}
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #dcdfe6;
  transition: .3s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .slider {
  background-color: var(--primary);
}
input:checked + .slider:before {
  transform: translateX(20px);
}

.config-actions {
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--border-lighter);
  display: flex;
  justify-content: center;
}
.btn-large {
  padding: 12px 36px;
  height: 44px;
  font-size: 15px;
}

/* 卡片标题操作区 */
.card-title-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* 空状态提示 */
.empty-tip {
  padding: 60px 20px;
  text-align: center;
  color: #909399;
  font-size: 14px;
}

/* iOS风格开关 */
.switch-wrap {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  cursor: pointer;
}
.switch-wrap input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.switch-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #dcdfe6;
  transition: 0.3s;
  border-radius: 22px;
}
.switch-slider:before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.switch-wrap input:checked + .switch-slider {
  background-color: #409EFF;
}
.switch-wrap input:checked + .switch-slider:before {
  transform: translateX(22px);
}

/* 表单标签美化 */
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-regular);
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  box-sizing: border-box;
}

/* ===== 套餐卡片 ===== */
.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}
.package-card {
  position: relative;
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  border: 1px solid var(--border-lighter);
  border-radius: 12px;
  padding: 28px 24px;
  text-align: center;
  transition: all 0.3s ease;
  overflow: hidden;
}
.package-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-light);
}
.package-card.hot {
  border-color: var(--warning);
  background: linear-gradient(135deg, #fff9ed 0%, #ffffff 100%);
}
.package-hot-tag {
  position: absolute;
  top: 12px;
  right: -28px;
  background: linear-gradient(135deg, #ff6b6b, #ffa502);
  color: #fff;
  font-size: 12px;
  padding: 4px 32px;
  transform: rotate(45deg);
  font-weight: 500;
}
.package-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.package-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.package-price {
  margin: 16px 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}
.price-symbol {
  font-size: 18px;
  color: var(--danger);
  font-weight: 500;
}
.price-value {
  font-size: 40px;
  font-weight: bold;
  color: var(--danger);
  line-height: 1;
}
.price-unit {
  font-size: 14px;
  color: var(--text-secondary);
  margin-left: 4px;
}
.package-tag {
  display: inline-block;
  padding: 4px 16px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-size: 12px;
  margin-bottom: 20px;
}
.package-card.hot .package-tag {
  background: #fff1e0;
  color: var(--warning);
}
.package-features {
  text-align: left;
  border-top: 1px dashed var(--border-light);
  padding-top: 16px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-regular);
}
.check-icon {
  color: var(--success);
  font-weight: bold;
  font-size: 14px;
}

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo-text, .menu-item span, .sidebar-footer { display: none; }
  .sidebar-logo { justify-content: center; }
  .main { margin-left: 60px; }
  .content { padding: 12px; }
  .stats-grid { grid-template-columns: 1fr; }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: #d0d4dc;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: #b4b9c2; }

/* 复选框美化 */
input[type="checkbox"] {
  accent-color: var(--primary);
}
