/* 私域学堂管理后台 - 样式 */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0f172a;
  --bg-2: #1e293b;
  --bg-3: #334155;
  --text: #e2e8f0;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --danger: #ef4444;
  --success: #10b981;
  --border: #334155;
  --radius: 8px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════ */
/* 通用 */
/* ═══════════════════════════════════════════════════════ */
.btn {
  background: var(--bg-3);
  color: var(--text);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.btn:hover { background: #475569; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 18px;
  padding: 4px 8px;
  cursor: pointer;
  border-radius: var(--radius);
}
.icon-btn:hover { background: var(--bg-3); }

input, select, textarea {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { resize: vertical; min-height: 60px; }

code {
  background: var(--bg-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.error { color: var(--danger); font-size: 13px; margin-top: 8px; }
.hint { color: var(--text-2); font-size: 12px; margin: 8px 0; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════ */
/* 配置面板 / 登录面板 */
/* ═══════════════════════════════════════════════════════ */
.config-panel, .login-panel {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  padding: 20px;
}
.config-card, .login-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.config-card h1, .login-card h1 {
  text-align: center;
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}
.config-card input, .login-card input {
  margin: 12px 0;
}
.config-card .btn, .login-card .btn {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  font-size: 15px;
}
.login-card .logo {
  text-align: center;
  font-size: 48px;
  margin-bottom: 8px;
}
.login-card .slogan {
  text-align: center;
  color: var(--text-2);
  margin-bottom: 24px;
}

/* ═══════════════════════════════════════════════════════ */
/* 主应用布局 */
/* ═══════════════════════════════════════════════════════ */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.brand { font-size: 16px; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 8px; }
.user-tag {
  font-size: 12px;
  background: var(--bg-3);
  padding: 4px 10px;
  border-radius: 12px;
  color: var(--text-2);
}

.app-main {
  display: flex;
  flex: 1;
  overflow: hidden;
}
.sidebar {
  width: 160px;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}
.nav-item {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 10px 12px;
  text-align: left;
  font-size: 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.nav-item:hover { background: var(--bg-3); color: var(--text); }
.nav-item.active { background: var(--primary); color: white; }

.content {
  flex: 1;
  overflow: auto;
  padding: 20px;
}
.view { display: none; }
.view.active { display: block; }

/* ═══════════════════════════════════════════════════════ */
/* 工具栏 */
/* ═══════════════════════════════════════════════════════ */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
}
.search-input {
  flex: 1;
  min-width: 200px;
  max-width: 400px;
}

/* ═══════════════════════════════════════════════════════ */
/* 课程卡片 */
/* ═══════════════════════════════════════════════════════ */
.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.course-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, border-color 0.15s;
}
.course-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}
.course-card .cover {
  aspect-ratio: 16/9;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.course-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.course-card .cover-empty { font-size: 48px; opacity: 0.3; }
.course-card .info { padding: 12px; flex: 1; }
.course-card .title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.course-card .meta {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.tag {
  font-size: 11px;
  background: var(--bg-3);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-2);
}
.tag.status-active { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.tag.status-deleted { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.tag.status-inactive { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }
.course-card .sub { font-size: 12px; color: var(--text-2); }
.course-card .actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.empty {
  text-align: center;
  color: var(--text-2);
  padding: 40px 20px;
  grid-column: 1 / -1;
}
.empty.error { color: var(--danger); }

/* ═══════════════════════════════════════════════════════ */
/* 分类卡片 - 科技感立体风格 */
/* ═══════════════════════════════════════════════════════ */
.category-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.cat-card {
  position: relative;
  background: linear-gradient(145deg, rgba(30,41,59,0.9) 0%, rgba(15,23,42,0.95) 100%);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 12px;
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.3),
    0 1px 3px rgba(59,130,246,0.08),
    inset 0 1px 0 rgba(255,255,255,0.03);
  overflow: hidden;
}
.cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(59,130,246,0.5), rgba(16,185,129,0.5), transparent);
  opacity: 0.7;
}
.cat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(59,130,246,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.cat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(59,130,246,0.35);
  box-shadow:
    0 8px 28px rgba(0,0,0,0.45),
    0 2px 8px rgba(59,130,246,0.15),
    0 0 20px rgba(59,130,246,0.06),
    inset 0 1px 0 rgba(255,255,255,0.05);
}
.cat-card:active {
  transform: translateY(-1px);
  transition: all 0.1s;
}
.cat-icon {
  font-size: 28px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(59,130,246,0.12) 0%, rgba(16,185,129,0.06) 100%);
  border-radius: 12px;
  border: 1px solid rgba(59,130,246,0.15);
  flex-shrink: 0;
}
.cat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
}
.cat-name {
  font-size: 15px;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.5px;
  text-align: center;
  word-break: break-all;
}
.cat-id {
  font-size: 10px;
  color: rgba(100,116,139,0.7);
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  letter-spacing: 0.3px;
  text-align: center;
  word-break: break-all;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════ */
/* 关于 */
/* ═══════════════════════════════════════════════════════ */
.about-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 600px;
}
.about-card h2 { margin-bottom: 12px; }
.about-card ul { list-style: none; margin: 12px 0; }
.about-card li { padding: 6px 0; color: var(--text-2); }

/* ═══════════════════════════════════════════════════════ */
/* 弹窗 */
/* ═══════════════════════════════════════════════════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}
.modal-box {
  position: relative;
  background: var(--bg-2);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
  font-weight: 600;
}
.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.close-btn { font-size: 20px; line-height: 1; }

/* 表单 */
.form-row { margin-bottom: 16px; }
.form-row label {
  display: block;
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.upload-row input { flex: 1; min-width: 200px; }
.cover-preview {
  max-width: 120px;
  max-height: 80px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* 章节列表 */
.chapters-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chapter-item {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chapter-item input {
  flex: 1;
}
.chapter-item .btn-remove-chapter {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.chapter-item .btn-remove-chapter:hover { background: #dc2626; }

.progress {
  width: 100%;
  height: 20px;
  background: var(--bg);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid var(--border);
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  width: 0%;
  transition: width 0.2s;
}
.progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* 上传进度条（upload-progress） */
.upload-progress {
  width: 100%;
  height: 20px;
  background: var(--bg);
  border-radius: 10px;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
  border: 1px solid var(--border);
}
.upload-progress .progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  width: 0%;
  transition: width 0.2s;
}
.upload-progress .progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* ═══════════════════════════════════════════════════════ */
/* 提示框 */
/* ═══════════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-3);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  font-size: 14px;
  max-width: 90vw;
  text-align: center;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ═══════════════════════════════════════════════════════ */
/* 概览 summary-card 风格（紧凑指标卡） */
/* ═══════════════════════════════════════════════════════ */
.summary-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.summary-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  position: relative;
  overflow: hidden;
}
.summary-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, #f59e0b, #f97316);
}
.summary-card .stat-label {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 6px;
}
.summary-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #f59e0b;
}

/* ═══════════════════════════════════════════════════════ */
/* 数据表格 */
/* ═══════════════════════════════════════════════════════ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-2);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.data-table th {
  background: var(--bg-3);
  padding: 10px 14px;
  text-align: left;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.data-table tr:hover td { background: rgba(59, 130, 246, 0.05); }
.data-table a { color: var(--primary); text-decoration: none; }
.data-table a:hover { text-decoration: underline; }

/* ═══════════════════════════════════════════════════════ */
/* 设置卡片 */
/* ═══════════════════════════════════════════════════════ */
.settings-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  max-width: 460px;
}
.settings-card h3 { margin-bottom: 16px; font-size: 16px; }
.settings-card .form-row { margin-bottom: 14px; }
.settings-card .btn { margin-top: 8px; }

/* ═══════════════════════════════════════════════════════ */
/* 页面装修 */
.deco-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.deco-panel {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.deco-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--border);
}
.deco-panel-header h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

