/* ============================================================
   焕家 AI · 装修效果图工作台
   晋江市飞虹智科技企业管理有限公司 / 飞虹智研发中心
   ============================================================ */

:root {
  --bg: #fbf9f6;
  --bg-soft: #f4efe7;
  --card: #ffffff;
  --ink: #2c2a26;
  --muted: #8a847b;
  --line: #ece5da;
  --brand: #e07b39;
  --brand-deep: #c8662a;
  --brand-soft: #fdeede;
  --green: #3e6b58;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(44, 42, 38, .08);
  --shadow-lg: 0 24px 60px rgba(44, 42, 38, .14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
.container { width: min(1120px, 92%); margin: 0 auto; }
[hidden] { display: none !important; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; border-radius: 999px;
  font-size: 15px; font-weight: 600; text-decoration: none;
  padding: 12px 24px; transition: all .2s ease; font-family: inherit;
}
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-lg { padding: 15px 34px; font-size: 16px; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; box-shadow: 0 8px 20px rgba(224, 123, 57, .35); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(224, 123, 57, .45); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 249, 246, .85); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--green));
  color: #fff; font-size: 19px; font-weight: 700;
}
.logo-text { font-weight: 700; font-size: 17px; display: flex; flex-direction: column; line-height: 1.2; }
.logo-text small { font-weight: 400; font-size: 11px; color: var(--muted); }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 500; }
.nav-links a:hover { color: var(--brand-deep); }

/* ---------- Hero ---------- */
.hero { padding: 72px 0 40px; background:
  radial-gradient(1000px 400px at 85% -10%, rgba(224,123,57,.10), transparent 60%),
  radial-gradient(800px 400px at 0% 110%, rgba(62,107,88,.10), transparent 60%),
  var(--bg);
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero-tag {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-deep);
  font-size: 13px; font-weight: 600; margin-bottom: 18px;
}
.hero h1 { font-size: clamp(30px, 4.6vw, 50px); line-height: 1.22; letter-spacing: -1px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--brand), var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { margin-top: 18px; font-size: 16.5px; color: #5f5a52; max-width: 460px; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.hero-points { display: flex; gap: 18px; margin-top: 22px; flex-wrap: wrap; list-style: none; }
.hero-points li { font-size: 13px; color: var(--muted); position: relative; padding-left: 18px; }
.hero-points li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.hero-visual { position: relative; }
.hero-img {
  width: 100%; border-radius: 24px; box-shadow: var(--shadow-lg);
  aspect-ratio: 4/3; object-fit: cover;
}
.hero-chip {
  position: absolute; background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  border-radius: 14px; padding: 10px 16px; font-size: 12.5px; color: var(--muted);
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.hero-chip b { color: var(--ink); margin-right: 4px; }
.hero-chip-1 { left: -18px; bottom: 34px; }
.hero-chip-2 { right: -14px; top: 26px; }

/* ---------- 三步流程 ---------- */
.steps { padding: 46px 0 10px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.step-num {
  font-size: 44px; font-weight: 800; line-height: 1;
  background: linear-gradient(120deg, var(--brand-soft), transparent);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-text-stroke: 1px rgba(224,123,57,.55); margin-bottom: 12px;
}
.step-card h3 { font-size: 17px; margin-bottom: 8px; }
.step-card p { font-size: 13.8px; color: var(--muted); }

/* ---------- 通用 Section 标题 ---------- */
.section-head { text-align: center; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.5px; }
.section-head p { color: var(--muted); margin-top: 8px; font-size: 14.5px; }

/* ---------- 生成器 ---------- */
.generator { padding: 56px 0; }
.gen-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 34px; box-shadow: var(--shadow-lg);
}
.gen-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 34px; }
.gen-label { font-weight: 700; font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.gen-label em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--muted); }
.gen-label .idx {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 7px; font-size: 12px;
  background: var(--brand-soft); color: var(--brand-deep); font-weight: 700;
}

/* 上传区 */
.upload-box {
  border: 2px dashed #d8cfc0; border-radius: var(--radius); background: var(--bg-soft);
  cursor: pointer; transition: all .2s; position: relative; overflow: hidden;
  aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
}
.upload-box:hover, .upload-box.dragover { border-color: var(--brand); background: var(--brand-soft); }
.upload-empty { text-align: center; padding: 20px; }
.upload-icon { color: var(--brand); margin-bottom: 10px; }
.upload-main { font-weight: 600; font-size: 15px; }
.upload-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.upload-preview { position: absolute; inset: 0; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.preview-mask {
  position: absolute; inset: 0; background: rgba(0,0,0,.0);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 14px;
  transition: background .2s;
}
.upload-box:hover .preview-mask { background: rgba(0,0,0,.35); }
.preview-tip { color: #fff; font-size: 13px; opacity: 0; transition: opacity .2s; }
.upload-box:hover .preview-tip { opacity: 1; }
.upload-note { font-size: 12px; color: var(--muted); margin-top: 8px; min-height: 18px; }
.custom-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 14px;
  padding: 12px 14px; font-size: 14px; font-family: inherit; resize: none;
  background: var(--bg-soft); color: var(--ink); outline: none;
}
.custom-input:focus { border-color: var(--brand); }

/* 风格网格 */
.style-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.style-item {
  border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 6px;
  text-align: center; cursor: pointer; transition: all .18s; background: var(--bg-soft);
}
.style-item:hover { border-color: var(--brand); transform: translateY(-2px); }
.style-item.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 6px 16px rgba(224,123,57,.18); }
.style-swatch { height: 34px; border-radius: 9px; margin: 0 auto 8px; width: 82%; }
.style-name { font-size: 13px; font-weight: 600; }
.style-en { font-size: 10px; color: var(--muted); letter-spacing: .4px; }

