/* ===== 基础变量 ===== */
/* 禁止鼠标左拖触发浏览器返回（保护编辑内容） */
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;
}

.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; }

@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;
  }
}

/* ===== 右侧预览面板 ===== */
.preview-panel {
  width: 380px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.preview-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.preview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.preview-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.preview-select-row {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-light);
}

.preview-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
  white-space: nowrap;
}

.preview-status.saved {
  background: rgba(76,175,80,0.1);
  color: var(--success);
}

.preview-status.unsaved {
  background: rgba(255,152,0,0.1);
  color: var(--warning);
}

.preview-device {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  overflow-y: auto;
}

.preview-device-notch {
  width: 120px;
  height: 24px;
  background: #1a1a1a;
  border-radius: 0 0 12px 12px;
  margin-bottom: 4px;
  position: relative;
  z-index: 2;
}

.preview-device-screen {
  width: 100%;
  max-width: 340px;
  height: 740px;
  background: var(--p-bg-primary);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  color: #333;
  position: relative;
  display: flex;
  flex-direction: column;
}

.preview-device-screen > .p-scroll-wrap {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
}

.preview-device-home {
  width: 100px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  margin-top: 12px;
}

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

.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);
}

/* ===== 预览面板：严格匹配真实小程序暗夜主题 ===== */

/* 预览面板内的小程序变量 */
.preview-device-screen {
  --p-bg-primary: #0A0A12;
  --p-bg-card: #161626;
  --p-bg-input: #1A1A2A;
  --p-gold-primary: #C9A96E;
  --p-gold-dark: #8B7347;
  --p-text-primary: #F5E6D0;
  --p-text-secondary: #A09888;
  --p-text-muted: #6A6460;
  --p-success: #4CAF50;
  --p-border-subtle: rgba(201,169,110,0.15);
  --p-border-light: rgba(255,255,255,0.08);
  --p-shadow-gold: 0 0 20px rgba(201,169,110,0.15);
  background: var(--p-bg-primary);
  color: var(--p-text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  overflow-y: auto;
}

/* ====== product 页面：轮播图 ====== */
.p-hero {
  position: relative;
  height: 200px;
}
.p-hero-swiper {
  height: 100%;
  display: flex;
  overflow: hidden;
  position: relative;
}
.p-hero-slide {
  min-width: 100%;
  width: 100%;
  height: 100%;
  flex-shrink: 0;
}
.p-hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.p-hero-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  background: linear-gradient(transparent, var(--p-bg-primary));
  pointer-events: none;
}
.p-hero-dots {
  position: absolute;
  bottom: 12px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.p-hero-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
}
.p-hero-dot.on {
  background: var(--p-gold-primary);
}

/* ====== product 页面：标题区 ====== */
.p-header {
  padding: 0 16px;
  margin-top: -16px;
  position: relative;
  z-index: 2;
}
.p-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--p-text-primary);
  display: block;
  margin-bottom: 10px;
}
.p-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}
.p-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}
.p-stars {
  display: flex;
  gap: 2px;
}
.p-star {
  width: 14px; height: 14px;
}
.p-star svg {
  width: 100%; height: 100%;
}
.p-star-fill { fill: var(--p-gold-primary); }
.p-star-empty { fill: rgba(255,255,255,0.15); }
.p-rating-score {
  font-size: 14px;
  color: var(--p-gold-primary);
  font-weight: 600;
}
.p-players {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--p-text-secondary);
}

/* ====== product 页面：标签 ====== */
.p-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px;
  margin-bottom: 16px;
}
.p-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(201,169,110,0.08);
  border: 1px solid var(--p-border-subtle);
  border-radius: 6px;
  font-size: 12px;
  color: var(--p-text-secondary);
}
.p-tag-icon {
  width: 12px; height: 12px;
  opacity: 0.6;
}

/* ====== product 页面：描述 ====== */
.p-desc {
  padding: 0 16px 16px;
  font-size: 14px;
  color: var(--p-text-secondary);
  line-height: 1.8;
  white-space: pre-wrap;
}

/* ====== product 页面：信息卡片 ====== */
.p-info-card {
  margin: 0 16px 16px;
  background: var(--p-bg-card);
  border-radius: 16px;
  padding: 4px 16px;
  border: 1px solid var(--p-border-subtle);
}
.p-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.p-info-row:last-child {
  border-bottom: none;
}
.p-info-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--p-text-secondary);
}
.p-info-icon {
  width: 14px; height: 14px;
  opacity: 0.5;
}
.p-info-value {
  font-size: 13px;
  color: var(--p-text-primary);
  font-weight: 500;
}
.p-diff-stars {
  display: flex;
  gap: 2px;
}
.p-diff-stars .p-star {
  width: 12px; height: 12px;
}

