/**
 * 子悦律所官网 - 移动端全面适配
 * 与已开发的桌面端完全兼容：仅在窄屏下重排布局，不影响桌面端。
 * 断点：1024 / 768 / 480
 */

/* ============ 平板（≤1024） ============ */
@media (max-width: 1024px) {
  .wrap { width: 100%; padding: 0 20px; box-sizing: border-box; }
  .topbar-inner { gap: 8px; padding: 8px 20px; }
  .topbar-left { font-size: 12px; }
  .topbar-right { gap: 14px; font-size: 12px; }
  /* 导航：汉堡菜单，深色面板（覆盖 front.css 的白色面板） */
  .menu.open {
    background: #0B1226;
    border-bottom: 1px solid rgba(212,175,55,.25);
    box-shadow: 0 18px 40px rgba(0,0,0,.5);
  }
  .menu.open .menu-link { color: rgba(255,255,255,.85); }
  .menu.open .menu-link:hover, .menu.open .menu-link.active { background: rgba(212,175,55,.12); color: #fff; }
  .menu.open .submenu { background: rgba(255,255,255,.04); }
  .menu.open .submenu-link { color: rgba(255,255,255,.78); }
  .menu.open .submenu-link:hover { background: rgba(212,175,55,.1); color: #fff; }
  .nav-cta { margin: 8px 0 0; }
  /* Hero */
  .hero { padding: 60px 0 48px; }
  .hero h1 { font-size: clamp(30px, 8vw, 46px); letter-spacing: 1px; }
  .hero-inner.hero-split { gap: 26px; }
  .hero-aside { flex: none; }
  .hero-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  /* 区块单列化 */
  .areas-grid, .team-grid, .cases-grid, .news-grid, .why-grid, .sv-grid, .promise-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ============ 手机（≤768） ============ */
@media (max-width: 768px) {
  /* 顶部信息条：隐藏地址留电话，节省空间 */
  .topbar-left { display: none; }
  .topbar-right { width: 100%; justify-content: space-between; }
  /* 导航品牌缩小 */
  .brand-logo { height: 40px; }
  .nav-inner { height: 60px; }
  .menu.open { top: 60px; }
  /* Hero：单列、紧凑 */
  .hero-inner.hero-split { flex-direction: column; align-items: flex-start; gap: 20px; }
  .hero-split .hero-aside { border-left: none; border-top: 2px solid rgba(212,175,55,.45); padding: 18px 0 0; flex: none; width: 100%; }
  .hero-aside .hero-sub { font-size: 16px; line-height: 1.9; }
  .hero-actions .btn { display: block; width: 100%; text-align: center; }
  .hero-stats { padding-top: 8px; }
  .hero-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stat { padding: 14px 6px; }
  /* 板块 */
  .section { padding: 48px 0 40px; }
  .section-head { margin-bottom: 26px; }
  .section-head h2 { font-size: 24px; }
  .section-sub { font-size: 14px; }
  .areas-grid, .team-grid, .cases-grid, .news-grid, .why-grid, .sv-grid, .promise-grid { grid-template-columns: 1fr !important; }
  .area-card, .team-card, .case-card, .news-card, .why-card { padding: 22px 18px; }
  /* CTA 表单 */
  .cta-grid { grid-template-columns: 1fr; gap: 24px; }
  .cta-left h2 { font-size: 24px; }
  .cta-form { padding: 18px; }
  .cta-form .btn-block { width: 100%; }
  /* 联系页/详情 */
  .contact-grid, .about-grid, .detail-grid, .article-wrap { grid-template-columns: 1fr; }
  /* 移动端 2 列内容卡片易在窄屏右缘溢出/裁剪 → 改单列 + 内容换行，防横向滚动 */
  .contact-items, .detail-points, .conv-grid, .form-grid, .honor-wall, .media-grid, .office-grid { grid-template-columns: 1fr !important; }
  .contact-item p, .contact-item strong, .detail-points li, .conv-card p, .sv-points li, .group-card p { word-break: break-word; }
  .contact-item, .contact-promise, .conv-card, .detail-points li, .group-card, .aside-card { min-width: 0; }
  .contact-promise span { white-space: normal; word-break: break-word; display: block; }
  /* 页脚 */
  .footer-main { flex-direction: column; align-items: center; text-align: center; gap: 24px; padding: 40px 0 30px; }
  .footer-lines { justify-items: center; }
  .footer-links { justify-content: center; flex-wrap: wrap; }
  /* 横幅 */
  .banner { padding: 40px 0 30px; }
  .banner h1 { font-size: 26px; }
  /* 子悦党建标签横滑 */
  .dj-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .dj-tab { white-space: nowrap; }
  /* 咨询浮窗全宽 */
  .chat-panel { width: calc(100vw - 24px); right: -6px; height: 72vh; }
  .chat-widget { right: 14px; bottom: 14px; }
  .chat-fab-text { display: none; }
  /* 右侧联系条隐藏（移动端用页脚与浮窗） */
  .rail { display: none; }
  .rail-pop { right: 12px; width: 200px; }
  /* 内页文章 */
  .article-body { font-size: 15px; line-height: 1.85; }
  .article-meta { flex-wrap: wrap; gap: 8px; }
  /* 落地页 */
  .cl-hero { padding: 32px 16px; }
  .cl-hero h1 { font-size: 26px; }
  .cl-points { grid-template-columns: 1fr; }
}

/* ============ 小屏手机（≤480） ============ */
@media (max-width: 480px) {
  .topbar-right { font-size: 11px; gap: 8px; }
  .topbar-phone { font-size: 12px; }
  .hero h1 { font-size: 30px; }
  .hero-eyebrow { font-size: 12px; letter-spacing: 2px; }
  .hero-stats-grid { grid-template-columns: 1fr 1fr; }
  .hero-stat-num { font-size: 26px; }
  .section-head h2 { font-size: 22px; }
  .footer-qr img { width: 120px; height: 120px; }
  .footer-lines li { font-size: 13px; }
  .footer-copy { font-size: 12px; }
  .nav-register, .nav-link { padding: 8px 10px; font-size: 13px; }
}

/* 表格在移动端可横向滚动（后台与前台通用） */
@media (max-width: 768px) {
  .tbl { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
}

/* ============ 移动端点按 / 触控优化（易用性） ============ */
/* 去除点击高亮闪烁，提升按压体验 */
* { -webkit-tap-highlight-color: transparent; }
/* 消除 300ms 延迟 / 双击缩放，点按即响应 */
a, button, [role="button"], .menu-link, .submenu-link, .area-card, .team-card,
.case-card, .news-card, .conv-card, .rail-item, .m-float-item, .chat-fab,
.chat-quick button, .quick-btn, .auth-tab, .sv-card, .group-card, .dj-tab { touch-action: manipulation; }

/* 触控目标最小高度 44px（易于点按命中） */
@media (max-width: 768px) {
  button, .btn, .nav-cta, .menu-link, .submenu-link, .chat-quick button, .quick-btn,
  .m-float-item, .area-more, .news-more, .conv-more, .auth-tab, .dj-tab,
  .sm-pdf, .filter-tag { min-height: 44px; }
  /* 点按反馈：按压轻微缩放/变色，明确触摸命中 */
  .btn:active, .btn-gold:active, .btn-outline:active, .nav-cta:active, .chat-fab:active,
  .m-float-item:active, .rail-item:active { transform: scale(.95); filter: brightness(.96); }
  .menu-link:active, .submenu-link:active, .area-card:active, .team-card:active,
  .case-card:active, .news-card:active, .conv-card:active, .sv-card:active,
  .group-card:active, .dj-tab:active { transform: translateY(1px); }
  /* 表单输入字号 ≥16px：避免 iOS 聚焦自动缩放 */
  input, textarea, select { font-size: 16px; }
  /* 内边距适触 */
  .menu-link, .submenu-link, .nav-link, .nav-register { padding: 12px 14px; }
}

/* 安全区适配（刘海 / 底部 Home 条） */
@supports (padding: env(safe-area-inset-bottom)) {
  .chat-widget { bottom: calc(14px + env(safe-area-inset-bottom)); right: calc(14px + env(safe-area-inset-right)); }
  .chat-panel { max-height: calc(80vh - env(safe-area-inset-bottom)); }
  .m-floatbar { padding-bottom: env(safe-area-inset-bottom); }
  .footer { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
}
