/* ===== 全局重置 & 设计变量 ===== */
:root {
  /* 主色 */
  --primary: #4f8cf6;
  --primary-dark: #3a7ad9;
  --primary-light: #eaf2ff;
  --primary-grad: linear-gradient(135deg, #5b9bff 0%, #3a7ad9 100%);

  /* 语义色 */
  --success: #2bb673;
  --success-light: #e8f8f0;
  --warning: #f5a623;
  --warning-light: #fff6e6;
  --danger: #f5564a;
  --danger-light: #fdecea;
  --info: #14b8c4;
  --info-light: #e6fafb;
  --purple: #8b5cf6;
  --purple-light: #f3edff;

  /* 文本 */
  --text-main: #1c2333;
  --text-secondary: #5b6478;
  --text-light: #9aa3b5;

  /* 背景 */
  --bg-main: #f4f6fb;
  --bg-card: #ffffff;
  --bg-hover: #f7f9fc;
  --bg-soft: #f9fbff;

  /* 描边 */
  --border: #e7eaf1;
  --border-light: #f1f3f8;

  /* 圆角 */
  --radius: 16px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(22, 34, 71, 0.04);
  --shadow-sm: 0 2px 10px rgba(22, 34, 71, 0.06);
  --shadow-md: 0 8px 24px rgba(22, 34, 71, 0.10);
  --shadow-lg: 0 16px 48px rgba(22, 34, 71, 0.16);
  --shadow-primary: 0 6px 18px rgba(79, 140, 246, 0.30);

  --sidebar-w: 200px;
  --topbar-h: 58px;
}

* { 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:
    radial-gradient(1200px 600px at 12% -8%, #eaf2ff 0%, rgba(234,242,255,0) 55%),
    radial-gradient(1000px 520px at 100% 0%, #eef6ff 0%, rgba(238,246,255,0) 50%),
    linear-gradient(160deg, #f5f7fc 0%, #eef2f9 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.65;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--primary-light); color: var(--primary-dark); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(79,140,246,0.22); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(79,140,246,0.42); border: 2px solid transparent; background-clip: content-box; }

/* ===== 顶部导航 ===== */
.topbar {
  min-height: var(--topbar-h);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: env(safe-area-inset-top) 22px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: 30px;
  white-space: nowrap;
}

.brand-icon {
  font-size: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--primary-grad);
  box-shadow: var(--shadow-primary);
}

.brand-name {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.2px;
  background: linear-gradient(120deg, #2b4a8b 0%, #4f8cf6 70%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lock-btn {
  margin-left: 4px;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 10px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.lock-btn:hover { background: var(--primary-light); border-color: var(--primary); }
.lock-btn:active { transform: scale(0.94); }

.nav-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 15px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
  font-weight: 500;
}
.nav-tab:hover { background: var(--primary-light); color: var(--primary-dark); }
.nav-tab.active {
  background: var(--primary-grad);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-primary);
}

/* 移动端底部导航 */
.mobile-nav-tabs {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 300;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--border-light);
  box-shadow: 0 -4px 20px rgba(22,34,71,0.07);
  padding: 5px 0 calc(7px + env(safe-area-inset-bottom));
  justify-content: space-around;
}
.mobile-nav-tab {
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 7px 2px; border: none; background: transparent;
  color: var(--text-light); border-radius: 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s ease;
}
.mobile-nav-tab.active { color: var(--primary); background: var(--primary-light); }
.mobile-nav-tab .mobile-nav-icon { font-size: 23px; line-height: 1; filter: grayscale(0.3); transition: transform 0.18s ease; }
.mobile-nav-tab.active .mobile-nav-icon { filter: grayscale(0); transform: translateY(-1px); }
.mobile-nav-tab .mobile-nav-label { font-size: 12px; font-weight: 600; }

/* ===== 主内容区 ===== */
.main-content { max-width: 1180px; margin: 0 auto; padding: 24px; }
.view { display: none; animation: fadeIn 0.28s ease; }
.view.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ===== 页面标题 ===== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 12px;
}
.page-title {
  font-size: 23px; font-weight: 800; letter-spacing: 0.2px;
  padding-left: 14px; position: relative; line-height: 1.3;
}
.page-title::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 5px; height: 22px; border-radius: 4px; background: var(--primary-grad);
}
.page-subtitle { font-size: 13.5px; color: var(--text-secondary); margin-top: 4px; }

/* ===== 统计卡片 ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px; margin-bottom: 24px;
}
.stat-card {
  position: relative; overflow: hidden;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card::after {
  content: ''; position: absolute; right: -28px; top: -28px;
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--accent-soft, var(--primary-light));
  opacity: 0.5; transition: transform 0.3s ease;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.stat-card:hover::after { transform: scale(1.12); }

.stat-card .stat-label {
  font-size: 13.5px; color: var(--text-secondary); margin-bottom: 10px;
  display: flex; align-items: center; gap: 7px; font-weight: 600; position: relative; z-index: 1;
}
.stat-card .stat-value {
  font-size: 30px; font-weight: 800; color: var(--text-main);
  font-variant-numeric: tabular-nums; letter-spacing: -0.6px; position: relative; z-index: 1;
}
.stat-card .stat-sub {
  font-size: 12.5px; color: var(--text-light); margin-top: 6px; position: relative; z-index: 1;
}

.stat-card.accent-blue   { --accent-soft: #eaf2ff; border-top: 3px solid var(--primary); }
.stat-card.accent-blue   .stat-value { color: var(--primary); }
.stat-card.accent-green  { --accent-soft: #e8f8f0; border-top: 3px solid var(--success); }
.stat-card.accent-green  .stat-value { color: var(--success); }
.stat-card.accent-orange { --accent-soft: #fff6e6; border-top: 3px solid var(--warning); }
.stat-card.accent-orange .stat-value { color: #d9890a; }
.stat-card.accent-red    { --accent-soft: #fdecea; border-top: 3px solid var(--danger); }
.stat-card.accent-red    .stat-value { color: var(--danger); }
.stat-card.accent-teal   { --accent-soft: #e6fafb; border-top: 3px solid var(--info); }
.stat-card.accent-teal   .stat-value { color: #0f9aa4; }
.stat-card.accent-purple { --accent-soft: #f3edff; border-top: 3px solid var(--purple); }
.stat-card.accent-purple .stat-value { color: var(--purple); }

.stat-card.clickable { cursor: pointer; user-select: none; }
.stat-card.clickable:hover { transform: translateY(-3px) scale(1.012); }

.grid-section-label { font-size: 13px; font-weight: 700; color: var(--text-secondary); margin: 4px 2px 12px; display: flex; align-items: center; gap: 6px; letter-spacing: 0.3px; }

/* ===== 区块卡片 ===== */
.section-card, .settings-card, .chart-container {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 20px;
  overflow: hidden;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.section-card:hover, .settings-card:hover, .chart-container:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.section-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-light);
  border-left: 4px solid var(--primary);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 16px;
  background: linear-gradient(90deg, rgba(79,140,246,0.05), transparent 60%);
}
.section-body { padding: 18px 22px; }
.ops-advice .section-body { padding: 10px 22px 18px; }

