/**
 * R08 本地商家批量视频封面站
 */
:root {
  --c-primary: #FF6B35;
  --c-accent: #FFB347;
  --c-bg: #FFF8F5;
  --c-surface: #FFFFFF;
  --c-text: #2D1B14;
  --c-muted: #8B7355;
  --c-gradient: linear-gradient(135deg, #FF6B35, #FFB347);
  --c-shadow: 0 4px 20px rgba(255,107,53,0.15);
  --nav-h: 64px;
  --max-w: 1200px;
  --editor-left: 220px;
  --editor-right: 300px;
  --radius: 12px;
  --font: 'PingFang SC', 'Microsoft YaHei', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--c-primary); text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { max-width: 100%; display: block; }

/* Nav */
.nav-bar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--nav-h); padding: 0 20px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.nav-logo { font-weight: 700; font-size: 1.1rem; }
.nav-subtitle { font-size: 0.8rem; color: var(--c-muted); margin-left: 8px; }
.nav-right { display: flex; gap: 10px; align-items: center; }
.btn-nav {
  border: 1px solid rgba(0,0,0,0.1); background: transparent;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
}
.btn-nav.btn-primary, .btn--primary {
  background: var(--c-gradient); color: #fff; border: none;
}
.theme-switcher {
  border: 1px solid rgba(0,0,0,0.1); background: var(--c-surface);
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.btn--primary { background: var(--c-gradient); color: #fff; box-shadow: var(--c-shadow); }
.btn--ghost { background: transparent; border: 1px solid rgba(0,0,0,0.12); color: var(--c-text); }
.btn--sm { padding: 6px 12px; font-size: 0.85rem; }
.btn:hover { transform: translateY(-1px); }

/* Hero */
.section-hero {
  max-width: var(--max-w); margin: 0 auto; padding: 48px 20px 64px;
  opacity: 0; transform: translateY(20px);
  transition: opacity .6s ease, transform .6s ease;
}
.section-hero.is-visible { opacity: 1; transform: none; }
.hero-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 12px; }
.hero-subtitle { color: var(--c-muted); margin-bottom: 28px; }
.industry-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px;
}
.industry-card {
  background: var(--c-surface); border: 2px solid transparent;
  border-radius: var(--radius); padding: 16px 10px; cursor: pointer;
  box-shadow: var(--c-shadow); transition: all .25s;
}
.industry-card--active { border-color: var(--c-primary); transform: scale(1.02); }
.industry-icon { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.hero-input-group { display: flex; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.hero-input {
  flex: 1; min-width: 220px; padding: 14px 16px; border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1); background: var(--c-surface);
}
.btn-ai-generate, .btn-cta-hero {
  padding: 14px 24px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--c-gradient); color: #fff; font-weight: 600;
}
.hero-previews {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px;
}
.hero-preview-card {
  background: var(--c-surface); border-radius: var(--radius); padding: 10px;
  box-shadow: var(--c-shadow); text-align: center;
}
.hero-cover-canvas { border-radius: 8px; background: #eee; }
.platform-tag { font-size: 0.75rem; color: var(--c-muted); margin-top: 6px; display: block; }
.hero-cta-wrap { text-align: center; margin-bottom: 32px; }
.hero-trust-stats, .trust-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; text-align: center;
}
.stat-num, .trust-num { display: block; font-size: 1.4rem; font-weight: 700; color: var(--c-primary); }
.stat-label { font-size: 0.8rem; color: var(--c-muted); }

/* Gallery */
.section-gallery, .section-trust {
  max-width: var(--max-w); margin: 0 auto; padding: 48px 20px;
}
.section-title { font-size: 1.6rem; margin-bottom: 8px; text-align: center; }
.section-desc { text-align: center; color: var(--c-muted); margin-bottom: 28px; }
.gallery-tabs { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.gallery-tab {
  padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(0,0,0,0.1);
  background: var(--c-surface); cursor: pointer;
}
.gallery-tab--active { background: var(--c-primary); color: #fff; border-color: transparent; }
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;
}
.gallery-card {
  background: var(--c-surface); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--c-shadow); padding-bottom: 16px; cursor: pointer;
  transition: transform .25s, box-shadow .25s;
}
.gallery-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(0,0,0,0.12); }
.gallery-card-preview { height: 140px; display: flex; align-items: center; justify-content: center; }
.gallery-card-icon { font-size: 2.5rem; }
.gallery-card h3, .gallery-card p { padding: 0 16px; }
.gallery-card h3 { margin-top: 12px; font-size: 1rem; }
.gallery-card p { font-size: 0.85rem; color: var(--c-muted); margin: 6px 0 12px; }
.gallery-card .btn { margin: 0 16px; width: calc(100% - 32px); }

/* Trust */
.steps-flow { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }
.step-card {
  background: var(--c-surface); border-radius: var(--radius); padding: 20px; text-align: center;
  min-width: 160px; box-shadow: var(--c-shadow);
}
.step-num { font-size: 1.4rem; color: var(--c-primary); font-weight: 700; }
.step-arrow { font-size: 1.4rem; color: var(--c-muted); }
.trust-grid { grid-template-columns: repeat(3, 1fr); margin-bottom: 32px; }
.faq-item {
  background: var(--c-surface); border-radius: var(--radius); margin-bottom: 10px;
  padding: 14px 18px; box-shadow: var(--c-shadow);
}
.faq-item summary { cursor: pointer; font-weight: 600; }
.faq-item p { margin-top: 10px; color: var(--c-muted); font-size: 0.9rem; }

