/* ===================================================================
   base.css — 百智荟 全站基础样式
   包含：设计变量 / 重置 / 通用容器 / 按钮 / 顶部导航 / 页脚 / 工具类
   =================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  /* 主色：深墨绿（品牌字色） */
  --c-ink:        #12312A;
  --c-ink-soft:   #2C4A42;
  --c-ink-mute:   #5E7770;

  /* 强调色：青绿 */
  --c-accent:     #12A594;
  --c-accent-dk:  #0E8577;
  --c-accent-lt:  #E6F6F3;

  /* 浅色调背景 */
  --c-bg:         #FFFFFF;
  --c-bg-alt:     #F6FAF9;   /* 浅青灰 */
  --c-bg-tint:    #EDF4F3;

  /* 线与描边 */
  --c-line:       #E3EBE9;
  --c-line-soft:  #EEF4F3;

  /* 文字 */
  --c-text:       #2B3A36;
  --c-text-mute:  #6E827D;

  /* 尺寸 */
  --header-h:     72px;
  --radius:       14px;
  --radius-sm:    10px;
  --radius-lg:    20px;

  /* 阴影 */
  --sh-sm: 0 1px 2px rgba(18,49,42,.05), 0 2px 8px rgba(18,49,42,.04);
  --sh-md: 0 4px 12px rgba(18,49,42,.06), 0 12px 32px rgba(18,49,42,.07);
  --sh-lg: 0 10px 40px rgba(18,49,42,.10);

  /* 布局 */
  --container: 1680px;
  --gap: 28px;

  /* 过渡 */
  --tr: .28s cubic-bezier(.4,0,.2,1);

  /* 字体 */
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
          "Helvetica Neue", Arial, sans-serif;
}

/* ---------- 2. 重置 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--c-text);
  background: var(--c-bg);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 700; line-height: 1.28; color: var(--c-ink); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color var(--tr); }
button { font-family: inherit; border: 0; background: none; cursor: pointer; }
svg { display: block; }

::selection { background: var(--c-accent); color: #fff; }

/* ---------- 3. 容器 ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* 大屏：进一步放宽版心，让内容更贴近屏幕边缘 */
@media (min-width: 1760px) {
  :root { --container: 1760px; }
}
@media (min-width: 2000px) {
  :root { --container: 1880px; }
}

/* ---------- 4. 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  padding: 0 30px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
  transition: all var(--tr);
  cursor: pointer;
}
.btn-primary {
  background: var(--c-accent);
  color: #fff;
  box-shadow: 0 6px 18px rgba(18,165,148,.28);
}
.btn-primary:hover {
  background: var(--c-accent-dk);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(18,165,148,.36);
}
.btn-outline {
  border: 1.5px solid var(--c-line);
  color: var(--c-ink);
  background: #fff;
}
.btn-outline:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  transform: translateY(-2px);
}
.btn-ghost {
  border: 1.5px solid rgba(255,255,255,.5);
  color: #fff;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
}
.btn-ghost:hover {
  border-color: #fff;
  background: rgba(255,255,255,.18);
  transform: translateY(-2px);
}
.btn-ghost-light {
  border: 1.5px solid rgba(255,255,255,.45);
  color: #fff;
}
.btn-ghost-light:hover { background: rgba(255,255,255,.16); transform: translateY(-2px); }

/* ===================================================================
   5. 顶部导航栏
   =================================================================== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(255,255,255,.82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: background var(--tr), border-color var(--tr), box-shadow var(--tr);
}
.site-header.is-scrolled {
  background: rgba(255,255,255,.95);
  border-bottom-color: var(--c-line);
  box-shadow: 0 1px 14px rgba(18,49,42,.06);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo-mark {
  display: block;
  width: auto;
  height: 34px;          /* BZ 组合标，宽度按 535:300 自适应 */
  flex-shrink: 0;
}
.logo-text {
  display: flex;
  flex-direction: column;
  font-size: 19px;
  font-weight: 800;
  color: var(--c-ink);
  letter-spacing: 1px;
  line-height: 1.05;
}
.logo-text em {
  font-style: normal;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2.4px;
  color: var(--c-accent);
  opacity: .85;
}