/* ====== product 页面：底部操作栏 ====== */
.p-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(transparent, var(--p-bg-primary) 30%);
  border-top: 1px solid var(--p-border-subtle);
}
.p-fav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0 12px;
  color: var(--p-text-muted);
  font-size: 11px;
}
.p-fav-icon {
  width: 20px; height: 20px;
  opacity: 0.4;
}
.p-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
}
.p-action-buy {
  background: linear-gradient(135deg, var(--p-gold-primary), var(--p-gold-dark));
  color: var(--p-bg-primary);
  box-shadow: var(--p-shadow-gold);
}

/* ====== play 页面：居中装饰标题 ====== */
.p-section-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.p-deco-line {
  width: 40px;
  height: 1px;
}
.p-deco-line:first-child {
  background: linear-gradient(90deg, transparent, var(--p-gold-primary));
}
.p-deco-line:last-child {
  background: linear-gradient(90deg, var(--p-gold-primary), transparent);
}
.p-deco-diamond {
  width: 6px; height: 6px;
  background: var(--p-gold-primary);
  transform: rotate(45deg);
  flex-shrink: 0;
}
.p-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--p-gold-primary);
  letter-spacing: 2px;
}
.p-section-subtitle {
  display: block;
  text-align: center;
  font-size: 12px;
  color: var(--p-text-muted);
  margin-bottom: 16px;
}

/* ====== play 页面：题目列表 ====== */
.p-questions {
  padding: 0 16px 16px;
}
.p-q-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.p-q-item {
  background: var(--p-bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--p-border-subtle);
  position: relative;
}
.p-q-item.final {
  border: 2px solid var(--p-gold-primary);
  box-shadow: var(--p-shadow-gold);
}
.p-q-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
.p-q-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--p-border-subtle);
  background: rgba(255,255,255,0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--p-gold-primary);
  flex-shrink: 0;
}
.p-q-item.final .p-q-num {
  background: rgba(201,169,110,0.1);
  border-color: var(--p-gold-primary);
}
.p-q-title {
  flex: 1;
  font-size: 15px;
  color: var(--p-text-primary);
  font-weight: 500;
}
.p-q-status {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid var(--p-border-subtle);
  flex-shrink: 0;
}
.p-q-hint {
  padding: 4px 10px;
  border: 1px solid var(--p-border-subtle);
  border-radius: 6px;
  font-size: 11px;
  color: var(--p-gold-primary);
  flex-shrink: 0;
  margin-left: 4px;
}
.p-final-badge {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(201,169,110,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.p-final-badge::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--p-gold-primary);
  border-radius: 50%;
  flex-shrink: 0;
}
.p-final-desc {
  font-size: 11px;
  color: var(--p-text-muted);
}

/* ===== 解谜页样式 ===== */
.p-mystery-page { padding-bottom: 60px; }
.p-play-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; height: 44px;
}
.p-play-nav-placeholder { width: 32px; }
.p-play-nav-title { font-size: 16px; font-weight: 600; color: var(--p-text-primary); }

.p-play-footer {
  display: flex; align-items: center;
  padding: 12px 0; margin-top: 16px;
  border-top: 1px solid var(--p-border-subtle);
}
.p-play-footer-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  cursor: pointer;
}
.p-footer-icon {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--p-border-subtle);
  display: flex; align-items: center; justify-content: center;
  color: var(--p-text-primary);
}
.p-footer-label { font-size: 12px; color: var(--p-text-primary); font-weight: 500; }
.p-footer-desc { font-size: 10px; color: var(--p-text-muted); }
.p-footer-divider { width: 1px; height: 40px; background: var(--p-border-subtle); }

/* 谜题列表 */
.p-questions { padding: 0 16px; }
.p-q-list { display: flex; flex-direction: column; gap: 10px; }
.p-q-item {
  background: var(--p-bg-card); border-radius: 12px; padding: 12px;
  border: 1px solid var(--p-border-subtle);
}
.p-q-item.answered { border-color: rgba(76,175,80,0.3); }
.p-q-item.final { border: 2px solid var(--p-gold-primary); }
.p-q-main { display: flex; align-items: center; gap: 10px; }
.p-q-num {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--p-border-subtle); background: rgba(255,255,255,0.04);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--p-gold-primary); flex-shrink: 0;
}
.p-q-item.answered .p-q-num { background: rgba(76,175,80,0.1); border-color: var(--p-success); color: var(--p-success); }
.p-q-item.final .p-q-num { background: rgba(201,169,110,0.1); border-color: var(--p-gold-primary); }
.p-q-title { flex: 1; font-size: 14px; color: var(--p-text-primary); font-weight: 500; }
.p-q-status {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--p-border-subtle); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.p-q-status:has(svg), .p-q-status:has(> div) { background: rgba(76,175,80,0.15); border-color: var(--p-success); }
.p-q-hint {
  padding: 3px 8px; border: 1px solid var(--p-border-subtle); border-radius: 4px;
  font-size: 10px; color: var(--p-gold-primary); flex-shrink: 0; cursor: pointer;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
#p-input-area.shake {
  animation: shake 0.4s ease-in-out;
}