.ops-list { list-style: none; margin: 0; padding: 0; }
.ops-list li {
  position: relative; padding: 11px 0 11px 4px; line-height: 1.7;
  border-bottom: 1px dashed var(--border-light); font-size: 15px;
  transition: background 0.15s ease;
}
.ops-list li:last-child { border-bottom: none; }
.ops-list li:hover { background: var(--bg-hover); border-radius: var(--radius-xs); }
.ops-list b { color: var(--primary-dark); }
.ops-list li::before { content: ''; }

.todo-list { list-style: none; }
.todo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border-light);
  transition: background 0.15s ease;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: var(--bg-hover); border-radius: var(--radius-xs); }
.todo-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; border-radius: 9px;
  font-size: 12px; font-weight: 700; padding: 0 9px;
}
.todo-badge.urgent { background: var(--danger-light); color: var(--danger); }
.todo-badge.normal { background: var(--warning-light); color: #d9890a; }
.todo-badge.ok { background: var(--success-light); color: var(--success); }
.todo-text { flex: 1; font-size: 15px; }
.todo-action { font-size: 14px; color: var(--primary); cursor: pointer; text-decoration: none; font-weight: 600; }
.todo-action:hover { text-decoration: underline; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text-main);
  border-radius: var(--radius-sm); font-size: 14.5px; font-weight: 600;
  cursor: pointer; transition: all 0.16s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--primary-grad); color: #fff; border-color: transparent; box-shadow: var(--shadow-primary); }
.btn-primary:hover { background: linear-gradient(135deg, #4f8cf6, #2f6bce); box-shadow: 0 8px 20px rgba(79,140,246,0.42); transform: translateY(-1px); color: #fff; }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { opacity: 0.92; box-shadow: 0 6px 16px rgba(43,182,115,0.35); transform: translateY(-1px); color: #fff; }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.92; box-shadow: 0 6px 16px rgba(245,86,74,0.35); transform: translateY(-1px); color: #fff; }

.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn-text {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font-size: 14px; padding: 5px 10px; border-radius: var(--radius-xs); font-weight: 600;
  transition: background 0.15s ease;
}
.btn-text:hover { background: var(--primary-light); }
.btn-text.danger { color: var(--danger); }
.btn-text.danger:hover { background: var(--danger-light); }

/* ===== 工具栏 ===== */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-spacer { flex: 1; }
.input, .select {
  padding: 9px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 14.5px; background: var(--bg-card); color: var(--text-main);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,140,246,0.15); }
.input-search { width: 220px; }
.input-date { width: 155px; }

/* ===== 表格 ===== */
.table-wrap {
  background: var(--bg-card); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); border: 1px solid var(--border-light);
  overflow-x: auto; overflow-y: hidden;
}
.modal:has(.status-modal-table) { max-width: min(1100px, 92vw); }

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

