/* ============================================================
 * common.css · 全站通用增强样式
 * 从首页"动效与交互增强层"抽取的可复用部分，所有页面共用：
 *   1. 顶部滚动进度条
 *   2. GSAP Hero 标题切片容器与加载失败兜底
 *   3. AOS 未初始化时的可见性兜底
 *   4. Banner 底部 SCROLL 提示呼吸动画
 *   5. 卡片 hover 科技特效（.biz-card / .post 全站通用）
 *   6. 全站跟随光标三态
 * 自动探测的配套脚本见 assets/common.js
 * 首页专属区块样式见 assets/home.css
 * ============================================================ */

/* 顶部滚动进度条 */
.tech-scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-600), #4a9fff);
  z-index: 9999;
  box-shadow: 0 0 10px rgba(200, 16, 46, 0.6);
  transition: width 0.1s ease;
}

/* GSAP Hero 标题切片容器（逐字上移需要裁切） */
.hero-title-word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  position: relative;
}
.no-gsap .hero-title-word > span,
body:not(.gsap-ready) .hero-title-word > span {
  transform: none !important;
  opacity: 1 !important;
}

/* Banner 底部 SCROLL 提示：呼吸 + 轻微下移 */
.hero__scroll {
  animation: scrollPulse 2.4s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%,
  100% {
    opacity: 0.4;
    transform: translate(-50%, 0);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, 8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll {
    animation: none;
  }
}

/* ============================================================
 * 卡片 hover 科技特效（.biz-card / .post 全站通用）
 * 四角直角标记 + 图片扫描光带 + 右上圆形箭头 + 编号/标签字距
 * 原仅限首页 .cap-grid / .news-grid，现泛化到所有卡片
 * ============================================================ */
.biz-card,
.post {
  position: relative;
}

.biz-card__img,
.post__img {
  position: relative;
}

/* 科技点缀一：四角直角标记，hover 浮现 */
.biz-card::before,
.post::before {
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
  background:
    linear-gradient(var(--brand-600), var(--brand-600)) left top / 16px 1px no-repeat,
    linear-gradient(var(--brand-600), var(--brand-600)) left top / 1px 16px no-repeat,
    linear-gradient(var(--brand-600), var(--brand-600)) right bottom / 16px 1px no-repeat,
    linear-gradient(var(--brand-600), var(--brand-600)) right bottom / 1px 16px no-repeat;
}

/* 科技点缀二：图片扫描光带 */
.biz-card__img::before,
.post__img::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -40%;
  height: 40%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.18) 50%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* 科技点缀三：图片右上圆形箭头 */
.biz-card__img::after,
.post__img::after {
  content: "→";
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  line-height: 1;
  color: var(--brand-600);
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translate(-8px, 8px) scale(0.8);
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease);
}

@media (hover: hover) and (pointer: fine) {
  .biz-card:hover {
    --ty: -6px;
  }
  .biz-card:hover .biz-card__img img,
  .post:hover .post__img img {
    transform: scale(1.06);
  }
  .biz-card:hover::before,
  .post:hover::before {
    opacity: 1;
  }
  .biz-card:hover .biz-card__img::before,
  .post:hover .post__img::before {
    opacity: 1;
    animation: capScan 1.1s var(--ease) forwards;
  }
  .biz-card:hover .biz-card__img::after,
  .post:hover .post__img::after {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  .biz-card__no,
  .card-tag {
    transition: letter-spacing 0.3s var(--ease);
  }
  .biz-card:hover .biz-card__no {
    letter-spacing: 0.14em;
  }
  .post:hover .card-tag {
    letter-spacing: 0.1em;
  }
}

/* ============================================================
 * 业务卡片内的服务列表（.biz-card__body ul/li）
 * 替换浏览器默认黑圆点，用品牌红小方点 + 清爽排版
 * ============================================================ */
.biz-card__body ul {
  list-style: none;
  padding: 0 0 0 12px;
  margin: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.biz-card__body li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.65;
  color: #5a5550;
  transition: color 0.25s var(--ease);
}
.biz-card__body li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  background: var(--brand-600, #c8102e);
  border-radius: 1px;
  opacity: 0.85;
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
@media (hover: hover) and (pointer: fine) {
  .biz-card:hover .biz-card__body li::before {
    transform: scale(1.3) translateX(2px);
    opacity: 1;
  }
  .biz-card:hover .biz-card__body li {
    color: var(--ink-800, #14110f);
  }
}

/* ============================================================
 * 服务体系页面：交替排版行（一行一个子公司，奇行图右文左 / 偶行图左文右）
 * ============================================================ */
.svc-list {
  display: flex;
  flex-direction: column;
  gap: 72px;
}
.svc-row {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 56px;
  align-items: center;
}
.svc-row--flip {
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
}
.svc-row--flip .svc-row__body { order: 2; }
.svc-row--flip .svc-row__media { order: 1; }

/* --- 文字区 --- */
.svc-row__body { min-width: 0; }
.svc-row__meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.svc-row__no {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 1;
  color: #e8ded6;
  letter-spacing: -0.02em;
  transition: color 0.35s var(--ease);
}
.svc-row__tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--brand-600);
  background: #fdf1f2;
  border: 1px solid #f2c9cd;
  border-radius: 999px;
  padding: 5px 14px;
  transition: background-color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.svc-row h3 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #14110f;
  letter-spacing: -0.01em;
}
.svc-row__pos {
  color: #7a726a;
  font-size: 15px;
  line-height: 1.7;
  margin: 0 0 22px;
}
.svc-row__list {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 24px;
}
.svc-row__list li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.6;
  color: #4a4642;
  transition: color 0.25s var(--ease);
}
.svc-row__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--brand-600);
  opacity: 0.75;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.svc-row__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-600);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: gap 0.25s var(--ease);
}
.svc-row__link span { transition: transform 0.25s var(--ease); }
.svc-row__link:hover { gap: 10px; }
.svc-row__link:hover span { transform: translateX(3px); }

