/* css/style.css — AI拼豆图纸生成 H5版 v2 */

:root {
  --primary: #FF6B8A;
  --primary-light: #FF8FA8;
  --primary-dark: #E85578;
  --primary-bg: #FFF0F3;
  --secondary: #7EC8E3;
  --accent: #FFD166;
  --accent-dark: #E8B84D;
  --success: #6BCB77;
  --bg: #FAFAFA;
  --card: #FFFFFF;
  --card-shadow: 0 2px 16px rgba(255,107,138,0.08);
  --text: #2D2D2D;
  --text-2: #666666;
  --text-3: #999999;
  --border: #F0E8E8;
  --border-focus: #FF6B8A;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* === App Layout === */
#app {
  padding: 12px 16px 80px 16px;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
}
.page { display: none; animation: fadeIn 0.3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* === Card === */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
  margin-bottom: 14px;
  border: 1px solid rgba(255,107,138,0.06);
}

/* === Header Bar === */
.header-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0 16px;
}
.header-bar h1 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* === Mode Switch === */
.mode-switch {
  display: flex;
  background: var(--card);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 14px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255,107,138,0.06);
}
.mode-tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: var(--transition);
}
.mode-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFF;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255,107,138,0.25);
}

/* === Upload Area === */
.upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  background: var(--primary-bg);
}
.upload-area:active {
  border-color: var(--primary);
  background: #FFE8EE;
}
.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFF;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(255,107,138,0.25);
}
.upload-text { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.upload-hint { font-size: 12px; color: var(--text-3); }

.preview-area {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
  background: var(--primary-bg);
  border-radius: var(--radius);
}
.preview-area img {
  max-width: 100%;
  max-height: 280px;
  border-radius: var(--radius-sm);
  object-fit: contain;
}
.remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 16px;
  cursor: pointer;
  border: none;
  line-height: 1;
}

/* === Text Input === */
.text-input {
  width: 100%;
  min-height: 110px;
  font-size: 15px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  color: var(--text);
  font-family: inherit;
  transition: var(--transition);
  background: var(--primary-bg);
}
.text-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,107,138,0.1);
}
.text-input::placeholder { color: var(--text-3); }
.text-count {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
}

/* === Board Size === */
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

/* === Custom Select / Dropdown === */
.custom-select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1.5px solid #E5E5E5;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: #FAFAFA;
  appearance: none;
  -webkit-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='%23999' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: var(--transition);
}
.custom-select:focus {
  border-color: var(--primary);
  outline: none;
  background-color: #FFF;
  box-shadow: 0 0 0 3px rgba(255,107,138,0.1);
}
.select-hint {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.4;
}

/* === Ratio Keep (Checkbox + 文字) === */
.ratio-keep-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}
.ratio-keep-label input[type="checkbox"] { display: none; }
.ratio-keep-checkmark {
  width: 18px;
  height: 18px;
  border: 2px solid #D1D5DB;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.ratio-keep-checkmark::after {
  content: '';
  width: 10px;
  height: 6px;
  border-left: 2px solid #FFF;
  border-bottom: 2px solid #FFF;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.ratio-keep-label input:checked + .ratio-keep-checkmark {
  background: var(--primary);
  border-color: var(--primary);
}
.ratio-keep-label input:checked + .ratio-keep-checkmark::after {
  opacity: 1;
}
.ratio-keep-text {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}

/* === AI Preview Section === */
.ai-preview-section {
  margin-top: 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
  border: 1px solid rgba(255,107,138,0.06);
  animation: fadeIn 0.4s ease;
}
.ai-preview-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ai-preview-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.ai-preview-step {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-bg);
  padding: 2px 10px;
  border-radius: 10px;
}
.ai-preview-images {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.ai-preview-card {
  flex: 1;
  background: #F8F8F8;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ai-preview-card:only-child { max-width: 100%; }
.ai-card-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding: 8px 10px 4px;
  text-align: center;
}
.ai-card-img-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 4px 8px 8px;
  min-height: 120px;
}
.ai-card-img-wrap img {
  max-width: 100%;
  max-height: 240px;
  border-radius: 6px;
  object-fit: contain;
}
.ai-preview-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.btn-ai-action {
  flex: 1;
  height: 36px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn-ai-regen { background: #F3F4F6; color: #525252; }
.btn-ai-regen:active { background: #E5E7EB; }
.btn-ai-save {
  background: var(--primary-bg);
  color: var(--primary);
  border: 1px solid rgba(255,107,138,0.2);
}
.btn-ai-save:active { background: #FFE0E8; }
.btn-confirm-bead {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFF;
  border: none;
  border-radius: 22px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255,107,138,0.25);
  transition: all 0.2s ease;
}
.btn-confirm-bead:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(255,107,138,0.2);
}
.btn-confirm-bead:disabled { opacity: 0.5; cursor: not-allowed; }

/* === Smart Recommendation Bar === */
.ai-recommend-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ECFDF5, #F0F9FF);
  border: 1px solid #D1FAE5;
  border-radius: var(--radius-sm);
  animation: fadeIn 0.4s ease;
}
.recommend-icon {
  font-size: 16px;
  flex-shrink: 0;
}
.recommend-text {
  font-size: 13px;
  color: #065F46;
  font-weight: 500;
  line-height: 1.4;
}

/* === AI Params Card (紧凑参数卡片) === */
.ai-params-card {
  margin: 12px 0;
  padding: 12px;
  background: #F8F9FA;
  border-radius: var(--radius-sm);
}
.ai-param-row {
  margin-bottom: 10px;
}
.ai-param-row:last-child {
  margin-bottom: 0;
}
.ai-param-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

/* === Size Presets (4选1卡片, 2x2排列) === */
.size-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.size-preset-card {
  width: calc(50% - 4px);
  padding: 8px 4px;
  background: #FFF;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.size-preset-card.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 2px 8px rgba(255,107,138,0.15);
}
.size-preset-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.size-preset-card.active .size-preset-name {
  color: var(--primary);
}
.size-preset-size {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}
.size-preset-card.active .size-preset-size {
  color: var(--primary-dark);
}
.ai-preview-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 8px;
}

