/* R109 style.css */
:root, [data-theme="trust-blue"] {
  --primary: #4A90D9; --primary-light: #6BA5E7; --accent: #FF6B6B;
  --bg: #F5F7FA; --card: #FFFFFF; --text: #1A1A2E; --text-light: #6B7280;
  --radius: 12px; --shadow: 0 2px 12px rgba(0,0,0,0.08);
  --contact-footer-h: 72px;
  --bottom-nav-h: 68px;
  --em-entry-stack: 52px;
}
[data-theme="coral"] { --primary: #FF6B6B; --primary-light: #FF8E8E; --accent: #FFD93D; --bg: #FFF5F5; }
[data-theme="mint"] { --primary: #10B981; --primary-light: #34D399; --accent: #3B82F6; --bg: #F0FDF4; }
[data-theme="official"] { --primary: #1677FF; --primary-light: #4096FF; --accent: #FA8C16; --bg: #F0F5FF; }
[data-theme="dark"] { --primary: #635BFF; --primary-light: #A78BFA; --accent: #00D4AA; --bg: #0F0F23; --card: #1A1A2E; --text: #E8E8F0; --text-light: #8890A0; }
[data-theme="warm"] { --primary: #6C5CE7; --primary-light: #A29BFE; --accent: #FD7B5C; --bg: #F7F6F3; }

*, *::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', sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  min-height: 100dvh;
}
body.has-contact-footer {
  padding-bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom));
}
.page-section { max-width: 640px; margin: 0 auto; min-height: 100dvh; }
.page-section[hidden] { display: none !important; }

/* Hero */
.hero-content { padding: 48px 20px 32px; text-align: center; animation: fadeInUp 0.5s ease; }
.hero-badge { display: inline-block; background: color-mix(in srgb, var(--primary) 15%, var(--card)); color: var(--primary); padding: 6px 14px; border-radius: 20px; font-size: 14px; margin-bottom: 16px; }
.hero-content h1 { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.hero-sub { color: var(--text-light); font-size: 15px; margin-bottom: 12px; }
.social-proof { font-size: 13px; color: var(--text-light); margin-bottom: 24px; }
.btn-primary {
  background: var(--primary); color: #fff; border: none; border-radius: var(--radius);
  padding: 14px 28px; font-size: 16px; font-weight: 600; cursor: pointer;
  min-height: 48px; transition: transform 0.15s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary.loading { opacity: 0.85; pointer-events: none; }
.btn-primary.success { background: #10B981; }
.btn-hero { width: 100%; max-width: 320px; }
.btn-secondary {
  background: transparent; color: var(--text); border: 2px solid #E5E7EB;
  border-radius: var(--radius); padding: 12px 20px; font-size: 15px; cursor: pointer; min-height: 48px;
}
.btn-block { display: block; width: 100%; margin-bottom: 10px; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; border: 1px solid var(--primary-light); background: var(--card); color: var(--primary); cursor: pointer; }
.hero-links { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 14px; cursor: pointer; min-height: 44px; }

/* Industry grid */
.industry-section { padding: 16px 16px calc(var(--em-entry-stack) + 8px); }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 12px; padding: 0 4px; }
.industry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.industry-card {
  background: var(--card); border: 2px solid #E5E7EB; border-radius: var(--radius);
  padding: 12px 8px; text-align: center; cursor: pointer; transition: all 0.2s; min-height: 72px;
}
.industry-card.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, var(--card)); }
.ind-icon { display: block; font-size: 24px; }
.ind-name { font-size: 11px; font-weight: 600; margin-top: 4px; }

/* Form */
.form-header { padding: 16px 16px 0; display: flex; justify-content: space-between; align-items: center; }
.form-header h2 { font-size: 18px; }
.mode-toggle { background: var(--card); border: 1px solid #E5E7EB; border-radius: 20px; padding: 6px 12px; font-size: 12px; cursor: pointer; }
.progress-wrap { padding: 12px 16px; }
.progress-bar { height: 4px; background: #E5E7EB; border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-light)); transition: width 400ms ease; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-light); margin-top: 6px; }
.form-container { padding: 16px; padding-bottom: 120px; }
.field-group { margin-bottom: 20px; }
.field-label { display: block; font-size: 14px; color: var(--text-light); margin-bottom: 6px; }
.field-required::after { content: ' *'; color: var(--accent); }
.input {
  width: 100%; min-height: 48px; padding: 0 14px; border: 2px solid #E5E7EB;
  border-radius: var(--radius); font-size: 16px; background: var(--card); color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); outline: none; }
.input.error { border-color: #EF4444; }
.textarea { min-height: 96px; padding: 12px 14px; resize: vertical; }
.option-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.option-card {
  padding: 14px 10px; border: 2px solid #E5E7EB; border-radius: var(--radius);
  background: var(--card); cursor: pointer; font-size: 14px; text-align: center; min-height: 48px;
  transition: all 0.2s;
}
.option-card.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--card)); font-weight: 600; }
.cascader-row { display: flex; flex-direction: column; gap: 8px; }
.toggle-wrap { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 48px; }
.toggle-wrap input { display: none; }
.toggle-slider {
  width: 48px; height: 28px; background: #E5E7EB; border-radius: 14px; position: relative; transition: background 0.2s;
}
.toggle-slider::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-wrap input:checked + .toggle-slider { background: var(--primary); }
.toggle-wrap input:checked + .toggle-slider::after { transform: translateX(20px); }
.image-upload .image-preview img { max-width: 100%; border-radius: 8px; margin-top: 8px; max-height: 200px; }
.rating-row { display: flex; gap: 8px; }
.rating-star { background: none; border: none; font-size: 28px; opacity: 0.35; cursor: pointer; min-height: 48px; }
.rating-star.active { opacity: 1; }

.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 640px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--card); box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  display: flex; gap: 10px; z-index: 100;
}
.bottom-nav button { flex: 1; }

