/* =============================================
   谦元养生管理系统 - 主样式表
   中式养生风格：米黄 + 深红/金色
   ============================================= */

:root {
  --primary: #8b2020;        /* 深红主色 */
  --primary-dark: #6a1818;
  --primary-light: #c94444;
  --gold: #c9a55a;           /* 金色 */
  --gold-light: #e4c87e;
  --gold-dark: #a07830;
  --bg-main: #f7f2e8;        /* 米黄背景 */
  --bg-card: #fefcf6;        /* 卡片背景 */
  --bg-sidebar: #2c1a0e;     /* 侧边栏深色 */
  --text-primary: #2c1a0e;
  --text-secondary: #6b5c4a;
  --text-muted: #9e8e7a;
  --border: #e0d5c0;
  --border-light: #f0e8d8;
  --success: #4a7c59;
  --warning: #c47f2a;
  --danger: #a02020;
  --info: #2a5c8a;
  --shadow: 0 2px 12px rgba(44, 26, 14, 0.08);
  --shadow-lg: 0 8px 32px rgba(44, 26, 14, 0.15);
  --radius: 10px;
  --radius-sm: 6px;
  --sidebar-width: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; margin: 0; padding: 0; overflow-x: hidden; }

body {
  font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  border-bottom: 1px solid rgba(201, 165, 90, 0.2);
}

.logo-icon svg { width: 44px; height: 44px; }
.logo-text h1 {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  color: var(--gold);
  letter-spacing: 2px;
}
.logo-text span { font-size: 11px; color: rgba(201, 165, 90, 0.6); }

.sidebar-nav { flex: 1; padding: 16px 0; }
.nav-section { margin-bottom: 8px; }
.nav-section-title {
  display: block;
  font-size: 10px;
  color: rgba(201, 165, 90, 0.4);
  padding: 8px 20px 4px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(255, 248, 235, 0.65);
  text-decoration: none;
  transition: all 0.2s;
  font-size: 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: rgba(201, 165, 90, 0.1);
  color: var(--gold-light);
}
.nav-item.active {
  background: rgba(201, 165, 90, 0.15);
  color: var(--gold);
  border-left-color: var(--gold);
}
.nav-icon { width: 20px; text-align: center; font-size: 14px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(201, 165, 90, 0.2);
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
  width: 36px; height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-light);
  font-size: 14px;
  font-family: 'Noto Serif SC', serif;
}
.user-name { display: block; font-size: 13px; color: #fff8eb; }
.user-role { display: block; font-size: 11px; color: rgba(201, 165, 90, 0.5); }

/* ===== 主内容区 ===== */
#main-app {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  font-size: 20px; color: var(--text-secondary);
}
.topbar-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.date-display { font-size: 13px; color: var(--text-muted); }
.btn-notify {
  background: none; border: none; cursor: pointer;
  font-size: 18px; position: relative; padding: 4px 8px;
}
.notify-dot {
  position: absolute; top: 4px; right: 6px;
  width: 8px; height: 8px;
  background: var(--primary); border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* ===== 页面区域 ===== */
.page-container { padding: 24px; flex: 1; width: 100%; box-sizing: border-box; }
.page { display: none; width: 100%; box-sizing: border-box; }
.page.active { display: block; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.page-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 22px;
  color: var(--text-primary);
}
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
  width: 100%;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--gold);
}
.stat-card.gold::before { background: var(--primary); }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  font-size: 28px;
  color: var(--gold);
  opacity: 0.7;
  min-width: 36px;
  text-align: center;
}
.stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: 'Noto Serif SC', serif;
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-trend { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.stat-trend.up { color: var(--success); }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}
.card-header h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 15px;
  color: var(--text-primary);
}

/* ===== 布局网格 ===== */
.section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ===== 表格 ===== */
.table-wrapper { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  background: rgba(201, 165, 90, 0.08);
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}
.data-table tr:hover td { background: rgba(201, 165, 90, 0.04); }
.empty-row { text-align: center; color: var(--text-muted); padding: 32px !important; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.input-field {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.input-field:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201, 165, 90, 0.15);
}
.input-field-sm {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-primary);
  font-size: 13px;
}
.hint-text { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.time-range { display: flex; align-items: center; gap: 10px; }
.time-range .input-field { flex: 1; }
.time-range span { color: var(--text-muted); }

/* ===== 按钮 ===== */
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: background 0.2s, transform 0.1s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
  background: rgba(201, 165, 90, 0.05);
}

