/* =====================================
   豆阵 · 拼豆图纸生成器
   响应式 CSS
   Mobile-first, 支持 手机/平板/PC
   ===================================== */

/* === CSS Variables / Theme === */
:root {
  --primary: #FF6B35;
  --primary-dark: #E55A2B;
  --primary-light: #FFD4C0;
  --secondary: #2C3E50;
  --accent: #27AE60;
  --danger: #E74C3C;
  --warning: #F39C12;
  
  --bg: #FAFAFA;
  --bg-card: #FFFFFF;
  --bg-dark: #1A1A2E;
  
  --text: #2C3E50;
  --text-light: #7F8C8D;
  --text-white: #FFFFFF;
  
  --border: #E0E0E0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  
  --header-h: 56px;
  --nav-h: 60px;
  --max-w: 480px;
}

/* === Reset === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; display: block; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* === Layout === */
.app-container {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === Header === */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: white;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}

.app-header .logo {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}

.app-header .brand-sub {
  font-size: 11px;
  opacity: 0.8;
  margin-left: 6px;
  font-weight: 400;
}

/* === Main Content === */
.app-main {
  flex: 1;
  padding: 0 0 calc(var(--nav-h) + 20px) 0;
}

/* === Page Container === */
.page {
  display: none;
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Navigation Bar === */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  max-width: var(--max-w);
  width: 100%;
  height: var(--nav-h);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--text-light);
  font-size: 11px;
  transition: color 0.2s;
}

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

.nav-item .nav-icon {
  font-size: 22px;
  line-height: 1;
}

/* === Components === */

/* Card */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

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

.card-desc {
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.5;
}

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

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-accent {
  background: var(--accent);
  color: white;
}

.btn-large {
  padding: 14px 28px;
  font-size: 17px;
  border-radius: var(--radius);
}

.btn-block {
  display: flex;
  width: 100%;
}

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

/* Upload Zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: #FAFAFA;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-zone .upload-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.upload-zone .upload-text {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 4px;
}

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

/* Grid Size Selector */
.grid-size-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.grid-size-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: white;
  font-size: 14px;
  transition: all 0.2s;
}

.grid-size-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Brand Selector */
.brand-selector {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.brand-btn {
  flex: 1;
  padding: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  text-align: center;
  font-size: 14px;
  transition: all 0.2s;
}

.brand-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.brand-btn .brand-name {
  font-weight: 600;
  display: block;
}

.brand-btn .brand-count {
  font-size: 12px;
  color: var(--text-light);
}

/* Preview Canvas */
.canvas-wrapper {
  position: relative;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-wrapper canvas {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* Color Legend */
.color-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.color-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  background: #F0F0F0;
}

.color-chip .swatch {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}

/* Pricing Cards */
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.pricing-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  transition: all 0.2s;
  position: relative;
}

.pricing-card.featured {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.pricing-card .badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.pricing-card .price {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0;
}

.pricing-card .price small {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-light);
}

.pricing-card .features {
  list-style: none;
  font-size: 13px;
  color: var(--text-light);
  text-align: left;
  margin: 8px 0;
}

.pricing-card .features li {
  padding: 3px 0;
}

.pricing-card .features li::before {
  content: "✓ ";
  color: var(--accent);
  font-weight: bold;
}

/* Slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Pixel Canvas (Drawing) */
.pixel-canvas {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  background: white;
}

.pixel-canvas .pixel {
  aspect-ratio: 1;
  cursor: pointer;
  border: 1px solid rgba(0,0,0,0.06);
  transition: background 0.1s;
  /* 移动端防止意外选中/滚动 */
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.pixel-canvas .pixel:hover {
  border-color: rgba(0,0,0,0.3);
}

/* 移动端画布容器防止页面滚动 */
#pixel-canvas-container {
  touch-action: none;
  -webkit-overflow-scrolling: auto;
}

/* Drawing Tools */
.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  flex-wrap: wrap;
}

