/* =============================================================
   道如意心理官网 · 移动端专属样式 v2
   目标：解决"没有设计感"问题 —— 强化视觉层级、卡片质感、
         字号对比、色彩对比度，加入浮动 CTA。
   仅在 <=768px 生效；不影响桌面端。
   ============================================================= */

/* 桌面端默认隐藏浮动按钮；移动端在 O 段中通过 display:flex 覆盖 */
.floating-cta { display: none; }

/* ============================================================
   A. 移动端基础重置与设计令牌覆盖
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --pad-x: 20px;
    --section-py: 36px;
    --r-sm: 14px;
    --r-md: 18px;
    --r-lg: 22px;
    --r-xl: 26px;
    --shadow-card: 0 4px 18px rgba(31, 58, 82, 0.05);
    --shadow-pop: 0 10px 32px rgba(31, 58, 82, 0.10);
    --shadow-cta: 0 10px 28px rgba(44, 95, 124, 0.32);
  }

  html { -webkit-text-size-adjust: 100%; }
  body {
    font-size: 15px;
    line-height: 1.7;
    background: #f6fafc;
  }
  .container { padding: 0 20px; }
  .section { padding: var(--section-py) 0; }
  .section--white { background: #ffffff; }
  .section--alt { background: linear-gradient(180deg, #f4f9fb 0%, #eaf3f7 100%); }
  .section--dark { background: linear-gradient(180deg, #1f3a52 0%, #15293b 100%); }
  /* 连续同背景 section 之间不要各留完整 padding，避免“两页衔接”空白过大 */
  .section--white + .section--white { padding-top: 16px; }
  .section--alt + .section--alt { padding-top: 16px; }
  .section--dark + .section--dark { padding-top: 16px; }
  /* JS 注入的 FAQ 区用内联 padding:60px 0，移动端统一收紧 */
  .section-light { padding: var(--section-py) 0 !important; }
}

/* ============================================================
   B. 顶部导航（更精致、玻璃感）
   ============================================================ */
@media (max-width: 768px) {
  .header {
    height: 56px;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(31, 58, 82, 0.06);
  }
  .header.scrolled { box-shadow: 0 2px 16px rgba(31, 58, 82, 0.06); }
  .header-inner { height: 56px; }
  .logo { gap: 8px; }
  .logo__icon { width: 30px; height: 30px; font-size: 15px; border-radius: 9px; }
  .logo__text { font-size: 17px; font-weight: 600; }
  .nav-toggle { width: 24px; }
  .nav-toggle span { height: 2px; }

  .nav.open {
    display: flex; flex-direction: column; gap: 0;
    position: fixed; top: 56px; left: 0; right: 0;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    padding: 12px 0;
    box-shadow: 0 8px 24px rgba(31, 58, 82, 0.10);
    border-bottom: 1px solid rgba(31, 58, 82, 0.06);
  }
  .nav.open a {
    padding: 13px 20px;
    font-size: 15px;
    color: var(--text);
    border-bottom: 1px solid rgba(31, 58, 82, 0.05);
  }
  .nav.open a:last-child { border-bottom: none; }
}

/* ============================================================
   C. HERO 首屏 - 重塑视觉冲击力
   ============================================================ */