.btn-text {
  background: none; border: none;
  color: var(--gold-dark);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  font-family: inherit;
}
.btn-text:hover { color: var(--primary); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-edit {
  background: transparent;
  color: var(--info);
  border: 1px solid var(--info);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
  margin-right: 6px;
}
.btn-edit:hover { background: var(--info); color: #fff; }

/* ===== 徽章 ===== */
.badge {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
}
.badge-success { background: rgba(74, 124, 89, 0.12); color: var(--success); }
.badge-warning { background: rgba(196, 127, 42, 0.12); color: var(--warning); }
.badge-danger { background: rgba(160, 32, 32, 0.12); color: var(--danger); }
.badge-info { background: rgba(42, 92, 138, 0.12); color: var(--info); }
.badge-gold { background: rgba(201, 165, 90, 0.15); color: var(--gold-dark); }

/* ===== 状态标签 ===== */
.status-active { color: var(--success); font-weight: 500; }
.status-warning { color: var(--warning); font-weight: 500; }
.status-expired { color: var(--text-muted); }

/* ===== 搜索/筛选栏 ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 13px;
  color: var(--text-primary);
}
.search-input:focus { outline: none; border-color: var(--gold); }
.filter-select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
}

/* ===== 通知列表 ===== */
.notice-list { display: flex; flex-direction: column; gap: 12px; }
.notice-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(201, 165, 90, 0.05);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--gold);
}
.notice-dot {
  width: 8px; height: 8px;
  background: var(--gold); border-radius: 50%;
  margin-top: 6px; flex-shrink: 0;
}
.notice-text { font-size: 13px; color: var(--text-primary); line-height: 1.6; }
.notice-time { font-size: 11px; color: var(--text-muted); margin-top: 4px; display: block; }

