/* ===== 拼豆图纸生成器 - 自定义样式 ===== */

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --accent: #ec4899;
  --bg-dark: #0f0f1a;
  --bg-card: #1e1e2e;
  --bg-input: #2a2a3e;
  --text-primary: #e4e4e7;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --border: #2e2e3e;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
}

* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
}

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

/* ===== 顶部导航栏 ===== */
.topbar {
  height: 56px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  position: relative;
  z-index: 100;
  flex-shrink: 0;
}

.topbar .logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.topbar .logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.topbar .nav-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== 主布局 ===== */
.main-layout {
  display: flex;
  height: calc(100vh - 56px);
  position: relative;
}

/* ===== 左侧控制面板 ===== */
.sidebar {
  width: 340px;
  min-width: 340px;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-content {
  padding: 16px;
  flex: 1;
}

.sidebar-section {
  margin-bottom: 20px;
}

.sidebar-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== 步骤指示器 ===== */
.steps {
  display: flex;
  align-items: center;
  padding: 0 16px 12px;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}

.step-item.active {
  color: var(--primary-light);
}

.step-item.done {
  color: var(--success);
}

.step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-item.active .step-num {
  background: var(--primary);
  color: #fff;
}

.step-item.done .step-num {
  background: var(--success);
  color: #fff;
}

.step-arrow {
  color: var(--text-muted);
  font-size: 10px;
}

/* ===== 上传区域 ===== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-input);
}

.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.05);
}

.upload-zone .icon {
  font-size: 36px;
  margin-bottom: 8px;
}

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

.upload-zone .hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== 控件 ===== */
.control-group {
  margin-bottom: 12px;
}

.control-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label .value {
  color: var(--primary-light);
  font-weight: 600;
  font-family: monospace;
}

.range-input {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: var(--bg-input);
  border-radius: 2px;
  outline: none;
}

.range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 0 0 2px var(--bg-card);
}

.range-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid var(--bg-card);
}

.text-input, .select-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.text-input:focus, .select-input:focus {
  border-color: var(--primary);
}

.select-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a1a1aa' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