/* === Result Step Badge === */
.result-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}
.result-step {
  font-size: 12px;
  font-weight: 600;
  color: #6BCB77;
  background: #ECFDF5;
  padding: 2px 10px;
  border-radius: 10px;
}
.size-options { display: flex; gap: 8px; }
.size-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 4px;
  background: var(--card);
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.size-option.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  box-shadow: 0 2px 8px rgba(255,107,138,0.15);
}
.size-name { font-size: 13px; font-weight: 600; color: var(--text); }
.size-option.active .size-name { color: var(--primary); }
.size-desc { font-size: 10px; color: var(--text-3); margin-top: 2px; }

/* === Generate Button === */
.generate-section { margin-top: 16px; }
.btn-generate {
  width: 100%;
  height: 50px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFF;
  border: none;
  border-radius: 25px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,107,138,0.3);
  transition: var(--transition);
  letter-spacing: 0.5px;
}
.btn-generate:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-generate:active:not(:disabled) { transform: scale(0.98); box-shadow: 0 2px 8px rgba(255,107,138,0.2); }

.usage-info {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 10px;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
}
.usage-text { font-weight: 500; }
.usage-ad {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  padding: 2px 12px;
  border: 1.5px solid var(--primary);
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.usage-ad:active {
  background: var(--primary);
  color: #FFF;
}

/* === Result === */
.result-section { margin-top: 16px; animation: fadeIn 0.4s ease; }

.pattern-viewer {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #F8F8F8;
  border: 1px solid var(--border);
}
.pattern-viewer canvas { display: block; width: 100%; }

/* === Color Legend === */
.color-legend {
  margin-top: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--card-shadow);
}
.legend-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.legend-title { font-size: 14px; font-weight: 700; }
.legend-total { font-size: 12px; color: var(--text-2); flex: 1; }
.legend-toggle { font-size: 12px; color: var(--primary); font-weight: 600; }
.legend-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  max-height: 90px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.legend-list.expanded { max-height: none; }
.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: var(--primary-bg);
  border-radius: 6px;
  font-size: 11px;
}
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #E8E0E0;
}
.legend-code { color: var(--primary); font-weight: 700; }
.legend-name { color: var(--text); }
.legend-count { color: var(--text-3); }

/* === Action Bar === */
.action-bar {
  margin-top: 12px;
  margin-bottom: 80px;
  padding: 12px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.label-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
}
.label-toggle input[type="checkbox"] {
  width: 44px;
  height: 24px;
  accent-color: var(--primary);
}
.action-buttons { display: flex; gap: 8px; }
.btn-sm {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}
.btn-primary-sm {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFF;
  box-shadow: 0 2px 8px rgba(255,107,138,0.2);
}
.btn-secondary-sm {
  background: var(--primary-bg);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

/* === Tab Bar === */
#tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 58px;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid rgba(0,0,0,0.05);
  z-index: 100;
}
.tab-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 3px;
  opacity: 0.35;
  cursor: pointer;
  transition: var(--transition);
  background: none;
  border: none;
  font-family: inherit;
  padding: 6px 0;
}
.tab-item.active { opacity: 1; }
.tab-item .tab-icon { width: 24px; height: 24px; }
.tab-item .tab-text { font-size: 10px; color: var(--text-3); font-weight: 500; }
.tab-item.active .tab-text { color: var(--primary); font-weight: 600; }

