/* ================================================================
   CONTACT — 联系我们页专属样式
     · 地图区：contactmap.jpg 视差底图 + 左侧毛玻璃联系卡片
       - 顶部上探进 hero 底部，clip 中央 V 缺口露出 hero KV（地图填补两侧白角区）
       - 底部白色双角 V mask 作为与表单的分割（同 hero 底部样式）
     · 留言区：左 1/5 标题 + 右 4/5 表单，整体抽屉式滑入
   依赖：tokens.css、base.css（.cta-pill）、hero-image.css、footer-cta.css
   ================================================================ */

/* hero V mask 高度（与 hero-image.css 的 .page-hero__mask 对齐） */
:root { --hero-mask-h: 180px; }

/* 本页隐藏 hero 自带白色 V mask —— 改由地图上探 + clip 缺口接管，
   使地图填补原白色三角区，中央缺口露出 hero KV（需求 2）。 */
body[data-page="contact"] .page-hero__mask { display: none; }

/* ================================================================
   地图区
   ================================================================ */
.contact-map {
  position: relative;
  z-index: 11;                 /* 高于 hero(auto) 与表单(z10)、vision::before(z6) */
  margin-top: calc(var(--hero-mask-h) * -1);   /* 上探进 hero 底部 mask 区（需求 2） */
  padding-top: var(--hero-mask-h);             /* 内容下移回可视区，卡片不被 hero 盖住 */
  padding-bottom: 110px;       /* 给底部 V mask 留位，卡片完整显示在 mask 之上 */
  min-height: 740px;           /* 加高地图区，容纳完整信息卡片 */
  display: flex;
  align-items: center;
  overflow: hidden;            /* 裁掉视差底图溢出 */
  background: #e9eef0;         /* 底图加载前兜底 */
  /* 顶部中央 V 缺口：两侧填地图、中央露 hero KV（需求 2）。缺口放在父级（随页面整体合成平移），
     底图在其内做 ±3% 视差（见 contact.js buildMapParallax）。
     注：曾因疑似卡顿把缺口下沉到底图层并关掉视差；后确认卡顿实为浏览器长时间运行后的合成层状态劣化
     （重启浏览器即恢复），与本结构无关 → 已还原为「缺口在父级 + 底图视差」的原始做法。 */
  clip-path: polygon(0 0, 50% var(--hero-mask-h), 100% 0, 100% 100%, 0 100%);
}

/* 视差底图层（需求 4）+ 公司定位针横向位置锁定（需求 1）
   ── 原理：定位针在底图中位于 fracX≈0.497。background-size:130% + 左对齐，
      使针落点 = 0.497 × 1.30 × 容器宽 ≈ 0.646×容器宽 ≈ 64.6%。
      该比例与容器宽度无关（C 约去），故任何 PC 分辨率下针落点恒定、偏右侧。
   ── 视差：元素上下各留 4% 溢出（top:-4% + height:108%），GSAP 仅做 yPercent 平移，
      不缩放（缩放会改变针的横向落点）。4% 溢出在 1280 宽下仍能被 130% 底图覆盖。 */
.contact-map__bg {
  position: absolute;
  left: 0; right: 0;
  top: -4%; height: 108%;        /* 视差溢出：上下各留 4%，配合 130% 底图，yPercent ±3 平移不露边 */
  background: url('https://v.sh-original.com/image/default/0024AA90D0FF4C06ACD94EBCC1474B7A-6-2.jpg') no-repeat left center;  /* contactmap.jpg → 阿里云 VOD */
  background-size: 130% auto;    /* 针落点 = 0.497×1.30 ≈ 64.6% 横向（与分辨率无关） */
  will-change: transform;        /* 视差 transform → 提示独立合成层 */
  z-index: 0;
  pointer-events: none;         /* 纯视觉层；点击交给上方 .contact-map__link */
}

/* 可点击地图层：覆盖整个地图区，点击 → 新标签页打开高德地图。
   位于 bg(0) 之上、inner(2) 之下；inner 设 pointer-events:none 让空白处的点击
   穿透到本层，而卡片 pointer-events:auto 自行拦截。 */