/* 主导航 */
.main-nav { margin-left: auto; }
.nav-list {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  position: relative;
  display: block;
  padding: 8px 14px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--c-ink);
  letter-spacing: .2px;
  white-space: nowrap;
  transition: color var(--tr);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--c-accent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform var(--tr);
}
.nav-link:hover { color: var(--c-accent); }
.nav-link:hover::after { transform: scaleX(.5); }
.nav-link.is-active { color: var(--c-accent); }
.nav-link.is-active::after { transform: scaleX(1); }

/* ---------- 二级下拉菜单（通用：面板内的排版与链接） ---------- */
.nav-item { position: relative; }
.nav-list > .nav-item > .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nav-caret {
  width: 11px; height: 11px;
  flex-shrink: 0;
  opacity: .55;
  transition: transform var(--tr), opacity var(--tr);
}
.nav-sub {
  z-index: 60;
  padding: 10px;
  background: #fff;
  border: 1px solid var(--c-line);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(18,49,42,.15);
}
.nav-sub-inner { display: grid; gap: 2px; }
.nav-sub-link {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--c-text);
  white-space: nowrap;
  transition: background var(--tr), color var(--tr);
}
.nav-sub-link:hover {
  background: var(--c-accent-lt);
  color: var(--c-accent-dk);
}

/* ---- 桌面端：hover / 键盘聚焦 展开 ---- */
@media (min-width: 901px) {
  .nav-sub {
    position: absolute;
    top: calc(100% + 20px);   /* 落到页头下沿之外 */
    left: 50%;
    min-width: 176px;
    --tx: -50%;
    transform: translateX(var(--tx)) translateY(-8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
  }
  /* 不可见的悬停桥：鼠标从一级项移到面板的过程中不中断 hover */
  .nav-sub::before {
    content: "";
    position: absolute;
    left: 0; right: 0; top: -24px;
    height: 24px;
  }

  /* 靠右的栏目改成右对齐面板，避免顶出视口 */
  .nav-item--end .nav-sub { left: auto; right: 0; --tx: 0; }
  .nav-sub--2 { min-width: 336px; }
  .nav-sub--2 .nav-sub-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .nav-item.has-sub:hover > .nav-sub,
  .nav-item.has-sub:focus-within > .nav-sub,
  .nav-item.has-sub.is-open > .nav-sub {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(var(--tx)) translateY(0);
  }
  .nav-item.has-sub:hover > .nav-link > .nav-caret,
  .nav-item.has-sub.is-open > .nav-link > .nav-caret { transform: rotate(180deg); opacity: 1; }
  .nav-item.has-sub:hover > .nav-link,
  .nav-item.has-sub.is-open > .nav-link { color: var(--c-accent); }

  /* 悬停整行时保持高亮 */
  .nav-item.has-sub { display: block; }
}

/* 头部落户按钮 */
.header-cta {
  flex-shrink: 0;
  height: 40px;
  padding: 0 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--c-accent);
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  transition: all var(--tr);
}
.header-cta:hover {
  background: var(--c-accent-dk);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(18,165,148,.3);
}
/* 当前页就是「免费预约」时的按钮激活态 */
.header-cta.is-current,
.header-cta.is-current:hover {
  background: var(--c-accent-dk);
  box-shadow: 0 0 0 4px rgba(18,165,148,.15);
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  width: 42px; height: 42px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 10px;
  transition: background var(--tr);
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  border-radius: 2px;
  background: var(--c-ink);
  transition: transform var(--tr), opacity var(--tr);
}
.nav-toggle:hover { background: var(--c-accent-lt); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===================================================================
   6. 页脚
   =================================================================== */
.site-footer {
  background: var(--c-ink);
  color: rgba(255,255,255,.72);
  padding: 68px 0 0;
  font-size: 14.5px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 56px;
  padding-bottom: 52px;
}
.logo-footer .logo-text { color: #fff; }
.logo-footer .logo-text em { color: var(--c-accent); opacity: 1; }
.footer-slogan {
  margin-top: 20px;
  max-width: 300px;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255,255,255,.55);
}

/* 关注我们：圆形图标，hover / 聚焦弹出二维码 */
.footer-social { margin-top: 30px; }
.footer-social-row { display: flex; gap: 14px; }
.footer-social-item { position: relative; outline: none; }
.footer-social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 50%;
  color: rgba(255,255,255,.85);
  cursor: pointer;
  transition: border-color .2s ease, color .2s ease;
}
.footer-social-btn svg { width: 22px; height: 22px; display: block; }
.footer-social-item:hover .footer-social-btn,
.footer-social-item:focus-visible .footer-social-btn {
  border-color: var(--c-accent);
  color: var(--c-accent);
}
.footer-qr-pop {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: 148px;
  padding: 12px 12px 10px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(0,0,0,.28);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 30;
  text-align: center;
}
.footer-qr-pop::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #fff;
}
.footer-qr-pop img { width: 100%; height: auto; display: block; border-radius: 6px; }
.footer-qr-pop span { display: block; margin-top: 8px; font-size: 12px; color: var(--c-ink); }
.footer-social-item:hover .footer-qr-pop,
.footer-social-item:focus-visible .footer-qr-pop {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
.footer-col h4 {
  margin-bottom: 18px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .5px;
}
.footer-col li { margin-bottom: 11px; }
.footer-col a:hover { color: var(--c-accent); }
.footer-col span { color: rgba(255,255,255,.6); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 13.5px;
  color: rgba(255,255,255,.45);
}
.footer-links { display: flex; align-items: center; gap: 10px; }
.footer-links a:hover { color: var(--c-accent); }

/* ===================================================================
   7. 回到顶部
   =================================================================== */
.back-top {
  position: fixed;
  right: 26px; bottom: 26px;
  z-index: 900;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--c-accent);
  border: 1px solid var(--c-line);
  box-shadow: var(--sh-md);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all var(--tr);
}
.back-top svg { width: 20px; height: 20px; }
.back-top.is-show { opacity: 1; visibility: visible; transform: translateY(0); }
.back-top:hover {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
  transform: translateY(-3px);
}