/* ===== 推荐徽标 ===== */
.badge-rec {
  display: inline-block;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

/* ===== 按钮 ===== */
.btn {
  padding: 8px 16px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

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

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #db2777);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-icon:hover {
  background: var(--border);
  color: var(--text-primary);
}

.btn-icon.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== 画布区域 ===== */
.canvas-area {
  flex: 1;
  position: relative;
  background: var(--bg-dark);
  overflow: hidden;
}

/* ===== 右侧操作栏（工具栏 + 面板 + 材料统计，不遮挡画布）===== */
.right-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

/* 竖排工具栏 */
.side-toolbar {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
.side-toolbar-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  padding: 0 4px;
}
.side-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s;
  white-space: nowrap;
}
.side-btn:hover { background: var(--bg-input); color: var(--text-primary); }
.side-btn.active { background: var(--primary); color: #fff; }
.side-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.side-btn span { font-size: 12px; }
.side-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* 侧边栏内嵌面板（改色/画质） */
.side-panel {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.side-panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

/* 改色面板 - 色板列表项 */
.edit-swatch-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.12s;
}
.edit-swatch-item:hover { background: var(--bg-input); }
.edit-swatch-item.active { background: var(--primary); }
.edit-swatch-item.active .edit-swatch-code,
.edit-swatch-item.active .edit-swatch-name { color: #fff; }
.edit-swatch-color {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.edit-swatch-code {
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
  color: var(--text-primary);
  min-width: 32px;
}
.edit-swatch-name {
  font-size: 10px;
  color: var(--text-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 材料统计区（在侧边栏顶部） */
.stats-section {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid var(--border);
  max-height: 52%;
  overflow-y: auto;
}

.canvas-container {
  width: 100%;
  height: 100%;
  position: relative;
}

#mainCanvas {
  display: block;
  touch-action: none;
}

/* ===== 画布工具栏 ===== */
.canvas-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  background: rgba(30, 30, 46, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  z-index: 10;
}

.canvas-toolbar .btn-icon {
  border: none;
  background: transparent;
}

.canvas-toolbar .btn-icon:hover {
  background: var(--bg-input);
}

.canvas-toolbar .divider {
  width: 1px;
  background: var(--border);
  margin: 2px 2px;
}

.canvas-toolbar .btn-icon-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 14px;
  padding: 4px 6px;
}

/* 画质微调弹出面板 */
.quality-popover {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  max-width: calc(100% - 24px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  padding: 14px;
  z-index: 20;
}
/* 靠右停靠：不遮挡图纸主体 */
.quality-popover.popover-right {
  left: auto;
  right: 12px;
  transform: none;
  width: 210px;
  max-height: calc(100% - 80px);
  overflow-y: auto;
}
/* 自定义悬停提示（比原生 title 更快显示、样式统一） */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  right: calc(100% + 8px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-card, #1e1e2e);
  color: var(--text-primary, #eee);
  border: 1px solid var(--border, #444);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 190px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  z-index: 50;
  pointer-events: none;
}
.quality-popover .quality-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.quality-popover .control-group {
  margin-bottom: 12px;
}

/* ===== 右侧统计面板 ===== */
.stats-panel {
  width: 280px;
  min-width: 280px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.stats-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.stats-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.stats-summary {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.stat-card {
  flex: 1;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.stat-card .value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-light);
}

.stat-card .label {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.color-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.color-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  margin-bottom: 1px;
  transition: background 0.15s;
}

.color-item:hover {
  background: var(--bg-input);
}

.color-item.highlighted {
  background: rgba(250, 204, 21, 0.12);
  outline: 1px solid #facc15;
}

.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.color-info {
  flex: 1;
  min-width: 0;
}

.color-code {
  font-size: 11px;
  font-weight: 700;
  font-family: monospace;
}

.color-name {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.color-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* ===== 进度条 ===== */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-input);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), #34d399);
  border-radius: 2px;
  transition: width 0.3s;
}

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

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.modal-header {
  padding: 20px 24px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.modal-body {
  padding: 0 24px 24px;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-lg {
  max-width: 760px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-input);
}

/* ===== 裁剪 ===== */
.crop-stage {
  position: relative;
  width: 100%;
  height: 56vh;
  max-height: 520px;
  background: repeating-conic-gradient(#e9e9ef 0% 25%, #f7f7fb 0% 50%) 50% / 20px 20px;
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
  user-select: none;
}
.crop-img {
  position: absolute;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.crop-box {
  position: absolute;
  box-sizing: border-box;
  border: 1.5px solid #fff;
  outline: 1px solid rgba(99, 102, 241, 0.9);
  cursor: move;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  touch-action: none;
}
.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 1.5px solid #6366f1;
  border-radius: 50%;
  z-index: 2;
}
.crop-handle[data-handle="nw"] { top: -7px; left: -7px; cursor: nwse-resize; }
.crop-handle[data-handle="n"]  { top: -7px; left: 50%; margin-left: -7px; cursor: ns-resize; }
.crop-handle[data-handle="ne"] { top: -7px; right: -7px; cursor: nesw-resize; }
.crop-handle[data-handle="e"]  { top: 50%; margin-top: -7px; right: -7px; cursor: ew-resize; }
.crop-handle[data-handle="se"] { bottom: -7px; right: -7px; cursor: nwse-resize; }
.crop-handle[data-handle="s"]  { bottom: -7px; left: 50%; margin-left: -7px; cursor: ns-resize; }
.crop-handle[data-handle="sw"] { bottom: -7px; left: -7px; cursor: nesw-resize; }
.crop-handle[data-handle="w"]  { top: 50%; margin-top: -7px; left: -7px; cursor: ew-resize; }

.crop-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.crop-info {
  flex: 1;
  min-width: 180px;
  font-size: 12px;
  color: var(--text-secondary);
  font-family: monospace;
}
.crop-actions {
  display: flex;
  gap: 8px;
}

/* ===== 激活码输入 ===== */
.activation-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

.activation-card .lock-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.activation-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.activation-card p {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.code-input {
  text-align: center;
  font-size: 16px;
  font-family: monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 12px;
}

.activation-success {
  text-align: center;
  padding: 20px;
}

.activation-success .check-icon {
  font-size: 48px;
  color: var(--success);
  margin-bottom: 12px;
}

/* ===== Toast 通知 ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 13px;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 90vw;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.info { border-color: var(--primary); }

/* ===== 加载动画 ===== */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-input);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 裁剪区域 ===== */
.crop-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.crop-box {
  position: relative;
  background: var(--bg-card);
  border-radius: 12px;
  padding: 16px;
  max-width: 600px;
  width: 90%;
}

.crop-preview {
  width: 100%;
  background: var(--bg-dark);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}

/* ===== 响应式（手机 / iPad / 电脑通用） ===== */

/* 中等屏：右侧栏略窄 */
@media (max-width: 1180px) and (min-width: 769px) {
  .right-sidebar { width: 200px; min-width: 200px; }
}

/* 移动端（手机、竖屏 iPad）：左右栏变抽屉，画布全宽 */
@media (max-width: 768px) {
  .main-layout { position: relative; }

  /* 左侧向导抽屉 */
  .sidebar {
    position: fixed;
    left: 0; top: 56px; bottom: 0;
    width: 300px; max-width: 85vw;
    min-width: 0;
    z-index: 300;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: 4px 0 16px rgba(0,0,0,0.4);
  }
  .sidebar.open { transform: translateX(0); }

  /* 右侧操作栏抽屉 */
  .right-sidebar {
    position: fixed;
    right: 0; top: 56px; bottom: 0;
    width: 280px; max-width: 88vw;
    min-width: 0;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    z-index: 300;
    box-shadow: -4px 0 16px rgba(0,0,0,0.4);
  }
  .right-sidebar.open { transform: translateX(0); }

  /* 遮罩 */
  .sidebar-backdrop {
    position: fixed;
    inset: 56px 0 0 0;
    background: rgba(0,0,0,0.5);
    z-index: 290;
    display: none;
  }
  .sidebar-backdrop.show { display: block; }

  /* 顶部菜单按钮 */
  .mobile-toggle { display: flex !important; }
  .topbar .logo span { display: none; }

  /* 画布区占满 */
  .canvas-area { width: 100%; }
}

/* 移动端悬浮工具按钮 */
.mobile-tools-fab {
  display: none;
  position: fixed;
  right: 14px; bottom: 18px;
  z-index: 320;
  align-items: center; gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 12px 16px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 14px rgba(0,0,0,0.45);
}
@media (max-width: 768px) {
  .mobile-tools-fab { display: flex; }
}

/* ===== 空状态 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
}

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

.empty-state h2 {
  font-size: 18px;
  margin: 0 0 8px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
  max-width: 300px;
  line-height: 1.5;
}

/* ===== Tab ===== */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.tab.active {
  background: var(--primary);
  color: #fff;
}

/* ===== 折叠面板 ===== */
.accordion-item {
  border-bottom: 1px solid var(--border);
}

.accordion-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.accordion-content {
  padding: 0 16px 12px;
  display: none;
}

.accordion-item.open .accordion-content {
  display: block;
}

.accordion-arrow {
  transition: transform 0.2s;
  font-size: 10px;
  color: var(--text-muted);
}

.accordion-item.open .accordion-arrow {
  transform: rotate(90deg);
}
