/* 移动端适配（仅在 ≤720px 生效，PC 样式完全不受影响）
   目标：更大的点击区、更舒服的行高与留白、修掉挤压/重叠。 */

@media (max-width: 720px) {
  /* ---------- 1. 基础排版 ---------- */
  html { -webkit-text-size-adjust: 100%; }
  body { font-size: 16px; line-height: 1.7; }
  p, li, dd, .card p { font-size: 15px; line-height: 1.75; }

  /* ---------- 2. 容器留白 ---------- */
  .container { width: 100%; padding-left: 18px; padding-right: 18px; }

  /* ---------- 3. 触控目标统一放大（≥44px）---------- */
  /* 只放大可点区域，不改变布局方式（否则会影响汉堡按钮内部的横线） */
  .main-nav a { padding-left: 14px; padding-right: 14px; min-height: 46px; display: inline-flex; align-items: center; }
  .primary-button,
  .secondary-button,
  .text-button,
  .icon-text-button,
  .role-tab,
  .chat-route,
  .guest-public a,
  .forum-actions button,
  .post-action { min-height: 44px; }
  .primary-button, .secondary-button, .auth-submit { display: inline-flex; align-items: center; justify-content: center; }
  .header-tools .text-button, .icon-text-button { padding-top: 8px; padding-bottom: 8px; }
  .send-button { width: 44px; height: 44px; }
  .menu-button { min-width: 44px; min-height: 44px; }
  .avatar-guest { min-height: 44px; display: inline-flex; align-items: center; }

  /* ---------- 4. 首页 hero ---------- */
  .hero { padding: 16px 18px 10px; }
  .hero h1 { font-size: clamp(30px, 9.2vw, 42px); line-height: 1.16; letter-spacing: -.01em; }
  .hero-subtitle { font-size: 14px; letter-spacing: .04em; }
  .eyebrow { font-size: 12.5px; }
  .assistant-box { margin-top: 16px; border-radius: 18px; }
  .assistant-box textarea { font-size: 16px; min-height: 26px; }
  .privacy-note, .assistant-example { font-size: 12.5px; line-height: 1.6; }
  .scroll-hint { font-size: 12px; }

  /* ---------- 5. 访客门禁（修图标与“个人空间”挤在一起）---------- */
  .guest-gate { min-height: auto; padding: 32px 18px 56px; }
  .guest-gate-card { display: flex; flex-direction: column; align-items: center; }
  .gate-icon { display: grid; place-items: center; margin: 0 auto 16px; }
  .guest-gate .section-kicker { display: block; margin: 0 0 4px; }
  .guest-gate h1 { font-size: clamp(27px, 8vw, 34px); margin: 10px 0 14px; line-height: 1.25; }
  .guest-gate-card > p { margin-bottom: 22px; }
  .guest-public { gap: 10px 16px; margin: 24px 0 0; font-size: 14px; }

  /* ---------- 6. 对话页 ---------- */
  .chat-composer, .composer, .chat-dock { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .chat-composer textarea, #chatInput { font-size: 16px; max-height: 32vh; }
  .chat-quick button, .chat-prompts button { font-size: 14px; min-height: 44px; }
  .chat-note, .composer-note { font-size: 11.5px; line-height: 1.5; }
  .chat-text, .chat-message p { font-size: 15px; line-height: 1.75; }

  /* ---------- 7. 卡片与列表 ---------- */
  .card { border-radius: 16px; padding: 16px; }
  .card-header h2, .card h2 { font-size: 17px; }
  .forum-post, .post-item, .booking-item, .progress-item, .list-item { padding: 14px; border-radius: 14px; }
  .post-title, .post-item h3 { font-size: 16px; line-height: 1.5; }
  .post-body, .chat-text, .card p { overflow-wrap: anywhere; }

  /* ---------- 8. 表单 ---------- */
  .form-field input, .form-field textarea, .form-field select, .auth-submit { font-size: 16px; min-height: 46px; }
  .form-field label { font-size: 14px; }
  .field-help { font-size: 12px; }

  /* ---------- 9. 表格横向滚动，不挤压 ---------- */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }

  /* ---------- 10. 顶部导航：抽屉更宽松 ---------- */
  .main-nav { gap: 4px; }
  .main-nav a { min-height: 46px; }
}
/* ---------- 平板过渡（721–1024px，PC 与手机都不受影响）---------- */
@media (min-width: 721px) and (max-width: 1024px) {
  /* 容器留白略收 */
  .container { width: 100%; padding-left: 28px; padding-right: 28px; }

  /* 首页：标题与卡片密度 */
  .hero { padding: 22px 28px 14px; }
  .hero h1 { font-size: clamp(38px, 5.2vw, 54px); line-height: 1.12; }
  .hero-subtitle { font-size: 15px; }
  .agent-grid { grid-template-columns: repeat(2, 1fr); }
  .quick-grid, .role-grid { grid-template-columns: repeat(2, 1fr); }
  .focus-layout { grid-template-columns: 1fr; }
  .forum-preview-grid { grid-template-columns: 1fr; gap: 40px; }

  /* 顶栏：隐藏装饰性课表信息，避免挤 */
  .class-now { display: none; }
  .main-nav { gap: 10px; }

  /* 我的 / 论坛 / 请假：两列改一列，避免挤压 */
  .forum-layout { grid-template-columns: 1fr; }
  .leave-layout { grid-template-columns: 1fr; }
  .forum-preview-grid, .focus-layout { gap: 28px; }

  /* 管理端：侧栏 + 内容改上下堆叠 */
  .assistant-admin-layout { grid-template-columns: 1fr; }
  .dashboard-layout { grid-template-columns: 180px 1fr; }

  /* 表单两列在平板上仍可，但间距收一点 */
  .form-grid { gap: 14px; }

  /* 对话页：正文列宽与底部留白 */
  .chat-thread, .chat-composer { max-width: 100%; }
  .chat-composer { padding-left: 20px; padding-right: 20px; }
}