thead th {
  background: var(--bg-soft);
  padding: 13px 16px; text-align: left; font-size: 13px; font-weight: 700;
  color: var(--text-secondary); border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
thead th.text-right, td.text-right { text-align: right; }

tbody td {
  padding: 13px 16px; border-bottom: 1px solid var(--border-light);
  font-size: 14.5px; font-variant-numeric: tabular-nums; color: var(--text-main);
}
tbody tr:nth-child(even) { background: #fbfcfe; }
tbody tr:hover td { background: var(--primary-light); }
tbody tr:last-child td { border-bottom: none; }

.text-center { text-align: center; }
.cell-ellipsis { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clickable-row { cursor: pointer; }
.action-link { color: var(--primary); font-weight: 700; text-decoration: none; margin-right: 8px; }
.action-link:hover { text-decoration: underline; }

/* ===== 状态标签 ===== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.badge-pending { background: var(--warning-light); color: #d9890a; }
.badge-procured { background: #e6f3ff; color: #1f7ae0; }
.badge-shipped { background: var(--primary-light); color: var(--primary-dark); }
.badge-completed { background: var(--success-light); color: var(--success); }
.badge-refunded { background: var(--danger-light); color: var(--danger); }
.badge-aftersale { background: #fff0e6; color: #ea5d1f; }
.badge-cancelled { background: #f1f3f8; color: var(--text-light); }
.badge-active { background: var(--success-light); color: var(--success); }
.badge-inactive { background: #f1f3f8; color: var(--text-light); }
.badge-warn { background: var(--danger-light); color: var(--danger); border: 1px solid #f6c6c1; cursor: help; }
.warn-text { color: var(--danger); font-weight: 500; margin-top: 4px; display: inline-block; }

/* 私域客户状态快捷切换 chip */
.chip-group { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border); background: #fff; color: var(--text-light);
  border-radius: 999px; padding: 4px 11px; font-size: 13px; line-height: 1.6;
  cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip-active { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: var(--shadow-xs); }

.tier-chip { transition: border-color 0.15s; }
.tier-chip:hover { border-color: var(--primary) !important; background: var(--primary-light) !important; }

/* ===== 利润颜色 ===== */
.profit-positive { color: var(--success); font-weight: 700; }
.profit-negative { color: var(--danger); font-weight: 700; }
.profit-zero { color: var(--text-light); }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 56px 20px; color: var(--text-light); }
.empty-state .empty-icon {
  font-size: 40px; margin-bottom: 14px; display: inline-flex; align-items: center; justify-content: center;
  width: 84px; height: 84px; border-radius: 50%; background: var(--primary-light); color: var(--primary);
}
.empty-state .empty-text { font-size: 15px; font-weight: 700; color: var(--text-secondary); }
.empty-state .empty-hint { font-size: 13px; margin-top: 6px; }

/* 批量导入 */
.modal-divider { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.import-summary { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; margin-top: 14px; font-size: 15px; color: var(--text-main); }
.import-summary b { color: var(--primary); font-size: 18px; }
.import-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #b45309; border-radius: var(--radius-sm); padding: 9px 13px; margin-top: 10px; font-size: 13px; line-height: 1.6; }
.import-actions { margin-top: 14px; }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.5);
  /* 性能优化：去掉 backdrop-filter blur，避免弹窗滚动时实时模糊整页掉帧（电脑端尤甚） */
  display: flex; align-items: center; justify-content: center; z-index: 1000;
  animation: fadeIn 0.18s ease; padding: 16px;
}
body.modal-open { overflow: hidden; } /* 弹窗打开时锁定底层页面，防滚动穿透/跳动 */
.modal {
  background: var(--bg-card); border-radius: var(--radius-md);
  width: 90%; max-width: 560px; max-height: 90vh;
  box-shadow: var(--shadow-lg); border-top: 3px solid var(--primary);
  animation: popIn 0.22s ease;
  /* 滚动优化：header/footer 固定，body 独立滚动，避免长表单整页重绘卡顿 */
  display: flex; flex-direction: column; overflow: hidden;
  /* 合成层提升：弹窗内容滚动更顺滑，不触发整页重排 */
  transform: translateZ(0); will-change: transform;
}
.modal-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 17px; font-weight: 800;
  flex: 0 0 auto;
}
.modal-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--text-light); line-height: 1; width: 32px; height: 32px; border-radius: 8px;
  transition: all 0.15s ease;
}
.modal-close:hover { color: var(--danger); background: var(--danger-light); }
.modal-body {
  padding: 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS Safari 惯性滚动 */
  overscroll-behavior: contain;      /* 防止滚动到底后带动底层页面 */
  flex: 1 1 auto;
  min-height: 0;                     /* flex 子项收缩关键 */
}
.modal-footer { padding: 15px 22px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; flex: 0 0 auto; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-label { display: block; margin-bottom: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-secondary); }
.form-label .required { color: var(--danger); }
.form-label .hint { margin-left: 6px; font-weight: 400; font-size: 12px; color: var(--text-light); }

