/* ───────────────────────────────────────────────────────────────────────────
 * 立大志官网 · 全局响应式样式表
 * 部署日期：2026-05-14
 * 设计原则：
 *   - 按主流标准断点适配（1440/1280/1024/768/480）
 *   - 不修改文字内容，仅调整布局与排版
 *   - 不破坏现有设计系统（黄色 #FFB300、深色 #1A1A2E、PingFang 字体）
 *   - 移动端遵循人体工学：触控目标 ≥44px、字号 ≥14px、单列堆叠
 *   - desktop-first，移动端用渐进降级覆盖
 * ────────────────────────────────────────────────────────────────────────── */

/* ════════════════════════════════════════════════════════════════════════════
 *  0. 通用基础规则（所有尺寸）
 * ══════════════════════════════════════════════════════════════════════════ */

html {
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img, video, svg {
  max-width: 100%;
  height: auto;
}

table {
  max-width: 100%;
}

/* 触控设备：去掉 hover 闪烁 */
@media (hover: none) {
  a:hover, button:hover, .btn:hover { transform: none !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  1. 大屏幕 (1441px+) ── 默认设计目标，仅做兜底
 * ══════════════════════════════════════════════════════════════════════════ */

@media (min-width: 1441px) {
  .container { max-width: 1280px; }
}

/* 4K 超宽屏避免被拉得过空 */
@media (min-width: 1920px) {
  .container { max-width: 1440px; }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  2. 标准笔记本 (1281-1440px)
 * ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1440px) {
  .container { max-width: 1180px; padding-left: 28px; padding-right: 28px; }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  3. 小笔记本 / 平板横屏 (1024-1280px)
 * ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1280px) {
  .container { max-width: 100%; padding-left: 28px; padding-right: 28px; }

  /* 导航：缩小 padding 防溢出 */
  nav { padding-left: 24px !important; padding-right: 24px !important; }
  .nav-links { gap: 4px !important; }
  .nav-links a { padding: 6px 10px !important; font-size: 13px !important; }

  /* 首页 Hero 三栏稍缩 */
  .hero-inner { gap: 24px !important; }

  /* 标题略缩 */
  .page-hero h1 { font-size: 36px !important; }
  .page-hero p { font-size: 17px !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  4. 平板竖屏 / 大手机横屏 (768-1024px)
 *  ── 这里开始：多列网格 → 双列
 * ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
  .container { padding-left: 24px; padding-right: 24px; }

  /* 导航条 */
  nav { padding: 0 20px !important; height: 60px !important; }
  .nav-logo { font-size: 15px !important; }
  .nav-links { gap: 2px !important; }
  .nav-links a { font-size: 12.5px !important; padding: 6px 8px !important; }

  /* 首页 Hero 三栏 → 双列 / 中间下移 */
  .hero-inner {
    grid-template-columns: 1fr 1fr !important;
    grid-template-areas: "left right" "center center" !important;
  }
  .hero-left { grid-area: left; }
  .hero-right { grid-area: right; }
  .hero-center { grid-area: center; }
  .hero-title { font-size: 38px !important; }
  .hero-subtitle { font-size: 16px !important; }

  /* 多列卡片网格 → 双列 */
  .hf-card, .stat-card, .c-card, .cost-card, .a-card, .adv-card,
  .s-card, .flow-item {
    width: auto;
  }
  [class*="-grid"], .stats, .cards-grid, .features-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* 页面级 hero 字号 */
  .page-hero { padding: 44px 0 30px !important; }
  .page-hero h1 { font-size: 32px !important; }
  .page-hero p { font-size: 16px !important; }

  /* 通用 section padding */
  .content-section { padding: 32px 0 !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  5. 平板竖屏 / 手机横屏 (481-768px)
 *  ── 关键断点：开启汉堡菜单、所有网格单列
 * ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  html, body { font-size: 15px; }

  .container, .container-fluid {
    padding-left: 16px !important;
    padding-right: 16px !important;
    max-width: 100% !important;
  }

  /* ────── 导航：隐藏桌面菜单，露出汉堡 ────── */
  nav {
    padding: 0 16px !important;
    height: 56px !important;
  }
  .nav-logo {
    font-size: 14px !important;
    max-width: calc(100vw - 80px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .nav-links {
    /* 默认隐藏；JS 加 .open 后下拉显示 */
    position: fixed !important;
    top: 56px !important;
    right: -100% !important;
    width: 78% !important;
    max-width: 320px !important;
    height: calc(100vh - 56px) !important;
    background: rgba(26, 26, 46, 0.98) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    padding: 18px 0 !important;
    transition: right 0.3s ease !important;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 999;
    overflow-y: auto;
  }
  .nav-links.open { right: 0 !important; }
  .nav-links a {
    padding: 14px 22px !important;
    font-size: 15px !important;
    border-radius: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92) !important;
    min-height: 44px;
    display: flex !important;
    align-items: center;
  }
  .nav-links a:hover, .nav-links a.active {
    background: rgba(255, 179, 0, 0.18) !important;
    color: var(--yellow) !important;
  }

  /* 汉堡按钮（由 responsive.js 注入） */
  .nav-burger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
  }
  .nav-burger:hover { background: rgba(255, 179, 0, 0.12); }
  .nav-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--yellow, #FFB300);
    border-radius: 2px;
    transition: all 0.25s;
  }
  .nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger.open span:nth-child(2) { opacity: 0; }
  .nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* 菜单遮罩 */
  .nav-mask {
    position: fixed;
    top: 56px; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
  }
  .nav-mask.show { opacity: 1; pointer-events: auto; }

  /* ────── 首页：单列堆叠 ────── */
  .hero-inner {
    grid-template-columns: 1fr !important;
    grid-template-areas: "left" "center" "right" !important;
    gap: 24px !important;
  }
  .hero-tag { font-size: 12px !important; padding: 5px 12px !important; }
  .hero-title { font-size: 30px !important; line-height: 1.3 !important; }
  .hero-subtitle { font-size: 15px !important; }
  .hero-desc { font-size: 14.5px !important; line-height: 1.7 !important; }
  .hero-btns { flex-wrap: wrap; gap: 10px !important; }
  .hero-btns .btn-primary, .hero-btns .btn-outline {
    width: 100%;
    text-align: center;
    padding: 12px 18px !important;
    min-height: 44px;
    font-size: 14px !important;
  }

  /* 中央能力图：缩小 */
  .ad-hub { transform: scale(0.85); margin: 0 auto; }
  .ability-diagram { padding: 16px !important; }
  .ad-badges { flex-wrap: wrap; justify-content: center; gap: 6px !important; }
  .ad-badge { font-size: 11px !important; padding: 4px 10px !important; }

  /* 右侧服务特色卡 */
  .hero-right { display: flex; flex-direction: column; gap: 10px; }
  .hf-card { padding: 14px !important; }
  .hf-title { font-size: 14.5px !important; }

  /* ────── 所有多列网格 → 单列 ────── */
  [class*="-grid"], .stats, .cards-grid, .features-grid,
  .ad-hub, .stat-cards, .cost-cards, .a-cards, .adv-cards,
  .s-cards, .c-cards, .flow-list, .pillars, .pillar-grid {
    grid-template-columns: 1fr !important;
    display: grid !important;
    gap: 14px !important;
  }

  /* ────── 内页 hero ────── */
  .page-hero { padding: 30px 0 22px !important; }
  .page-hero h1 { font-size: 24px !important; line-height: 1.35 !important; }
  .page-hero p { font-size: 14.5px !important; }

  /* 章节标题 */
  h2 { font-size: 22px !important; line-height: 1.35 !important; }
  h3 { font-size: 18px !important; line-height: 1.4 !important; }
  h4 { font-size: 16px !important; }

  /* 段落 */
  p, li {
    font-size: 14.5px !important;
    line-height: 1.75 !important;
  }

  /* 按钮触控友好 */
  button, .btn, .btn-primary, .btn-outline, .btn-secondary,
  .s-btn, .cta-btn, a.btn-primary, a.btn-outline {
    min-height: 44px;
    padding: 11px 18px !important;
    font-size: 14px !important;
  }

  /* section padding */
  section, .content-section, .section { padding: 28px 0 !important; }

  /* 面包屑 */
  .breadcrumb { padding: 10px 0 !important; font-size: 12.5px !important; }

  /* 表格横向滚动避免溢出 */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 列表/卡片间距 */
  .c-card, .cost-card, .a-card, .adv-card, .flow-item, .s-card {
    margin-bottom: 12px;
    padding: 16px !important;
  }

  /* 引用块 */
  .quote-block { padding: 16px !important; font-size: 14.5px !important; }

  /* footer */
  footer { padding: 24px 16px !important; font-size: 13px !important; text-align: center; }
  footer p { line-height: 1.7 !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  6. 小手机 (480px 以下)
 * ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 480px) {
  html, body { font-size: 14.5px; }

  .container { padding-left: 12px !important; padding-right: 12px !important; }

  nav { padding: 0 12px !important; }
  .nav-logo { font-size: 13px !important; max-width: calc(100vw - 70px); }

  /* 首页 */
  .hero-title { font-size: 26px !important; }
  .hero-subtitle { font-size: 14px !important; }
  .hero-desc { font-size: 13.5px !important; }
  .ad-hub { transform: scale(0.75); }
  .hf-card { padding: 12px !important; }

  /* 标题 */
  .page-hero h1 { font-size: 21px !important; }
  .page-hero p { font-size: 13.5px !important; }
  h2 { font-size: 19px !important; }
  h3 { font-size: 16px !important; }

  /* 按钮 */
  button, .btn, .btn-primary, .btn-outline { font-size: 13.5px !important; padding: 10px 14px !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  7. 横屏手机（高度小）
 * ══════════════════════════════════════════════════════════════════════════ */

@media (max-height: 480px) and (orientation: landscape) {
  .page-hero { padding: 20px 0 14px !important; }
  .hero-inner { gap: 18px !important; }
  section, .content-section { padding: 22px 0 !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  8. 桌面端默认：隐藏汉堡按钮和遮罩
 * ══════════════════════════════════════════════════════════════════════════ */

.nav-burger { display: none; }
.nav-mask { display: none; }

@media (max-width: 768px) {
  .nav-mask { display: block; }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  9. 打印样式
 * ══════════════════════════════════════════════════════════════════════════ */

@media print {
  nav, .nav-burger, .nav-mask, footer { display: none !important; }
  body { color: #000; background: #fff; }
  a { color: #000; text-decoration: underline; }
}


/* ════════════════════════════════════════════════════════════════════════════
 *  P0 无障碍：减弱动效用户偏好（WCAG 2.3.3）
 *  当用户在系统设置中开启「减少动态效果」时，全站动效降到最低
 * ══════════════════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ════════════════════════════════════════════════════════════════════════════
 *  P0 无障碍：键盘焦点态（WCAG 2.4.7）
 *  默认浏览器焦点环过弱，统一改为品牌色 2px outline
 * ══════════════════════════════════════════════════════════════════════════ */
*:focus-visible {
  outline: 2px solid var(--yellow-dark, #FF8F00);
  outline-offset: 2px;
  border-radius: 4px;
}
/* mouse 点击不显焦点环（仅键盘 Tab 才显），:focus-visible 已经做到 */