/* ===================================================================
   8. 通用工具类
   =================================================================== */
.section { padding: 100px 0; }
.section-head { text-align: center; margin-bottom: 56px; }
.section-title {
  font-size: 38px;
  letter-spacing: -.5px;
}
.section-title::after {
  content: "";
  display: block;
  width: 40px; height: 3px;
  margin: 18px auto 0;
  border-radius: 3px;
  background: var(--c-accent);
}
.section-desc {
  margin-top: 18px;
  font-size: 16.5px;
  color: var(--c-text-mute);
}

/* ===================================================================
   通用全屏 Banner（about / agents / consult / consulting / marketing / site 共用）
   - 桌面端：min-height 100vh，再用 100svh 覆盖 —— svh 取「地址栏展开时的最小视口」，
     移动端地址栏收起/展开时高度不会跳动，也不会露白边
   - 照片与文字分层：<img class="page-hero-img"> 只负责照片
     （object-fit: cover 裁切 + 各页自己的 --focus 定焦点），
     原来的 .page-hero-bg 只当容器和兜底底色；蒙版渐变仍在 .page-hero-mask
   - 移动端（≤768px）不再全屏：高度压到 min(480px, 92svh)，见章节末尾；
     ≤520px 时 HTML 里的 <source media> 会换用同一素材的竖版裁切 1080×1620
     （生成脚本见 tools/fetch_page_hero_portrait.py），避免横图被裁得只剩一条
   - 偏移：顶部 padding 含 --header-h，固定页头不会压住内容；底部含安全区
   =================================================================== */
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 100vh;
  min-height: 100svh;
  background: #EFF5F4;                 /* 图片载入前的兜底底色 */
  padding: calc(var(--header-h) + 40px) 0
           calc(40px + env(safe-area-inset-bottom, 0px));
}

.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-color: #EFF5F4;           /* 照片载入前的兜底 */
}

/* 照片层：铺满裁切，焦点用各页自己的 --focus 微调，保证主体不被裁掉 */
.page-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focus, 50% 50%);
}