/* Tab icons */
.icon-wand { position: relative; width: 20px; height: 20px; }
.wand-stick {
  position: absolute;
  bottom: 0; left: 2px;
  width: 2px; height: 16px;
  background: var(--text-3);
  border-radius: 1px;
  transform: rotate(-45deg);
  transform-origin: bottom left;
}
.tab-item.active .wand-stick { background: var(--primary); }
.wand-star {
  position: absolute;
  top: 1px; right: 0;
  width: 10px; height: 10px;
  background: var(--text-3);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.tab-item.active .wand-star { background: var(--accent); }

.icon-grid { display: flex; flex-wrap: wrap; width: 18px; height: 18px; gap: 2px; }
.grid-cell { width: 7px; height: 7px; border-radius: 2px; background: var(--text-3); }
.tab-item.active .grid-cell:nth-child(1) { background: var(--primary); }
.tab-item.active .grid-cell:nth-child(2) { background: var(--secondary); }
.tab-item.active .grid-cell:nth-child(3) { background: var(--accent); }
.tab-item.active .grid-cell:nth-child(4) { background: var(--success); }

.icon-mine { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mine-head { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text-3); }
.tab-item.active .mine-head { border-color: var(--primary); }
.mine-body { width: 16px; height: 8px; border: 2px solid var(--text-3); border-bottom: none; border-radius: 8px 8px 0 0; }
.tab-item.active .mine-body { border-color: var(--primary); }

/* === Gallery === */
.gallery-header { margin-bottom: 12px; padding: 8px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gallery-notice {
  width: 100%;
  background: #FFF3E0;
  color: #E65100;
  font-size: 12px;
  padding: 8px 12px;
  border-radius: var(--radius);
  margin-bottom: 4px;
  text-align: center;
  border: 1px solid #FFE0B2;
}
.gallery-count { font-size: 14px; color: var(--text-2); font-weight: 500; }
.btn-clear-history {
  font-size: 12px;
  color: var(--text-3);
  background: none;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 10px;
  cursor: pointer;
}
.btn-clear-history:active { background: var(--primary-bg); }
.gallery-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery-item {
  width: calc(50% - 5px);
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: var(--transition);
}
.gallery-item:active { transform: scale(0.97); }
.item-preview {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg);
}
.item-thumb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.mini-grid { display: grid; grid-template-columns: repeat(8, 12px); gap: 1px; padding: 10px; }
.mini-cell { width: 12px; height: 12px; border-radius: 2px; }
.item-info {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
}
.item-size { font-size: 13px; font-weight: 600; color: var(--text); }
.item-date { font-size: 11px; color: var(--text-3); }
.expire-time { font-size: 10px; color: var(--text-3); width: 100%; }
.expire-warn { font-size: 10px; color: #E65100; width: 100%; font-weight: 500; }

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-text { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-hint { font-size: 13px; color: var(--text-3); margin-bottom: 24px; }

/* === Mine Page === */
.usage-card .app-name { font-size: 18px; font-weight: 800; }
.usage-card .badge {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 600;
}
.badge-free { background: var(--primary-bg); color: var(--primary); }
.badge-vip { background: linear-gradient(135deg, var(--accent), var(--accent-dark)); color: #7A5A00; }
.usage-stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-top: 16px;
}
.stat-item { text-align: center; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.stat-divider { width: 1px; height: 32px; background: var(--border); }

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #F5F0ED;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.settings-item:last-child { border-bottom: none; }
.settings-item:active { background: var(--primary-bg); }
.settings-arrow { color: var(--text-3); font-size: 16px; }
.settings-ver { color: var(--text-3); font-size: 13px; }

/* === Modal / Overlay === */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
.modal-content {
  width: 100%;
  max-width: 360px;
  background: #FFF;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0,0,0,0.15);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-title { font-size: 18px; font-weight: 800; }
.modal-close {
  font-size: 22px;
  color: var(--text-3);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  line-height: 1;
}

/* === Activation Modal === */
.activation-input {
  width: 100%;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  text-align: center;
  letter-spacing: 1px;
  margin-bottom: 12px;
  transition: var(--transition);
  font-weight: 600;
  font-family: 'Courier New', Courier, monospace;
}
.activation-input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(255,107,138,0.1);
}
.activation-input::placeholder {
  font-weight: 400;
  letter-spacing: 0;
  font-size: 14px;
}
.btn-activate {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #FFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255,107,138,0.25);
  transition: var(--transition);
}
.btn-activate:active { transform: scale(0.98); }

/* === Pricing Section === */
.pricing-section { margin-top: 16px; }
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pricing-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--card);
}
.pricing-card.popular {
  border-color: var(--primary);
  background: var(--primary-bg);
  position: relative;
}
.pricing-card.popular::after {
  content: '推荐';
  position: absolute;
  top: -1px;
  right: 8px;
  font-size: 10px;
  padding: 1px 6px;
  background: var(--primary);
  color: #FFF;
  border-radius: 0 0 4px 4px;
  font-weight: 600;
}
.pricing-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.pricing-price-row { display: flex; align-items: baseline; gap: 6px; justify-content: center; }
.pricing-original { font-size: 13px; color: var(--text-3); text-decoration: line-through; }
.pricing-price { font-size: 20px; font-weight: 800; color: var(--primary); }
.pricing-price small { font-size: 12px; font-weight: 400; }
.pricing-unit { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.pricing-contact {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-2);
  padding: 10px;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
}

/* === Toast === */
#global-toast {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0,0,0,0.78);
  backdrop-filter: blur(8px);
  color: #FFF;
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  z-index: 999;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  max-width: 80%;
  text-align: center;
}
#global-toast.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* === Loading === */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 12px;
}
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-text { font-size: 13px; color: var(--text-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* === Responsive === */
@media (min-width: 500px) {
  #app { padding: 24px; }
}