/* Success */
.success-content { padding: 40px 20px; text-align: center; }
.success-icon {
  width: 72px; height: 72px; line-height: 72px; border-radius: 50%;
  background: #10B981; color: #fff; font-size: 36px; margin: 0 auto 16px;
}
.summary-card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 20px 0; text-align: left; box-shadow: var(--shadow); }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #E5E7EB; font-size: 14px; }
.summary-row:last-child { border-bottom: none; }
.hint { color: var(--text-light); font-size: 13px; }

/* Config overlay */
#config-panel {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
#config-panel[hidden] { display: none !important; }
.config-sheet {
  background: var(--card); width: 100%; max-width: 640px; border-radius: 16px 16px 0 0;
  padding: 20px; max-height: 80dvh; overflow-y: auto;
}
.config-sheet header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.close-btn { background: none; border: none; font-size: 28px; cursor: pointer; min-width: 44px; min-height: 44px; }
.theme-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.theme-chip { border: 2px solid transparent; color: #fff; padding: 8px 12px; border-radius: 20px; font-size: 12px; cursor: pointer; min-height: 36px; }
.theme-chip.active { border-color: var(--text); }

/* Toast & FAB */
.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(30,41,59,0.92); color: #fff; padding: 10px 20px; border-radius: 24px;
  font-size: 14px; opacity: 0; pointer-events: none; z-index: 300; transition: all 0.25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); animation: toastIn 0.25s ease; }
.fab-top {
  position: fixed; left: 16px; right: auto;
  bottom: calc(var(--contact-footer-h) + var(--em-entry-stack) + 14px + env(safe-area-inset-bottom));
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--card); border: 1px solid #E5E7EB; box-shadow: var(--shadow);
  cursor: pointer; z-index: 105; font-size: 18px;
}