/* Editor */
.section-editor {
  display: none; flex-direction: column; min-height: calc(100vh - var(--nav-h));
  opacity: 0; transform: translateY(20px);
  transition: opacity .4s, transform .4s;
}
.section-editor.is-visible { opacity: 1; transform: none; }
.editor-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--c-surface); border-bottom: 1px solid rgba(0,0,0,0.08);
}
.btn-back { border: none; background: transparent; cursor: pointer; color: var(--c-primary); }
.editor-top-actions { display: flex; gap: 8px; }
.btn-editor-action {
  padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(0,0,0,0.1);
  background: var(--c-surface); cursor: pointer;
}
.editor-main {
  flex: 1; display: grid;
  grid-template-columns: var(--editor-left) 1fr var(--editor-right);
  gap: 0; min-height: 0;
}
.editor-left, .editor-right {
  background: var(--c-surface); border-right: 1px solid rgba(0,0,0,0.06);
  overflow-y: auto; padding: 12px;
}
.editor-right { border-right: none; border-left: 1px solid rgba(0,0,0,0.06); }
.editor-panel { margin-bottom: 16px; }
.panel-header {
  font-weight: 600; font-size: 0.9rem; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.btn-upload-sm {
  font-size: 0.75rem; padding: 4px 8px; border-radius: 6px;
  border: 1px dashed var(--c-primary); background: transparent; color: var(--c-primary); cursor: pointer;
}
.tpl-item {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px; margin-bottom: 6px; border-radius: 8px; border: 2px solid transparent;
  background: var(--c-bg); cursor: pointer; text-align: left;
}
.tpl-item--active { border-color: var(--c-primary); background: rgba(255,107,53,0.08); }
.tpl-swatch { width: 28px; height: 28px; border-radius: 6px; flex-shrink: 0; }
.material-empty { font-size: 0.85rem; color: var(--c-muted); }
.material-thumb {
  position: relative; display: inline-block; margin: 4px; border-radius: 8px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer;
}
.material-thumb--active { border-color: var(--c-primary); }
.material-thumb img { width: 72px; height: 72px; object-fit: cover; }
.material-del {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
  border: none; border-radius: 50%; background: rgba(0,0,0,0.6); color: #fff; cursor: pointer;
}
.editor-center {
  display: flex; flex-direction: column; align-items: center;
  padding: 16px; background: #f0f2f5; overflow: auto;
}
.platform-toggle-group { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; justify-content: center; }
.platform-toggle {
  padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(0,0,0,0.12);
  background: var(--c-surface); cursor: pointer;
}
.platform-toggle--active { background: var(--c-primary); color: #fff; border-color: transparent; }
.canvas-container {
  background: #222; border-radius: var(--radius); padding: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
#cover-canvas { display: block; border-radius: 6px; }
.form-label { display: block; font-size: 0.8rem; color: var(--c-muted); margin: 10px 0 4px; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 10px 12px; border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12); background: var(--c-bg);
}
.editor-bottombar {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 14px; background: var(--c-surface); border-top: 1px solid rgba(0,0,0,0.08);
}
.btn-bulk-generate {
  padding: 12px 28px; border: none; border-radius: 12px; cursor: pointer;
  background: var(--c-gradient); color: #fff; font-weight: 600; font-size: 1rem;
}
.editor-image-count { color: var(--c-muted); font-size: 0.9rem; }

/* Bulk / Result */
.section-bulk, .section-result { max-width: var(--max-w); margin: 0 auto; padding: 32px 20px; }
.bulk-wrap h2, .result-head h2 { margin-bottom: 16px; }
.bulk-grid, .result-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px;
}
.bulk-cell, .result-card {
  background: var(--c-surface); border-radius: var(--radius); padding: 10px;
  text-align: center; box-shadow: var(--c-shadow);
}
.bulk-cell--active { outline: 2px solid var(--c-primary); }
.bulk-cell--done img, .result-card img { width: 100%; border-radius: 8px; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 20px; }
.result-actions { margin-left: auto; display: flex; gap: 8px; }

/* Drawer */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 200;
}
.drawer-panel {
  position: fixed; top: 0; right: 0; width: min(380px, 100vw); height: 100vh;
  background: var(--c-surface); z-index: 201; display: none; flex-direction: column;
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
}
.drawer-head, .drawer-foot {
  padding: 16px; border-bottom: 1px solid rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: space-between;
}
.drawer-foot { border-bottom: none; border-top: 1px solid rgba(0,0,0,0.08); margin-top: auto; gap: 8px; }
.drawer-body { padding: 16px; overflow-y: auto; flex: 1; }
.btn-close { border: none; background: transparent; font-size: 1.4rem; cursor: pointer; }
.brand-logo-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.brand-logo-preview { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; }
.brand-logo-placeholder { font-size: 0.85rem; color: var(--c-muted); }

/* Toast */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: rgba(30,30,30,0.9); color: #fff; padding: 10px 20px;
  border-radius: 999px; z-index: 300; font-size: 0.9rem;
}

/* H5 footer */
.contact-footer {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: rgba(255,255,255,0.96); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.contact-footer__btns { display: flex; gap: 8px; justify-content: center; }
.contact-footer__cta, .contact-footer__btn {
  flex: 1; max-width: 140px; text-align: center; padding: 10px 8px;
  border-radius: 10px; font-size: 0.85rem;
}
.contact-footer__cta { background: var(--c-gradient); color: #fff; }
.contact-footer__btn {
  background: var(--c-surface); border: 1px solid rgba(0,0,0,0.1); color: var(--c-text);
}
.contact-footer__brand { text-align: center; font-size: 0.7rem; color: var(--c-muted); margin-top: 6px; }

/* Responsive */
@media (max-width: 1023px) {
  .editor-main { grid-template-columns: 1fr; }
  .editor-left, .editor-right { border: none; border-bottom: 1px solid rgba(0,0,0,0.06); }
  .industry-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .hero-trust-stats, .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-subtitle { display: none; }
}
