/* ===== 基础变量 ===== */
/* 禁止鼠标左拖触发浏览器返回（保护编辑内容） */
html, body {
  overscroll-behavior-x: none;
  overscroll-behavior-y: none;
}
:root {
  --bg-primary: #0A0A12;
  --bg-secondary: #12121E;
  --bg-card: #161626;
  --bg-hover: #1E1E32;
  --bg-input: #1A1A2A;
  --border-subtle: rgba(201,169,110,0.15);
  --border-light: rgba(255,255,255,0.08);
  --gold-primary: #C9A96E;
  --gold-light: #E8D5A3;
  --gold-dark: #8B7347;
  --gold-glow: rgba(201,169,110,0.25);
  --text-primary: #F5E6D0;
  --text-secondary: #A09888;
  --text-muted: #6A6460;
  --success: #4CAF50;
  --warning: #FF9800;
  --error: #E57373;
  --info: #64B5F6;
  --sidebar-width: 240px;
  --topbar-height: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-gold: 0 0 20px rgba(201,169,110,0.15);
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
}

#app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  padding-bottom: 36px;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-light);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: var(--bg-primary);
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

/* 侧边栏收起/展开按钮 */
.sidebar-collapse-btn {
  margin-left: auto;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  opacity: 0.7;
  transition: all 0.2s;
}
.sidebar-collapse-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.sidebar-collapse-btn img { width: 18px; height: 18px; display: block; }

.sidebar-expand-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 6px;
  background: transparent;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  margin-right: 4px;
  opacity: 0.7;
  transition: all 0.2s;
}
.sidebar-expand-btn:hover { opacity: 1; background: rgba(255,255,255,0.1); }
.sidebar-expand-btn img { width: 18px; height: 18px; display: block; }

/* 侧边栏收起状态：隐藏侧边栏，主内容区占满整页 */
.sidebar.collapsed {
  display: none;
}
.app-sidebar-collapsed .main,
.main.sidebar-collapsed-expanded {
  flex: 1 1 auto;
  width: 100%;
  max-width: none;
}

.logo-cn {
  font-size: 16px;
  font-weight: 600;
  color: var(--gold-primary);
  letter-spacing: 2px;
}

.logo-en {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(201,169,110,0.1);
  color: var(--gold-primary);
  border: 1px solid var(--border-subtle);
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.nav-label {
  font-size: 14px;
  font-weight: 500;
}

.nav-divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 12px;
}

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

.review-status-badge {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
}

.review-status-badge.pending {
  background: rgba(255,152,0,0.1);
  color: #f59e0b;
}

.review-status-badge.approved {
  background: rgba(76,175,80,0.1);
  color: var(--success);
}

.review-status-badge.rejected {
  background: rgba(244,67,54,0.1);
  color: var(--danger);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-light);
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-primary);
  color: var(--bg-primary);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-name {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== 主内容区 ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-primary);
}

.topbar {
  height: var(--topbar-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
}

.page-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.env-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  background: rgba(100,181,246,0.1);
  color: var(--info);
  border: 1px solid rgba(100,181,246,0.2);
}

.env-badge.cloud {
  background: rgba(76,175,80,0.1);
  color: var(--success);
  border-color: rgba(76,175,80,0.2);
}

/* ===== 发布进度条 ===== */
.publish-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  background: linear-gradient(90deg, rgba(201,169,110,0.08), rgba(201,169,110,0.04));
  border-bottom: 1px solid rgba(201,169,110,0.15);
  flex-shrink: 0;
}
.publish-progress-track {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.publish-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #C9A96E, #A88B4A);
  border-radius: 3px;
  transition: width 0.4s ease;
  box-shadow: 0 0 8px rgba(201,169,110,0.3);
  position: relative;
}
.publish-progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  animation: progressShimmer 1.2s ease-in-out infinite;
}
@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes aiShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: 0 0; }
}
.publish-progress-text {
  font-size: 13px;
  color: var(--gold-primary);
  white-space: nowrap;
  min-width: 120px;
  font-weight: 500;
}