/* ===== 底部导航栏 ===== */
.p-nav-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: rgba(10,10,18,0.95);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--p-border-subtle);
  display: flex;
  align-items: center;
  z-index: 10;
}
.p-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 100%;
  cursor: pointer;
  color: var(--p-text-muted);
  transition: color 0.2s;
}
.p-nav-item.on {
  color: var(--p-gold-primary);
}
.p-nav-icon {
  font-size: 18px;
  line-height: 1;
}
.p-nav-label {
  font-size: 10px;
}

/* 首页卡片 */
.p-home-card {
  flex-shrink: 0;
  width: 130px;
  background: var(--p-bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--p-border-subtle);
  cursor: pointer;
  transition: border-color 0.2s;
}
.p-home-card:hover {
  border-color: var(--p-gold-primary);
}

/* ===== 首页样式 ===== */
.p-home-page { padding-bottom: 20px; }
.p-home-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; height: 48px;
}
.p-home-menu {
  width: 24px; display: flex; flex-direction: column; gap: 6px; cursor: pointer;
}
.p-menu-line {
  height: 2px; background: var(--p-gold-primary); border-radius: 1px;
}
.p-home-brand { text-align: center; }
.p-brand-cn {
  display: block; font-size: 18px; font-weight: 700; color: var(--p-gold-primary); letter-spacing: 4px;
}
.p-brand-en {
  display: block; font-size: 9px; color: var(--p-text-muted); letter-spacing: 2px; margin-top: 2px;
}

.p-continue-section { padding: 0 16px; margin-bottom: 16px; }
.p-continue-card {
  background: var(--p-bg-card); border-radius: 12px; padding: 16px 20px;
  border: 1px solid var(--p-border-subtle); display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
}
.p-continue-info { flex: 1; }
.p-continue-name { display: block; font-size: 15px; font-weight: 600; color: var(--p-text-primary); margin-bottom: 4px; }
.p-continue-progress { display: block; font-size: 12px; color: var(--p-gold-primary); margin-bottom: 2px; }
.p-continue-time { display: block; font-size: 10px; color: var(--p-text-muted); }
.p-continue-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; background: rgba(201,169,110,0.1); border-radius: 6px;
  font-size: 12px; color: var(--p-gold-primary);
}

.p-scan-section {
  display: flex; align-items: center; justify-content: center;
  margin: 24px 0; position: relative; height: 180px;
}
.p-scan-ring-outer {
  position: absolute; width: 160px; height: 160px; border-radius: 50%;
  border: 2px solid rgba(201,169,110,0.15); animation: ring-pulse 3s ease-in-out infinite;
}
.p-scan-ring-inner {
  position: absolute; width: 140px; height: 140px; border-radius: 50%;
  border: 1px solid rgba(201,169,110,0.3); animation: ring-pulse 3s ease-in-out infinite 0.5s;
}
.p-scan-btn-main {
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,169,110,0.2) 0%, transparent 70%);
  border: 2px solid var(--p-gold-primary); display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(201,169,110,0.3), inset 0 0 16px rgba(201,169,110,0.1);
  position: relative; z-index: 2;
}
.p-scan-btn-main::before {
  content: ''; position: absolute; top: -4px; left: -4px; right: -4px; bottom: -4px;
  border-radius: 50%; border: 1px solid rgba(201,169,110,0.2); animation: ring-rotate 8s linear infinite;
}
.p-scan-text { font-size: 14px; font-weight: 600; color: var(--p-gold-primary); letter-spacing: 2px; }
.p-scan-subtext { font-size: 9px; color: var(--p-text-muted); margin-top: 4px; }

@keyframes ring-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.7; }
}
@keyframes ring-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.p-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; margin-bottom: 12px;
}
.p-section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 600; color: var(--p-text-primary);
}
.p-diamond-icon { width: 6px; height: 6px; background: var(--p-gold-primary); transform: rotate(45deg); }
.p-section-more { font-size: 11px; color: var(--p-text-muted); cursor: pointer; }

