/**
 * mobile.css - 复瑞物业官网移动端适配（V4 视觉升级版）
 * 仅在 0~768px 加载（media 限定），桌面端完全不受影响
 * 改进：留白系统 / Hero居中+遮罩 / 卡片质感 / 全屏抽屉菜单 / 悬浮拨号 / 响应式细节
 */

/* ====== 768px 以下（平板 / 大手机）====== */
@media (max-width: 768px) {

  /* ---- 全局 ---- */
  body { font-size: 14px; }

  /* ---- 统一留白系统 ---- */
  .container { padding-left: 16px !important; padding-right: 16px !important; }
  .section { padding: 48px 0 !important; }
  .section-title { font-size: 24px !important; }
  .section-desc { font-size: 14px !important; }
  .section-header { margin-bottom: 28px !important; }

  /* ---- 眉标（中英标题区）---- */
  .section-eyebrow { font-size: 11px !important; letter-spacing: .14em; }
  .section-eyebrow .bar { width: 18px !important; }
  .section-head.center .section-eyebrow .bar { margin: 0 6px 0 0 !important; }

  /* ---- Header 移动端：隐藏顶部橙色栏，只留 logo+汉堡 ---- */
  .header-top { display: none !important; }
  .header-phone { display: none !important; }
  .header-bottom .container { height: 56px; }

  /* ===== 导航：右侧全屏抽屉（移动端）===== */
  .nav {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    top: 56px;
    right: 0;
    width: min(82vw, 340px);
    height: calc(100dvh - 56px);
    background: #fff;
    padding: 24px 16px 32px;
    border-radius: 16px 0 0 16px;
    box-shadow: -8px 0 32px rgba(15,23,42,.18);
    transform: translateX(105%);
    transition: transform .35s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 1000;
  }
  .nav.mobile-open { transform: translateX(0); }

  /* 抽屉顶部品牌区 */
  .nav::before {
    content: '复瑞物业';
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: 3px;
    padding: 4px 4px 16px;
    margin-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
  }

  .nav-link {
    padding: 15px 16px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 12px;
    color: var(--text) !important;
    display: flex !important;
    align-items: center;
    border-bottom: none !important;
    transition: background .2s, color .2s, padding-left .2s;
  }
  .nav-link::after {
    content: '\f105';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    margin-left: auto;
    color: #d1d5db;
    font-size: 14px;
  }
  .nav-link:hover,
  .nav-link.active { background: #fff7ed !important; color: var(--primary) !important; padding-left: 20px !important; }
  .nav-link.active::after { color: #f97316; }

  /* 抽屉打开时锁定背景滚动 + 全屏遮罩 */
  body.nav-lock { overflow: hidden; }
  body.nav-lock::before {
    content: '';
    position: fixed;
    top: 56px; left: 0; right: 0; bottom: 0;
    background: rgba(15,23,42,.45);
    z-index: 999;
    animation: nav-fade .3s ease;
  }
  @keyframes nav-fade { from { opacity: 0; } to { opacity: 1; } }

  /* 汉堡按钮 */
  .mobile-toggle {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: rgba(249, 115, 22, 0.12);
    border: none;
    cursor: pointer;
    border-radius: 10px;
    z-index: 1001;
    transition: background 0.2s;
  }
  .mobile-toggle:active { background: rgba(249, 115, 22, 0.25); }
  .mobile-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #f97316 !important;
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
  }
  .mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-toggle.active span:nth-child(2) { opacity: 0; }
  .mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* ---- 悬浮一键拨号按钮 ---- */
  .float-phone {
    position: fixed;
    right: 16px;
    bottom: max(24px, env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: #fff !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(249,115,22,.4);
    z-index: 998;
    animation: phone-pulse 2.2s infinite;
  }
  .float-phone i { color: #fff !important; }
  .float-phone:active { transform: scale(.94); }
  @keyframes phone-pulse {
    0%   { box-shadow: 0 8px 24px rgba(249,115,22,.4); }
    50%  { box-shadow: 0 8px 32px rgba(249,115,22,.68); }
    100% { box-shadow: 0 8px 24px rgba(249,115,22,.4); }
  }
  /* 回到顶部上移，避免与拨号按钮重叠 */
  .back-to-top { bottom: max(84px, calc(env(safe-area-inset-bottom) + 60px)) !important; right: 16px !important; width: 44px; height: 44px; }

  /* ---- Hero 移动端：居中 + 深色遮罩 + 避开顶部固定栏 ---- */
  .hero { min-height: 480px !important; height: 65vh !important; }
  .hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 76px !important;
    padding-bottom: 48px;
  }
  .hero-eyebrow { font-size: 12px !important; letter-spacing: .2em; }
  .hero-title { font-size: 30px !important; }
  .hero-desc { font-size: 14px !important; max-width: 100% !important; opacity: .92; }
  .hero-overlay {
    background: linear-gradient(to top, rgba(15,23,42,.68), rgba(15,23,42,.28)) !important;
  }
  .hero-actions { flex-direction: column; align-items: stretch; gap: 12px; width: 100%; }
  .hero-btn { width: 100%; justify-content: center; padding: 14px 20px; font-size: 15px; border-radius: 12px; min-height: 48px; }
  .hero-arrows { display: none !important; }
  .hero-dots { bottom: 16px; }
  .hero-dot { width: 20px; height: 3px; }
  .hero-dot.active { width: 28px; }

  /* ---- 卡片质感升级 ---- */
  .biz-card, .news-card, .value-card, .csr-card, .position-card,
  .investor-card, .contact-info-card, .contact-form-card {
    border-radius: 16px !important;
    box-shadow: 0 2px 14px rgba(15,23,42,.06) !important;
  }
  .biz-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .biz-card-body { padding: 20px !important; }
  .biz-card-title { font-size: 17px !important; }
  .biz-card-desc { font-size: 13px !important; -webkit-line-clamp: 3; }
  .biz-card-link { font-size: 13px !important; margin-top: 14px !important; }
  .biz-card:hover { transform: none !important; box-shadow: 0 2px 14px rgba(15,23,42,.06) !important; border-color: var(--border) !important; }

  /* ---- 图片统一比例 16:9 ---- */
  .biz-card-img, .news-card-img { aspect-ratio: 16/9; height: auto !important; }
  .biz-card-img img, .news-card-img img { width: 100%; height: 100%; object-fit: cover; }

  /* ---- 新闻卡片 ---- */
  .news-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .news-card-body { padding: 18px !important; }
  .news-card-title { font-size: 15px !important; -webkit-line-clamp: 2; }
  .news-card-summary { font-size: 12px !important; -webkit-line-clamp: 2; }
  .news-card:hover { transform: none !important; box-shadow: 0 2px 14px rgba(15,23,42,.06) !important; }
  .news-card:hover .news-card-title { color: var(--text) !important; }
  .news-card:hover .news-card-img img { transform: none !important; }

  /* ---- 新闻列表：橙色日期块 ---- */
  .news-list-item { padding: 16px !important; flex-direction: column; gap: 10px; }
  .news-list-date {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    background: rgba(249,115,22,.1);
    color: #f97316 !important;
    font-weight: 600;
    font-size: 12px !important;
    padding: 4px 10px;
    border-radius: 8px;
    margin-bottom: 2px;
  }
  .news-list-title { font-size: 15px !important; }
  .news-list-summary { font-size: 12px !important; }
  .news-filter { gap: 6px !important; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .filter-btn { padding: 6px 14px !important; font-size: 13px !important; white-space: nowrap; }

  /* ---- 数据统计 ---- */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .stat-num { font-size: 26px !important; }
  .stat-label { font-size: 12px !important; }
  .stat-card { padding: 20px 16px !important; }

  /* ---- 合作伙伴 ---- */
  .partners-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 12px !important; }
  .partner-item { height: 60px !important; border-radius: 8px; }
  .partner-item img { max-height: 44px !important; }

  /* ---- 关于我们 ---- */
  .about-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .about-img img { height: 240px !important; }
  .culture-cards-grid { grid-template-columns: 1fr !important; gap: 16px !important; }

  /* ---- 价值观 ---- */
  .values-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .value-card { padding: 28px 20px !important; }
  .value-title { font-size: 17px !important; }

  /* ---- 投资者关系 ---- */
  .investor-grid { grid-template-columns: 1fr !important; }
  .investor-card { padding: 20px !important; }

  /* ---- 业务详情 ---- */
  .detail-layout { grid-template-columns: 1fr !important; gap: 24px !important; }
  .detail-title { font-size: 24px !important; }
  .detail-content { font-size: 14px !important; line-height: 1.9 !important; }

  /* ---- 招聘页面 ---- */
  .position-card { padding: 20px !important; flex-direction: column !important; gap: 14px; }
  .position-card .btn { width: 100% !important; justify-content: center; min-height: 44px; }

  /* ---- 联系页面 ---- */
  .contact-layout { grid-template-columns: 1fr !important; }
  .contact-info-card, .contact-form-card { padding: 20px !important; border-radius: 12px; }
  .contact-info-item { padding: 12px 0 !important; }
  .form-row, .form-row-2 { grid-template-columns: 1fr !important; }

  /* ---- CSR 页面 ---- */
  .csr-grid { grid-template-columns: 1fr !important; }
  .csr-card { padding: 24px !important; }

  /* ---- 表单（触控优化 + 橙色聚焦）---- */
  .form-group input,
  .form-group textarea,
  .form-group select,
  .form-group-new input,
  .form-group-new textarea {
    font-size: 16px !important;
    padding: 12px 14px !important;
    min-height: 48px;
    border-radius: 10px;
    transition: border-color .2s, box-shadow .2s;
  }
  .form-group input:focus,
  .form-group textarea:focus,
  .form-group select:focus,
  .form-group-new input:focus,
  .form-group-new textarea:focus {
    border-color: #f97316 !important;
    box-shadow: 0 0 0 3px rgba(249,115,22,.15) !important;
    outline: none;
  }
  .btn-submit, .btn-submit-new { min-height: 48px !important; padding: 14px 20px !important; font-size: 16px !important; border-radius: 10px; }
  .btn, .btn-primary, .btn-outline { min-height: 44px; padding: 10px 20px; border-radius: 10px; font-size: 15px; }

  /* ---- 分页 ---- */
  .pagination { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .pagination a, .pagination span { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

  /* ===== Footer 移动端：左品牌 / 右联系方式，版权居中 ===== */
  .footer-row {
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    text-align: left !important;
    gap: 24px;
  }
  .footer-divider { display: none !important; }

  .footer-brand-item { flex: 1 1 38%; min-width: 0; }
  .footer-slogan { font-size: 12px !important; margin-top: 8px; text-align: left; }

  .footer-contact-stack {
    flex: 1 1 55%;
    min-width: 0;
    align-items: flex-start;
    gap: 6px;
  }
  .footer-contact-inline { font-size: 12px !important; justify-content: flex-start; text-align: left; }
  /* 联系方式图标品牌橙点缀 */
  .footer-contact-inline i { color: #f97316 !important; }

  .footer-legal {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-align: center;
    font-size: 11px;
    margin-top: 20px;
  }

  .footer { padding-bottom: max(20px, env(safe-area-inset-bottom)) !important; }

  /* ---- 页头 banner（避开 96px 固定导航）---- */
  .page-banner { min-height: 200px !important; padding: 88px 0 48px !important; }
  .page-banner h1 { font-size: 26px !important; }
  .page-banner p { font-size: 14px !important; }

  /* ---- CTA ---- */
  .cta-section { padding: 48px 0 !important; }
  .cta-section h2 { font-size: 22px !important; }
  .cta-section p { font-size: 14px !important; }

  /* ---- 图片溢出保护 ---- */
  img { max-width: 100%; height: auto; }

  /* ---- 平滑滚动 ---- */
  html { scroll-behavior: smooth; }

  /* ===== 横向滑动卡片（节省移动端垂直空间，内容滑动浏览）===== */
  .biz-grid, .news-grid, .values-grid, .honor-grid, .csr-grid, .investor-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory !important;
    gap: 14px !important;
    margin: 0 -16px !important;
    padding: 2px 16px 16px !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .biz-grid::-webkit-scrollbar,
  .news-grid::-webkit-scrollbar,
  .values-grid::-webkit-scrollbar,
  .honor-grid::-webkit-scrollbar,
  .csr-grid::-webkit-scrollbar,
  .investor-grid::-webkit-scrollbar { display: none; }

  /* 每张卡片 78vw：露出下一张边缘，提示可左右滑动 */
  .biz-grid > *,
  .news-grid > *,
  .values-grid > *,
  .honor-grid > *,
  .csr-grid > *,
  .investor-grid > * {
    flex: 0 0 78vw !important;
    max-width: 330px !important;
    scroll-snap-align: center !important;
    margin: 0 !important;
  }
  /* 职位卡片内部保持紧凑 */
  .position-list .card { border-radius: 16px !important; }

  /* ===== 方案B：卡片紧凑网格 + 点击弹出 Bottom Sheet ===== */
  body.sheet-open { overflow: hidden; }

  /* body 入场动画去掉 transform（保留淡入），避免 body 成为 fixed 包含块导致 Sheet/抽屉/悬浮按钮定位失效 */
  body.page-enter { animation: pageFadeIn .5s ease !important; }
  @keyframes pageFadeIn { from { opacity: 0; } to { opacity: 1; } }

  /* [补丁 v2 2026-09-09] 业务卡/责任卡从 3 列调整为 2 列：
     375px 视口下 3 列每卡仅约 102px，标题与描述严重挤压；
     2 列每卡约 166px，配合字号提升后可读性达标。
     荣誉徽章/职位列表为短文本胶囊，维持 3 列不变。 */
  .biz-grid, .values-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }
  .honor-grid, .position-list {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    scroll-snap-type: none !important;
  }
  .biz-grid > *, .values-grid > *, .honor-grid > *, .position-list > * {
    flex: none !important;
    max-width: none !important;
    scroll-snap-align: none !important;
  }
  .biz-card, .value-card, .honor-card { padding: 12px 10px !important; }
  .biz-card-body { padding: 10px 0 0 !important; }
  .biz-card-img { aspect-ratio: 1.5/1 !important; border-radius: 10px !important; }
  .biz-card-title, .value-card h3, .honor-card h3 { font-size: 14px !important; margin-bottom: 6px; }
  .biz-card-desc, .value-card p, .honor-card p {
    font-size: 12px !important; line-height: 1.65 !important;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  }
  .biz-card-link { display: none !important; }
  .value-label { display: none !important; }
  .value-card .value-icon, .honor-card .honor-icon { width: 34px !important; height: 34px !important; }
  .honor-tag { font-size: 10px !important; padding: 2px 8px !important; }

  /* 在招职位：3列网格 + 点击弹 Sheet（覆盖卡片内联 flex 样式） */
  .position-list .card {
    display: block !important;
    margin: 0 !important;
    padding: 12px 10px !important;
    border-radius: 12px !important;
    box-shadow: 0 2px 14px rgba(15,23,42,.06) !important;
  }
  .position-list .card h3 {
    font-size: 13px !important; font-weight: 700; margin: 0 !important;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .position-list .card div[style] {
    flex-wrap: wrap !important; gap: 2px 6px !important; margin-top: 5px !important;
    font-size: 10px !important; color: #666 !important; line-height: 1.4;
  }
  .position-list .card .btn { display: none !important; }

  /* 联系我们页：移动端隐藏联系方式（底部导航已展示），仅保留在线留言 */
  .contact-info-wrap { display: none !important; }

  /* Bottom Sheet */
  .sheet-mask {
    position: fixed; inset: 0; background: rgba(15,23,42,.5);
    opacity: 0; visibility: hidden;
    transition: opacity .3s ease, visibility .3s;
    z-index: 1001;
  }
  .sheet-mask.show { opacity: 1; visibility: visible; }
  .sheet-panel {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff; border-radius: 20px 20px 0 0;
    padding: 8px 20px 28px;
    transform: translateY(100%);
    visibility: hidden;
    transition: transform .35s cubic-bezier(.32,.72,.28,1), visibility .35s;
    z-index: 1002; max-height: 74vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sheet-panel.show { transform: translateY(0); visibility: visible; }
  .sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: #e5e7eb; margin: 4px auto 14px; }
  .sheet-head { display: flex; align-items: center; gap: 12px; }
  .sheet-icon {
    width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(249,115,22,.12); color: #f97316; font-size: 20px;
  }
  .sheet-head-text { flex: 1; min-width: 0; }
  .sheet-head-text h3 { font-size: 17px; font-weight: 800; color: #1a1a2e; }
  .sheet-tag {
    display: inline-block; margin-top: 5px; font-size: 11px; font-weight: 600;
    background: rgba(249,115,22,.1); color: #f97316; padding: 2px 10px; border-radius: 20px;
  }
  .sheet-close {
    width: 32px; height: 32px; border-radius: 50%; border: none; background: #f3f4f6;
    color: #6b7280; font-size: 15px; cursor: pointer; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
  }
  .sheet-body { margin-top: 14px; font-size: 14px; line-height: 1.9; color: #4b5563; }
  .sheet-btn {
    display: block; width: 100%; margin-top: 20px; padding: 13px;
    background: #f97316; color: #fff; border-radius: 14px;
    font-size: 15px; font-weight: 700; text-align: center; text-decoration: none;
  }
  .sheet-btn:active { transform: scale(.98); }
}


/* ====== 480px 以下（小型手机）====== */
@media (max-width: 480px) {

  body { font-size: 13px; }

  .section { padding: 40px 0 !important; }
  .section-title { font-size: 20px !important; }
  .section-header { margin-bottom: 24px !important; }

  .hero { min-height: 400px !important; height: 60vh !important; }
  .hero-title { font-size: 27px !important; }
  .hero-inner { padding-top: 72px !important; padding-bottom: 40px; }

  /* 抽屉顶部跟随（56px header-bottom）*/
  .nav { top: 56px; height: calc(100dvh - 56px); }
  body.nav-lock::before { top: 56px; }

  .biz-card-body { padding: 16px !important; }
  .news-card-body { padding: 14px !important; }
  .value-card { padding: 20px 16px !important; }  .partners-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stats-grid { gap: 10px !important; }
  .stat-num { font-size: 24px !important; }
  .partner-item { height: 52px !important; }

  .cta-section { padding: 40px 0 !important; }
  .cta-section h2 { font-size: 20px !important; }

  .about-img img { height: 200px !important; }

  .logo-text-img { height: 20px !important; }
  .logo-icon { width: 28px !important; height: 28px !important; }

  /* 480px 以下 footer 更紧凑 */
  .footer-row { gap: 16px; }
  .footer-brand-item .logo-text { font-size: 12px !important; }
  .footer-contact-inline { font-size: 11px !important; }
  .footer-slogan { font-size: 11px !important; }
  .footer-legal { flex-direction: column; gap: 4px; font-size: 10px; }

  .float-phone { width: 48px; height: 48px; font-size: 18px; }
}


/* ====== 480px 以下（小型手机）====== */
@media (max-width: 480px) {
  /* 覆盖 480 块旧 padding，保持方案B紧凑网格 */
  .biz-card-body { padding: 10px 0 0 !important; }
  .value-card { padding: 12px 10px !important; }
  .biz-card { padding: 10px 8px !important; }
  .honor-card { padding: 12px 10px !important; }
  .biz-card-title, .value-card h3, .honor-card h3 { font-size: 13px !important; }
  .sheet-panel { padding: 8px 16px 24px; }
}


/* ====== iPhone 安全区域（刘海屏）====== */
@supports (padding: max(0px)) {
  .header { padding-top: max(0px, env(safe-area-inset-top)); }
  .footer { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .back-to-top { bottom: max(84px, calc(env(safe-area-inset-bottom) + 60px)); }
  .nav.mobile-open {
    padding-top: max(24px, env(safe-area-inset-top));
    padding-bottom: max(32px, env(safe-area-inset-bottom));
  }
}

/* ============================================================
   [补丁 v3 · 2026-09-09] 移动端 slide-right 动画方向翻转
   初始位移 translateX(+40px) 向右，会让尚未进入视口的图片容器
   （如加入我们页"团队文化"）产生约 24px 横向溢出，手机上可
   左右晃动页面。翻转为向左 -40px：滑入视觉相近，且负方向
   位移不产生横向滚动溢出。
   ============================================================ */
@media (max-width: 768px) {
  .slide-right { transform: translateX(-40px); }
  .slide-right.visible { transform: translateX(0); }
}