@media (max-width: 768px) {
  .hero:not(.hero--v2) {
    min-height: 0;
    padding: 88px 20px 40px;
    gap: 18px;
    text-align: center;
  }
  /* 默认隐藏后台背景图，避免小屏被压垮 */
  .hero:not(.hero--v2) .hero__bg { display: none !important; }
  /* 缩小光晕避免小屏挤压 */
  .hero__glow--pink {
    width: 260px; height: 260px;
    left: -80px; top: 40px;
    opacity: 0.55;
  }
  .hero__glow--blue {
    width: 300px; height: 300px;
    right: -100px; top: 180px;
    opacity: 0.55;
  }
  .hero__glow--green {
    width: 240px; height: 240px;
    left: 50%; top: 320px; transform: translateX(-50%);
    opacity: 0.4;
  }

  .hero__eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.18em;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(122, 174, 192, 0.35);
    color: var(--primary);
    padding: 7px 16px;
    border-radius: 100px;
    margin: 0;
  }
  .hero__title {
    font-family: var(--font-serif);
    font-size: 34px;
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0;
  }
  .hero__subtitle {
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0;
    max-width: 320px;
  }

  /* 数据条 - 玻璃感三列 */
  .stats {
    width: 100%;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    padding: 16px 8px;
    margin: 8px 0 0;
    box-shadow: 0 4px 20px rgba(31, 58, 82, 0.06);
    flex-direction: row;
    gap: 0;
  }
  .stat { padding: 4px 0; }
  .stat__num {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
  }
  .stat__label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
  }
  .stats .stat + .stat { border-left: 1px solid rgba(44, 95, 124, 0.10); }

  /* 主 CTA 按钮 - 渐变 + 阴影 */
  .hero > .btn--primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    padding: 14px 40px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 100px;
    box-shadow: var(--shadow-cta);
    margin: 12px 0 0;
    letter-spacing: 0.05em;
  }
  .hero > .btn--primary:active { transform: scale(0.97); }

  /* HERO v3 移动端适配已并入 hero-v2.css 的 @media (max-width: 640px) 段 */
}

/* ============================================================
   D. 段落标题（左对齐、更精致）
   ============================================================ */
@media (max-width: 768px) {
  .sec-head {
    text-align: left;
    margin-bottom: 18px;
    padding: 0;
  }
  .sec-eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.18em;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 10px;
    background: rgba(122, 174, 192, 0.1);
    padding: 4px 12px;
    border-radius: 100px;
  }
  .sec-title {
    font-family: var(--font-serif);
    font-size: 24px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.005em;
  }
  .section--dark .sec-title { color: #fff; }
}

/* ============================================================
   E. 服务卡片 - 2x2 网格 + 渐变图标底
   ============================================================ */
@media (max-width: 768px) {
  .cards-4 {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .svc-card {
    background: #fff;
    border: 1px solid rgba(212, 230, 235, 0.6);
    border-radius: 18px;
    padding: 18px 14px;
    box-shadow: var(--shadow-card);
    gap: 10px;
    align-items: flex-start;
    text-align: left;
    transition: transform 0.2s;
  }
  .svc-card:active { transform: scale(0.98); }
  .svc-card__icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, rgba(122, 174, 192, 0.18), rgba(44, 95, 124, 0.08));
    border-radius: 12px;
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    margin: 0;
  }
  .svc-card__icon svg { width: 22px; height: 22px; }
  .svc-card__title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
  }
  .svc-card__desc {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
  }
}

/* ============================================================
   F. 优势卡 - 横向图标 + 文字
   ============================================================ */
@media (max-width: 768px) {
  .cards-why {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .feat-card {
    background: #fff;
    border: 1px solid rgba(212, 230, 235, 0.5);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
    gap: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
  }
  .feat-card--wide { grid-column: span 1; }
  .feat-card__icon {
    width: 46px; height: 46px;
    flex: 0 0 46px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    margin-right: 14px;
  }
  .feat-card__icon svg { width: 22px; height: 22px; }
  .feat-card__title {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    margin-bottom: 2px;
  }
  .feat-card__desc {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-muted);
  }
  /* 让 feat-card 内的 icon 和正文分两块 */
  .feat-card__body { flex: 1; min-width: 0; }
}

/* ============================================================
   G. 创始人 - 卡片化
   ============================================================ */
@media (max-width: 768px) {
  .founder {
    flex-direction: column;
    gap: 20px;
    background: #fff;
    border: 1px solid rgba(212, 230, 235, 0.5);
    border-radius: 22px;
    padding: 20px;
    box-shadow: var(--shadow-card);
  }
  .founder__photo {
    width: 100%;
    max-width: 100%;
    height: 200px;
    flex: none;
    border-radius: 16px;
  }
  .founder__photo::after { font-size: 80px; }
  .founder__photo span.tag {
    font-size: 11px;
    margin-bottom: 14px;
    letter-spacing: 2px;
  }
  .founder__bio { gap: 10px; }
  .founder__name { font-size: 22px; font-weight: 600; }
  .founder__role { font-size: 12px; }
  .founder__tagline {
    font-size: 13px;
    line-height: 1.7;
    color: var(--primary);
  }
  .founder__desc { font-size: 13px; line-height: 1.7; }
  .founder__cta {
    width: 100%;
    padding: 12px 0;
    text-align: center;
    margin-top: 8px;
    font-size: 14px;
  }
}