/* ===== 发布确认弹窗 ===== */
.publish-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.75);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  animation: modalFadeIn 0.25s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.publish-modal {
  width: 720px;
  max-width: 94vw;
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid rgba(201,169,110,0.2);
  border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  display: flex;
  flex-direction: column;
  animation: modalSlideUp 0.3s ease;
}
@keyframes modalSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.publish-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.publish-modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}
.publish-modal-close {
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.publish-modal-close:hover { background: rgba(255,255,255,0.06); color: #fff; }
.publish-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.publish-modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 16px;
  line-height: 1.6;
}
.publish-check-all {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}
.publish-check-all label {
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.publish-change-list { }
.publish-change-section {
  margin-bottom: 12px;
}
.publish-change-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  cursor: pointer;
  user-select: none;
}
.publish-change-section-header input[type="checkbox"] { flex-shrink: 0; }
.publish-change-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-primary);
}
.publish-change-section-count {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 10px;
}
.publish-change-section-toggle {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  transition: transform 0.2s;
}
.publish-change-section-toggle.open { transform: rotate(90deg); }
.publish-change-items {
  padding-left: 28px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.publish-change-items.open { max-height: 2000px; }
.publish-change-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
}
.publish-change-item:hover { background: rgba(255,255,255,0.04); }
.publish-change-item input[type="checkbox"] { flex-shrink: 0; }
.publish-change-item-type {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
  flex-shrink: 0;
}
.publish-change-item-type.add { background: rgba(76,175,80,0.15); color: #4CAF50; }
.publish-change-item-type.mod { background: rgba(33,150,243,0.15); color: #2196F3; }
.publish-change-item-type.del { background: rgba(244,67,54,0.15); color: #F44336; }
.publish-change-item-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.publish-change-item-id {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}
.publish-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
}
.publish-modal-footer .btn { min-width: 100px; }
.publish-modal-footer .btn-gold { font-size: 14px; font-weight: 600; padding: 10px 24px; }

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

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: var(--bg-primary);
}

.btn-primary:hover {
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--gold-primary);
}

.btn-secondary:hover {
  background: rgba(201,169,110,0.08);
}

.btn-danger {
  background: rgba(229,115,115,0.1);
  color: var(--error);
  border: 1px solid rgba(229,115,115,0.3);
}

.btn-danger:hover {
  background: rgba(229,115,115,0.2);
}

.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ===== 卡片 ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
}

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

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-body {
  padding: 24px;
}

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

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  padding: 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.2s;
}

.stat-card:hover {
  border-color: var(--border-subtle);
  transform: translateY(-2px);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(201,169,110,0.08);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-info { flex: 1; }

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-change {
  font-size: 12px;
  color: var(--success);
  margin-top: 4px;
}

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

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

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table tbody tr:hover {
  background: rgba(255,255,255,0.02);
}

.data-table td {
  color: var(--text-primary);
}

/* ===== 拖拽排序手柄 ===== */
.drag-handle-col {
  width: 28px;
  padding: 0 !important;
  text-align: center !important;
}
.drag-handle-td {
  padding: 0 !important;
  text-align: center;
  vertical-align: middle;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.drag-handle {
  display: inline-block;
  color: rgba(201,169,110,0.35);
  font-size: 14px;
  letter-spacing: 2px;
  line-height: 1;
  transition: color 0.2s;
  padding: 14px 8px;
  cursor: grab;
}
.data-table tbody tr:hover .drag-handle {
  color: var(--gold-primary);
}
.drag-handle:active {
  cursor: grabbing;
}

/* 被拖拽的源行 */
tr.drag-source {
  opacity: 0.4;
  background: rgba(201,169,110,0.08) !important;
}
tr.drag-source td {
  color: rgba(255,255,255,0.3) !important;
}

/* 拖拽悬停目标行（金色指示线在行上方） */
tr.drag-target td {
  border-top: 2px solid var(--gold-primary) !important;
}

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

.tag-gold {
  background: rgba(201,169,110,0.1);
  color: var(--gold-primary);
  border: 1px solid var(--border-subtle);
}

.tag-green {
  background: rgba(76,175,80,0.1);
  color: var(--success);
  border: 1px solid rgba(76,175,80,0.2);
}

.tag-gray {
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  border: 1px solid var(--border-light);
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== 开关 ===== */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.switch-track {
  width: 44px;
  height: 24px;
  background: var(--border-light);
  border-radius: 12px;
  position: relative;
  transition: all 0.2s;
}

.switch-input:checked + .switch-track {
  background: var(--gold-primary);
}

.switch-thumb {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.2s;
}

.switch-input:checked + .switch-track .switch-thumb {
  left: 22px;
}

.switch-input { display: none; }

/* ===== 搜索栏 ===== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-box input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
}

.search-box input:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 14px;
  box-shadow: var(--shadow-card);
  animation: toastIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 200px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error   { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-card);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s ease;
  transform: translateZ(0);
  will-change: transform;
  contain: layout paint;
}

.modal-lg { max-width: 720px; }
.modal-wide { max-width: 95vw; max-height: 95vh; }

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}

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

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

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

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

.empty-title {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* ===== 操作按钮组 ===== */
.action-btns {
  display: flex;
  gap: 8px;
}

.action-btn {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}

.action-btn.edit { color: var(--info); }
.action-btn.delete { color: var(--error); }

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

.page-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
}

.page-btn:hover,
.page-btn.active {
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

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

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    z-index: 100;
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .menu-toggle {
    display: block;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-box {
    max-width: none;
  }
}


.btn-gold {
  background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
  color: var(--bg-primary);
  font-weight: 600;
}

.btn-gold:hover {
  box-shadow: var(--shadow-gold);
  transform: translateY(-1px);
}

.btn-danger-outline {
  background: transparent;
  border: 1.5px solid #e74c3c;
  color: #e74c3c;
  font-weight: 500;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.btn-danger-outline:hover {
  background: #e74c3c;
  color: #fff;
  transform: translateY(-1px);
}


/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-subtle);
}

/* ===== 层级指示器 ===== */
.hint-level {
  display: inline-flex;
  gap: 4px;
}

.hint-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-light);
}