/* 装修子项（banner/icon/section 卡片） */
.deco-item {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0;
}
.deco-item:last-child { border-bottom: none; }
.deco-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
}
.deco-item-header .btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}
.deco-item-body {
  padding: 0 16px 14px;
}
.deco-item-body .form-row {
  margin-bottom: 10px;
}
.deco-name {
  flex: 1;
  font-weight: 500;
  font-size: 13px;
}

/* 拖拽排序视觉反馈 */
.deco-item[draggable="true"] {
  cursor: grab;
}
.deco-item.dragging {
  opacity: 0.5;
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}
.deco-item.drag-over {
  border-top: 2px dashed var(--primary);
}

/* Toggle 开关 */
.deco-toggle {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.deco-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.deco-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--bg-3);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}
.deco-toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.deco-toggle input:checked + .deco-toggle-slider {
  background: var(--primary);
}
.deco-toggle input:checked + .deco-toggle-slider::before {
  transform: translateX(18px);
}

/* ═══════════════════════════════════════════════════════ */
/* 移动端适配 */
/* ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  .sidebar { width: 56px; padding: 8px 4px; }
  .nav-item { padding: 10px 6px; font-size: 12px; text-align: center; }
  .nav-item { word-break: break-all; }
  .course-list { grid-template-columns: 1fr; }
  .app-header { padding: 10px 12px; }
  .content { padding: 12px; }
}

/* ═══════════════════════════════════════════════════════ */
/* 概览图表 & 分享溯源 */
/* ═══════════════════════════════════════════════════════ */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 14px;
}
.chart-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: 220px;
  display: flex;
  flex-direction: column;
}
.chart-box canvas {
  flex: 1;
  min-height: 0;
}
.chart-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.share-track-section {
  margin-top: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}