.page-hero-mask { position: absolute; inset: 0; z-index: 1; }

.page-hero-inner { position: relative; z-index: 3; width: 100%; }

/* 窄屏：页头变矮，内边距相应收紧 */
@media (max-width: 900px) {
  .page-hero {
    padding: calc(var(--header-h) + 28px) 0
             calc(28px + env(safe-area-inset-bottom, 0px));
  }
}

/* 移动端 hero 不全屏（与首页 banner 同一套策略，桌面端视觉不变）：
   高度由文案撑出、压到 480px 下限；照片层是 absolute，高度变化不引起布局跳动 */
@media (max-width: 768px) {
  .page-hero { min-height: min(480px, 92svh); }
}

/* 滚动入场动画 */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.4,0,.2,1);
}
.reveal.is-in { opacity: 1; transform: none; }

/* ===================================================================
   9. 响应式
   =================================================================== */
@media (max-width: 1080px) {
  .nav-link { padding: 8px 10px; font-size: 14.5px; }
  .logo-text { font-size: 17px; }
  .logo-mark { height: 30px; }
}

@media (max-width: 900px) {
  :root { --header-h: 66px; }
  .logo-mark { height: 28px; }

  .header-cta { display: none; }
  .nav-toggle { display: flex; margin-left: auto; }

  /* 移动端抽屉菜单 */
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    max-height: 0;
    overflow: hidden;
    background: #fff;
    border-bottom: 1px solid transparent;
    box-shadow: 0 12px 30px rgba(18,49,42,0);
    transition: max-height .38s cubic-bezier(.4,0,.2,1),
                box-shadow .3s, border-color .3s;
  }
  .main-nav.is-open {
    max-height: 70vh;
    overflow-y: auto;
    border-bottom-color: var(--c-line);
    box-shadow: 0 18px 40px rgba(18,49,42,.12);
  }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 24px 22px;
  }
  .nav-link {
    padding: 15px 4px;
    font-size: 16px;
    border-bottom: 1px solid var(--c-line-soft);
  }
  .nav-link::after { left: 4px; right: auto; width: 24px; bottom: -1px; }
  .nav-link.is-active::after { transform: scaleX(1); }

  /* ---- 移动端：一级项改手风琴原地展开子菜单 ---- */
  .nav-list > .nav-item > .nav-link { display: flex; }
  .nav-item { position: static; }
  .nav-caret { margin-left: auto; width: 12px; height: 12px; opacity: .5; }
  .nav-item.has-sub.is-open > .nav-link > .nav-caret { transform: rotate(180deg); opacity: 1; }
  .nav-item.has-sub.is-open > .nav-link { color: var(--c-accent); }

  .nav-sub {
    position: static;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height .32s cubic-bezier(.4,0,.2,1);
  }
  .nav-sub--2 { min-width: 0; }
  .nav-item.has-sub.is-open > .nav-sub { max-height: 660px; }
  .nav-sub-inner { gap: 0; padding: 4px 0 10px 14px; }
  .nav-sub--2 .nav-sub-inner { grid-template-columns: 1fr; }
  .nav-sub-link {
    padding: 11px 10px;
    font-size: 15px;
    border-left: 2px solid var(--c-line);
    border-radius: 0 8px 8px 0;
  }
  .nav-sub-link:hover { background: var(--c-accent-lt); }

  .section { padding: 76px 0; }
  .section-title { font-size: 30px; }
  .section-head { margin-bottom: 40px; }

  .footer-top { grid-template-columns: 1fr; gap: 40px; padding-bottom: 40px; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; padding: 22px 24px; }
  .back-top { right: 18px; bottom: 18px; width: 42px; height: 42px; }
}

@media (max-width: 520px) {
  .container { padding: 0 18px; }
  .section { padding: 60px 0; }
  .section-title { font-size: 26px; }
  .section-desc { font-size: 15px; }
  .footer-cols { grid-template-columns: 1fr; gap: 28px; }
  .btn { height: 46px; padding: 0 24px; font-size: 14.5px; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