.p-product-scroll { width: 100%; overflow-x: auto; white-space: nowrap; }
.p-product-list { display: flex; padding: 0 16px; gap: 12px; }
.p-home-card {
  flex-shrink: 0; width: 140px; background: var(--p-bg-card); border-radius: 12px;
  overflow: hidden; border: 1px solid var(--p-border-subtle); cursor: pointer; transition: border-color 0.2s;
}
.p-home-card:hover { border-color: var(--p-gold-primary); }
.p-home-cover-wrap { position: relative; width: 140px; height: 180px; overflow: hidden; }
.p-home-cover { width: 100%; height: 100%; object-fit: cover; display: block; }
.p-home-fallback {
  display: none; position: absolute; inset: 0; background: linear-gradient(135deg,#1a1a2e,#0a0a12);
  align-items: center; justify-content: center; color: #C9A96E; font-size: 28px; font-weight: 700;
}
.p-home-info { padding: 10px; }
.p-home-name { font-size: 14px; font-weight: 600; color: var(--p-text-primary); display: block; margin-bottom: 8px; }
.p-home-tags { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.p-home-tag {
  padding: 2px 6px; background: rgba(201,169,110,0.1); border: 1px solid var(--p-border-subtle);
  border-radius: 4px; font-size: 9px; color: var(--p-gold-primary);
}
.p-home-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 6px; background: rgba(201,169,110,0.08); border-radius: 6px;
  font-size: 11px; color: var(--p-gold-primary);
}

.p-progress-card {
  margin: 0 16px 12px; background: var(--p-bg-card); border-radius: 12px;
  padding: 16px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--p-border-subtle);
  cursor: pointer;
}
.p-progress-ring { position: relative; width: 70px; height: 70px; flex-shrink: 0; }
.p-progress-center {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.p-progress-info { flex: 1; }
.p-progress-title { font-size: 14px; font-weight: 600; color: var(--p-text-primary); display: block; margin-bottom: 8px; }
.p-progress-bar-bg { height: 4px; background: rgba(255,255,255,0.05); border-radius: 2px; overflow: hidden; margin-bottom: 8px; }
.p-progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--p-gold-dark), var(--p-gold-primary)); border-radius: 2px; transition: width 0.6s ease; }
.p-progress-stats { text-align: right; margin-bottom: 4px; font-size: 14px; font-weight: 600; color: var(--p-gold-primary); }
.p-progress-hint { font-size: 10px; color: var(--p-text-muted); display: block; }

/* ===== 我的页面样式 ===== */
.p-profile-page { padding-bottom: 20px; }
.p-profile-header {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 16px; height: 48px;
}
.p-profile-title { font-size: 16px; font-weight: 600; color: var(--p-text-primary); }
.p-user-card {
  margin: 0 16px 12px; background: var(--p-bg-card); border-radius: 12px;
  padding: 16px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--p-border-subtle);
}
.p-user-avatar {
  width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, #1a1a2e, #0a0a12);
  border: 2px solid var(--p-border-subtle); display: flex; align-items: center; justify-content: center;
}
.p-user-info { flex: 1; }
.p-user-name { display: block; font-size: 15px; font-weight: 600; color: var(--p-text-primary); margin-bottom: 2px; }
.p-user-phone { display: block; font-size: 13px; color: var(--p-gold-primary); font-weight: 500; margin-bottom: 2px; }
.p-user-id { display: block; font-size: 11px; color: var(--p-text-muted); }
.p-stats-card {
  margin: 0 16px 16px; background: var(--p-bg-card); border-radius: 12px;
  padding: 16px; display: flex; align-items: center; justify-content: space-around; border: 1px solid var(--p-border-subtle);
}
.p-stat-item { text-align: center; }
.p-stat-value { display: block; font-size: 20px; font-weight: 700; color: var(--p-gold-primary); }
.p-stat-label { display: block; font-size: 11px; color: var(--p-text-muted); margin-top: 4px; }
.p-stat-divider { width: 1px; height: 32px; background: var(--p-border-subtle); }
.p-menu-list { margin: 0 16px; background: var(--p-bg-card); border-radius: 12px; border: 1px solid var(--p-border-subtle); overflow: hidden; }
.p-menu-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--p-border-subtle); cursor: pointer; color: var(--p-text-primary); font-size: 13px;
}
.p-menu-item:last-child { border-bottom: none; }
.p-menu-icon { width: 32px; height: 32px; border-radius: 8px; background: rgba(201,169,110,0.08); display: flex; align-items: center; justify-content: center; color: var(--p-gold-primary); }
.p-menu-text { flex: 1; }
.p-menu-badge {
  padding: 2px 8px; background: var(--p-gold-primary); color: var(--p-bg-primary);
  border-radius: 10px; font-size: 10px; font-weight: 600;
}

/* 响应式：小屏幕隐藏预览面板 */
@media (max-width: 1200px) {
  .preview-panel {
    display: none;
  }
}

/* ===== 滚动条 ===== */
::-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);
}