.tool-btn {
  width: 36px;
  height: 36px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.tool-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.tool-btn:hover {
  border-color: var(--primary);
}

/* Current Color Display */
.current-color {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 90vw;
  width: 360px;
  box-shadow: var(--shadow-lg);
}

.modal h3 {
  font-size: 18px;
  margin-bottom: 12px;
}

.modal p {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 16px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--secondary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}

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

.empty-state p {
  font-size: 15px;
}

/* === Tablet & PC === */
@media (min-width: 768px) {
  :root {
    --max-w: 720px;
    --header-h: 64px;
  }
  
  .page { padding: 24px; }
  
  .pricing-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1024px) {
  :root {
    --max-w: 960px;
  }
  
  .pricing-grid {
    max-width: 800px;
    margin: 16px auto;
  }
}

/* === Utility === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.hidden { display: none !important; }

/* === Preset Selector (推荐参数) === */
.preset-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.preset-btn {
  padding: 10px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  text-align: center;
  font-size: 13px;
  transition: all 0.2s;
  cursor: pointer;
}

.preset-btn .preset-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 2px;
}

.preset-btn .preset-label {
  font-size: 11px;
  color: var(--text-light);
}

.preset-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
}
.preset-btn.active .preset-label { color: var(--primary); }

/* === Style Tabs (鲜艳/柔和) === */
.style-tabs {
  display: flex;
  gap: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 12px 0;
}

.style-tab {
  flex: 1;
  padding: 8px 0;
  border: none;
  background: white;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.style-tab.active {
  background: var(--primary);
  color: white;
}

/* === Background Removal Toggle === */
.option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}

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

.option-hint {
  font-size: 11px;
  color: var(--text-light);
  display: block;
  margin-top: 2px;
}

.toggle-switch {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--border);
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-switch.on {
  background: var(--primary);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch.on::after {
  transform: translateX(22px);
}

/* === Compare View (原图/图纸对比) === */
.compare-tabs {
  display: flex;
  gap: 0;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 12px;
}

.compare-tab {
  flex: 1;
  padding: 6px 0;
  border: none;
  background: white;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.compare-tab.active {
  background: var(--secondary);
  color: white;
}

.compare-tab.active .compare-label {
  font-weight: 600;
}

.compare-view-container {
  position: relative;
  min-height: 200px;
}

.compare-view-container .compare-item {
  display: none;
  width: 100%;
}

.compare-view-container .compare-item.active {
  display: block;
}

/* === Result Info Card === */
.result-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  padding: 12px 0;
}

.result-info .info-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-cell .info-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.info-cell .info-label {
  font-size: 11px;
  color: var(--text-light);
}

/* === Re-parameterize bar === */
.reparam-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: #F8F8F8;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.reparam-bar .reparam-label {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
}

.reparam-bar .btn {
  font-size: 12px;
  padding: 5px 12px;
}

/* === Save/Export bar === */
.action-bar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.action-bar .btn {
  flex: 1;
}

/* === Section divider === */
.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin: 16px 0 8px 0;
}

/* Improve slider hint */
.slider-hint {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-light);
  margin-top: 4px;
}

/* ============================================
   结果页布局 · 对标拼豆星球
   ============================================ */

/* 整体结果容器 */
.result-page {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}

/* 预览区：左侧缩略图 + 右侧大图 */
.preview-section {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: #F8F8F8;
  position: relative;
}

.preview-left {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 80px;
  flex-shrink: 0;
}

.preview-thumb {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  background: #fff;
}

.preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-thumb .thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  text-align: center;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10px;
  padding: 2px 0;
}

.preview-thumb.active {
  border-color: var(--primary);
}

.preview-thumb .thumb-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 右侧主预览 */
.preview-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  background: #fff;
  border-radius: 8px;
  position: relative;
}

.preview-main img, .preview-main canvas {
  max-width: 100%;
  border-radius: 4px;
  image-rendering: auto;
}
.preview-main canvas {
  max-height: 520px;
  image-rendering: pixelated;
}

.preview-main .preview-label {
  position: absolute;
  top: 6px;
  left: 8px;
  font-size: 11px;
  color: #fff;
  background: var(--primary);
  padding: 1px 6px;
  border-radius: 3px;
}

.preview-main .ai-badge {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 10px;
  color: var(--text-light);
  opacity: 0.7;
}

/* 多尺寸缩略图行 */
.size-preview-row {
  display: flex;
  gap: 10px;
  padding: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.size-preview-item {
  flex-shrink: 0;
  text-align: center;
  cursor: pointer;
}

.size-preview-item canvas {
  border-radius: 6px;
  border: 2px solid var(--border);
  display: block;
}

.size-preview-item.size-active canvas {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(255,107,53,0.25);
}

.size-preview-item .size-label {
  font-size: 10px;
  color: var(--text-light);
  margin-top: 3px;
}

.size-preview-item.size-active .size-label {
  color: var(--primary);
  font-weight: 600;
}

/* 免费预览次数行 */
.free-counter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #FFF9F0;
  font-size: 12px;
  color: #8B6914;
  flex-wrap: wrap;
  gap: 6px;
}