/* --- 图片区 --- */
.svc-row__media {
  position: relative;
  aspect-ratio: 5 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: #f4f1ee;
  box-shadow:
    0 2px 6px rgba(20, 17, 15, 0.04),
    0 12px 32px -12px rgba(20, 17, 15, 0.14);
}
.svc-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease);
  filter: saturate(0.95);
}

/* --- hover 联动 --- */
@media (hover: hover) and (pointer: fine) {
  .svc-row:hover .svc-row__no { color: var(--brand-600); }
  .svc-row:hover .svc-row__tag { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
  .svc-row:hover .svc-row__list li { color: #14110f; }
  .svc-row:hover .svc-row__list li::before { opacity: 1; transform: scale(1.4); }
  .svc-row:hover .svc-row__media img { transform: scale(1.06); }
}

/* --- 响应式 --- */
@media (max-width: 1020px) {
  .svc-row,
  .svc-row--flip { grid-template-columns: 1fr 1fr; gap: 32px; }
  .svc-row h3 { font-size: 24px; }
  .svc-row__no { font-size: 28px; }
  .svc-row__list { gap: 7px 16px; }
}
@media (max-width: 720px) {
  .svc-list { gap: 56px; }
  .svc-row,
  .svc-row--flip {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .svc-row--flip .svc-row__body { order: 1; }
  .svc-row--flip .svc-row__media { order: 2; }
  .svc-row__media { aspect-ratio: 16 / 10; border-radius: 12px; }
  .svc-row h3 { font-size: 22px; }
  .svc-row__meta { gap: 10px; margin-bottom: 12px; }
  .svc-row__pos { margin-bottom: 16px; }
  .svc-row__list {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 20px;
  }
}

@keyframes capScan {
  0% {
    top: -40%;
  }
  100% {
    top: 110%;
  }
}

/* ============================================================
 * 全站光标：常驻淡红圆环 → 落在链接上放大加深 → 特色卡片换形态
 * 系统指针始终保留，圆环仅作为跟随装饰
 * 外层只负责定位，内层负责形态过渡
 * ============================================================ */
.cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: transform;
}
.cursor.is-live {
  opacity: 1;
}

.cursor__inner {
  position: absolute;
  left: 0;
  top: 0;
  width: 34px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid transparent;
  background: transparent;
  opacity: 0.4;
  transition:
    width 0.3s var(--ease),
    height 0.3s var(--ease),
    opacity 0.3s var(--ease),
    background-color 0.3s var(--ease),
    border-color 0.3s var(--ease),
    box-shadow 0.3s var(--ease);
}

.cursor__inner::after {
  content: "→";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.22s var(--ease);
}

/* 链接 / 按钮：放大 + 提升不透明度 */
.cursor__inner.cursor--link {
  width: 46px;
  height: 46px;
  opacity: 1;
  background: rgba(200, 16, 46, 0);
}

/* 特色卡片（.biz-card / .post）：填色 + 箭头，形态区别明显 */
.cursor__inner.cursor--card {
  width: 62px;
  height: 62px;
  opacity: 1;
  background: var(--brand-600);
  border-color: var(--brand-600);
  box-shadow: 0 8px 22px rgba(200, 16, 46, 0.25);
}
.cursor__inner.cursor--card::after {
  opacity: 1;
}

/* ============================================================
 * 右侧悬浮联系窗 · 全站通用
 * 竖直胶囊排列三个入口（电话 / 公众号 / 小程序），hover 向左展开信息卡
 * 品牌色：var(--brand-600)（澄鉴红），风格与全站高端商务一致
 * ============================================================ */
.float-contact {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  pointer-events: none;
}

.float-contact__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #ffffff;
  border-radius: 100px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 18px 42px rgba(200, 16, 46, 0.12);
  overflow: visible;
  pointer-events: auto;
  backdrop-filter: blur(8px);
  padding: 10px 0;
}

.float-contact__item {
  position: relative;
}

/* 三个按钮之间的分隔线 */
.float-contact__item + .float-contact__item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
}