/* ============================================================
   2026-11 移动端 / 平板精修（追加层，仅在小屏生效，PC 不受影响）
   目标：更大的留白、更统一的字号节奏、单列不再挤、平板上两列更稳
   ============================================================ */

/* ---------- 手机：≤720px ---------- */
@media (max-width: 720px) {
  /* 1. 容器与版面节奏 */
  .container { padding-left: 20px; padding-right: 20px; }
  .page-hero, .campus-hero, .hero { padding-top: 28px; }
  .page-hero { padding-bottom: 18px; }
  .page-content, .section { padding-top: 20px; padding-bottom: 40px; }
  .breadcrumbs { margin-bottom: 14px; font-size: 12.5px; }

  /* 2. 标题与正文的层级 */
  .page-title { font-size: clamp(28px, 8.6vw, 36px); line-height: 1.18; letter-spacing: -.01em; margin: 6px 0 12px; }
  .section-kicker { font-size: 12.5px; letter-spacing: .06em; }
  .page-description { font-size: 15px; line-height: 1.75; }
  h2 { font-size: 20px; line-height: 1.35; }
  h3 { font-size: 16.5px; line-height: 1.45; }

  /* 3. 卡片统一：更松的内边距与更柔的圆角 */
  .card, .suce-card, .vol-card, .org-card, .drive-card, .hot-list-card,
  .checklist-card, .privacy-card, .today-list, .event-list {
    border-radius: 18px;
    padding: 18px;
  }
  .card + .card, .suce-card + .suce-card, .vol-card + .vol-card { margin-top: 14px; }
  .card-header, .suce-row-head { gap: 10px; align-items: flex-start; }

  /* 4. 所有多列网格在手机上统一单列 */
  .agent-grid, .quick-grid, .role-grid, .service-grid, .drive-grid,
  .privacy-grid, .culture-grid, .culture-cards, .honors-grid, .honor-list,
  .people-grid, .party-grid, .party-card-grid, .party-list, .party-stat-grid,
  .overview-grid, .admin-overview-grid, .admin-stats, .health-grid,
  .maintenance-grid, .media-firewall-grid, .moderation-list, .scene-admin-grid,
  .content-admin-grid, .forum-preview-grid, .campus-hero-grid, .freshman-hero-grid,
  .hero-art-grid, .module-list, .help-list, .checklist, .suce-list, .vol-cards,
  .post-list, .message-list, .chat-history-list, .progress-list, .event-list {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .suce-form-grid { grid-template-columns: 1fr; gap: 12px; }

  /* 5. 触控与按钮：主操作占满一行，次操作并排 */
  .primary-button, .auth-submit, .vol-actions .primary, .suce-actions .primary {
    width: 100%;
    min-height: 48px;
    border-radius: 14px;
  }
  .vol-actions, .suce-actions, .checklist-footer { display: flex; flex-wrap: wrap; gap: 10px; }
  .vol-actions > button, .suce-actions > button { flex: 1 1 140px; min-height: 46px; border-radius: 14px; }
  .text-button, .secondary-button { min-height: 44px; }

  /* 6. 标签页：横向滑动，不再换行挤压 */
  .tabs, .tab-list, .suce-tabs, .drive-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding-bottom: 4px;
  }
  .tab-button { flex: 0 0 auto; scroll-snap-align: start; min-height: 44px; padding: 0 16px; border-radius: 12px; }

  /* 7. 徽章与提示 */
  .suce-hero-badges, .hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
  .suce-badge, .badge { font-size: 12px; padding: 6px 10px; border-radius: 999px; }
  .suce-note, .field-help, .privacy-note { font-size: 12.5px; line-height: 1.65; }

  /* 8. 表单：字段之间更松，输入框更高 */
  .form-field + .form-field, .suce-field + .suce-field { margin-top: 14px; }
  .form-field input, .form-field select, .form-field textarea,
  .suce-field input, .suce-field select { min-height: 48px; border-radius: 12px; }

  /* 9. 页脚：竖排、分组之间留白 */
  .footer-main { flex-direction: column; align-items: flex-start; gap: 18px; }
  .footer-links { flex-wrap: wrap; gap: 14px 18px; line-height: 2; }
  .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 16px; }
  .site-footer { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }

  /* 10. 顶栏：标题与操作不挤 */
  .brand-name { font-size: 16px; }
  .header-tools { gap: 8px; }
}