.hint-dot.active {
  background: var(--gold-primary);
}

/* ===== 代码/二维码展示 ===== */
.code-block {
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  color: var(--gold-light);
  word-break: break-all;
}

/* ===== 进度条 ===== */
.progress-bar {
  height: 6px;
  background: var(--border-light);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold-primary));
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ===== 审核管理页面 ===== */
.review-page,
.versions-page {
  padding: 24px;
}

.review-header {
  margin-bottom: 24px;
}

.review-header h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: var(--text-primary);
}

.review-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-top: 16px;
}

.review-tab {
  padding: 10px 24px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
}

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

.review-tab.active {
  color: var(--gold-dark);
  border-bottom-color: var(--gold-dark);
}

.tab-count {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--text-muted);
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  margin-left: 6px;
  font-weight: 600;
}

.review-tab.active .tab-count {
  background: rgba(180,140,70,0.15);
  color: var(--gold-dark);
}

.review-content {
  margin-top: 20px;
}

.review-card {
  transition: box-shadow 0.2s;
}

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

/* ===== 版本管理表格 ===== */
.version-list {
  margin-top: 16px;
}

.version-list .data-table {
  font-size: 13px;
}

.version-list .data-table th {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 10px 12px;
}

.version-list .data-table td {
  padding: 10px 12px;
  vertical-align: middle;
}

/* ===== 审核预览模拟器 ===== */
#reviewSimPhone {
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  background: #f5f5f5;
}

/* ===== 打回原因输入框 ===== */
#rejectReasonInput:focus {
  border-color: var(--gold-dark);
  outline: none;
  box-shadow: 0 0 0 3px rgba(180,140,70,0.1);
}

/* ===== 模态框 XL ===== */
.modal-xl {
  width: 90%;
  max-width: 960px;
  max-height: 90vh;
}

.modal-xl .modal-body {
  max-height: 70vh;
  overflow-y: auto;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.6;
}

/* ===== 审核状态 Badge ===== */
#reviewStatusBadge {
  cursor: default;
}

/* ================================================ */
/*   商家管理页面　Merchant Management Styles       */
/* ================================================ */

