/* AI换新家 V2 全局样式（视觉升级版）
   —— 设计令牌与公共组件，三端视觉唯一真源（网页端）
   注意：Tailwind Play 运行时（assets/js/vendor/tailwind.js）只编译
   <style type="text/tailwindcss">，不处理本外链文件里的 @apply。
   因此本文件中的自定义组件类一律写原生 CSS，禁止使用 @apply。
   工具类（HTML 上的 class="px-4 ..."）仍由 Play 运行时扫描 DOM 生成。 */

/* =========================================================
   设计令牌（暖白 + 深墨灰 + 香槟古铜）
   ========================================================= */
:root {
  --bg: #F7F3EC;          /* 页面暖白 */
  --bg-aux: #E7DED1;      /* 高级米灰 */
  --ink: #303630;         /* 深墨灰 */
  --ink-2: #5A5F55;       /* 次级文字 */
  --ink-3: #8A8C81;       /* 辅助文字 */
  --brand: #AD8663;       /* 香槟古铜 */
  --brand-deep: #8E6A4B;
  --card: #FFFFFF;
  --line: rgba(48, 54, 48, .10);
  --line-strong: rgba(48, 54, 48, .18);
  --brand-tint: rgba(173, 134, 99, .10);
  --brand-line: rgba(173, 134, 99, .42);
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --shadow: 0 18px 50px rgba(58, 48, 36, .08);
  --shadow-soft: 0 10px 30px rgba(58, 48, 36, .06);
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button { -webkit-tap-highlight-color: transparent; }
::selection { background: rgba(173, 134, 99, .22); }
:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(173, 134, 99, .28); }

/* ---------- 排版 ---------- */
.font-display,
.page-title,
.section-title {
  font-family: var(--font-serif);
  font-weight: 500;
  letter-spacing: .02em;
}
.page-title { font-size: 32px; line-height: 1.25; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--brand-deep);
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--brand-line);
}
.eyebrow--plain::before { display: none; }
.micro { font-size: 13px; line-height: 1.7; color: var(--ink-3); }

/* ---------- 按钮 ---------- */
.btn-primary,
.btn-ghost,
.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 500;
  border-radius: 9999px;
  padding: 0.8rem 1.6rem;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background-color .25s cubic-bezier(.22,.61,.36,1),
              border-color .25s cubic-bezier(.22,.61,.36,1),
              color .25s cubic-bezier(.22,.61,.36,1),
              transform .25s cubic-bezier(.22,.61,.36,1),
              box-shadow .25s cubic-bezier(.22,.61,.36,1);
}
.btn-primary {
  background: var(--brand);
  color: #fff;
  border: 1px solid transparent;
  box-shadow: 0 12px 26px rgba(142, 106, 75, .18);
}
.btn-primary:hover {
  background: var(--brand-deep);
  box-shadow: 0 16px 30px rgba(142, 106, 75, .24);
}
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: .4; pointer-events: none; box-shadow: none; }

.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-deep); }
.btn-ghost:active { transform: translateY(1px); }

.btn-dark {
  background: var(--ink);
  color: #fff;
  border: 1px solid transparent;
}
.btn-dark:hover { background: #1F241F; }
.btn-dark:active { transform: translateY(1px); }

/* 文字链箭头：细描边 + 位移，避免粗重箭头 */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-deep);
  font-size: 14px;
  letter-spacing: .01em;
  transition: gap .3s cubic-bezier(.22,.61,.36,1), color .3s cubic-bezier(.22,.61,.36,1);
}
.link-arrow::after {
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><line x1='4' y1='12' x2='19' y2='12'/><polyline points='13 6 19 12 13 18'/></svg>") center / contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><line x1='4' y1='12' x2='19' y2='12'/><polyline points='13 6 19 12 13 18'/></svg>") center / contain no-repeat;
  transition: transform .3s cubic-bezier(.22,.61,.36,1);
}
.link-arrow:hover { color: var(--ink); }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-soft);
}
.card--l { border-radius: var(--radius-l); }

/* ---------- 选项按钮（房间类型 / 风格 / 预算） ---------- */
.chip {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0.5rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid var(--line-strong);
  font-size: 0.875rem;
  line-height: 1.25;
  text-align: center;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.chip-on {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--brand-deep);
  font-weight: 500;
}
.chip-off {
  border-color: var(--line-strong);
  background: #fff;
  color: var(--ink-2);
}
.chip-off:hover { border-color: var(--brand-line); }

/* ---------- 文案与徽标 ---------- */
.section-title {
  font-size: 22px;
  color: var(--ink);
  line-height: 1.45;
}
@media (min-width: 640px) {
  .section-title { font-size: 24px; }
}
.demo-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--brand-deep);
  background: var(--brand-tint);
  border: 1px solid var(--brand-line);
  border-radius: 9999px;
  padding: 2px 9px;
  letter-spacing: .02em;
}
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 9999px;
  font-size: 11.5px;
  line-height: 1.2;
  letter-spacing: .02em;
  white-space: nowrap;
}
.tag--brand { background: var(--brand-tint); color: var(--brand-deep); }
.tag--soft { background: var(--bg-aux); color: var(--ink-2); }
.tag--line { border: 1px solid var(--line); background: rgba(255,255,255,.75); color: var(--ink-2); }