/* ---------- 平板：721–1024px ---------- */
@media (min-width: 721px) and (max-width: 1024px) {
  .container { padding-left: 32px; padding-right: 32px; }
  .page-hero, .campus-hero { padding-top: 36px; padding-bottom: 26px; }
  .page-content, .section { padding-top: 26px; padding-bottom: 56px; }
  .page-title { font-size: clamp(36px, 5vw, 46px); line-height: 1.15; }

  /* 两列更稳：卡片不拉伸、间距一致 */
  .agent-grid, .quick-grid, .role-grid, .service-grid, .drive-grid,
  .privacy-grid, .culture-grid, .honors-grid, .people-grid, .party-card-grid,
  .overview-grid, .admin-overview-grid, .admin-stats, .health-grid,
  .maintenance-grid, .suce-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .forum-preview-grid, .content-admin-grid, .campus-hero-grid, .hero-art-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .card, .suce-card, .vol-card, .org-card, .drive-card { border-radius: 20px; padding: 22px; }
  .page-description { font-size: 16px; line-height: 1.75; }
  .primary-button, .auth-submit { min-height: 46px; }
  .tab-button { min-height: 44px; padding: 0 18px; }
}

/* ---------- 窄屏手机：≤430px（390/393/430 这类机型） ---------- */
@media (max-width: 430px) {
  .container { padding-left: 16px; padding-right: 16px; }
  .page-title { font-size: clamp(26px, 8.4vw, 32px); }
  .hero h1 { font-size: clamp(28px, 9vw, 36px); }
  .hero-subtitle { font-size: 13.5px; }

  /* 计分行：窄屏下允许换行，分数与数量框不再挤压文字 */
  .suce-item { flex-wrap: wrap; gap: 8px 10px; padding: 12px 14px; }
  .suce-item label { flex: 1 1 auto; min-width: 60%; }
  .suce-item .suce-pts { flex: 0 0 auto; }
  .suce-item input[type="number"] { width: 64px; min-height: 42px; }

  /* 卡片行头竖排，长标题不再被挤断 */
  .suce-row-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .tab-button { padding: 0 12px; font-size: 14px; }
  .footer-links { gap: 12px 14px; }
  .vol-meta, .vol-tags { gap: 6px 10px; }
}