/* ===== 锦序人生 · 全站移动端适配（仅作用于窄屏，不影响桌面） ===== */

/* 导航栏：默认显示汉堡按钮（桌面由下方媒体查询隐藏） */
.navbar .menu-btn {
  display: none;
  font-size: 24px;
  color: #c9a34b;
  cursor: pointer;
  padding: 8px 4px;
  line-height: 1;
}

/* 平板：整体收窄 */
@media (max-width: 900px) {
  .main, .main-wrap, .container, .content, .page, .section {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }
  .main, .main-wrap { flex-direction: column; }
  .right, .sidebar { width: 100% !important; }
}

/* 手机：核心适配 */
@media (max-width: 768px) {
  /* 导航栏折叠为汉堡菜单 */
  .navbar {
    padding: 0 16px !important;
    height: 56px !important;
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .navbar .logo { font-size: 18px !important; }
  .navbar .menu-btn { display: block !important; }
  .navbar .nav-user { display: inline-block !important; font-size: 14px !important; } /* 手机端保留登录入口可点 */
  .navbar .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #1a1a2e;
    padding: 8px 0;
    gap: 0;
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  }
  .navbar .nav-links.show { display: flex !important; }
  .navbar .nav-links a {
    padding: 14px 20px !important;
    font-size: 15px !important;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  /* 容器与栅格 */
  .main, .main-wrap, .container, .content, .page, .section, .wrap {
    max-width: 100% !important;
    padding: 16px 16px !important;
    flex-direction: column;
  }
  .left, .right, .sidebar { width: 100% !important; flex: none !important; }

  .plans, .benefits-grid, .course-grid, .ebook-grid, .grid,
  .favorites-grid, .orders-grid, .cards {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* 通用区块内边距 */
  .vip-hero, .hero, .page-head, .benefits, .card, .plan-card,
  .course-card, .ebook-card, .section-box {
    padding: 32px 18px !important;
  }
  .page-head { padding: 36px 18px 24px !important; }

  /* 字号自适应 */
  h1 { font-size: 24px !important; }
  .vip-hero h1, .hero h1, .page-head h1 { font-size: 24px !important; }
  .vip-hero .price { font-size: 38px !important; }
  .plan-card .price, .price-lg { font-size: 30px !important; }
  p, li, .desc { font-size: 14px !important; line-height: 1.7 !important; }

  /* 按钮：主CTA在手机上更易点 */
  .btn-buy, .btn-plan, .btn-primary, .btn-secondary, .btn-fav, .btn {
    font-size: 15px !important;
    padding: 13px 28px !important;
  }

  /* 算卦页：聊天区适配 */
  .chat-messages { height: 60vh !important; }
  .chat-header { padding: 14px 16px !important; }
  .chat-input { padding: 10px 12px !important; }
  .chat-input input, .chat-input textarea { font-size: 16px !important; }
  .msg { max-width: 90% !important; }

  /* 课程页：视频与章节 */
  .video-wrap { border-radius: 8px !important; }
  .chapter-item { padding: 14px 12px !important; }
  .chapter-item .title { font-size: 14px !important; }

  /* 表单与弹窗 */
  .modal, .login-box, .pay-box, .success-box {
    max-width: 100% !important;
    width: 92% !important;
    padding: 28px 20px !important;
  }
  input, textarea, select {
    font-size: 16px !important; /* 防止 iOS 聚焦缩放 */
    padding: 12px 14px !important;
  }

  /* 表格类（订单/用户）横向可滚动 */
  .table-wrap, table { width: 100% !important; overflow-x: auto; display: block; }
  table { font-size: 13px !important; }

  /* 底部按钮组换行 */
  .btn-group { flex-direction: column !important; }
  .btn-group a, .btn-group button { width: 100% !important; text-align: center; }
}

/* 超小屏微调 */
@media (max-width: 380px) {
  .navbar .logo { font-size: 16px !important; }
  h1 { font-size: 21px !important; }
  .vip-hero h1 { font-size: 21px !important; }
}