/* 生成进度动画 */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.shimmer {
  background: linear-gradient(90deg, #efe7dd 25%, #f8f3ec 50%, #efe7dd 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
}
@keyframes spinSlow { to { transform: rotate(360deg); } }
.spin-slow { animation: spinSlow 1.1s linear infinite; }

/* 前后对比滑杆 */
.compare-range { -webkit-appearance: none; appearance: none; }
.compare-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 40px; height: 40px;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23AD8663' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 6 4 12 9 18'/><polyline points='15 6 20 12 15 18'/></svg>") center no-repeat;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(48, 54, 48, .28);
  cursor: ew-resize;
}
.compare-range::-moz-range-thumb {
  width: 40px; height: 40px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23AD8663' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'><polyline points='9 6 4 12 9 18'/><polyline points='15 6 20 12 15 18'/></svg>") center no-repeat;
  box-shadow: 0 2px 10px rgba(48, 54, 48, .28);
  cursor: ew-resize;
}

/* 图片淡入 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.fade-up { animation: fadeUp .5s ease both; }

/* iPhone 底部安全区（刘海屏 / PWA 全屏时避免被 Home 指示条遮挡） */
#app-tabs nav {
  padding-bottom: calc(0.375rem + env(safe-area-inset-bottom));
}
@media (max-width: 767px) {
  footer { padding-bottom: calc(6rem + env(safe-area-inset-bottom)) !important; }
}

/* ---------- V4.5 首页营销广告轮播（原生 CSS，禁用 @apply） ---------- */
.ads-carousel {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  background: #F1E7DD;
  box-shadow: 0 10px 30px rgba(48, 54, 48, .07);
}
.ads-slide {
  display: none;
  position: relative;
  text-decoration: none;
  color: inherit;
  height: auto;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
}
.ads-slide.on { display: block; }
.ads-slide.has-image {
  aspect-ratio: 5 / 2;
  min-height: 0;
}
.ads-slide-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  width: 100%;
  min-height: 160px;
  box-sizing: border-box;
  padding: 2.25rem 2.5rem;
  background: linear-gradient(120deg, #7C5C3F, #AD8663 55%, #C9AB8B);
  border-radius: inherit;
}
.ads-slide.has-image .ads-slide-inner {
  height: 100%;
  padding: 0;
}
.ads-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ads-img-failed .ads-img { display: none; }
.ads-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(35,38,34,.60) 0%, rgba(35,38,34,.26) 55%, rgba(35,38,34,0) 100%);
}
.ads-text {
  position: relative;
  color: #fff;
}
.ads-slide.has-image .ads-text {
  position: absolute;
  left: 22px;
  right: 96px;
  top: 50%;
  transform: translateY(-50%);
}
.ads-title {
  display: block;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 24px;
  letter-spacing: .01em;
}
.ads-sub { display: block; font-size: 14px; opacity: .86; margin-top: 6px; }
/* 轮播箭头：极简描边圆环 + 细腻高光，取代厚重白底箭头 */
.ads-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(30, 26, 20, .12);
  transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}
.ads-arrow:hover {
  background: rgba(255, 255, 255, .26);
  border-color: rgba(255, 255, 255, .8);
}
.ads-arrow:active { transform: translateY(-50%) scale(.94); }
.ads-arrow svg { stroke-width: 1.5; }
.ads-arrow-left { left: 12px; }
.ads-arrow-right { right: 12px; }
.ads-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}
.ads-dots { display: flex; gap: 6px; }
.ads-dot {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  border: 0;
  padding: 0;
  background: rgba(255,255,255,.55);
  cursor: pointer;
  transition: width .2s, background .2s;
}
.ads-dot.on { background: #fff; width: 18px; }
.ads-pause {
  font-size: 11px;
  color: #fff;
  background: rgba(35,38,34,.36);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 9999px;
  padding: 3px 10px;
  cursor: pointer;
}
.ads-single .ads-arrow,
.ads-single .ads-dots,
.ads-single .ads-pause { display: none; }
@media (max-width: 640px) {
  .ads-slide { border-radius: 20px; }
  .ads-slide.has-image { aspect-ratio: 9 / 4; min-height: 0; }
  .ads-slide-inner { min-height: 130px; padding: 1.75rem 1.5rem; }
  .ads-title { font-size: 19px; }
  .ads-sub { font-size: 13px; }
  .ads-slide.has-image .ads-text { left: 16px; right: 64px; }
  .ads-arrow { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .ads-dot, .ads-arrow, .ads-img { transition: none; animation: none; }
}

/* ============================================================
   首页案例卡：手机点击切换前后对比，桌面悬停显示
   ============================================================ */
.case-card { cursor: pointer; }
.case-card .case-after { opacity: 0; transition: opacity .45s ease; }
.case-card .case-tag-after { display: none; }
@media (hover: hover) {
  .case-card:hover .case-after { opacity: 1; }
  .case-card:hover .case-tag-before { display: none; }
  .case-card:hover .case-tag-after { display: inline; }
}
.case-card.is-flipped .case-after { opacity: 1; }
.case-card.is-flipped .case-tag-before { display: none; }
.case-card.is-flipped .case-tag-after { display: inline; }
@media (prefers-reduced-motion: reduce) {
  .case-card .case-after { transition: none; }
}