.share-search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  align-items: center;
}
.share-results table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.share-results th,
.share-results td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.share-results th {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.share-results tr:hover td {
  background: rgba(255,255,255,0.03);
}
@media (max-width: 768px) {
  .charts-row { grid-template-columns: 1fr; }
}

/* 小程序页面路径下拉选择 */
.mp-link-select {
  margin-top: 6px;
  width: 100%;
  padding: 6px 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.mp-link-select option {
  background: var(--card);
  color: var(--text);
}

/* 课程选择下拉（装修模块拼接ID时使用） */
.course-picker {
  margin-top: 6px;
  width: 100%;
  padding: 6px 8px;
  background: var(--card);
  border: 1px solid #4a90d9;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.course-picker option {
  background: var(--card);
  color: var(--text);
}

/* 分类图标上传 */
.cat-icon-upload {
  display: flex;
  align-items: center;
  gap: 12px;
}
.cat-icon-preview {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  border: 2px dashed var(--border, #334155);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(15,23,42,0.4);
  flex-shrink: 0;
  overflow: hidden;
}
.cat-icon-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cat-icon-controls {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cat-icon-controls select {
  background: var(--card);
  border: 1px solid var(--border, #334155);
  border-radius: 6px;
  color: var(--text);
  padding: 6px 10px;
  font-size: 13px;
}
.cat-icon-upload-btn {
  font-size: 12px;
  padding: 4px 12px;
  background: rgba(59,130,246,0.15);
  border: 1px solid rgba(59,130,246,0.4);
  border-radius: 6px;
  color: #60a5fa;
  cursor: pointer;
  transition: all 0.2s;
}
.cat-icon-upload-btn:hover {
  background: rgba(59,130,246,0.25);
  border-color: rgba(59,130,246,0.6);
}
/* 卡片内图标图片 */
.cat-card .cat-icon img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  border-radius: 4px;
}

/* ═══════════════════════════════════════════════════════ */
/* 可视化页面装修 - 新增样式 */
/* ═══════════════════════════════════════════════════════ */

/* 装修工具栏 */
.deco-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}
.deco-toolbar h2 { font-size: 18px; font-weight: 600; }
.deco-toolbar-right { display: flex; align-items: center; gap: 12px; }
.deco-preview-hint { font-size: 12px; color: var(--text-3); }

/* 左右分栏布局 */
.deco-split {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.deco-preview-side {
  width: 375px;
  flex-shrink: 0;
  position: sticky;
  top: 60px;
}
.deco-preview-label {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 8px;
  text-align: center;
  font-weight: 600;
}
.deco-edit-side {
  flex: 1;
  min-width: 0;
}

/* Tab 切换 */
.deco-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.deco-tab {
  background: transparent;
  border: none;
  color: var(--text-2);
  padding: 10px 16px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.deco-tab:hover { color: var(--text); }
.deco-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.deco-tab-panel { display: none; }
.deco-tab-panel.active { display: block; }

/* ═══ 手机预览框 ════ */
.phone-frame {
  width: 375px;
  background: linear-gradient(180deg, #FFF8E6 0%, #FFFDF5 40%, #FFFFFF 100%);
  border-radius: 16px;
  border: 4px solid #1a1a1a;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  position: relative;
  max-height: 750px;
  overflow-y: auto;
}
.phone-frame::-webkit-scrollbar { width: 3px; }
.phone-frame::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 3px; }

/* 状态栏 */
.pf-statusbar {
  height: 20px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.pf-st-time { font-size: 12px; color: #fff; font-weight: 600; }
.pf-st-icons { display: flex; align-items: center; gap: 4px; }
.pf-st-icons span { font-size: 10px; }
.pf-battery { font-size: 13px; }

/* 导航栏 */
.pf-navbar {
  background: rgba(255,255,255,0.92);
  position: relative;
  z-index: 10;
  border-bottom: 1px solid rgba(255,154,0,0.06);
}
.pf-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  transition: height 0.2s;
}
.pf-nav-brand { font-size: 15px; font-weight: 800; color: #333; letter-spacing: 1px; }
.pf-nav-search {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 27px;
  padding: 0 11px;
  background: rgba(255,154,0,0.05);
  border: 1px solid rgba(255,154,0,0.12);
  border-radius: 14px;
}
.pf-nav-search-icon { font-size: 11px; opacity: 0.5; }
.pf-nav-search-text { font-size: 11px; color: #AAA; }
.pf-nav-accent {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,154,0,0.2) 20%, rgba(255,154,0,0.35) 50%, rgba(255,154,0,0.2) 80%, transparent 100%);
}

/* 页面内容区 */
.pf-body { padding: 0 16px; }

/* Banner 预览 */
.pf-banner-wrap { margin: 10px 0 8px; }
.pf-banner {
  width: 100%;
  height: 160px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0A1F3F 0%, #1A2D50 50%, #0D2240 100%);
  box-shadow: 0 2px 12px rgba(10,31,63,0.25);
  position: relative;
  overflow: hidden;
}
.pf-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
}
.pf-banner-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 12px;
  color: rgba(255,216,154,0.5);
}
.pf-banner-dots {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
}
.pf-banner-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
}
.pf-banner-dot.active { background: #FF9A00; }
.pf-banner-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  color: #FF9A00;
  background: rgba(255,255,255,0.9);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
}

/* 菜单图标预览 */
.pf-menu-section { padding: 4px 0 8px; }
.pf-menu-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 4px;
}
.pf-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
}
.pf-menu-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,154,0,0.08) 0%, rgba(255,180,0,0.03) 100%);
  border: 1px solid rgba(255,154,0,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pf-menu-emoji { font-size: 22px; }
.pf-menu-name { font-size: 11px; color: #555; margin-top: 5px; font-weight: 600; }
.pf-menu-hidden { opacity: 0.3; }

/* 区块标题 */
.pf-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 10px;
}
.pf-section-title { font-size: 16px; font-weight: 800; color: #333; }
.pf-section-more {
  font-size: 12px;
  color: #FF9A00;
  font-weight: 600;
  padding: 3px 9px;
  border: 1px solid rgba(255,154,0,0.2);
  border-radius: 10px;
  background: rgba(255,154,0,0.03);
}

/* 热门卡片预览 */
.pf-hot-scroll {
  display: flex;
  gap: 10px;
  overflow: hidden;
  padding-bottom: 4px;
}
.pf-hot-card {
  display: flex;
  width: 230px;
  background: #fff;
  border: 1px solid rgba(255,154,0,0.06);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,0.03);
  flex-shrink: 0;
}
.pf-hot-cover {
  width: 90px;
  height: 90px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #FF9A00, #FFB800);
}
.pf-hot-cover img { width: 100%; height: 100%; object-fit: cover; }
.pf-hot-body { padding: 8px 10px; flex: 1; }
.pf-hot-title { font-size: 13px; font-weight: 700; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-hot-cat { font-size: 10px; color: #999; margin-top: 4px; }
.pf-hot-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.pf-hot-tag { font-size: 10px; color: #fff; font-weight: 700; background: linear-gradient(135deg, #FF9A00, #FFB800); padding: 2px 7px; border-radius: 4px; }
.pf-hot-views { font-size: 10px; color: #999; }
.pf-empty-text { font-size: 12px; color: #BBB; text-align: center; padding: 18px 0; }

/* 最新上架卡片预览 */
.pf-poster-scroll {
  display: flex;
  gap: 10px;
  overflow: hidden;
  padding-bottom: 4px;
}
.pf-poster-card {
  width: 200px;
  height: 100px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, #0A1F3F, #1A2D50);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}
.pf-poster-card img { width: 100%; height: 100%; object-fit: cover; }
.pf-poster-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 10px 10px;
  background: linear-gradient(0deg, rgba(0,0,0,0.55) 0%, transparent 100%);
}
.pf-poster-title { font-size: 12px; font-weight: 700; color: #fff; }
.pf-poster-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 10px;
  color: #FFD89A;
  font-weight: 600;
  background: rgba(10,31,63,0.6);
  border-radius: 4px;
}

/* 分类浏览 */
.pf-cat-row {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 4px;
}
.pf-cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px;
}
.pf-cat-emoji { font-size: 24px; }
.pf-cat-name { font-size: 11px; color: #444; font-weight: 600; margin-top: 4px; }

/* 底部海报 */
.pf-bottom-poster {
  width: 100%;
  height: 100px;
  margin: 10px 0 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0A1F3F 0%, #1A2D50 50%, #0D2240 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.pf-bp-title { font-size: 14px; font-weight: 800; color: #FFD89A; letter-spacing: 2px; }
.pf-bp-desc { margin-top: 4px; font-size: 11px; color: rgba(255,255,255,0.65); letter-spacing: 3px; }

/* 页脚 */
.pf-footer { text-align: center; padding: 16px 0 20px; font-size: 10px; color: #CCC; }

/* TabBar */
.pf-tabbar {
  display: flex;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: #fff;
}
.pf-tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  gap: 1px;
}
.pf-tab-icon { font-size: 18px; }
.pf-tab-label { font-size: 10px; color: #999; }
.pf-tab-item.active .pf-tab-label { color: #FF9A00; font-weight: 700; }

/* 板块隐藏标记 */
.pf-section-hidden {
  opacity: 0.35;
  position: relative;
}
.pf-section-hidden::after {
  content: '已隐藏';
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  color: #999;
  background: rgba(0,0,0,0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 布局参数面板 */
.deco-layout-panel {
  padding: 16px;
}
.deco-layout-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.deco-li-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.deco-li-label { font-size: 14px; font-weight: 600; }
.deco-li-value {
  font-size: 18px;
  font-weight: 800;
  color: #f59e0b;
}
.deco-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-3);
  border-radius: 3px;
  outline: none;
  margin: 0;
  padding: 0;
  border: none;
}
.deco-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f59e0b;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(245,158,11,0.4);
}
.deco-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #f59e0b;
  cursor: pointer;
  border: 2px solid #fff;
}
.deco-li-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
}
.deco-layout-info {
  background: rgba(59,130,246,0.08);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.deco-info-title { font-size: 13px; font-weight: 700; color: #60a5fa; margin-bottom: 8px; }
.deco-info-formula { background: var(--bg); border-radius: 4px; padding: 6px 8px; margin-bottom: 4px; }
.deco-info-desc { font-size: 12px; color: var(--text-2); }
.deco-layout-code {
  background: #0d1117;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
}
.deco-code-title { font-size: 11px; color: #8b949e; margin-bottom: 6px; font-family: monospace; }
.deco-code-block { display: flex; flex-direction: column; gap: 2px; }
.deco-code-line { font-size: 12px; color: #c9d1d9; font-family: "SFMono-Regular", Consolas, monospace; }
.deco-code-line span { color: #f0883e; font-weight: 700; }

/* 轮播图预览图 */
.banner-preview { border-radius: 4px; }

/* 响应式：小屏幕时预览框缩小 */
@media (max-width: 1100px) {
  .deco-split { flex-direction: column; }
  .deco-preview-side { width: 100%; position: relative; top: 0; }
  .phone-frame { width: 100%; max-width: 375px; margin: 0 auto; }
}
@media (max-width: 640px) {
  .deco-toolbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .deco-toolbar-right { width: 100%; justify-content: space-between; }
  .deco-tabs { overflow-x: auto; }
  .deco-tab { white-space: nowrap; padding: 8px 12px; font-size: 13px; }
}