/* ============================================================
   H. 平台卡（深色区，玻璃感）
   ============================================================ */
@media (max-width: 768px) {
  .platform-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .plat-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(122, 174, 192, 0.2);
    border-radius: 20px;
    padding: 24px 20px;
    min-height: 0;
    gap: 12px;
  }
  .plat-card__icon {
    width: 40px; height: 40px;
    background: rgba(122, 174, 192, 0.15);
    border-radius: 11px;
    color: var(--accent);
    padding: 0;
    display: flex; align-items: center; justify-content: center;
  }
  .plat-card__icon svg { width: 22px; height: 22px; }
  .plat-card__name {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 500;
    color: #fff;
  }
  .plat-card__tagline { font-size: 12px; color: var(--accent); }
  .plat-card__features {
    font-size: 13px;
    line-height: 1.7;
    color: #c5d5de;
  }
  .plat-card__qr {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 14px;
    padding: 12px;
    margin-top: 8px;
  }
  .qr-box {
    width: 56px; height: 56px;
    border-radius: 10px;
  }
  .qr-box svg { width: 44px; height: 44px; }
  .plat-card__qrtext {
    font-size: 11px;
    line-height: 1.5;
    color: #a8c3d0;
  }
}

/* ============================================================
   I. 案例统计 - 2x2 网格 + 数字突出
   ============================================================ */
@media (max-width: 768px) {
  .cases-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
  }
  .case-stat {
    background: #fff;
    border: 1px solid rgba(212, 230, 235, 0.5);
    border-radius: 16px;
    padding: 16px 12px;
    box-shadow: var(--shadow-card);
    text-align: center;
  }
  .case-stat__num {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
  }
  .case-stat__label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
  }
  .cases-stats .case-stat + .case-stat { border-left: none; }

  .logo-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .logo-cell {
    height: 52px;
    font-size: 12px;
    border-radius: 12px;
  }
}

/* ============================================================
   J. 位置区 - 单列 + 卡片化信息
   ============================================================ */
@media (max-width: 768px) {
  .location-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .location-map__box {
    aspect-ratio: 16/10;
    border-radius: 16px;
  }
  .location-map__zoom {
    font-size: 12px;
    padding: 6px 12px;
  }
  .location-info {
    background: #fff;
    border: 1px solid rgba(212, 230, 235, 0.5);
    border-radius: 18px;
    padding: 20px;
    box-shadow: var(--shadow-card);
    gap: 10px;
  }
  .location-info__title {
    font-size: 16px;
    font-weight: 600;
  }
  .location-info__addr {
    font-size: 13px;
    line-height: 1.6;
  }
  .location-info__guide {
    font-size: 12px;
    line-height: 1.7;
  }
}

/* ============================================================
   K. 文章卡 - 横向滚动
   ============================================================ */
