/* 国考网 · 移动端 App 化增强层（mobile.css）
   全部规则锁定在 ≤768px 断点内——PC 视口下本文件等于空文件，零影响。
   加载顺序：app.css → theme.css → mobile.css（最后）。 */

/* ---- 桌面隐藏移动端专用节点（放在断点外，>768 时生效） ---- */
.m-tabbar, .m-chips { display: none; }
.desk-actions .desk-m-only { display: none; }  /* 个性设置卡仅移动端显示，PC 保持 8 卡 */

@media (max-width: 768px) {

  /* ================= 全局质感 ================= */
  html { -webkit-tap-highlight-color: transparent; }
  body {
    padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    overscroll-behavior-y: none;
  }

  /* ================= 顶部栏瘦身 ================= */
  /* 汉堡与下拉抽屉退役：导航职能由底部 Tab 承担 */
  .nav-burger { display: none !important; }
  .site-nav { display: none !important; }
  .header-inner { height: 52px; gap: 8px; }
  /* 「免费领10次」入口保留在顶部：紧凑胶囊 */
  .nav-claim {
    margin-left: auto; padding: 6px 12px; font-size: 12.5px;
    border-radius: 999px; white-space: nowrap;
  }

  /* ================= 底部 Tab 栏 ================= */
  .m-tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(14px) saturate(1.4);
    backdrop-filter: blur(14px) saturate(1.4);
    border-top: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 -4px 20px -12px rgba(30, 41, 59, .25);
  }
  .m-tabbar a {
    flex: 1; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; height: 54px;
    color: var(--text-sub); font-size: 10.5px; text-decoration: none;
    -webkit-user-select: none; user-select: none;
  }
  .m-tabbar a svg { width: 23px; height: 23px; transition: transform .15s ease; }
  .m-tabbar a:active svg { transform: scale(.88); }
  .m-tabbar a.on { color: var(--primary); font-weight: 600; }
  .m-tabbar a.on svg { color: var(--primary); }

  /* 控制台页内：chips 出现时 tabbar 仍保留（返回站点入口） */

  /* ================= 控制台横向滚动 chips ================= */
  .m-chips {
    display: flex; gap: 8px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 16px 10px;
    margin: -6px -16px 10px;
    background: var(--bg, #F5F8FD);
  }
  .m-chips::-webkit-scrollbar { display: none; }
  /* ≤640px 容器左右 padding 收窄到 14px，负边距同步对齐避免 2px 溢出 */
  @media (max-width: 640px) { .m-chips { margin: -6px -14px 10px; padding: 4px 14px 10px; } }
  .m-chips a {
    flex-shrink: 0;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 8px 14px; min-height: 36px;
    border-radius: 999px; border: 1px solid var(--border);
    background: #fff; color: var(--text);
    font-size: 13px; text-decoration: none; white-space: nowrap;
    transition: all .15s ease;
  }
  .m-chips a:active { transform: scale(.96); }
  .m-chips a.on {
    background: var(--primary); border-color: var(--primary);
    color: #fff; font-weight: 600;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .28);
  }
  .m-chips a i {
    font-style: normal; font-size: 11px;
    background: #F1F5F9; color: var(--text-sub);
    border-radius: 999px; padding: 0 7px; line-height: 17px;
  }
  .m-chips a.on i { background: rgba(255, 255, 255, .25); color: #fff; }

  /* 控制台顶栏变返回式 */
  .acct-bar { padding: 12px 14px; }
  .acct-bar .acct-id h2 { font-size: 17px; }

  /* ================= 试卷详情：操作区吸底 ================= */
  .paper-top .actions {
    position: fixed; left: 0; right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    z-index: 40; margin: 0;
    display: flex; gap: 10px; align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 -6px 24px -14px rgba(30, 41, 59, .3);
  }
  .paper-top .actions .btn { flex: 1; min-width: 0; padding: 12px 8px; font-size: 14px; }
  .paper-top .actions .btn-lg { padding: 12px 8px; }
  /* 占位：内容区补出吸底栏高度，避免被遮 */
  .paper-top .paper-info { padding-bottom: 118px; }

  /* ================= 云打印清单：结算按钮吸底 ================= */
  .cart-checkout-row {
    position: fixed; left: 0; right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom, 0px));
    z-index: 40; margin: 0;
    display: flex; align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(226, 232, 240, .9);
    box-shadow: 0 -6px 24px -14px rgba(30, 41, 59, .3);
  }
  .cart-checkout-row .btn { flex: 1; padding: 12px 8px; font-size: 14.5px; }
  .print-cart-page { padding-bottom: 128px; }

  /* ================= 触控与通用 ================= */
  .btn { min-height: 44px; }
  .btn-sm { min-height: 36px; }
  .tabs a { min-height: 38px; display: inline-flex; align-items: center; }
  /* 弹窗底部留白：不被 tabbar 遮挡 */
  .pt-modal { margin-bottom: 8px; }
  /* 页脚本就隐藏；任务面板上移让位 tabbar */
  .task-panel { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }

  /* ================= 首页搜索卡吸顶 ================= */
  /* hero 滚出视口后（JS 给卡片加 .stuck），搜索卡收成紧凑搜索条钉在 header 下方 */
  .home-search-sticky { position: sticky; top: 52px; z-index: 45; }
  .search-hero-card.stuck {
    padding: 7px 9px !important;
    border-radius: 14px;
    box-shadow: 0 10px 28px -14px rgba(30, 41, 59, .4);
  }
  .search-hero-card.stuck .sh-title,
  .search-hero-card.stuck .sh-sub,
  .search-hero-card.stuck .sh-hot,
  .search-hero-card.stuck .form-hint { display: none; }

  /* ================= 题库筛选：横滑胶囊行 ================= */
  .share-filters { padding: 0; }
  .share-filters form {
    flex-wrap: nowrap !important;   /* 覆盖模板 inline 的 wrap：改为单行横滑 */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 2px 8px;
    gap: 8px !important;
  }
  .share-filters form::-webkit-scrollbar { display: none; }
  .share-filters select {
    flex-shrink: 0;
    appearance: none; -webkit-appearance: none;
    min-height: 38px;
    max-width: 46vw;   /* 防 option 文字过长（如"全部年级（1234）"）把横滑行撑爆 */
    padding: 8px 28px 8px 14px !important;
    border: 1px solid var(--border);
    border-radius: 999px !important;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2364748B' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
    font-size: 13px;
    color: var(--text);
  }
  /* 有选中值（JS 标记 .m-on）：蓝色胶囊，同 chips 的选中语言 */
  .share-filters select.m-on {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  }
  .share-filters label { flex-shrink: 0; font-size: 13px !important; gap: 8px !important; }
  /* ================= 控制台表格瘦身 ================= */
  /* 卷型/类型列隐藏（次要信息，PC 保留） */
  .tbl-papers .col-kind, .tbl-docs .col-kind { display: none; }
  /* 状态文字收成圆形图标徽点（沿用胶囊配色：绿✓/红✕/蓝⟳） */
  .tbl-papers .col-status .status, .tbl-docs .col-status .status {
    font-size: 0; width: 24px; min-width: 24px; height: 24px;
    padding: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .tbl-papers .status::before, .tbl-docs .status::before { font-size: 12.5px; font-weight: 700; }
  .tbl-papers .status-ready::before, .tbl-docs .status-ready::before { content: "✓"; }
  .tbl-papers .status-failed::before, .tbl-docs .status-failed::before { content: "✕"; }
  .tbl-papers .status-generating::before, .tbl-papers .status-pending::before,
  .tbl-docs .status-generating::before, .tbl-docs .status-pending::before { content: "⟳"; }
  .tbl-papers th.col-status, .tbl-docs th.col-status { padding-left: 4px; padding-right: 4px; }
  /* 发卷表：答题链接文字收成链接图标（点击行为不变） */
  .tbl-assigns .col-link a.mono {
    font-size: 0; width: 30px; height: 30px; border-radius: 999px;
    background: var(--primary-light, #EFF6FF); color: var(--primary);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .tbl-assigns .col-link a.mono::before { content: "🔗"; font-size: 14px; }
  .tbl-assigns th.col-link { font-size: 0; }
  .tbl-assigns th.col-link::before { content: "链接"; font-size: 12px; }
  /* 概览 8 卡：移动端更紧凑 */
  .desk-actions { gap: 8px; margin-bottom: 12px; }
  .desk-actions a { padding: 12px 6px; }
  .desk-actions svg { width: 22px; height: 22px; }
  .desk-actions b { font-size: 13px; }
  .desk-actions small { font-size: 11px; }
  /* 概览第 9 卡（个性设置）：仅移动端 */
  .desk-actions .desk-m-only { display: flex; }
}