.contact-map__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: pointer;
  display: block;
}
/* 点击提示徽标（右下角，浮在地图上） */
.contact-map__hint {
  position: absolute;
  right: clamp(24px, 5vw, 60px);
  bottom: 128px;                /* 高于底部 110px V mask */
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 8px 15px;
  border-radius: 999px;
  box-shadow: 0 8px 22px -10px rgba(31, 92, 54, 0.5);
  pointer-events: none;        /* 点击由父 <a> 处理 */
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out);
}
.contact-map__link:hover .contact-map__hint {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px -10px rgba(31, 92, 54, 0.6);
}

.contact-map__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 60px);
  pointer-events: none;        /* 让空白区点击穿透到地图层；卡片自行恢复 auto */
}

/* 底部白色双角 V mask —— 与表单的分割（需求 1，同 hero 底部样式） */
.contact-map__mask {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 110px;
  display: flex;
  pointer-events: none;
  z-index: 3;
}
.contact-map__mask span { flex: 1; position: relative; height: 100%; }
.contact-map__mask span::before {
  content: ""; position: absolute; inset: -1px; background: #fff;
}
.contact-map__mask .left::before  { clip-path: polygon(0 0,   100% 100%, 0 100%); }
.contact-map__mask .right::before { clip-path: polygon(100% 0, 100% 100%, 0 100%); }

/* ── 浮动联系卡片：毛玻璃半透（需求 4）+ 2 列布局（需求 2） ──────
   上区：左标题 / 右公司信息；下区：左 刘静(带"敬请联系") / 右 张静静 -->*/
.contact-card {
  width: min(660px, 100%);
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 6px;
  padding: clamp(28px, 3vw, 44px);
  box-shadow: 0 26px 60px -24px rgba(31, 92, 54, 0.45);
  pointer-events: auto;        /* 卡片恢复可交互（inner 设了 none） */
}
/* 上区 2 列：左标题(1) + 右公司信息(1.25)，顶部对齐 */
.contact-card__top {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(20px, 2.5vw, 40px);
  align-items: start;
}
/* 下区 2 列：与上区同比例，刘静/张静静 顶部对齐 */
.contact-card__contacts {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: clamp(20px, 2.5vw, 40px);
  align-items: start;
  margin-top: clamp(28px, 3vw, 40px);
}
/* 幽灵"敬请联系"：占位但不可见，把右列 张静静 下推到与左列 刘静 对齐 */
.contact-card__sub--ghost { visibility: hidden; }

/* 卡片标题：联系我们 / CONTACT（三角 + 红中文 + 绿英文） */
.contact-card__head { margin-bottom: 24px; margin-left: 30px; }
.contact-card__head .triangle {
  display: block;
  width: 36px; aspect-ratio: 54 / 33;
  background: url('../../../images/half-green-logo.svg') no-repeat center / contain;
  margin-bottom: 12px;
  margin-left: -30px;
}
.contact-card__head .cn {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.2vw, 32px);
  color: var(--red);
  font-weight: 900;
  letter-spacing: .14em;
  line-height: 1;
}
.contact-card__head .en {
  margin-top: 7px;
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: .25em;
  color: var(--green);
  font-weight: 600;
}

/* 公司名 */
.contact-card__company { margin-bottom: 16px; }
.contact-card__company .cn {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .02em;
}
.contact-card__company .en {
  margin-top: 3px;
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: .04em;
  color: var(--ink-soft);
}

/* 公司信息行 */
.contact-card__info {
  font-family: var(--font-cn);
  font-size: 13px;
  line-height: 1.9;
  color: #2F3D34;              /* 毛玻璃上稍加深保证可读 */
}
.contact-card__info > div,
.contact-card__info > a { display: flex; }
.contact-card__info b {
  flex-shrink: 0;
  color: var(--green-deep);
  font-weight: 700;
  letter-spacing: .04em;
}
/* 地址可点击 → 高德地图 */
.contact-card__addr {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-radius: 3px;
  transition: color .2s var(--ease-out);
}
.contact-card__addr span { text-decoration: underline dotted rgba(47,131,78,.5); text-underline-offset: 3px; }
.contact-card__addr:hover { color: var(--green-deep); }
.contact-card__addr:hover span { text-decoration-color: var(--green); }

