/* 美梵空间官网 · SITE-HOME-20260730-BUILD
   C 版实现：沉浸首屏 + 第二空间 + 手机介绍区 + 页脚三行左右分栏。 */

:root {
  --ink: #1a2320; --paper: #f7f6f3; --raised: #ffffff; --line: #e5e1d9; --muted: #57635d;
  --teal: #1c6b57; --teal-soft: #e8f0ec; --amber: #b26622; --amber-soft: #f6ecdf;
  --gold: #c9a227;
  --shadow: 0 1px 2px rgba(26, 35, 32, .05), 0 12px 32px -16px rgba(26, 35, 32, .16);
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration: none; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 10px; border: 1px solid transparent;
  padding: 8px 16px; font-size: 14px; font-weight: 650; font-family: inherit;
  cursor: pointer; transition: background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); color: #fff; }
.btn-secondary { background: var(--teal-soft); color: var(--ink); }
.btn-secondary:hover { background: color-mix(in srgb, var(--teal-soft) 80%, var(--teal) 20%); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-lg { padding: 14px 26px; font-size: 15.5px; border-radius: 12px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 10px; font-size: 15px; }

/* ===== 顶栏 ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand-word { display: flex; align-items: baseline; gap: 6px; }
.brand-word b { font-family: var(--serif); font-size: 17px; letter-spacing: .04em; line-height: 1.2; }
.brand-word small { color: var(--muted); font-size: 10.5px; letter-spacing: .12em; }
.site-nav { display: none; gap: 22px; margin-left: 12px; }
.site-nav a, .site-nav button { color: var(--ink); font-size: 14px; font-weight: 600; }
.site-nav button { background: none; border: 0; padding: 0; font-family: inherit; cursor: pointer; }
.site-nav a:hover, .site-nav button:hover { color: var(--teal); }
.header-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-toggle { display: inline-flex; }
.site-nav.open {
  display: flex; flex-direction: column; gap: 4px;
  position: absolute; top: 62px; left: 0; right: 0;
  background: var(--raised); border-bottom: 1px solid var(--line);
  padding: 10px 20px 14px; margin: 0;
}
.site-nav.open a, .site-nav.open button {
  display: block; width: 100%; box-sizing: border-box;
  padding: 8px 2px; border-bottom: 1px solid var(--line);
  text-align: left; font-size: 14px; font-weight: 600; line-height: 1.5;
}
.site-nav.open a:last-child, .site-nav.open button:last-child { border-bottom: 0; }

/* ===== 首屏 ===== */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.hero-scene { position: relative; width: 100%; height: 100vh; overflow: hidden; }
@media (min-width: 1920px) and (min-aspect-ratio: 2/1) {
  .hero-scene { max-width: 3440px; }
}
.hero-picture { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-picture img { width: 100%; height: 100%; object-fit: cover; }
/* 文案安全区：几何由 perspective.js 按真源 copySafeRect 设定，
   宽度不再靠 ch/em 猜 —— 大字号下猜宽度必然换行错位。 */
.hero-copy {
  pointer-events: auto;
  display: flex; flex-direction: column; justify-content: center;
}
.hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(36px, 8.4vw, 60px);
  line-height: 1.22; margin: 0 0 20px; letter-spacing: .02em; font-weight: 700;
}
.hero-sub { color: var(--ink); opacity: .82; font-size: 17.5px; line-height: 1.75; margin: 0 0 28px; }
.hero-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ===== 场景坐标层 =====
   几何由 perspective.js 设为底图实际绘制矩形，层内归一化坐标 == 真源坐标。
   投影元素必须是本层【直接子元素】且 left:0/top:0/margin:0，
   自身布局偏移恒为 0 —— 这是不再需要 dx/dy 补偿的结构前提。 */
.scene-layer {
  position: absolute; left: 0; top: 0;
  width: 100%; height: 100%;
  z-index: 20;
  pointer-events: none;          /* 只有内部真实控件接收事件 */
}
.scene-layer > * {
  position: absolute; left: 0; top: 0; margin: 0;
  transform-origin: 0 0;
}
.scene-layer [hidden] { display: none !important; }

/* 行业场景：桌面为右侧竖列，几何按真源 industryRailRectSeed 设定 */
.hero-industry {
  pointer-events: auto;
  display: flex; flex-direction: column; gap: 10px;
  align-items: flex-end; justify-content: flex-start;
}
.industry-title {
  margin: 0 0 2px; font-size: 12px; font-weight: 600;
  color: var(--muted); letter-spacing: .12em; white-space: nowrap;
}
.industry-item {
  padding: 7px 12px;
  background: transparent;
  border: none; outline: none; box-shadow: none; border-radius: 4px;
  font-size: 13px; font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
}
.industry-item.active { background: var(--ink); color: #fff; }
/* 真源 §8：未接入行业显示半透明「规划中」。此前 opacity:.5 叠在浅色底图上几乎不可见，
   改为保留降级语义的同时保证正文对比度不低于 4.5:1。 */
.industry-item.planned {
  opacity: 1; cursor: not-allowed;
  color: var(--muted);
  background: rgba(255,255,255,.55);
}
.industry-item small { display: block; font-size: 10px; font-weight: 400; opacity: .85; }

/* ===== hero 文字层定位（静态底图形态：perspective.js 空实现后由 CSS 接管几何） =====
   坐标真源 02-scene-region-map.json（归一化，sourceOfTruth=底图 naturalW/H）；
   scene-layer 铺满 hero-scene（视口宽×100vh），底图 object-fit:cover。
   用 .scene-layer > 前缀提高特异性，覆盖 .scene-layer > * 的 left:0/top:0。
   主标题 copySafeRect 居左（右缘 0.315）、行业栏 industryRailRectSeed 靠右（左缘 0.915），
   两缘相距约 60%，与主标题零相交。 */
.scene-layer > .hero-copy {
  /* 真源 copySafeRect standardDesktop: x0.045 y0.205 w0.27 */
  left: 4.5%; top: 20.5%; width: 27%;
}
.scene-layer > .hero-industry {
  /* 真源 industryRailRectSeed standardDesktop: x0.915 y0.145 w0.075（右缘 0.99） */
  left: 91.5%; top: 14.5%; width: 7.5%;
}
@media (min-width: 1920px) and (min-aspect-ratio: 2/1) {
  /* 真源 ultrawide: copySafeRect w0.25、industryRailRectSeed x0.925 y0.15 w0.065 */
  .scene-layer > .hero-copy { width: 25%; }
  .scene-layer > .hero-industry { left: 92.5%; top: 15%; width: 6.5%; }
}
@media (max-width: 767px) {
  /* 真源 mobile: copySafeRect x0.07 y0.07 w0.86（顶部全宽）、industryMode=horizontalHtmlRail。
     scene-layer 改 flex column 文档流，标题在上、行业栏横向 rail 在下，垂直分离（不写死 top 猜高度）。 */
  .hero .scene-layer {
    display: flex; flex-direction: column; justify-content: flex-start;
    padding: 7vh 7% 0;
  }
  .scene-layer > .hero-copy {
    position: static; left: auto; top: auto; width: 100%;
  }
  .scene-layer > .hero-industry {
    position: static; left: auto; right: auto; top: auto;
    width: 100%; margin-top: 22px;
  }
}

/* ===== 过渡 ===== */
.transition { padding: 80px 0; text-align: center; }
.transition-line {
  width: 1px; height: 60px;
  background: linear-gradient(to bottom, transparent, var(--gold), transparent);
  margin: 0 auto 24px;
}
.transition h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 5vw, 32px);
  margin: 0 0 8px; letter-spacing: .02em;
}
.transition p { color: var(--muted); margin: 0; font-size: 15px; }