/* 房型 pills */
.pill-group { display: flex; flex-wrap: wrap; gap: 10px; }
.pill {
  padding: 9px 18px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--bg-soft); cursor: pointer; font-size: 13.5px; font-weight: 500;
  transition: all .18s; font-family: inherit; color: var(--ink);
}
.pill:hover { border-color: var(--brand); }
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 配色卡片 */
.palette-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.palette-item {
  border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden;
  cursor: pointer; transition: all .18s; background: var(--bg-soft);
}
.palette-item:hover { border-color: var(--brand); transform: translateY(-2px); }
.palette-item.active { border-color: var(--brand); box-shadow: 0 6px 16px rgba(224,123,57,.18); }
.palette-strip { display: flex; height: 30px; }
.palette-strip span { flex: 1; }
.palette-name { font-size: 12px; font-weight: 600; text-align: center; padding: 7px 4px; }

/* 生成按钮区 */
.gen-footer { margin-top: 30px; text-align: center; }
.gen-fee { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; }
.btn-generate { min-width: 280px; }
.btn-generate.loading { pointer-events: none; opacity: .8; }

/* loading */
.gen-loading { margin-top: 22px; text-align: center; }
.loading-bar {
  height: 6px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; max-width: 420px; margin: 0 auto;
}
.loading-bar span {
  display: block; height: 100%; width: 40%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--green));
  animation: slide 1.6s ease-in-out infinite;
}
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.loading-text { margin-top: 12px; font-size: 13.5px; color: var(--brand-deep); font-weight: 500; }

/* toast */
.toast {
  margin: 18px auto 0; max-width: 560px; padding: 12px 18px; border-radius: 12px;
  background: #fde8e4; color: #a33d2e; border: 1px solid #f6c8bf;
  font-size: 13.5px; text-align: center;
}

/* ---------- 结果对比 ---------- */
.result { padding: 30px 0 60px; }
.compare-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 26px; box-shadow: var(--shadow-lg);
}
.compare {
  position: relative; border-radius: 18px; overflow: hidden; aspect-ratio: 16/9;
  background: #111; user-select: none; touch-action: none;
}
.compare-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-after-wrap { position: absolute; inset: 0; clip-path: inset(0 0 0 55%); }
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: 55%; width: 3px; background: #fff;
  box-shadow: 0 0 12px rgba(0,0,0,.5); cursor: ew-resize;
}
.compare-knob {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; border-radius: 50%; background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
  box-shadow: var(--shadow-lg); cursor: ew-resize;
}
.compare-tag {
  position: absolute; top: 14px; padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff; background: rgba(0,0,0,.45);
  backdrop-filter: blur(4px);
}
.tag-before { left: 14px; }
.tag-after { right: 14px; background: rgba(224,123,57,.85); }
.compare-range { width: 100%; margin: 18px 0 6px; accent-color: var(--brand); cursor: ew-resize; }
.result-actions { display: flex; gap: 14px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }

/* 历史记录 */
.history { margin-top: 44px; }
.history h3 { font-size: 17px; margin-bottom: 16px; }
.history-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.history-item { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--card); position: relative; }
.history-item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; cursor: pointer; }
.history-meta { padding: 8px 10px; font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; }
.history-meta b { color: var(--ink); }

/* ---------- 画廊 ---------- */
.gallery { padding: 60px 0; background: linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%); }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.g-card {
  border-radius: var(--radius); overflow: hidden; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow); transition: all .2s;
}
.g-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.g-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.g-body { padding: 14px 16px 16px; }
.g-body h4 { font-size: 15.5px; display: flex; align-items: baseline; gap: 8px; }
.g-body h4 small { font-size: 10.5px; color: var(--muted); font-weight: 500; letter-spacing: .5px; }
.g-body p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- FAQ ---------- */
.faq { padding: 60px 0; }
.faq-inner { max-width: 820px; }
.faq-list details {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 20px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.faq-list summary { font-weight: 600; cursor: pointer; font-size: 15px; list-style: none; position: relative; padding-right: 30px; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+"; position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 20px; color: var(--brand); font-weight: 400;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { margin-top: 10px; font-size: 13.8px; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { background: #221f1b; color: #b8b1a6; padding: 40px 0; }
.footer-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.footer-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 17px; }
.footer-sub { font-size: 12px; color: #8a847b; font-weight: 400; }
.footer-sign { text-align: right; font-size: 13px; line-height: 1.9; }
.footer-note { font-size: 11.5px; color: #6f6a62; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .steps-grid { grid-template-columns: 1fr; }
  .gen-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .history-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .footer-sign { text-align: left; }
}
@media (max-width: 520px) {
  .style-grid { grid-template-columns: repeat(2, 1fr); }
  .palette-grid { grid-template-columns: repeat(2, 1fr); }
  .gen-card { padding: 22px 18px; }
  .hero { padding-top: 46px; }
}

/* ========== 小程序引流 ========== */
.mp-cta {
  padding: 56px 0;
  background: linear-gradient(135deg, #fdeede, #fbf3e8);
  border-top: 1px solid #f3ddc8;
}
.mp-cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.mp-cta-text h3 {
  font-size: 22px;
  color: #3d3226;
  margin-bottom: 8px;
}
.mp-cta-text p {
  color: #8a847b;
  font-size: 14px;
  line-height: 1.7;
  max-width: 560px;
}
.mp-cta-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.mp-cta-chip {
  display: inline-block;
  background: #e07b39;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
}
.mp-cta-note {
  font-size: 12px;
  color: #b8b1a6;
}
@media (max-width: 720px) {
  .mp-cta-actions { align-items: flex-start; }
}