.contact-card__sub {
  font-size: 14px;
  font-weight: 700;
  color: var(--green-deep);
  letter-spacing: .08em;
  margin-bottom: 14px;
}

/* 联系人块 */
.contact-person {
  font-size: 12.5px;
  line-height: 1.5;
  color: #2F3D34;
}
.contact-person__dept {
  font-size: 12px;
  color: #2F3D34;
  font-weight: 600;
  margin-bottom: 6px;
}
.contact-person__line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 6px;
}
.contact-person__line:last-child { margin-bottom: 0; }
.contact-person__line img { width: 16px; height: 16px; flex-shrink: 0; }
.contact-person__line.name {
  font-weight: 700;
  color: var(--ink);
  font-size: 13.5px;
}
.contact-person__line .val { word-break: break-all; }

/* ================================================================
   留言区：抽屉式（需求 5）+ 左 1/5 标题 + 右 4/5 表单（需求 3）
   ================================================================ */
.contact-form-sec {
  position: relative;
  z-index: 10;                 /* 低于地图(11)：抽屉上拉时藏在地图后；高于 vision 盖住其抽屉 */
  overflow: hidden;            /* 裁剪上拉的抽屉 */
  background: #fff;
  /* 下半部分收紧：上 padding 适中，下 padding 明显减小（原 96 留白过多） */
  padding: clamp(44px, 5vw, 72px) 0 clamp(0px, 0vw, 44px);
}
/* 抽屉容器：GSAP 控制 y 从上方滑入（见 js/pages/contact.js） */
.contact-form__drawer { will-change: transform; }

/* 左 1/5 标题 + 右 4/5 表单 */
.contact-form-sec__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(24px, 5vw, 60px);
  display: grid;
  grid-template-columns: 1fr 4fr;     /* 1/5 + 4/5 */
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

/* 表单标题：欢迎留言 / CONTACT（三角 + 红中文 + 绿英文，左列） */
.contact-form__head { padding-top: 4px; }
.contact-form__head .triangle {
  display: block;
  width: 38px; aspect-ratio: 54 / 33;
  background: url('../../../images/half-green-logo.svg') no-repeat center / contain;
  margin-bottom: 14px;
  margin-left: -30px;
}
.contact-form__head .cn {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.2vw, 34px);
  color: var(--red);
  font-weight: 900;
  letter-spacing: .14em;
  line-height: 1.15;
}
.contact-form__head .en {
  margin-top: 8px;
  font-family: var(--font-en);
  font-size: 13px;
  letter-spacing: .22em;
  color: var(--green);
  font-weight: 600;
}