/* ===== 第二空间 ===== */
.second-space { padding: 80px 0; }
.second-space h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 5vw, 32px);
  margin: 0 0 40px; text-align: center; letter-spacing: .02em;
}
.second-lead { text-align: center; color: var(--muted); margin: -24px 0 40px; font-size: 15px; }

/* 一体化场景容器：底图 + 坐标层共享同一坐标系 */
.second-scene {
  position: relative;
  width: 100%; max-width: 1680px; margin: 0 auto;
  aspect-ratio: 3840 / 2026;      /* 真源 §4：禁止强裁 16:9 */
  overflow: hidden;
}
.second-picture { position: absolute; inset: 0; }
.second-picture img { width: 100%; height: 100%; object-fit: contain; }

.second-item {
  cursor: pointer;
  scroll-margin: 20px;
  background: transparent; border: none; box-shadow: none; border-radius: 0;
  pointer-events: auto;           /* 真实热区，键盘可达 */
  color: var(--gold);
  container-type: inline-size;
}
.second-item:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.second-item:not(.active) { opacity: .62; }
.second-item.active { opacity: 1; }

/* ===== 手机介绍区 ===== */
.mobile-intro { padding: 80px 0; }
.mobile-intro-grid { display: grid; gap: 24px; }
.mobile-intro-item { text-align: center; }
.mobile-intro-item img {
  width: 100%; height: auto; border-radius: 18px;
  border: 1px solid var(--line);
  aspect-ratio: 3/2; object-fit: cover;
}
.mobile-intro-item p { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

/* ===== CTA ===== */
.closing { padding: 80px 0; text-align: center; }
.closing-in { max-width: 640px; margin: 0 auto; }
.closing h2 {
  font-family: var(--serif);
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.35; margin: 0 0 28px; letter-spacing: .02em;
}

/* ===== 页脚 ===== */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 40px; }
.footer-in { display: grid; gap: 14px; }
.footer-row {
  display: grid; gap: 8px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
.footer-row:last-child { border-bottom: 0; }
.footer-left { font-weight: 600; color: var(--ink); }
.footer-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.footer-right a { color: var(--muted); }
.footer-right a:hover { color: var(--teal); }
.footer-sep { color: var(--line); }
.footer-domain { color: var(--ink); font-weight: 600; margin-right: 4px; }
.footer-icp { font-weight: 600; }
.footer-police { font-weight: 600; }

/* 图片失败占位：真源 §11 —— 图片失败时保留暖灰背景、预设宽高和真实 HTML 文案 */
.hero-picture, .second-picture, .mobile-intro-item {
  background: var(--teal-soft);
}
.hero-picture { min-height: 100vh; }
/* 宽高比只能加在 <img> 上：加在容器上会连同 min-height 反算出固定宽度
   （300px × 3/2 = 450px），在 375px 视口下直接把整页撑出横向滚动。 */
.mobile-intro-item img { min-height: 0; }
.mobile-intro-item { max-width: 100%; }
.hero-picture img, .second-picture img, .mobile-intro-item img {
  opacity: 0;
  transition: opacity .3s;
}
.hero-picture img[src], .second-picture img[src], .mobile-intro-item img[src] {
  opacity: 1;
}
img[data-failed] {
  display: none;
}

/* 严格 reduced-motion：无动画 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .island-item { transition: none; }
  .hero-picture img, .second-picture img, .mobile-intro-item img { transition: none; }
}

/* ===== 响应式 ===== */
@media (max-width: 767px) {
  /* 平板不再隐藏：真源 hero.mobile 给了 screenQuadSeed，手机端本就该显示平板画面。
     中岛的隐藏改由 perspective.js 按真源 islandProjectionMode="disabled" 置 [hidden]，
     不写死在 CSS 里 —— 坐标真源变了样式不用跟着改。 */
  /* 真源 §8：手机改为标题下方横向滚动标签，不压缩成小字。
     几何由 perspective.js 贴到文案安全区正下方（data-placed="below-copy"）。 */
  .hero-industry {
    flex-direction: row; align-items: center; justify-content: flex-start;
    overflow-x: auto; height: auto;
    gap: 8px; padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .industry-title { display: none; }
  .industry-item { flex: 0 0 auto; font-size: 13px; }

  /* 顶部导航禁止折行：折行是 §二-3 明列的失败信号 */
  .header-in { flex-wrap: nowrap; gap: 8px; }
  .header-acts { gap: 6px; flex-shrink: 0; }
  .site-header .btn { padding: 7px 10px; font-size: 13px; }
  .brand small { display: none; }

  /* 真源 §10：手机端预算与项目进度改成普通内容卡，不在小屏模拟桌面透视投影。
     perspective.js 会把 .second-scene 置为 data-mode="cards" 并清掉行内几何。 */
  .second-scene[data-mode="cards"] {
    aspect-ratio: auto; overflow: visible;
    padding: 0 20px;
  }
  .second-scene[data-mode="cards"] .second-picture {
    position: static; display: block;
    margin-bottom: 24px;
  }
  .second-scene[data-mode="cards"] .second-picture img {
    height: auto; aspect-ratio: 3840 / 2026; border-radius: 12px;
  }
  .second-scene[data-mode="cards"] .scene-layer {
    position: static; width: auto; height: auto;
    display: grid; gap: 16px;
  }
  .second-scene[data-mode="cards"] .scene-layer > * {
    position: static; transform: none !important;
    width: auto !important; height: auto !important;
  }
  .second-scene[data-mode="cards"] .second-item {
    opacity: 1;
    border: 1px solid var(--line); border-radius: 12px;
    padding: 20px; background: var(--raised);
  }
  .second-scene[data-mode="cards"] .second-item.active { border-color: var(--teal); }
  .second-scene[data-mode="cards"] .budget-lines { position: static; height: 90px; }

  .mobile-intro-grid { grid-template-columns: 1fr; }
  .footer-row { grid-template-columns: 1fr; text-align: center; }
  .footer-right { justify-content: center; }
  .brand-word { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
  .mobile-intro-item { width: 100%; max-width: 100%; }
}
@media (min-width: 768px) {
  .site-nav { display: flex; }
  .nav-toggle { display: none; }
  /* 真源 §10：手机同机位毛坯/成品双图是手机端专属证据区，桌面端由第二空间承担 */
  .mobile-intro { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
  .island-item { transition: none; }
}
