/* 装修案例 3D 实景展厅 */
:root {
  --plaster: #e6e4df;
  --paper: #f7f6f3;
  --graphite: #2e2c29;
  --stone: #6f685e;
  --line: #d3cfc7;
  --brass: #9c7442;
  --brass-ink: #7d5a2f;
  --moss: #4e5b37;
  --on-dark: #f3f1ec;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "Noto Serif CJK SC", "STSong", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --gutter: 16px;
  --max: 1120px;
  --radius-lg: 14px;
  --radius-sm: 8px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--plaster);
  color: var(--graphite);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 演示横幅 */
.demo-banner {
  background: var(--moss);
  color: var(--on-dark);
  font-size: 13px;
  line-height: 1.5;
  padding: 8px var(--gutter);
  text-align: center;
}
.demo-banner button {
  background: none; border: 0; padding: 0; color: inherit;
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}

/* 顶栏 */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { font: 700 19px/1 var(--serif); letter-spacing: .04em; text-decoration: none; }
.topbar .ghost { font-size: 14px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 0;
  background: var(--brass); color: #fff; font-weight: 600; font-size: 16px;
  text-decoration: none; cursor: pointer; transition: background .15s;
}
.btn:hover { background: var(--brass-ink); }
.btn.light { background: var(--paper); color: var(--graphite); }
.btn.light:hover { background: #fff; }
.btn.line { background: transparent; color: var(--graphite); box-shadow: inset 0 0 0 1.5px var(--graphite); }
.ghost {
  background: none; border: 0; padding: 6px 0; cursor: pointer;
  color: var(--graphite); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line);
}

