/* ============================================================================
   育创高考志愿填报系统 · 手机端统一设计层（2026-10-21）
   ----------------------------------------------------------------------------
   背景：全站只有 volunteer.html 加载 responsive-base.css，其余 12 页在手机上
   没有任何响应式兜底 —— 导航整条撑出屏幕（页面被浏览器缩到 530/665px）、
   文字偏大、换行错位。本文件是**所有页面**共用的手机端设计层，对齐优志愿
   手机端的排版密度：
     · 顶栏单行 / 页头两行（品牌+登录胶囊 ｜ 工具横滑条）
     · 基准字号 14px，标题降档，杜绝尴尬断行
     · 工具卡双列紧凑、数据表横向滑动、输入框 16px 防 iOS 聚焦缩放
   加载顺序：必须放在 site.css / style.css / scheme.css 之后。
   注：选择器普遍带父级提权（.tools-sec .tool 等），确保压过页面内联 <style>
   的同名校验；yc-member.js 运行时注入的样式最靠后，用 !important 压制。
   ============================================================================ */

/* ============================================================
   一、页头系统（≤880px：顶栏 + 品牌行 + 工具横滑条）
   ============================================================ */
@media (max-width: 880px) {

  /* ---- 防横向溢出（clip 不产生滚动容器，sticky 头部不受影响） ---- */
  html, body { overflow-x: clip; max-width: 100%; }
  body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  img, svg, video { max-width: 100%; }

  /* ---- 顶部通栏：单行，公司名截断，电话靠右 ---- */
  .topbar { font-size: 11.5px; }
  .topbar .in { gap: 10px; min-height: 30px; }
  .topbar > .in > span:first-child {
    flex: 1 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .topbar .tel { flex: 0 0 auto; white-space: nowrap; }

  /* ---- 页头改两行网格：品牌+登录胶囊 ｜ 导航横滑条 ---- */
  .header { border-bottom: 1px solid var(--line); }
  .header .in {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand entry"
      "nav   nav";
    align-items: center;
    column-gap: 10px; row-gap: 0;
    min-height: 0; padding-top: 9px; padding-bottom: 0;
  }
  .header .brand { grid-area: brand; min-width: 0; gap: 8px; }
  .header .brand .logo { width: 34px; height: 34px; flex: none; }
  .header .brand .nm { font-size: 15.5px; line-height: 1.2; }
  .header .brand .sub { font-size: 10.5px; letter-spacing: .3px; }

  /* 登录/注册胶囊：收进品牌行右侧（压过 yc-member.js 运行时注入样式） */
  .header .in > .yc-member-entry-group,
  .header .in > .yc-member-entry { grid-area: entry; margin: 0 !important; }
  .header .yc-member-entry {
    height: 31px !important; padding: 0 12px !important;
    font-size: 12.5px !important;
  }

  /* ---- 导航：横向滑动工具条（核心修复：不再撑破页面） ---- */
  .header .nav {
    grid-area: nav;
    display: flex; flex-wrap: nowrap; align-items: center;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: 2px;
    margin: 6px calc(-1 * var(--m-gutter, 16px)) 0;
    padding: 2px var(--m-gutter, 16px) 7px;
    scrollbar-width: none;
  }
  .header .nav::-webkit-scrollbar { display: none; }
  .header .nav a,
  .header .nav .dd-t {
    flex: 0 0 auto;
    padding: 7px 11px; font-size: 13px; border-radius: 8px;
  }
  .header .nav .dd { flex: 0 0 auto; display: flex; align-items: center; }
  .header .nav .dd-t { white-space: nowrap; }
  .header .nav .dd-t i { font-size: 9px; }
  .header .nav a.cta { padding: 7px 14px; font-size: 13px; }

  /* ---- 下拉组（触屏点按展开，面板固定定位不被滑动条裁剪） ---- */
  .header .nav .dd-menu { display: none; }
  .header .nav .dd.open .dd-menu {
    display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
    position: fixed; left: 10px; right: 10px;
    top: var(--m-dd-top, 96px);
    background: var(--card, #fff);
    border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 16px 40px rgba(20, 42, 94, .18);
    padding: 10px; z-index: 98;
    animation: m-dd-in .16s ease;
  }
  .header .nav .dd.open .dd-t i { transform: rotate(180deg); }
  .header .nav .dd-menu a {
    padding: 10px 12px; font-size: 13.5px; border-radius: 9px;
    background: #f7f9fd; margin: 0;
  }
  @keyframes m-dd-in { from { opacity: 0; transform: translateY(-6px); } }
}

@media (max-width: 420px) {
  .header .brand .sub { display: none; }   /* 副标题让位，保品牌单行 */
}

/* ============================================================
   二、正文排版（≤768px：字号整体降一档，杜绝尴尬断行）
   ============================================================ */
@media (max-width: 768px) {

  body { font-size: 14px; }

  /* ---- 首屏 ---- */
  .hero { padding: 34px 0 46px; }
  .hero h1 {
    font-size: 22px; line-height: 1.42; letter-spacing: 0;
    text-wrap: balance;
  }
  .hero .lead { font-size: 13.5px; line-height: 1.8; margin-bottom: 22px; }
  .hero .kicker { font-size: 11.5px; }
  .hero .stats {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 14px 12px; padding-top: 4px;
  }
  .hero .stats .it b { font-size: 20px; }
  .hero .stats .it span { font-size: 11.5px; }

  /* ---- 考生端入口大卡 ---- */
  .entries { margin-top: -26px; }
  .entries .entry { padding: 20px 16px 18px; }
  .entries .entry h3 { font-size: 18px; }
  .entries .entry p { font-size: 13.5px; }
  .entries .entry ul li { font-size: 13.5px; line-height: 1.9; padding-left: 17px; }
  .entries .entry .go { font-size: 14.5px; padding: 11px 16px; }

  /* ---- 区块骨架 ---- */
  .sec { padding: 36px 0; }
  .sec.alt { padding: 36px 0; }
  .sec-h h2 { font-size: 19px; line-height: 1.4; }
  .sec-h .k { font-size: 11.5px; }
  .sec-h p { font-size: 12.8px; }
  .wrap { padding: 0 16px; }

  /* ---- 通用小卡 / 步骤卡 ---- */
  .card, .steps .step { padding: 16px 14px; }
  .card h4, .steps .step h4 { font-size: 15px; line-height: 1.5; }
  .card p, .steps .step p { font-size: 13px; line-height: 1.7; }
  .flow-note { font-size: 12.5px; line-height: 1.75; }

  /* ---- 页脚 ---- */
  .footer { padding: 26px 0 18px; font-size: 12.5px; }
  .footer .cols { gap: 16px 12px; }
  .footer .about { grid-column: 1 / -1; }
  .footer h5 { font-size: 13px; }
  .footer .copyright { font-size: 11.5px; line-height: 1.7; }

  /* ---- 数据表：横向滑动，不挤压不错位 ---- */
  body:not(.pf) table {
    display: block; width: max-content; max-width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  body:not(.pf) table th,
  body:not(.pf) table td { white-space: nowrap; font-size: 12.2px; }
  body:not(.pf) table td.wrap-cell,
  body:not(.pf) table td[y-wrap] { white-space: normal; }

  /* ---- 页签条：横滑 ---- */
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; white-space: nowrap; }

  /* ---- 表单：16px 防 iOS 聚焦自动放大（「错位」的常见元凶） ---- */
  input[type="text"], input[type="tel"], input[type="number"],
  input[type="password"], input[type="email"], input[type="search"],
  input:not([type]), select, textarea { font-size: 16px !important; }
  select { height: 42px; }
}

/* ============================================================
   三、首页（index.html）专属：工具卡双列紧凑
   ============================================================ */
@media (max-width: 768px) {
  .tools-sec { padding: 36px 0 22px; }
  .tools-sec .tools-hd h2 { font-size: 20px; }
  .tools-sec .tools-hd p { font-size: 12.5px; margin-top: 4px; }
  .tools-sec .tools-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tools-sec .tool { padding: 14px 12px 12px; border-radius: 12px; }
  .tools-sec .tool .ic {
    width: 32px; height: 32px; font-size: 14px;
    border-radius: 9px; margin-bottom: 8px;
  }
  .tools-sec .tool b { font-size: 14px; margin-bottom: 3px; }
  .tools-sec .tool i { font-size: 11.5px; line-height: 1.55; }
}
@media (max-width: 359px) {
  .tools-sec .tools-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   四、小屏细节（≤640px）
   ============================================================ */
@media (max-width: 640px) {
  /* 反馈/公告跑马灯字号收敛 */
  .ycf-notice { font-size: 12px; }
  /* 悬浮反馈按钮不遮内容 */
  .ycf-fab { width: 44px; height: 44px; }
}
