/* ========== 全局重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #eef2ff;
  --bg: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
  height: 100vh;
}

/* ========== 欢迎页 ========== */
.welcome-screen {
  position: fixed;
  inset: 0;
  overflow-y: auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.welcome-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.welcome-content {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  text-align: center;
}
.welcome-header { margin-bottom: 32px; }
.welcome-logo {
  font-size: 56px;
  margin-bottom: 12px;
  animation: bounce 2s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.welcome-title {
  font-size: 36px;
  font-weight: 800;
  color: white;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.welcome-subtitle {
  font-size: 17px;
  color: rgba(255,255,255,0.85);
  font-weight: 400;
}

/* 步骤条 */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  padding: 8px 16px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
}
.step-item.active {
  background: white;
  box-shadow: var(--shadow-lg);
}
.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.step-item.active .step-text { color: var(--text); font-weight: 600; }
.step-text { color: rgba(255,255,255,0.9); font-size: 13px; }
.step-arrow { color: rgba(255,255,255,0.5); font-size: 16px; }

/* 大上传区域 */
.upload-hero {
  background: white;
  border-radius: 20px;
  padding: 48px 32px;
  cursor: pointer;
  transition: all 0.25s;
  border: 3px dashed rgba(99,102,241,0.3);
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
}
.upload-hero:hover, .upload-hero.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-2px);
}
.upload-hero-icon {
  font-size: 56px;
  margin-bottom: 16px;
}
.upload-hero-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.upload-hero-hint {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 或者分隔线 */
.or-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 20px 0;
}
.or-divider::before, .or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.3);
}
.or-divider span {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}

/* 示例图按钮 */
.btn-sample {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.5);
  padding: 14px 36px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
}
.btn-sample:hover {
  background: white;
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* 品牌选择 */
.brand-section {
  margin-top: 36px;
  text-align: left;
}
.brand-label {
  color: white;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  text-align: center;
}
.brand-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.brand-card {
  background: rgba(255,255,255,0.15);
  border-radius: 14px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
  backdrop-filter: blur(10px);
}
.brand-card:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-3px);
}
.brand-card.active {
  background: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}
.brand-colors {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 10px;
}
.brand-colors span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.5);
}
.brand-card.active .brand-colors span {
  border-color: rgba(0,0,0,0.1);
}
.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: white;
  margin-bottom: 2px;
}
.brand-card.active .brand-name { color: var(--text); }
.brand-count {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
}
.brand-card.active .brand-count { color: var(--text-secondary); }

/* 功能亮点 */
.features-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 36px;
  flex-wrap: wrap;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.9);
  font-size: 14px;
}
.feature-icon { font-size: 20px; }