.contact-footer {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 640px; margin: 0 auto;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: var(--card);
  border-top: 1px solid #E5E7EB; z-index: 90;
  text-align: center; font-size: 11px; color: var(--text-light);
}
.has-contact-footer .bottom-nav {
  bottom: calc(var(--contact-footer-h) + env(safe-area-inset-bottom));
}
.contact-footer__btns { display: flex; gap: 8px; justify-content: center; margin-bottom: 4px; }
.contact-footer__cta, .contact-footer__btn {
  padding: 6px 12px; border-radius: 16px; font-size: 12px; text-decoration: none;
}
.contact-footer__cta { background: var(--primary); color: #fff; }
.contact-footer__btn { border: 1px solid #E5E7EB; background: var(--card); color: var(--text); cursor: pointer; }

/* 试玩模式 · 避开底栏与返回顶部 FAB */
body.has-contact-footer:not(.editor-mode-active) .em-entry-btn {
  bottom: calc(var(--contact-footer-h) + 10px + env(safe-area-inset-bottom));
  z-index: 110;
  max-width: min(calc(100vw - 88px), 340px);
  white-space: normal;
  line-height: 1.25;
  text-align: center;
  font-size: 0.8125rem;
  padding: 0.45rem 0.85rem;
}
body.has-contact-footer:has(#form-section:not([hidden])):not(.editor-mode-active) .em-entry-btn {
  bottom: calc(var(--contact-footer-h) + var(--bottom-nav-h) + 10px + env(safe-area-inset-bottom));
}
body.has-contact-footer:has(#form-section:not([hidden])) .fab-top {
  bottom: calc(var(--contact-footer-h) + var(--bottom-nav-h) + var(--em-entry-stack) + 14px + env(safe-area-inset-bottom));
}
body.has-contact-footer .chat-widget-fab,
body.has-contact-footer .zw-root .zw-fab {
  bottom: calc(var(--contact-footer-h) + 10px + env(safe-area-inset-bottom));
  right: 16px;
  z-index: 130;
}
body.modal-open .em-entry-btn,
body.modal-open .fab-top,
body:has(#config-panel:not([hidden])) .em-entry-btn {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 480px) {
  .industry-grid { grid-template-columns: repeat(2, 1fr); }
  .option-grid { grid-template-columns: 1fr; }
  body.has-contact-footer:not(.editor-mode-active) .em-entry-btn {
    max-width: calc(100vw - 72px);
    font-size: 0.75rem;
  }
}

@media (min-width: 768px) {
  .industry-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ===== P2 模块样式 ===== */
.aigen-field-list { margin: 10px 0; padding-left: 18px; font-size: 14px; }
.aigen-field-list small { color: var(--text-light); }
.collab-code-row { display: flex; gap: 8px; margin: 8px 0; }
.collab-code-row .input { flex: 1; }
.collab-import-label { display: block; text-align: center; cursor: pointer; margin-bottom: 10px; }
.wh-platforms { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.wh-platform { font-size: 14px; display: flex; align-items: center; gap: 8px; min-height: 36px; }
.id-ocr-row { display: flex; gap: 8px; align-items: stretch; }
.id-ocr-row .input { flex: 1; }
.id-ocr-ok { color: #10B981; }
.id-ocr-warn { color: #F59E0B; }
.deposit-config { margin: 12px 0; padding-top: 8px; border-top: 1px solid #E5E7EB; }
.deposit-box {
  background: color-mix(in srgb, var(--primary) 6%, var(--card));
  border: 1px solid #E5E7EB; border-radius: var(--radius);
  padding: 16px; margin: 16px 0; text-align: center;
}
.deposit-box--paid { background: #ECFDF5; border-color: #10B981; }
.deposit-amount { font-size: 28px; margin: 8px 0; color: var(--primary); }
.deposit-btns { display: flex; gap: 10px; margin-top: 12px; }
.deposit-btns button { flex: 1; }
.share-landing .share-main { max-width: 640px; margin: 0 auto; padding: 32px 20px 100px; }
.share-hero { text-align: center; animation: fadeInUp 0.5s ease; }
.share-badge {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--card));
  padding: 4px 12px; border-radius: 20px; margin-bottom: 12px;
}
.share-qr-wrap { margin: 16px auto 20px; }
.share-qr {
  display: inline-block; padding: 12px; background: var(--card);
  border-radius: var(--radius); border: 1px solid #E5E7EB; box-shadow: var(--shadow);
}
.share-qr-canvas { display: block; width: 200px; height: 200px; }
.share-icon { font-size: 48px; margin-bottom: 12px; }
.share-sub { color: var(--text-light); margin-bottom: 16px; }
.share-fields { list-style: none; text-align: left; background: var(--card); border-radius: var(--radius);
  padding: 12px 16px; margin: 16px 0; border: 1px solid #E5E7EB; font-size: 14px; }
.share-fields li { padding: 6px 0; border-bottom: 1px solid #E5E7EB; }
.share-fields li:last-child { border-bottom: none; }
.share-cta { margin-top: 16px; text-decoration: none; display: block; }
.share-url { word-break: break-all; margin-top: 12px; font-size: 11px; }