/* Tab 切换条 */
.merchant-tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.merchant-tab-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: calc(var(--radius-md) - 2px);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.merchant-tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}
.merchant-tab-btn.active {
  background: rgba(201,169,110,0.12);
  color: var(--gold-primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 顶部工具栏 */
.merchant-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.merchant-toolbar .form-select {
  width: 170px;
}
.merchant-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}
.merchant-count b {
  color: var(--gold-primary);
  font-size: 16px;
}

/* ── 商家卡片网格 ── */
.merchant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

/* 商家卡片 */
.merchant-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.25s;
  display: flex;
  flex-direction: column;
}
.merchant-card:hover {
  border-color: var(--border-subtle);
  box-shadow: 0 8px 30px rgba(0,0,0,0.35);
  transform: translateY(-2px);
}
.merchant-card.disabled {
  opacity: 0.5;
  filter: grayscale(0.6);
}
.merchant-card.disabled:hover {
  opacity: 0.65;
}

/* 卡片图片区 */
.merchant-card-cover {
  position: relative;
  height: 160px;
  background: linear-gradient(135deg, rgba(201,169,110,0.06), rgba(10,10,18,0.3));
  overflow: hidden;
}
.merchant-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.merchant-card-cover .no-photo {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-muted);
}
.merchant-card-cover .no-photo .icon {
  font-size: 36px;
  opacity: 0.5;
}
.merchant-card-cover .no-photo span {
  font-size: 12px;
}

/* 卡片状态角标 */
.merchant-card-status {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.merchant-card-status.enabled {
  background: rgba(76,175,80,0.15);
  color: var(--success);
  border: 1px solid rgba(76,175,80,0.3);
}
.merchant-card-status.disabled {
  background: rgba(229,115,115,0.15);
  color: var(--error);
  border: 1px solid rgba(229,115,115,0.3);
}

/* 卡片游戏角标 */
.merchant-card-project {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(201,169,110,0.15);
  color: var(--gold-light);
  border: 1px solid rgba(201,169,110,0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* 卡片内容 */
.merchant-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.merchant-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}
.merchant-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.merchant-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.merchant-card-meta .meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 卡片标签 */
.merchant-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.merchant-card-tags .m-tag {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
}
.m-tag-food { background: rgba(255,152,0,0.1); color: #ffa726; border: 1px solid rgba(255,152,0,0.2); }
.m-tag-drink { background: rgba(100,181,246,0.1); color: #64b5f6; border: 1px solid rgba(100,181,246,0.2); }
.m-tag-live { background: rgba(171,71,188,0.1); color: #ce93d8; border: 1px solid rgba(171,71,188,0.2); }

/* 卡片折扣 */
.merchant-card-discount {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(201,169,110,0.06);
  border: 1px dashed rgba(201,169,110,0.15);
  font-size: 12px;
  color: var(--gold-primary);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 卡片操作 */
.merchant-card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  background: rgba(0,0,0,0.15);
}
.merchant-card-actions .btn {
  flex: 1;
  padding: 7px 0;
  font-size: 12px;
  text-align: center;
}

/* ── 核销统计 Tab ── */
.stats-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.stats-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}
.stat-card .stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--gold-primary);
  line-height: 1.2;
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.stat-card.green .stat-number { color: var(--success); }
.stat-card.blue .stat-number { color: var(--info); }
.stat-card.orange .stat-number { color: var(--warning); }

/* 统计列表 */
.stats-list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: all 0.2s;
}
.stats-list-item:hover {
  border-color: var(--border-subtle);
  background: var(--bg-hover);
}
.stats-list-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(201,169,110,0.1);
  color: var(--gold-primary);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stats-list-info {
  flex: 1;
  min-width: 0;
}
.stats-list-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.stats-list-region {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.stats-list-count {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-primary);
  flex-shrink: 0;
  min-width: 50px;
  text-align: center;
}
.stats-list-count-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
}
.stats-detail-section {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

/* ── 优惠券配置 Tab ── */
.config-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 560px;
}
.config-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
}
.config-card-header .icon {
  font-size: 20px;
}
.config-card-header h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}
.config-card-body {
  padding: 24px;
}
.config-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.config-row-left b {
  display: block;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.config-row-left p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.config-status {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
}
.config-status.limit-on {
  background: rgba(255,152,0,0.08);
  color: #ffa726;
  border: 1px solid rgba(255,152,0,0.15);
}
.config-status.limit-off {
  background: rgba(76,175,80,0.08);
  color: #81c784;
  border: 1px solid rgba(76,175,80,0.15);
}

/* ── Toggle 开关 ── */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: 28px;
  transition: 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: 0.25s;
}
.toggle-switch input:checked + .toggle-slider {
  background: rgba(201,169,110,0.2);
  border-color: var(--gold-primary);
}
.toggle-switch input:checked + .toggle-slider::before {
  background: var(--gold-primary);
  transform: translateX(22px);
  box-shadow: 0 0 8px rgba(201,169,110,0.3);
}