/* ========== 编辑页 ========== */
.editor-screen {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* 顶部栏 */
.editor-header {
  height: 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  box-shadow: var(--shadow);
  z-index: 100;
  flex-shrink: 0;
}
.btn-back {
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-back:hover { background: var(--primary); color: white; }

.header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-align: center;
}

/* 编辑页步骤 */
.editor-steps {
  display: flex;
  align-items: center;
  gap: 6px;
}
.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.step-dot.done { background: var(--success); color: white; }
.step-dot.active { background: var(--primary); color: white; box-shadow: 0 0 0 3px var(--primary-light); }
.step-line {
  width: 24px;
  height: 2px;
  background: var(--border);
}
.step-line.done { background: var(--success); }

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
}
.btn-header {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.btn-header:hover { background: #f1f5f9; }
.btn-header:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-header-primary {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-header-primary:hover { background: var(--primary-hover); }

/* 编辑主体 */
.editor-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* 左侧面板 */
.panel-left {
  width: 280px;
  min-width: 280px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-toggle {
  display: none;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.panel-content {
  flex: 1;
  overflow-y: auto;
}
.panel-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 当前图片 */
.current-image-wrap {
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
  margin-bottom: 8px;
}
.current-image-wrap img {
  width: 100%;
  display: block;
  max-height: 140px;
  object-fit: contain;
}
.btn-change-img {
  width: 100%;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-change-img:hover { background: #f1f5f9; border-color: var(--primary); }

/* 表单控件 */
.select-large {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.select-large:focus { border-color: var(--primary); }

.form-group { margin-bottom: 12px; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-label .value {
  color: var(--primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
input[type="range"] {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  background: #e2e8f0;
  border-radius: 3px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
select, input[type="number"], input[type="text"] {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}
select:focus, input:focus { border-color: var(--primary); }
.hint-text {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* 尺寸预设 */
.size-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.size-preset {
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.size-preset:hover { border-color: var(--primary); color: var(--primary); }
.size-preset.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}

/* 分板预设 */
.board-preset {
  padding: 8px 4px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.board-preset:hover { border-color: var(--primary); color: var(--primary); }
.board-preset.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}

/* 模式网格 */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.mode-btn {
  padding: 9px 4px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.mode-btn:hover { border-color: var(--primary); color: var(--primary); }
.mode-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 600;
}

/* 折叠面板 */
.collapsible { cursor: pointer; }
.collapsible .collapse-icon {
  display: inline-block;
  transition: transform 0.2s;
  font-size: 10px;
}
.collapsible.collapsed .collapse-icon { transform: rotate(-90deg); }
.collapsible-content { overflow: hidden; transition: max-height 0.2s; }
.collapsible.collapsed + .collapsible-content { display: none; }

/* 开关 */
.switch {
  position: relative;
  width: 38px;
  height: 22px;
  display: inline-block;
}
.switch input { display: none; }
.switch .slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  cursor: pointer;
  transition: 0.2s;
}
.switch .slider:before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider:before { transform: translateX(16px); }
.tool-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
}

/* 生成按钮 */
.generate-section {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  padding: 16px;
  border-top: 1px solid var(--border);
}
.btn-generate {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(99,102,241,0.4);
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.5);
}
.btn-generate:active { transform: translateY(0); }
.generate-icon { font-size: 20px; }
.generate-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ========== 画布区域 ========== */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f1f5f9;
  min-width: 0;
}
.canvas-toolbar {
  height: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.tool-group {
  display: flex;
  gap: 0;
}
.tool-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.tool-btn:hover { background: #f1f5f9; }
.tool-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.toolbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  margin: 0 4px;
}
.display-options {
  display: flex;
  gap: 12px;
  align-items: center;
}
.switch-sm {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
}
.switch-sm .switch { transform: scale(0.8); }
.btn-craft {
  padding: 7px 14px;
  border: 1.5px solid var(--primary);
  border-radius: 8px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-craft:hover { background: var(--primary); color: white; }
.btn-craft.active { background: var(--primary); color: white; }

.canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}
#beadCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
.canvas-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-muted);
  pointer-events: none;
}
.placeholder-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.placeholder-text { font-size: 17px; font-weight: 600; color: var(--text-secondary); }
.placeholder-sub { font-size: 13px; margin-top: 6px; opacity: 0.7; }
.btn-generate-big {
  margin-top: 24px;
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(99,102,241,0.4);
  transition: all 0.2s;
  pointer-events: auto;
}
.btn-generate-big:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(99,102,241,0.5);
}
.btn-generate-big:active { transform: translateY(0); }

.canvas-status {
  height: 34px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 12px;
  color: var(--text-secondary);
  gap: 20px;
  flex-shrink: 0;
}
.canvas-status b { color: var(--text); font-weight: 600; }

/* 加载遮罩 */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(3px);
}
.loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #e2e8f0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { margin-top: 14px; font-size: 14px; color: var(--text-secondary); font-weight: 500; }

/* ========== 右侧面板 ========== */
.panel-right {
  width: 260px;
  min-width: 260px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.right-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.right-tab {
  flex: 1;
  padding: 12px 6px;
  text-align: center;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-weight: 500;
}
.right-tab:hover { color: var(--text); }
.right-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}
.right-content { flex: 1; overflow-y: auto; }
.right-pane { display: none; }
.right-pane.active { display: block; }

/* 色板 */
.palette-info {
  padding: 10px 14px;
  background: var(--primary-light);
  font-size: 12px;
  color: var(--primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}
.color-search-wrap { padding: 8px 12px; }
.color-search-wrap input { font-size: 12px; padding: 7px 10px; }
.color-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  padding: 8px 12px;
}
.color-item {
  aspect-ratio: 1;
  border-radius: 5px;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  transition: transform 0.1s;
}
.color-item:hover { transform: scale(1.2); z-index: 10; }
.color-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}
.color-item.disabled { opacity: 0.25; pointer-events: none; }
.color-item .color-tooltip {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  z-index: 100;
  pointer-events: none;
  margin-bottom: 4px;
}
.color-item:hover .color-tooltip { display: block; }

.current-color-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}
.current-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: #e2e8f0;
}
.current-color-info { flex: 1; min-width: 0; }
.current-color-code { font-weight: 700; font-size: 13px; }
.current-color-name { font-size: 11px; color: var(--text-secondary); }
.palette-actions {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.palette-actions .switch-sm { margin-bottom: 8px; }
.btn-small {
  width: 100%;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-small:hover { background: #f1f5f9; border-color: var(--primary); }
.btn-small.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-small.btn-danger:hover { background: #fef2f2; }

/* 材料清单 */
.material-summary {
  padding: 14px;
  background: var(--primary-light);
  display: flex;
  justify-content: space-around;
  text-align: center;
}
.sum-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}
.sum-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.board-info {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.board-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}
.board-info-label {
  color: var(--text-secondary);
}
.board-info-value {
  font-weight: 700;
  color: var(--text);
}
.board-info-tip {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.material-actions {
  padding: 8px 12px;
  display: flex;
  gap: 6px;
}
.material-actions .btn-small { flex: 1; }
.material-list { padding: 4px 0; }
.material-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.1s;
}
.material-item:hover { background: #f8fafc; }
.material-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}
.material-code {
  font-size: 12px;
  font-weight: 700;
  width: 42px;
  flex-shrink: 0;
}
.material-name {
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.material-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
.material-bar {
  height: 3px;
  background: #e2e8f0;
  border-radius: 2px;
  margin: 0 14px 4px;
  overflow: hidden;
}
.material-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s;
}
.empty-tip {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* 进度追踪 */
.progress-header {
  padding: 16px 14px;
  text-align: center;
}
.progress-ring {
  width: 100px;
  height: 100px;
  margin: 0 auto 12px;
  position: relative;
}
.progress-ring svg { transform: rotate(-90deg); }
.ring-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
}
.progress-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 12px;
}
.progress-stats .stat-value { font-weight: 700; font-size: 16px; color: var(--text); }
.progress-stats .stat-label { color: var(--text-secondary); }
.progress-tip {
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  background: #f8fafc;
  margin: 0 12px;
  border-radius: 8px;
}
#paneProgress .btn-small {
  margin: 12px;
  width: calc(100% - 24px);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .panel-left { width: 250px; min-width: 250px; }
  .panel-right { width: 230px; min-width: 230px; }
  .brand-cards { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
  .welcome-title { font-size: 28px; }
  .welcome-subtitle { font-size: 15px; }
  .steps-bar { gap: 4px; }
  .step-item { padding: 6px 10px; }
  .step-text { font-size: 11px; }
  .step-arrow { display: none; }
  .brand-cards { grid-template-columns: repeat(2, 1fr); }
  .upload-hero { padding: 32px 20px; }
  .upload-hero-text { font-size: 17px; }
  .features-row { gap: 14px; }
  .feature-text { font-size: 12px; }

  /* 编辑页移动端 */
  .editor-header { padding: 0 10px; gap: 8px; height: 50px; }
  .btn-back { padding: 6px 10px; font-size: 13px; }
  .editor-steps { display: none; }
  .btn-header-primary { padding: 6px 10px; font-size: 12px; }
  .btn-header { width: 32px; height: 32px; }

  .panel-left {
    position: fixed;
    left: 0;
    top: 50px;
    bottom: 0;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s;
    box-shadow: var(--shadow-lg);
  }
  .panel-left.open { transform: translateX(0); }
  .panel-toggle { display: block; }

  .panel-right {
    position: fixed;
    right: 0;
    top: 50px;
    bottom: 0;
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.25s;
    box-shadow: var(--shadow-lg);
  }
  .panel-right.open { transform: translateX(0); }

  .canvas-toolbar { padding: 0 8px; gap: 4px; height: auto; min-height: 48px; }
  .display-options { display: none; }
  .toolbar-divider { display: none; }
  .canvas-status { font-size: 11px; gap: 12px; padding: 0 10px; }
}
