/* ============================================================
   五行小宝 · 全站移动端适配
   断点：
     ≤768px   小屏（手机）
     ≤480px   超小屏
   ============================================================ */

/* ============ ≤ 768px：手机适配 ============ */
@media (max-width: 768px) {

  /* ---------- 全局 ---------- */
  body { font-size: 14px; }
  .container {
    padding-left: 18px !important;
    padding-right: 18px !important;
    max-width: 100% !important;
  }
  .section {
    padding: 36px 0 24px !important;
  }

  /* ---------- 导航：汉堡菜单 ---------- */
  .navbar {
    padding: 0 !important;
  }
  .nav-container {
    padding: 12px 18px !important;
    flex-wrap: wrap;
    position: relative;
  }
  .nav-menu {
    display: none !important;     /* 默认隐藏 */
    width: 100%;
    flex-direction: column;
    gap: 0 !important;
    padding: 8px 0;
    margin: 8px -18px 0;
    background: #fff;
    border-top: 1px solid var(--line, #ECEDE8);
    box-shadow: 0 6px 16px rgba(0,0,0,0.05);
  }
  .nav-menu li {
    width: 100%;
    border-bottom: 1px solid #f3f3f0;
  }
  .nav-menu li:last-child { border-bottom: none; }
  .nav-menu li a {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    padding: 12px 18px !important;
    font-size: 15px;
  }
  /* 移动端：主名字 + 副名字横排 */
  .nav-menu li a .nav-main { font-size: 15px; }
  .nav-menu li a .nav-sub { font-size: 11.5px; color: #9A9285; font-weight: 300; }
  /* 汉堡按钮 */
  .nav-toggle {
    display: flex !important;
    flex-direction: column;
    gap: 4px;
    width: 32px; height: 32px;
    background: transparent; border: none; cursor: pointer;
    padding: 8px 6px;
    margin-left: auto;
    align-items: center; justify-content: center;
  }
  .nav-toggle span {
    display: block; width: 18px; height: 2px;
    background: var(--ink, #2A2A2A);
    border-radius: 2px;
    transition: transform .2s, opacity .2s;
  }
  /* 展开态 */
  .navbar.is-open .nav-menu { display: flex !important; }
  .navbar.is-open .nav-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }
  .navbar.is-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .navbar.is-open .nav-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }
  /* 隐藏右侧"登录"+"免费测试"主行动按钮（移到菜单中） */
  .nav-actions {
    order: 99;
    width: 100%;
    display: none !important;
    flex-direction: column;
    gap: 8px;
    padding: 0 18px 12px;
  }
  .navbar.is-open .nav-actions { display: flex !important; }
  .nav-actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* ---------- Hero ---------- */
  .hero {
    padding: 60px 18px 70px !important;
  }
  .hero-title { font-size: 26px !important; line-height: 1.45; letter-spacing: 0.5px !important; }
  .hero-subtitle { font-size: 14px !important; }
  .hero-mascot-v2 {
    width: 160px !important; height: 160px !important;
    margin-bottom: 24px !important;
  }
  .hero-cta { flex-direction: column; gap: 10px !important; }
  .hero-cta .btn { width: 100%; justify-content: center; }
  .hero-stats {
    flex-direction: column; gap: 12px !important;
    align-items: stretch !important;
  }
  .hero-stats > div {
    text-align: center; padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,.05);
  }
  .hero-stats > div:last-child { border-bottom: none; }

  /* ---------- 通用区块标题 ---------- */
  .section-title { font-size: 22px !important; }
  .section-subtitle { font-size: 13px !important; }

  /* ---------- 按钮 ---------- */
  .btn { padding: 10px 18px !important; font-size: 14px !important; }
  .btn-large { padding: 12px 22px !important; font-size: 15px !important; }

  /* ---------- 模块卡片网格 → 单列 ---------- */
  .modules,
  .case-list,
  .family-grid,
  .reviews,
  .footer-grid,
  .strength-weakness,
  .match-list,
  .plan-grid,
  .report-toc {
    grid-template-columns: 1fr !important;
    columns: 1 !important;
  }
  .footer-grid { gap: 24px !important; }

  /* ---------- 首页"专属日历"模块 ---------- */
  #calendar .daily-drop {
    grid-template-columns: 1fr !important;
    padding: 20px !important;
    gap: 18px !important;
  }
  .daily-drop-title { font-size: 20px !important; line-height: 1.5; }
  .daily-drop-content { font-size: 13px !important; line-height: 1.85 !important; }
  .cal-today-card { min-height: auto; padding: 18px !important; }
  .cal-today-pillar { font-size: 18px !important; }
  .cal-today-score-num { font-size: 28px !important; }
  .cal-today-yiji { grid-template-columns: 1fr !important; gap: 8px !important; }

  /* ---------- 日历主页 ---------- */
  .cal-h1 { font-size: 24px !important; letter-spacing: 2px !important; }
  .cal-id-bar { padding: 12px 14px !important; gap: 6px; }
  .cal-id-left, .cal-id-right { gap: 10px !important; flex-wrap: wrap; }
  .cal-month-nav { gap: 8px; }
  .cal-month-title { font-size: 15px !important; letter-spacing: 1px !important; }
  .cal-grid-wrap { padding: 10px 6px !important; }
  .cal-cell {
    aspect-ratio: 1 / 1.1 !important;
    border-radius: 6px;
  }
  .cal-d { font-size: 13px !important; margin-bottom: 2px !important; }
  .cal-dot { width: 4px !important; height: 4px !important; }
  .cal-score { font-size: 8.5px !important; }
  .cal-jq { font-size: 8px !important; padding: 0 3px !important; right: 3px !important; top: 3px !important; }
  .cal-month-summary {
    padding: 8px 12px !important; gap: 8px !important;
    font-size: 11px !important; flex-wrap: wrap;
    justify-content: space-between;
  }

  /* 详情面板 */
  .cal-detail { padding: 18px 16px !important; }
  .cal-detail-head { flex-direction: row !important; align-items: flex-start !important; }
  .cal-detail-d2 { font-size: 18px !important; }
  .cal-detail-score-num { font-size: 30px !important; }
  .cal-detail-score-lvl { font-size: 11px !important; }
  .cal-detail-yiji { grid-template-columns: 1fr !important; gap: 10px !important; }
  .cal-detail-greeting-txt { font-size: 14px !important; }
  .cal-detail-actions { flex-direction: column; }
  .cal-detail-actions .btn { width: 100%; justify-content: center; }

  /* ---------- 表单页（wxti / 通用） ---------- */
  .form-group .form-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .form-input, .form-select, select.form-input {
    font-size: 16px !important;  /* iOS 防自动缩放 */
  }

  /* ---------- daily-drop 全局降级 ---------- */
  .daily-drop {
    padding: 22px !important;
    border-radius: 12px;
  }

  /* ---------- footer ---------- */
  .footer {
    padding: 40px 0 24px !important;
  }
  .footer-disclaimer { font-size: 11px; line-height: 1.7; }

  /* ---------- demo-banner ---------- */
  .demo-banner {
    font-size: 11px !important;
    padding: 6px 12px !important;
    line-height: 1.5;
  }

  /* ---------- modal ---------- */
  .modal-card {
    width: calc(100% - 32px) !important;
    max-width: none !important;
    padding: 24px 18px !important;
  }
}

/* ============ ≤ 480px：超小屏微调 ============ */
@media (max-width: 480px) {
  .hero-title { font-size: 22px !important; }
  .section-title { font-size: 19px !important; }
  .hero-mascot-v2 { width: 140px !important; height: 140px !important; }
  .cal-d { font-size: 12px !important; }
  .cal-score { font-size: 8px !important; }
  .cal-h1 { font-size: 22px !important; }
  .cal-month-summary { font-size: 10px !important; }
}

/* ============ wxti 子站专用 ============ */
@media (max-width: 768px) {
  /* 子站独立适配 */
  .page { padding: 0 !important; }
  .page-header {
    padding: 12px 16px !important;
  }
  .page-header-title { font-size: 14px !important; }
  /* 表单 */
  #page-input form,
  #page-input .form {
    padding: 0 18px !important;
  }
}

/* ============ 触摸滚动优化 ============ */
@media (hover: none) {
  .cal-cell:hover { background: transparent; }
}

/* ============ 桌面端：默认隐藏汉堡按钮 ============ */
@media (min-width: 769px) {
  .nav-toggle { display: none !important; }
}