/* ── 弹窗表单增强 ── */
.merchant-form-photo-preview {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.merchant-form-photo-preview img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-light);
}

/* ── 空状态卡片 ── */
.merchant-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.merchant-empty .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.3;
}
.merchant-empty p {
  font-size: 14px;
  margin-bottom: 20px;
}

/* ── 响应式 ── */
@media (max-width: 768px) {
  .merchant-grid {
    grid-template-columns: 1fr;
  }
  .config-card {
    max-width: none;
  }
  .stat-card .stat-number {
    font-size: 24px;
  }
}

/* ===== 底部备案号栏 ===== */
.icp-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  height: 36px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}
.icp-footer a {
  font-size: 12px;
  color: var(--gold-primary);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.2s;
}
.icp-footer a:hover {
  color: var(--gold-light);
}

/* ===== 互动反馈题：分支编辑器 ===== */
.branch-item {
  transition: border-color 0.2s, box-shadow 0.2s;
}
.branch-item:hover {
  border-color: rgba(201,169,110,0.3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.branch-item-header {
  flex-wrap: wrap;
}
.branch-rte-content:empty:before {
  content: '输入该分支的回复内容...';
  color: var(--text-muted);
}
.branch-rte-content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 6px 0;
  display: block;
}
.tool-btn-sm {
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tool-btn-sm:hover {
  background: rgba(201,169,110,0.12);
  border-color: rgba(201,169,110,0.25);
}
.tool-sep-sm {
  width: 1px;
  background: var(--border-subtle);
  margin: 0 2px;
  height: 14px;
}
.branch-img-thumb:hover img {
  opacity: 0.7;
}
.branch-img-del:hover {
  transform: scale(1.2);
}

/* ─── 同步到本地按钮（顶栏，醒目）───── */
.btn-sync-cloud {
  margin-left: 12px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  border: 1px solid rgba(99, 102, 241, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-sync-cloud:hover {
  background: linear-gradient(135deg, #818CF8, #A78BFA);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}
.btn-sync-cloud:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(99, 102, 241, 0.2);
}
.btn-sync-cloud.syncing {
  opacity: 0.7;
  pointer-events: none;
  animation: syncPulse 1s ease-in-out infinite;
}
@keyframes syncPulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25); }
  50% { box-shadow: 0 2px 20px rgba(99, 102, 241, 0.6); }
}

/* ─── 导出编辑内容按钮（顶栏）───── */
.btn-export-xlsx {
  margin-left: 8px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #059669, #10B981);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}
.btn-export-xlsx:hover {
  background: linear-gradient(135deg, #34D399, #6EE7B7);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

/* ===== 地图配置：左右布局 ===== */
.map-config-grid {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: stretch;
}
/* 左侧：地图 + 表单 */
.map-config-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.map-config-left {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.map-config-left #sharedMapContainer {
  width: 100% !important;
  height: 460px !important;
  min-height: 460px;
}
.map-config-right {
  min-width: 0;
}
.map-config-right .card-header {
  padding: 10px 12px;
  font-size: 14px;
}
.map-config-right .card-body {
  padding: 12px;
}
.map-config-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.map-config-form .full {
  grid-column: 1 / -1;
}
.map-config-form .form-input,
.map-config-form .form-select,
.map-config-form .form-textarea {
  padding: 7px 10px;
  font-size: 13px;
}
.map-config-form .form-textarea {
  min-height: 52px;
  resize: vertical;
}
.map-preview-coords {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  display: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 右侧：点位/路线列表侧边栏 */
.map-config-sidebar {
  width: 280px;
  min-width: 280px;
  flex-shrink: 0;
  display: flex;
}
.map-config-sidebar > .card {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.map-config-sidebar #mapListBody {
  max-height: none !important;
  flex: 1;
  overflow-y: auto;
}
.map-config-sidebar .list-item {
  cursor: pointer;
  transition: background .15s;
}
.map-config-sidebar .list-item:hover {
  background: rgba(201, 169, 110, 0.08) !important;
}

@media (max-width: 1100px) {
  .map-config-grid {
    flex-direction: column;
  }
  .map-config-sidebar {
    width: 100%;
    min-width: 0;
    max-height: 260px;
    order: -1;
  }
  .map-config-sidebar #mapListBody {
    max-height: 180px !important;
  }
  .map-config-main {
    width: 100%;
  }
  .map-config-left #sharedMapContainer {
    height: 360px !important;
    min-height: 360px;
  }
}

/* ===== 移动端（手机 H5）全面适配 ===== */
/* 侧边栏抽屉遮罩层 */
.sidebar-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  display: none;
}

@media (max-width: 768px) {
  /* 顶栏：允许换行、自适应高度、操作按钮不被裁切 */
  .topbar {
    height: auto;
    min-height: 56px;
    flex-wrap: wrap;
    padding: 8px 10px;
    gap: 6px;
  }
  .topbar .page-title {
    flex: 1;
    min-width: 0;
    font-size: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-actions {
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
  }
  .topbar-actions .btn {
    font-size: 13px;
    padding: 8px 12px;
    white-space: nowrap;
  }

  /* 主内容区留白缩小 */
  .content {
    padding: 12px 10px !important;
  }

  /* 侧边栏：抽屉展开时占满 + 遮罩 */
  .sidebar {
    width: 260px;
  }
  .sidebar.open {
    box-shadow: 0 0 20px rgba(0,0,0,0.4);
  }

  /* 触控目标放大：操作按钮 */
  .action-btns .btn,
  .action-btn {
    font-size: 13px;
    padding: 8px 10px;
    min-height: 34px;
  }
  .table-wrap {
    -webkit-overflow-scrolling: touch;
  }
  .table-wrap table {
    font-size: 12px;
  }
  .table-wrap th,
  .table-wrap td {
    padding: 8px 8px;
    white-space: nowrap;
  }
  .table-wrap td:first-child,
  .table-wrap th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--bg-primary);
  }

  /* 弹窗：大/宽弹窗手机自适应留白 */
  .modal-lg,
  .modal-wide,
  .modal-xl {
    max-width: 96vw;
    width: 96vw;
    margin: 0 auto;
  }
  .modal {
    max-height: 90vh;
  }
  .modal-body {
    padding: 14px;
  }

  /* 按钮行纵向堆叠更易点按 */
  .modal-body [style*="display:flex"] {
    flex-wrap: wrap;
  }
  .modal-footer,
  .modal-body > div[style*="gap"],
  .btn-group {
    flex-wrap: wrap;
  }
  .btn {
    font-size: 14px;
  }

  /* 富文本编辑器工具栏换行 */
  .rich-toolbar-v2 {
    flex-wrap: wrap;
    gap: 4px;
  }
  .rich-toolbar-v2 .tool-btn {
    padding: 6px 8px;
    font-size: 12px;
    min-width: 32px;
  }
  .rich-editor-content {
    max-width: none;
    margin: 0;
    min-height: 200px;
  }

  /* 剧情分页 tab 横向滚动 */
  #storyPageTabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  #storyPageTabs .story-page-tab {
    flex: 0 0 auto;
  }

  /* 表单行单列、提示文字不溢出 */
  .form-row {
    grid-template-columns: 1fr !important;
  }
  .form-hint,
  [style*="white-space: nowrap"] {
    white-space: normal !important;
    word-break: break-word;
  }

  /* 审批卡片 */
  .review-card {
    padding: 12px;
  }
  .review-card .review-actions {
    flex-wrap: wrap;
  }
  .review-card .btn {
    min-height: 36px;
  }

  /* 商家 tab、故事 tab 横向滚动 */
  .merchant-tab-bar,
  .story-tabs-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .merchant-tab-bar .tab,
  .story-tabs-bar .tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* 统计卡片 */
  .stats-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px;
  }

  /* 二维码 grid 两列 */
  .code-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  }

  /* 工具栏按钮略紧凑 */
  .toolbar .btn {
    padding: 8px 12px;
  }

  /* 地图配置高度适配 */
  .map-config-left #sharedMapContainer {
    height: 320px !important;
    min-height: 320px;
  }
  .map-config-main {
    height: 420px;
  }
}