/* 首页主视觉：完工照片本身就是入口 */
.hero {
  position: relative; margin: 0 auto; max-width: var(--max);
  border-radius: 0; overflow: hidden; background: var(--graphite);
  min-height: 72svh; display: flex; align-items: flex-end;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(28,26,23,.88) 0%, rgba(28,26,23,.6) 40%, rgba(28,26,23,.15) 70%, rgba(28,26,23,0) 85%);
}
.hero-copy { position: relative; z-index: 1; padding: 28px var(--gutter) 32px; color: var(--on-dark); max-width: 640px; }
.hero h1 { font: 700 clamp(30px, 8vw, 56px)/1.18 var(--serif); margin: 0 0 12px; letter-spacing: .02em; }
.hero p { margin: 0 0 22px; font-size: 15px; color: #e4e0d8; max-width: 30em; }
.hero .meta { font-size: 13px; color: #cfc9be; margin-top: 14px; }
@media (min-width: 760px) {
  .hero { border-radius: var(--radius-lg); margin-top: 8px; min-height: 560px; }
  .hero-copy { padding: 44px 48px; }
}

/* 区块 */
.section { padding: 44px 0 8px; }
.section h2 { font: 700 24px/1.3 var(--serif); margin: 0 0 6px; }
.section .lead { margin: 0 0 20px; color: var(--stone); font-size: 15px; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1.5px solid var(--line); background: transparent; border-radius: 999px;
  padding: 6px 14px; font-size: 14px; cursor: pointer; color: var(--graphite);
}
.chip[aria-pressed="true"] { background: var(--graphite); border-color: var(--graphite); color: var(--on-dark); }

/* 案例列表 */
.cases { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .cases { grid-template-columns: 1fr 1fr; gap: 28px; } }
.case-card { text-decoration: none; display: block; }
.case-card .shot { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--line); }
.case-card .shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.case-card:hover .shot img { transform: scale(1.03); }
.badge-3d {
  position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 6px;
  background: rgba(247,246,243,.92); color: var(--moss); font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
}
.badge-3d svg { width: 14px; height: 14px; }
.badge-demo { left: auto; right: 12px; color: var(--stone); font-weight: 600; }
.case-card h3 { font: 700 19px/1.35 var(--serif); margin: 14px 0 4px; }
.case-card .facts { font-size: 14px; color: var(--stone); display: flex; flex-wrap: wrap; gap: 4px 14px; }

/* 演示站：给装修公司看的上新说明位 */
.slot {
  border: 1.5px dashed #b9b3a8; border-radius: var(--radius-lg); padding: 24px;
  display: flex; flex-direction: column; justify-content: center; gap: 10px; min-height: 240px;
}
.slot h3 { font: 700 19px/1.35 var(--serif); margin: 0; }
.slot p { margin: 0; color: var(--stone); font-size: 14px; }
.slot ol { margin: 4px 0 0; padding-left: 1.3em; font-size: 14px; color: var(--graphite); }

/* 怎么看 */
.howto { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 0; padding: 0; list-style: none; }
@media (min-width: 760px) { .howto { grid-template-columns: repeat(3, 1fr); } }
.howto li { background: var(--paper); border-radius: var(--radius-sm); padding: 16px 18px; font-size: 14px; color: var(--stone); }
.howto strong { display: block; color: var(--graphite); font-size: 16px; margin-bottom: 2px; }

/* 预约表单 */
.booking { background: var(--graphite); color: var(--on-dark); border-radius: var(--radius-lg); padding: 28px 20px; margin: 44px 0 0; }
@media (min-width: 760px) { .booking { padding: 40px 48px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; } }
.booking h2 { font: 700 24px/1.3 var(--serif); margin: 0 0 8px; }
.booking p { color: #cfc9be; font-size: 15px; margin: 0 0 18px; }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: #ddd8cf; }
.form input, .form textarea {
  width: 100%; border: 1.5px solid #57534c; background: #383531; color: var(--on-dark);
  border-radius: var(--radius-sm); padding: 11px 12px; font-size: 16px;
}
.form input::placeholder, .form textarea::placeholder { color: #8f887d; }
.form textarea { min-height: 76px; resize: vertical; }
.form .row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.form .hp { position: absolute; left: -9999px; }
.form .consent { font-size: 12px; color: #a8a196; margin: 0; }
.form .err { color: #f0b08a; font-size: 14px; min-height: 1em; margin: 0; }
.booking .done { display: none; }
.booking.sent .form { display: none; }
.booking.sent .done { display: block; }
.contact-alt { font-size: 14px; color: #cfc9be; margin-top: 4px; }
.contact-alt button { background: none; border: 0; color: #fff; text-decoration: underline; text-underline-offset: 3px; padding: 0; cursor: pointer; }

footer { padding: 36px 0 calc(110px + var(--safe-bottom)); font-size: 13px; color: var(--stone); }
footer a { color: var(--stone); }
footer p { margin: 0 0 6px; }

/* 详情页：3D 舞台 */
.stage-wrap { position: relative; background: #262421; }
.stage { position: relative; height: 72svh; min-height: 420px; max-height: 820px; }
@media (min-width: 760px) { .stage { height: 78svh; } }
.stage .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .6s; }
.stage.ready .poster { opacity: 0; pointer-events: none; }
.stage .viewer { position: absolute; inset: 0; }
.stage-top {
  position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; pointer-events: none;
}
.stage-top > * { pointer-events: auto; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
  background: rgba(30,28,25,.62); color: var(--on-dark); font-size: 14px; text-decoration: none; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.pill svg { width: 16px; height: 16px; }
.pill { flex: none; white-space: nowrap; }
.tools { display: flex; gap: 8px; }
.loading {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: rgba(30,28,25,.7); color: var(--on-dark); padding: 14px 18px; border-radius: var(--radius-sm);
  font-size: 14px; text-align: center; min-width: 200px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.bar { height: 3px; background: rgba(255,255,255,.18); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: #d9b47c; transition: width .2s; }
.stage.ready .loading { display: none; }
.hint {
  position: absolute; z-index: 2; left: 50%; bottom: 78px; transform: translateX(-50%);
  background: rgba(30,28,25,.62); color: var(--on-dark); font-size: 13px; padding: 6px 14px; border-radius: 999px;
  white-space: nowrap; opacity: 0; transition: opacity .4s; pointer-events: none;
}
.stage.ready .hint.show { opacity: 1; }
.views {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; overflow-x: auto;
  padding: 12px; scrollbar-width: none; background: linear-gradient(to top, rgba(28,26,23,.55), rgba(28,26,23,0));
}
.views::-webkit-scrollbar { display: none; }
.views .pill[aria-pressed="true"] { background: var(--paper); color: var(--graphite); }
.fallback {
  position: absolute; z-index: 4; inset: auto 12px 12px 12px; background: rgba(247,246,243,.96); color: var(--graphite);
  border-radius: var(--radius-sm); padding: 14px 16px; font-size: 14px; display: none;
}
.stage.failed .fallback { display: block; }
.stage.failed .loading, .stage.failed .views, .stage.failed .hint { display: none; }

/* 详情信息 */
.detail { padding-top: 24px; }
.detail h1 { font: 700 clamp(26px, 6vw, 38px)/1.25 var(--serif); margin: 0 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.tags li { font-size: 13px; color: var(--moss); background: rgba(78,91,55,.1); padding: 3px 10px; border-radius: 999px; }
.spec { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border-radius: var(--radius-sm); overflow: hidden; margin: 0 0 22px; }
@media (min-width: 760px) { .spec { grid-template-columns: repeat(4, 1fr); } }
.spec div { background: var(--paper); padding: 12px 14px; }
.spec dt { font-size: 12px; color: var(--stone); }
.spec dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.detail .summary { max-width: 38em; font-size: 16px; }
.credit { font-size: 13px; color: var(--stone); border-left: 3px solid var(--line); padding-left: 12px; margin: 20px 0 0; }

/* 前后对比 */
.compare { position: relative; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4 / 3; background: var(--line); user-select: none; touch-action: pan-y; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .handle { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; background: #fff; transform: translateX(-1px); }
.compare .handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%); box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.compare .lbl { position: absolute; top: 10px; font-size: 12px; background: rgba(30,28,25,.6); color: #fff; padding: 2px 8px; border-radius: 999px; }
.compare .lbl.l { left: 10px; } .compare .lbl.r { right: 10px; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

/* 底部常驻操作栏 */
.dock {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  padding: 10px var(--gutter) calc(10px + var(--safe-bottom));
  background: rgba(247,246,243,.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: center;
}
.dock .btn { flex: 1; max-width: 280px; }

/* 弹层 */
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(20,19,17,.5); display: none; }
.sheet {
  position: fixed; z-index: 31; left: 0; right: 0; bottom: 0; max-height: 92svh; overflow: auto;
  background: var(--graphite); color: var(--on-dark); border-radius: 18px 18px 0 0;
  padding: 22px 20px calc(22px + var(--safe-bottom)); transform: translateY(105%); transition: transform .28s ease;
}
@media (min-width: 760px) { .sheet { left: 50%; right: auto; width: 480px; bottom: 50%; border-radius: 18px; transform: translate(-50%, 60%); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; } }
body.sheet-open .sheet-bg { display: block; }
body.sheet-open .sheet { transform: translateY(0); }
@media (min-width: 760px) { body.sheet-open .sheet { transform: translate(-50%, 50%); opacity: 1; pointer-events: auto; } }
.sheet h2 { font: 700 22px/1.3 var(--serif); margin: 0 0 6px; }
.sheet p { color: #cfc9be; font-size: 14px; margin: 0 0 16px; }
.sheet .close { position: absolute; right: 14px; top: 12px; background: none; border: 0; color: #cfc9be; font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.sheet .done { display: none; }
.sheet.sent .form { display: none; }
.sheet.sent .done { display: block; }
.wx-card { background: #383531; border-radius: var(--radius-sm); padding: 16px; text-align: center; }
.wx-card img { width: 180px; height: 180px; margin: 0 auto 10px; border-radius: 6px; background: #fff; }
.wx-id { font-size: 22px; font-weight: 700; letter-spacing: .03em; margin: 4px 0 12px; }

.toast {
  position: fixed; z-index: 40; left: 50%; bottom: calc(96px + var(--safe-bottom)); transform: translateX(-50%);
  background: var(--graphite); color: var(--on-dark); padding: 10px 16px; border-radius: 999px; font-size: 14px;
  opacity: 0; transition: opacity .25s; pointer-events: none;
}
.toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* 铺满窗口的全屏（兼容微信与 iOS） */
body.stage-full { overflow: hidden; }
body.stage-full .stage-wrap { position: fixed; inset: 0; z-index: 25; }
body.stage-full .stage { height: 100svh; max-height: none; }
body.stage-full .dock { display: none; }