/* ===== 课程列表 ===== */
.course-list { display: flex; flex-direction: column; gap: 10px; }
.course-item {
  padding: 12px 16px;
  background: rgba(139, 32, 32, 0.04);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.course-name { font-size: 14px; font-weight: 500; color: var(--text-primary); }
.course-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ===== 预警列表 ===== */
.warning-list { display: flex; flex-direction: column; gap: 8px; }
.warning-item {
  padding: 10px 14px;
  background: rgba(196, 127, 42, 0.06);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--warning);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.warning-name { font-size: 13px; color: var(--text-primary); }
.warning-lessons { font-size: 12px; color: var(--warning); font-weight: 500; }

/* ===== 套餐网格 ===== */
.packages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.package-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}
.package-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--gold));
}
.package-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.pkg-name {
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.pkg-lessons {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Noto Serif SC', serif;
}
.pkg-lessons span { font-size: 14px; color: var(--text-muted); }
.pkg-price {
  font-size: 20px;
  color: var(--gold-dark);
  margin-top: 4px;
}
.pkg-desc { font-size: 12px; color: var(--text-muted); margin: 12px 0; line-height: 1.6; }
.pkg-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.pkg-tag {
  padding: 2px 8px;
  background: rgba(201, 165, 90, 0.12);
  color: var(--gold-dark);
  border-radius: 10px;
  font-size: 11px;
}
.pkg-actions { display: flex; gap: 8px; }

/* ===== 商品网格 ===== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-card.product-offline { opacity: 0.65; }
.product-card.product-offline .product-name { text-decoration: line-through; color: var(--text-muted); }
.product-img-wrap {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg, rgba(201, 165, 90, 0.15), rgba(139, 32, 32, 0.08));
  overflow: hidden;
}
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.product-img-wrap > div:not(.product-img-overlay):not(.product-status-tag) {
  display: flex; align-items: center; justify-content: center; height: 100%; font-size: 48px;
}
.product-status-tag {
  position: absolute; top: 8px; right: 8px;
  padding: 3px 8px; border-radius: 10px;
  font-size: 11px; font-weight: 600;
}
.product-status-tag.tag-online { background: rgba(46,125,50,0.85); color: #fff; }
.product-status-tag.tag-offline { background: rgba(229,57,53,0.85); color: #fff; }
.product-info { padding: 14px; }
.product-name { font-size: 15px; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }
.product-category { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.product-price { font-size: 16px; color: var(--primary); font-weight: 600; }
.product-price.hidden { color: var(--text-muted); font-style: italic; font-size: 13px; font-weight: 400; }
.product-spec { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.product-cost { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.product-stock { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.product-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.product-top-badges { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 6px; }

/* 上下架标签 */
.shelf-badge {
  display: inline-block; padding: 2px 7px; border-radius: 8px; font-size: 11px; font-weight: 600;
}
.shelf-badge.active { background: rgba(46,125,50,0.12); color: #2e7d32; }
.shelf-badge.inactive { background: rgba(229,57,53,0.1); color: #c62828; }

/* 商品统计条 */
.products-stats-bar {
  display: flex; gap: 20px; margin-bottom: 16px; padding: 10px 16px;
  background: rgba(139,32,32,0.05); border-radius: 10px; font-size: 13px;
}
.stat-item { color: var(--text-muted); }
.stat-item b { color: var(--text); font-weight: 600; margin: 0 2px; }
.stat-item.online b { color: #2e7d32; }
.stat-item.offline b { color: #c62828; }

/* 详情弹窗 */
.modal-xl { max-width: 860px; }
.detail-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px; }
.detail-gallery {
  position: relative; border-radius: 12px; overflow: hidden;
  background: #f7f2e8; aspect-ratio: 1;
}
.gallery-img { width: 100%; height: 300px; object-fit: cover; display: none; border-radius: 12px; }
.gallery-img.active { display: block; }
.gallery-dots { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.5); cursor: pointer; }
.dot.active { background: #fff; }
.gallery-hint { position: absolute; top: 8px; right: 10px; background: rgba(0,0,0,0.4); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.detail-no-img {
  width: 100%; aspect-ratio: 1; border-radius: 12px; background: #f7f2e8;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 72px;
}
.detail-name { font-size: 20px; font-weight: 700; color: var(--primary); margin-bottom: 10px; font-family: 'Noto Serif SC', serif; }
.detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.detail-cat { background: rgba(201,165,90,0.15); color: var(--gold); padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.detail-spec { background: rgba(139,32,32,0.08); color: var(--primary); padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.detail-status { padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.detail-status.online { background: rgba(46,125,50,0.12); color: #2e7d32; }
.detail-status.offline { background: rgba(229,57,53,0.1); color: #c62828; }
.detail-price { font-size: 28px; font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.detail-price-hide { font-size: 16px; color: var(--text-muted); font-style: italic; margin-bottom: 6px; }
.detail-cost { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.detail-stock { font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.detail-platform { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.detail-desc-label { font-size: 12px; color: var(--gold); font-weight: 600; margin: 12px 0 4px; border-left: 2px solid var(--gold); padding-left: 8px; }
.detail-desc { font-size: 13px; color: #444; line-height: 1.8; white-space: pre-wrap; }
.detail-desc-full { font-size: 13px; }

/* AI配置 */
.ai-test-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }

/* AI按钮 */
.ai-action-btn {
  background: linear-gradient(135deg, #8b2020, #c9a55a);
  color: #fff; border: none; border-radius: 8px; padding: 9px 12px;
  font-size: 12px; cursor: pointer; flex: 1; transition: all 0.2s;
}
.ai-action-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.ai-action-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ai-preview-card {
  background: #fff; border: 1px solid #e8d5b0; border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px;
}
.ai-use-btn {
  background: rgba(46,125,50,0.1); color: #2e7d32; border: 1px solid rgba(46,125,50,0.3);
  border-radius: 6px; padding: 5px 12px; font-size: 12px; cursor: pointer; margin-top: 8px;
}
.ai-use-btn:hover { background: rgba(46,125,50,0.2); }
.btn-view {
  background: rgba(201,165,90,0.15); color: var(--gold); border: 1px solid rgba(201,165,90,0.4);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.btn-view:hover { background: rgba(201,165,90,0.25); }
.btn-offline {
  background: rgba(229,57,53,0.1); color: #c62828; border: 1px solid rgba(229,57,53,0.3);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.btn-offline:hover { background: rgba(229,57,53,0.2); }
.btn-online {
  background: rgba(46,125,50,0.1); color: #2e7d32; border: 1px solid rgba(46,125,50,0.3);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
}
.btn-online:hover { background: rgba(46,125,50,0.2); }
.btn-toggle { transition: all 0.2s; }

/* ===== 弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(44, 26, 14, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
/* 宽弹窗（学员完整档案） */
.modal.modal-lg {
  max-width: 760px;
}
/* 表单分区标题 */
.form-section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(139,32,32,0.06);
  border-left: 3px solid var(--primary);
  padding: 7px 12px;
  border-radius: 0 4px 4px 0;
  margin: 16px 0 12px;
}
/* 档案详情查看 */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  margin-bottom: 6px;
}
.profile-item label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.profile-item .value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}
.profile-section {
  margin-bottom: 16px;
}
.health-tag {
  display: inline-block;
  background: rgba(139,32,32,0.08);
  color: var(--primary);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  margin: 2px 4px 2px 0;
}
@keyframes modalIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ===== 订单管理 ===== */
.stats-row { display: flex; gap: 16px; margin-bottom: 20px; }
.stats-row .stat-card { flex: 1; }
.order-id { font-family: monospace; font-size: 12px; color: var(--text-muted); }
.order-address { font-size: 12px; color: var(--text-muted); max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.order-detail-item label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.order-detail-item .value { font-size: 14px; color: var(--text-primary); font-weight: 500; }

/* 平台标签 */
.platform-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}
.platform-tag.douyin { background: rgba(255,0,80,0.1); color: #ff0050; }
.platform-tag.taobao { background: rgba(255,100,0,0.1); color: #ff6400; }
.platform-tag.pinduoduo { background: rgba(220,40,40,0.1); color: #dc2828; }
.platform-tag.none { background: rgba(150,150,150,0.1); color: #888; }

/* Webhook 配置 */
.webhook-item {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.webhook-platform { margin-bottom: 6px; }
.webhook-url {
  background: rgba(0,0,0,0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 12px;
  font-family: monospace;
  font-size: 13px;
  color: var(--primary);
  word-break: break-all;
}

/* 订单状态 */
.status-pending { background: rgba(150,150,150,0.15); color: #888; }
.status-assigned { background: rgba(74,144,226,0.15); color: #4a90e2; }
.status-shipped { background: rgba(201,165,90,0.15); color: var(--accent); }
.status-delivered { background: rgba(76,175,80,0.15); color: #4caf50; }
.status-cancelled { background: rgba(139,32,32,0.1); color: var(--primary); }

/* 商品平台设置 */
.product-platform-select { display: flex; gap: 8px; flex-wrap: wrap; }
.platform-radio { display: none; }
.platform-radio-label {
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
}
.platform-radio:checked + .platform-radio-label {
  border-color: var(--primary);
  background: rgba(139,32,32,0.08);
  color: var(--primary);
  font-weight: 600;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  font-family: 'Noto Serif SC', serif;
  font-size: 17px;
  color: var(--text-primary);
}
.modal-close {
  background: none; border: none; cursor: pointer;
  font-size: 22px; color: var(--text-muted);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(139, 32, 32, 0.08); color: var(--primary); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
}

/* ===== 操作按钮组 ===== */
.header-actions { display: flex; align-items: center; gap: 8px; }
.action-group { display: flex; gap: 6px; }

/* ===== Toggle 开关 ===== */
.toggle-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.toggle-label input { display: none; }
.toggle-switch {
  width: 36px; height: 20px;
  background: var(--border);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
}
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 14px; height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: left 0.2s;
}
input:checked + .toggle-switch { background: var(--success); }
input:checked + .toggle-switch::after { left: 19px; }

/* ===== 服务产品价格显示切换按钮 ===== */
.price-display-toggle {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.toggle-btn {
  display: inline-block;
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  background: linear-gradient(135deg, #8b2020, #a63030);
  color: #fff;
  text-align: center;
  box-shadow: 0 2px 8px rgba(139,32,32,0.3);
  letter-spacing: 0.5px;
}
.toggle-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139,32,32,0.4);
}
.toggle-btn:active {
  transform: translateY(0);
}
.toggle-hint {
  font-size: 12px;
  color: #999;
  font-style: italic;
}

/* ===== 图表占位 ===== */
.chart-placeholder {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chart-empty { color: var(--text-muted); font-size: 13px; }

/* ===== 小程序预览 ===== */
.miniprogram-frame-wrapper {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}
.phone-frame {
  width: 320px;
  flex-shrink: 0;
  background: #1a1a1a;
  border-radius: 40px;
  padding: 20px 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.phone-screen {
  background: #fff;
  border-radius: 24px;
  overflow: hidden;
  height: 580px;
}
.phone-screen iframe {
  width: 100%;
  height: 100%;
  border: none;
}
.miniprogram-info { flex: 1; padding-top: 20px; }
.miniprogram-info h4 {
  font-family: 'Noto Serif SC', serif;
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.miniprogram-info p { color: var(--text-secondary); margin-bottom: 8px; }
.miniprogram-info ul { list-style: none; margin-bottom: 24px; }
.miniprogram-info li {
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 14px;
  border-bottom: 1px dashed var(--border-light);
}

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(44, 26, 14, 0.88);
  color: var(--gold-light);
  padding: 10px 24px;
  border-radius: 24px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 999;
  pointer-events: none;
  white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 空状态 ===== */
.empty-hint {
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px;
  text-align: center;
  display: block;
}

/* ===== 财务图表 ===== */
.finance-chart-bar { display: flex; align-items: flex-end; gap: 8px; height: 160px; margin-top: 8px; }
.bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-fill { width: 100%; background: var(--gold); border-radius: 4px 4px 0 0; transition: height 0.4s; }
.bar-label { font-size: 10px; color: var(--text-muted); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .section-grid { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .miniprogram-frame-wrapper { flex-direction: column; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ===== 登录页面 ===== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2c1a0e 0%, #4a2c17 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

/* ===== AI商品辅助按钮 ===== */
.ai-gen-btn {
  padding: 7px 14px;
  background: linear-gradient(135deg, #c9a55a, #e0b86e);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(201,165,90,0.3);
  transition: all 0.2s ease;
  font-family: inherit;
}
.ai-gen-btn:hover {
  background: linear-gradient(135deg, #b8944a, #c9a55a);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(201,165,90,0.4);
}
.ai-action-btn {
  flex: 1;
  padding: 9px 6px;
  background: #f7f2e8;
  color: #8b2020;
  border: 1.5px solid #d4b896;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  font-family: inherit;
}
.ai-action-btn:hover {
  background: linear-gradient(135deg, #8b2020, #a63030);
  color: #fff;
  border-color: #8b2020;
  box-shadow: 0 2px 8px rgba(139,32,32,0.3);
}
.ai-action-btn:active { transform: scale(0.97); }
.ai-preview-card {
  background: #fff;
  border: 1px solid #e8d5b0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}
.ai-use-btn {
  margin-top: 6px;
  padding: 5px 12px;
  background: linear-gradient(135deg, #2e7d32, #43a047);
  color: #fff;
  border: none;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.ai-use-btn:hover { opacity: 0.9; transform: translateY(-1px); }

.login-box {
  background: #fff;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
}

.login-logo svg {
  width: 100%;
  height: 100%;
}

.login-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 28px;
  color: #8b2020;
  margin: 0 0 8px;
}

.login-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0 0 32px;
}

#login-form .form-group {
  margin-bottom: 16px;
}

#login-form input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
  color: #333;
  box-sizing: border-box;
  transition: border-color 0.3s;
}

#login-form input::placeholder {
  color: #999;
}

#login-form input:focus {
  outline: none;
  border-color: var(--gold);
}

.btn-login {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  margin-top: 8px;
  background: #8b2020;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-login:hover {
  background: #a52a2a;
}

.login-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

/* 退出登录按钮 */
.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.7);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s;
  margin-left: auto;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}