@media (max-width: 768px) {
  .cards-3 {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    margin: 0 -20px;
    padding: 4px 20px 16px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .cards-3::-webkit-scrollbar { display: none; }

  .article-card {
    flex: 0 0 80%;
    min-width: 80%;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid rgba(212, 230, 235, 0.5);
    border-radius: 18px;
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-card);
    gap: 8px;
  }
  .article-card__cat {
    display: inline-block;
    align-self: flex-start;
    font-size: 10px;
    font-weight: 500;
    color: var(--primary);
    background: rgba(122, 174, 192, 0.12);
    padding: 3px 10px;
    border-radius: 100px;
    margin: 0;
  }
  .article-card__title {
    font-family: var(--font-serif);
    font-size: 15px;
    line-height: 1.5;
    font-weight: 600;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .article-card__excerpt {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .article-card__date { font-size: 11px; color: #999; }
  .sync-badge { font-size: 10px; padding: 2px 8px; }
}

/* ============================================================
   L. 公众号区 - 卡片化
   ============================================================ */
@media (max-width: 768px) {
  .wechat-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .wc-card {
    background: #fff;
    border: 1px solid rgba(212, 230, 235, 0.5);
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: var(--shadow-card);
  }
  .wc-card--qr { text-align: center; align-items: center; }
  .wc-logo { width: 46px; height: 46px; }
  .wc-account { font-size: 18px; font-weight: 500; margin-top: 6px; }
  .wc-id { font-size: 12px; }
  .wc-qr {
    width: 124px; height: 124px;
    border-radius: 12px;
    padding: 8px;
  }
  .wc-follow {
    width: 100%;
    padding: 12px 0;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--wechat) 0%, #06ad56 100%);
  }

  .wc-card--flow { padding: 24px 20px; }
  .wc-flow-head { font-size: 17px; font-weight: 500; }
  .wc-flow {
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
  }
  .wc-arrow { transform: rotate(90deg); }
  .wc-step {
    background: linear-gradient(135deg, #f7fbfc, #eef6f9);
    border: 1px solid rgba(122, 174, 192, 0.2);
    border-radius: 14px;
    padding: 12px 14px;
    flex-direction: row;
    gap: 10px;
    justify-content: flex-start;
  }
  .wc-step__icon {
    width: 26px; height: 26px;
    flex: 0 0 26px;
  }
  .wc-step__text { font-size: 13px; }
  .wc-syncbar {
    font-size: 12px;
    padding: 10px 12px;
  }
  .wc-link { font-size: 13px; }
}

/* ============================================================
   M. 页脚 - 网格化
   ============================================================ */
@media (max-width: 768px) {
  .footer { padding: 40px 0 96px; }
  .footer__main {
    flex-direction: column;
    gap: 28px;
    margin-bottom: 28px;
  }
  .footer__brand { max-width: 100%; }
  .footer__logo { font-size: 20px; }
  .footer__tagline { font-size: 13px; line-height: 1.6; }
  .footer__nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 24px;
    flex-wrap: wrap;
  }
  .footer__col h4 {
    font-size: 13px;
    margin-bottom: 10px;
    color: #fff;
  }
  .footer__col a {
    font-size: 12px;
    line-height: 1.9;
    color: var(--text-soft);
  }
  .footer__bottom { padding-top: 20px; }
  .footer__copy { font-size: 11px; }
}

/* ============================================================
   N. 弹窗
   ============================================================ */
@media (max-width: 768px) {
  .modal { padding: 16px; }
  .modal__card {
    padding: 28px 20px;
    border-radius: 18px;
    gap: 14px;
  }
  .modal__title { font-size: 22px; font-weight: 600; }
  .modal__sub { font-size: 13px; }
  .modal__qr {
    width: 200px; height: 200px;
    padding: 12px;
    border-radius: 12px;
  }
  .modal__close { top: 8px; right: 8px; width: 32px; height: 32px; }
  .modal__hint { font-size: 13px; }
  .modal__time { font-size: 12px; }
}

/* ============================================================
   O. 浮动预约按钮（fixed 底部，圆角胶囊）
   ============================================================ */
@media (max-width: 768px) {
  .floating-cta {
    display: flex !important;
    position: fixed;
    left: 16px; right: 16px;
    bottom: 16px;
    z-index: 80;
    height: 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: #fff;
    border-radius: 100px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: var(--shadow-cta);
    border: none;
    cursor: pointer;
    letter-spacing: 0.05em;
    -webkit-tap-highlight-color: transparent;
  }
  .floating-cta:active { transform: scale(0.98); }
  .floating-cta svg { width: 18px; height: 18px; }

  /* 防止 footer 与按钮重叠：footer 多预留 80px */
  .footer { padding-bottom: 96px !important; }
}

/* ============================================================
   P. 超小屏 (iPhone SE 等 <=360px) 兜底
   ============================================================ */
@media (max-width: 360px) {
  .hero { padding: 80px 16px 32px; }
  .hero__title { font-size: 30px; }
  .sec-title { font-size: 22px; }
  .cards-4 { gap: 8px; }
  .svc-card { padding: 14px 12px; }
  .article-card { flex-basis: 84%; min-width: 84%; }
}