.fc-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 60px;
  padding: 10px 0;
  margin: 0;
  border: none;
  background: transparent;
  color: #333;
  cursor: pointer;
  gap: 2px;
  font-family: inherit;
  transition:
    color 0.22s ease,
    background-color 0.22s ease;
  text-decoration: none;
}

.fc-btn:hover,
.fc-btn:focus-visible {
  color: var(--brand-600);
  background: rgba(200, 16, 46, 0.04);
  outline: none;
}

.fc-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.22s ease;
}

.fc-btn:hover .fc-icon,
.fc-btn:focus-visible .fc-icon {
  transform: scale(1.08);
}

.fc-label {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* 信息卡片：电话卡 & 二维码卡
   默认隐藏：opacity + visibility + translateX
   由 .float-contact__item:hover 触发显示 */
.fc-card {
  position: absolute;
  top: 50%;
  right: calc(100% + 14px);
  transform: translateY(-50%) translateX(8px);
  background: #fff;
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow:
    0 6px 20px rgba(0, 0, 0, 0.08),
    0 22px 48px rgba(200, 16, 46, 0.15);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s ease;
  white-space: nowrap;
}

/* 小三角指向按钮 */
.fc-card::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 12px;
  height: 12px;
  background: #fff;
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.float-contact__item:hover .fc-card,
.float-contact__item:focus-within .fc-card,
.fc-btn:hover + .fc-card,
.fc-btn:focus-visible + .fc-card,
.fc-card:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

/* 卡片头部：图标 + 标题 */
.fc-card__hd {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--brand-600);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed rgba(200, 16, 46, 0.2);
}
.fc-card__hd svg {
  width: 16px;
  height: 16px;
}

/* 电话卡 */
.fc-card--tel {
  min-width: 200px;
}
.fc-card__tel {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  letter-spacing: 0.5px;
  padding: 4px 0;
  font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
.fc-card__tel:hover {
  color: var(--brand-600);
}
.fc-card__sub {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}
.fc-card__hint {
  font-size: 11px;
  color: #aaa;
  margin-top: 10px;
  text-align: center;
}

/* 二维码卡 */
.fc-card--qr {
  padding: 14px;
}
.fc-qr {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
  border-radius: 8px;
  padding: 8px;
  overflow: hidden;
}
.fc-qr img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  border-radius: 4px;
}
.fc-card--qr .fc-card__hd {
  margin-bottom: 8px;
}
.fc-card--qr .fc-card__hint {
  margin-top: 8px;
}

/* ============================================================
 * 移动端：隐藏整个悬浮联系窗
 * 小屏空间有限，悬浮入口容易遮挡主内容
 * ============================================================ */
@media (max-width: 768px) {
  .float-contact {
    display: none !important;
  }
}

/* ============================================================
 * 回到顶部按钮 · 全站通用
 * 滚动超过两屏后由 cms.js 添加 .is-show
 * ============================================================ */
.back-top {
  position: fixed;
  right: 24px;
  bottom: 32px;
  z-index: 1000;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line-strong, rgba(20, 17, 15, 0.12));
  background: #fff;
  color: var(--ink-700, #3c3438);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(20, 17, 15, 0.12);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s,
    background 0.2s var(--ease), color 0.2s var(--ease);
}
.back-top.is-show {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.back-top:hover {
  background: var(--brand-600, #c8102e);
  border-color: var(--brand-600, #c8102e);
  color: #fff;
}
.back-top:focus-visible {
  outline: 3px solid var(--brand-100, #fbe4e8);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .back-top {
    right: 16px;
    bottom: 20px;
    width: 42px;
    height: 42px;
  }
  /* iOS Safari 对小于 16px 的输入框聚焦时会放大页面 */
  input,
  textarea,
  select {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-top {
    transition: none;
  }
}