.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); font-size: 14.5px; background: #fff; color: var(--text-main);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s; font-family: inherit;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,140,246,0.16);
}
.form-textarea { min-height: 76px; resize: vertical; }
.form-hint { font-size: 12.5px; color: var(--text-light); margin-top: 5px; }
.form-divider { margin: 18px 0; border-top: 1px solid var(--border-light); padding-top: 18px; }
.form-section-title { font-size: 14px; font-weight: 700; color: var(--text-main); margin-bottom: 12px; }

/* ===== 图表区 ===== */
.chart-container { padding: 20px 22px; margin-bottom: 20px; }
.chart-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; color: var(--text-main); }
.chart-canvas-wrap { position: relative; height: 280px; }

/* ===== Toast ===== */
#toastContainer { position: fixed; top: 72px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: var(--text-main); color: #fff; padding: 11px 18px;
  border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-md);
  animation: slideIn 0.22s ease; max-width: 340px;
}
.toast.success { background: linear-gradient(135deg, #2bb673, #1f9d62); }
.toast.error { background: linear-gradient(135deg, #f5564a, #e23d31); }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== 两列布局 ===== */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

@media (max-width: 768px) {
  body { background-attachment: scroll; }
  .two-col { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .brand { margin-right: 0; }
  .brand-name { display: none; }
  .desktop-nav { display: none; }
  .mobile-nav-tabs { display: flex; }
  .main-content { padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); max-width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .dash-grid > .stat-card:last-child { grid-column: 1 / -1; }
  .stat-card { padding: 16px 18px; }
  .stat-card .stat-value { font-size: 25px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 13.5px; white-space: nowrap; }
  th, td { padding: 11px 12px; }
  .modal { width: 94%; max-width: 94vw; max-height: 92vh; }
  .modal:has(.status-modal-table) { max-width: 96vw; }
  .modal-body { padding: 18px; }
  .modal-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .page-header { margin-bottom: 16px; }
  .quick-actions .btn { flex: 1 0 auto; }
  .more-menu { position: fixed; inset: 0; z-index: 400; display: none; }
  .more-menu.open { display: block; }
  .more-menu-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.35); }
  .more-menu-panel {
    position: absolute; left: 0; right: 0; bottom: 0; background: var(--bg-card);
    border-radius: 20px 20px 0 0; padding: 20px 16px calc(26px + env(safe-area-inset-bottom));
    box-shadow: 0 -6px 28px rgba(22,34,71,0.14); animation: slideUp 0.26s ease;
  }
  .more-menu-title { font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 16px; text-align: center; }
  .more-menu-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .more-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px;
    border: none; background: var(--bg-soft); border-radius: var(--radius); font-size: 12px;
    color: var(--text-main); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background 0.15s ease;
  }
  .more-item:active { background: var(--primary-light); }
  .more-item span:first-child { font-size: 26px; }
}
@media (min-width: 769px) { .more-menu { display: none !important; } }

/* ===== 快捷操作 ===== */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }

/* ===== 进度条 ===== */
.progress-info { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.progress-bar { height: 8px; background: var(--border-light); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 999px; transition: width 0.3s ease; }

/* ===== 设置页 ===== */
.settings-card { padding: 22px; }
.settings-card h3 { font-size: 16.5px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border-light); }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--border-light); gap: 14px; }
.settings-row:last-child { border-bottom: none; }
.settings-row .label { font-weight: 600; }
.settings-row .desc { font-size: 12.5px; color: var(--text-light); margin-top: 3px; }

.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--border); border-radius: 26px; transition: 0.2s; }
.switch .slider::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.settings-hint { font-size: 12.5px; color: var(--text-secondary); line-height: 1.75; background: var(--bg-soft); border: 1px solid var(--border-light); border-radius: var(--radius-xs); padding: 11px 14px; margin-top: 4px; }
.settings-hint a { color: var(--primary); }

.filter-tip { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.filter-tip b { color: var(--primary); }