/* 表单本体 */
.contact-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: clamp(16px, 2vw, 28px);
  margin-bottom: clamp(16px, 2vw, 28px);
}
.contact-field { display: flex; flex-direction: column; }
.contact-field label {
  font-size: 13px;
  font-weight: 600;
  color: #4A554E;
  letter-spacing: .04em;
  margin-bottom: 10px;
}
.contact-field label .req { color: var(--red); margin-left: 3px; }
.contact-field input,
.contact-field textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: #F4F8F5;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 14px 16px;
  outline: none;
  transition: border-color .25s var(--ease-out), background .25s var(--ease-out);
  width: 100%;
}
/* 输入框（单行 input，非 textarea）上下内边距改薄 */
.contact-field input { padding: 2px 16px; }
.contact-field input::placeholder,
.contact-field textarea::placeholder { color: #9CB0A2; }
.contact-field input:focus,
.contact-field textarea:focus {
  background: #fff;
  border-color: var(--green);
}
.contact-field textarea {
  resize: vertical;
  min-height: 150px;
  line-height: 1.7;
}
.contact-field--full { margin-bottom: clamp(18px, 2vw, 28px); }

/* 部门下拉（发送至）：与 input 同款外观 + 自定义箭头 */
.contact-select { position: relative; }
.contact-select::after {
  content: ""; position: absolute; right: 16px; top: 45%;
  width: 8px; height: 8px;
  border-right: 2px solid #6B7A70; border-bottom: 2px solid #6B7A70;
  transform: translateY(-50%) rotate(45deg);
  pointer-events: none;
}
.contact-field select {
  font-family: inherit; font-size: 14px; color: var(--ink); line-height: 40px;
  background: #F4F8F5; border: 1px solid transparent; border-radius: 4px;
  padding: 2px 40px 2px 16px; outline: none; width: 100%;   /* 竖向 2px + line-height 40 → 高 46px，与 input 一致 */
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  cursor: pointer;
  transition: border-color .25s var(--ease-out), background .25s var(--ease-out);
}
.contact-field select:focus { background: #fff; border-color: var(--green); }
.contact-field select:required:invalid { color: #9CB0A2; }   /* 未选择时占位灰 */

/* —— 自定义部门下拉（contact.js 生成；外观与 input 一致 + 动画下拉列表）—— */
.contact-select--custom { position: relative; }
.contact-select__btn {
  font-family: inherit; font-size: 14px; color: var(--ink); text-align: left;
  background: #F4F8F5; border: 1px solid transparent; border-radius: 4px;
  height: 46px; line-height: 44px; padding: 0 40px 0 16px; width: 100%;
  outline: none; cursor: pointer;
  transition: border-color .25s var(--ease-out), background .25s var(--ease-out);
}
.contact-select__btn.is-placeholder { color: #9CB0A2; }                 /* 未选占位灰 */
.contact-select--custom.is-open .contact-select__btn,
.contact-select__btn:focus { background: #fff; border-color: var(--green); }
.contact-select--custom.is-invalid .contact-select__btn { border-color: var(--red); }
.contact-select__text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 箭头：随展开翻转 */
.contact-select--custom::after {
  content: ""; position: absolute; right: 16px; top: 50%;
  width: 8px; height: 8px; border-right: 2px solid #6B7A70; border-bottom: 2px solid #6B7A70;
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
  transition: transform .25s var(--ease-out);
}
.contact-select--custom.is-open::after { transform: translateY(-30%) rotate(-135deg); }
/* 下拉列表：圆角卡片 + 阴影 + 淡入 */
.contact-select__list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid rgba(47, 131, 78, .20); border-radius: 8px;
  box-shadow: 0 16px 36px -16px rgba(31, 92, 54, .45);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .22s var(--ease-out), transform .22s var(--ease-out), visibility .22s;
}
.contact-select--custom.is-open .contact-select__list { opacity: 1; visibility: visible; transform: translateY(0); }
.contact-select__opt {
  padding: 11px 14px; border-radius: 6px; font-size: 14px; color: var(--ink);
  cursor: pointer; transition: background .18s, color .18s;
}
.contact-select__opt:hover { background: #F0F6F2; color: var(--green-deep); }
.contact-select__opt.is-selected { background: var(--green); color: #fff; }

/* 提交按钮：绿色实心 pill 变体 */
.contact-form__submit {
  background: var(--green);
  color: #fff;
}
.contact-form__submit .cta-pill__icon .bg    { fill: #fff; }
.contact-form__submit .cta-pill__icon .arrow { fill: var(--green); }
.contact-form__submit:hover {
  background: var(--green-deep);
  color: #fff;
}
.contact-form__submit:hover .cta-pill__icon .bg    { fill: #fff; }
.contact-form__submit:hover .cta-pill__icon .arrow { fill: var(--green-deep); }

/* 提交成功提示 */
.contact-form__note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--green);
  opacity: 0;
  transition: opacity .4s var(--ease-out);
}
.contact-form__note.is-shown { opacity: 1; }

/* ── 页脚视频广告位 V mask：白色衔接（上方留言区是 #fff） ──────── */
section.vision::before {
  background: #fff;
}

/* ================================================================
   响应式
   ================================================================ */
@media (max-width: 980px) {
  :root { --hero-mask-h: 120px; }   /* 与 hero-image.css 移动端 mask 高度对齐 */
  /* 地图区加高 + 卡片顶对齐：完整信息卡片显示在底部 V mask 之上（需求 5） */
  .contact-map { min-height: 0; align-items: flex-start; padding-top: calc(var(--hero-mask-h) + 32px); padding-bottom: 120px; }
  /* 联系我们标题左对齐卡片正文：去掉左移缩进 + 三角不外挑（需求 4） */
  .contact-card__head { margin-left: 0 !important; padding-left: 0 !important; }
  .contact-card__head .triangle { margin-left: 0 !important; }
  /* 移动端卡片竖排很高，130% auto 高度不足会露底 —— 改 cover 兜底（移动端不要求针在 75%） */
  .contact-map__bg { top: 0; height: 100%; background-size: cover; background-position: center; }
  .contact-map__mask { height: 70px; }
  .contact-map__hint { display: none; }   /* 移动端地图多被卡片覆盖，隐藏提示，靠地址链接点击 */
  .contact-card { width: 100%; }
  .contact-form-sec__inner { grid-template-columns: 1fr; }   /* 标题回到表单上方 */
  .contact-form__head { margin-bottom: 28px; }
  .contact-form__row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  /* 卡片 2 列在窄屏堆叠为单列；幽灵标题不再需要（无对齐对象） */
  .contact-card__top,
  .contact-card__contacts { grid-template-columns: 1fr; gap: 18px; }
  .contact-card__contacts { margin-top: 22px; }
  .contact-card__sub--ghost { display: none; }
}

/* ================================================================
   滑块拖动验证码（与输入框同款外观：#F4F8F5 底 / 圆角4 / 绿色强调）
   ================================================================ */
.zz-cap-field { width: 100%; }
.zz-slider { width: 100%; }
.zz-slider__track {
  position: relative;
  height: 46px;
  background: #F4F8F5;
  border: 1px solid transparent;
  border-radius: 4px;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
}
.zz-slider__fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: var(--green-soft, #C7E3D2);
}
.zz-slider.is-done .zz-slider__fill { width: 100% !important; background: var(--green); }
.zz-slider__label {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #9CB0A2; pointer-events: none;
}
.zz-slider.is-done .zz-slider__label { color: #fff; font-weight: 600; }
.zz-slider__handle {
  position: absolute; left: 0; top: 0; z-index: 2;
  width: 46px; height: 46px; margin: 0; padding: 0; border: 0;
  cursor: grab; color: #fff; background: var(--green); border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(47, 131, 78, .35);
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
  touch-action: none;
}
.zz-slider.is-dragging .zz-slider__handle { cursor: grabbing; transition: none; }
.zz-slider.is-loading .zz-slider__handle { opacity: .7; }
.zz-slider.is-done .zz-slider__handle { cursor: default; background: var(--green-deep, #1F5C36); }
.zz-slider.is-error .zz-slider__track { border-color: var(--red); animation: zzCapShake .35s; }
@keyframes zzCapShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* 蜜罐：彻底离屏（不可见 / 不占位 / 不可聚焦），仅诱捕填表 bot */
.zz-hp {
  position: absolute !important;
  left: -9999px !important; top: -9999px !important;
  width: 1px; height: 1px; opacity: 0; pointer-events: none;
}

/* ================================================================
   滑块验证弹窗（点提交后弹出，弹窗内拖动验证）
   ================================================================ */
.zz-modal {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(26, 42, 32, .55);
  animation: zzModalFade .2s ease;
}
.zz-modal[hidden] { display: none; }
@keyframes zzModalFade { from { opacity: 0; } to { opacity: 1; } }
.zz-modal__dialog {
  position: relative;
  width: 100%; max-width: 380px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
  padding: 30px 26px 28px;
  animation: zzModalPop .25s cubic-bezier(.22, 1, .36, 1);
}
@keyframes zzModalPop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.zz-modal__title {
  margin: 0 0 18px; text-align: center;
  font-size: 16px; font-weight: 600; color: var(--ink);
}
.zz-modal__close {
  position: absolute; top: 8px; right: 10px;
  width: 34px; height: 34px; padding: 0; border: 0; cursor: pointer;
  background: transparent; color: #9CB0A2; font-size: 26px; line-height: 1;
  border-radius: 8px; transition: all .2s;
}
.zz-modal__close:hover { color: var(--ink); background: #F4F8F5; }
.zz-modal .zz-slider { width: 100%; }
body.zz-modal-open { overflow: hidden; }