.free-counter a {
  color: var(--primary);
  text-decoration: none;
  font-size: 11px;
}

/* 会员横幅（黄色渐变） */
.member-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  margin: 8px 12px;
  background: linear-gradient(135deg, #FFF3C4, #FFE082);
  border-radius: 10px;
  font-size: 12px;
  gap: 10px;
}

.member-banner .banner-text strong {
  display: block;
  font-size: 13px;
  color: #5D4037;
}

.member-banner .banner-text span {
  font-size: 11px;
  color: #8D6E63;
}

.member-banner .banner-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  background: #FF6B35;
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* 推荐参数 - 横向滚动药丸 */
.preset-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
  flex-wrap: nowrap;
}

.preset-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.preset-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

/* 尺寸选择器 */
.size-selector {
  padding: 8px 0;
}

.size-btns {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.size-btn {
  flex: 1;
  min-width: 48px;
  padding: 6px 0;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}

.size-btn.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
}

/* 自定义尺寸行（加减号 + 滑块） */
.size-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.size-custom .size-stepper {
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.size-custom .size-stepper:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.size-custom input[type="range"] {
  flex: 1;
}

.size-custom .size-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  min-width: 36px;
  text-align: center;
}

.size-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* 底部固定栏 */
.bottom-action-bar {
  position: sticky;
  bottom: 60px;
  left: 0;
  right: 0;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 50;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.bottom-action-bar .btn-member {
  flex-shrink: 0;
  padding: 12px 16px;
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  line-height: 1.3;
}

.bottom-action-bar .btn-member small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  opacity: 0.8;
}

.bottom-action-bar .btn-save {
  flex: 1;
  padding: 12px 0;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}

.bottom-action-bar .btn-save small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  opacity: 0.85;
}

/* 调整：结果页不再需要间距，卡片之间的间距由结果页自己控制 */
#convert-result .card {
  margin: 0 12px 10px 12px;
}

#convert-result .card:first-child { margin-top: 10px; }

/* 信息统计小行 */
.stats-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--text-light);
  padding: 4px 0;
}

.stats-row .stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  margin-right: 2px;
}

/* ============================================
   进度加载覆盖层
   ============================================ */
.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.progress-modal {
  background: white;
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  width: 280px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.progress-spinner {
  width: 44px;
  height: 44px;
  border: 3.5px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: spin 0.7s linear infinite;
}

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

.progress-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.4;
}

.progress-bar-track {
  height: 5px;
  background: #EDEDED;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #FF8C5A);
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
}

/* ============================================
   色卡调色板 · 横向滚动条
   ============================================ */
.color-palette-bar {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  margin-top: 8px;
  flex-wrap: nowrap;
  /* 隐藏滚动条但可滚动 */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.color-palette-bar::-webkit-scrollbar {
  height: 4px;
}

.color-palette-bar::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.color-swatch-item {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  position: relative;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.color-swatch-item:hover {
  transform: scale(1.15);
  z-index: 2;
  border-color: rgba(0,0,0,0.3);
}

.color-swatch-item.active {
  border-color: #333;
  transform: scale(1.18);
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.color-swatch-item .swatch-label {
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 8px;
  color: var(--text-light);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
}

.color-swatch-item.active .swatch-label,
.color-swatch-item:hover .swatch-label {
  opacity: 1;
}

/* ============================================
   激活码弹窗
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
  padding: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.25);
  animation: modalSlideUp 0.25s ease;
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.modal-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: #f0f0f0;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: all 0.15s;
}

.modal-close:hover {
  background: #e0e0e0;
  color: var(--text);
}

.modal-body {
  padding: 20px;
}

.activate-input {
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
}

.activate-input:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(255,107,53,0.15);
}

/* 价格页激活码卡片 */
.activate-card {
  transition: all 0.2s;
}

.activate-card:hover {
  background: #fff8f0 !important;
  border-color: var(--primary-dark) !important;
}

/* 面包多支付按钮 */
.payment-link-btn {
  display: block;
  text-align: center;
  padding: 12px 0;
  background: #FF6B35;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
}

.payment-link-btn:hover {
  background: #E55A2B;
}
