/* ==========================================================
   v2.1.0 · 移动端（≤600px）阅读体验覆盖层
   加载顺序：最后（app.css → compat.css → viewer.css → 本文件）
   目标：表头收敛、内容放大、功能键整齐、底部精简
   ========================================================== */

/* ---------- 全局：详情页按钮的「长 / 短文案」 ---------- */
.doc-actions .lb-short { display: none; }
.doc-actions .act-ico { width: 15px; height: 15px; flex: 0 0 auto; margin-right: 6px; }
.op-brk, .dv-brk { display: none; }
/* PDF 工具条按钮文字不折行（否则窄屏会被压成两行再裁掉） */
.dv-toolbar button,
.dv-toolbar .dv-zoom { white-space: nowrap; }

@media (max-width: 600px) {

  /* ==================== 1. 顶栏：66px → 52px ==================== */
  .site-header .nav { height: 52px; gap: 8px; }
  .site-header .logo { gap: 8px; font-size: 15px; }
  .site-header .logo-mark { width: 28px; height: 28px; border-radius: 8px; }
  .site-header .logo-mark svg { width: 16px; height: 16px; }
  .site-header .nav-right .btn { min-height: 32px; padding: 4px 11px; font-size: 12.5px; }
  .site-header .avatar { width: 28px; height: 28px; font-size: 12px; }
  .site-header .nav-toggle { width: 34px; height: 34px; }

  /* ==================== 2. 主体留白收紧，宽度让给内容 ==================== */
  .kb-main > .container { padding-left: 10px; padding-right: 10px; }
  .kb-main > .container.py-4 { padding-top: 10px; padding-bottom: 0; }

  /* ==================== 3. 文档信息头：约 200px → 约 124px ==================== */
  .doc-head { padding: 13px 14px 12px; border-radius: 12px; margin-bottom: 10px; }
  .doc-head::after { width: 220px; height: 220px; right: -100px; top: -130px; }
  .doc-head h1 { font-size: 16.5px; line-height: 1.42; letter-spacing: 0; }
  .doc-head .doc-type { font-size: 10.5px; padding: 2px 8px; }
  .doc-head .badge { font-size: 10.5px; padding: 2px 7px; }

  /* 元信息：原来是三行大字号，收紧为最多两行的紧凑行，不做截断 */
  .doc-head-meta {
    margin-top: 6px;
    font-size: 11.5px;
    line-height: 1.5;
    gap: 1px 11px;
    flex-wrap: wrap;
    overflow: visible;
  }
  .doc-head-meta span { flex: 0 0 auto; white-space: nowrap; }
  .doc-head-meta b { font-size: 10.5px; opacity: .72; margin-right: 4px; }

  /* ==================== 4. 操作按钮：主操作一行，其余收进「更多」 ==================== */
  .doc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .doc-actions > .btn,
  .doc-actions > form { flex: 1 1 0; min-width: 0; }
  .doc-actions > form > .btn { width: 100%; }
  .doc-actions .btn {
    height: 34px;
    padding: 0 8px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }
  .doc-actions .lb-long { display: none; }
  .doc-actions .lb-short { display: inline; }
  .doc-actions .act-ico { width: 14px; height: 14px; margin-right: 3px; }
  .doc-actions .btn-primary { box-shadow: 0 8px 18px -12px rgba(2, 6, 23, .9); }

  /* 「更多」开关只在窄屏出现：点开把全屏 / 分享 / 收藏 / AI / 审核折到第二行 */
  .doc-actions .doc-more-btn { display: inline-flex; flex: 0 0 auto; padding: 0 13px; }
  .doc-actions-extra { display: none; }
  .doc-actions.is-open .doc-actions-extra {
    display: flex; flex-wrap: wrap; gap: 6px;
    flex: 1 1 100%; order: 9;
    padding-top: 7px; margin-top: 3px;
    border-top: 1px dashed rgba(255, 255, 255, .24);
  }
  .doc-actions.is-open .doc-actions-extra > .btn,
  .doc-actions.is-open .doc-actions-extra > form { flex: 1 1 0; min-width: 0; }
  .doc-actions.is-open .doc-actions-extra > form > .btn { width: 100%; }
  .doc-actions.is-open .doc-more-btn { background: rgba(255, 255, 255, .26); }

  /* 元信息：收紧成一条可横滑的窄行，把高度让给阅读区 */
  .doc-head-meta {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 94%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 94%, transparent 100%);
  }
  .doc-head-meta::-webkit-scrollbar { height: 0; }

  /* ==================== 5. 阅读区：给足高度 ==================== */
  .preview-frame {
    height: calc(100dvh - 168px);
    min-height: 440px;
    max-height: none;
    border-radius: 12px;
    border-color: #e2e8f2;
    box-shadow: 0 2px 10px -6px rgba(15, 23, 42, .18);
  }
  .preview-frame .office-preview { min-height: 0; height: 100%; }

  /* 幻灯片是 16:9 横版：高度随宽度走，避免竖屏上下空出大片灰色 */
  .preview-frame--slide { height: auto; min-height: 0; max-height: none; }
  .preview-frame--slide .office-preview { height: auto; }
  .preview-frame--slide .op-body { flex: 0 0 auto; padding: 6px 4px 10px; }
  .preview-frame--slide .op-zoom { min-height: 0; }

  /* ==================== 6. Office 工具条：默认只留一行核心按钮 ==================== */
  .office-preview .op-toolbar { padding: 5px 6px; gap: 4px; flex-wrap: nowrap; align-items: center; }
  .office-preview .op-tool-acts { flex-wrap: nowrap; overflow: visible; gap: 4px; padding-bottom: 0; width: 100%; min-width: 0; }
  .office-preview .op-toolbar.is-open .op-tool-acts { flex-wrap: wrap; row-gap: 4px; }
  .office-preview .op-btn { height: 28px; min-width: 28px; padding: 0 8px; font-size: 11.5px; border-radius: 7px; }
  .office-preview .op-s { border-left: 0; padding-left: 0; margin-left: 0; }
  .office-preview .op-search { height: 28px; width: 96px; font-size: 11.5px; padding: 0 8px; }
  .office-preview .op-count { font-size: 11px; min-width: 0; }
  .office-preview .op-body { padding: 6px 5px 12px; }
  .office-preview .op-zoom { justify-content: center; }
  .office-preview .op-more { margin-left: auto; }

  /* 收起态：页码条 + 次要按钮面板全部隐藏 */
  .office-preview .op-panel { display: none; }
  .office-preview .op-toolbar.is-open { flex-wrap: wrap; }
  .office-preview .op-toolbar:not(.is-open) .op-tabs { display: none; }
  .office-preview .op-toolbar.is-open .op-panel {
    display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center;
    gap: 4px; padding-top: 4px; margin-top: 1px;
    border-top: 1px dashed var(--line-2, #eef2f7);
  }
  .office-preview .op-toolbar.is-open .op-tabs {
    display: flex; flex: 0 0 100%; gap: 3px; padding: 0 0 2px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .office-preview .op-tab { height: 23px; min-width: 23px; padding: 0 6px; font-size: 10.5px; border-radius: 6px; }

  /* ==================== 7. PDF 工具条：同样默认一行，「更多」展开其余 ==================== */
  .dv-toolbar {
    padding: 5px 6px; gap: 4px; font-size: 10.5px;
    flex-wrap: nowrap !important; overflow-x: visible !important;
  }
  .dv-toolbar .dv-group { border-right: 0; padding: 0; margin: 0; gap: 2px; }
  .dv-toolbar button { min-height: 26px; padding: 1px 7px; font-size: 11px; border-radius: 7px; white-space: nowrap; }
  .dv-zoom { min-width: 36px; font-size: 10.5px; }
  .dv-toolbar input[type=color] { width: 22px; height: 22px; border-radius: 6px; }
  .dv-toolbar .dv-panel { display: none; }
  .dv-toolbar.is-open { flex-wrap: wrap !important; row-gap: 4px; }
  .dv-toolbar.is-open .dv-panel {
    display: flex; flex: 1 1 100%; flex-wrap: wrap; align-items: center;
    gap: 4px; padding-top: 4px; margin-top: 1px;
    border-top: 1px dashed var(--line-2, #eef2f7);
  }
  .dv-toolbar .dv-more { margin-left: auto; }
  /* 折叠开关在窄屏才出现 */
  .dv-toolbar .dv-more,
  .office-preview .op-more { display: inline-flex; }

  /* ==================== 8. Word 正文：去掉 A4 页边距，按容器宽排版 ==================== */
  .office-preview .op-zoom.op-docx { align-items: stretch; width: 100%; min-width: 0; }
  .office-preview .op-zoom.op-docx > .docx-wrapper {
    width: 100%; min-width: 0;
    display: block !important;
    padding: 0 !important;
    background: transparent !important;
  }
  .office-preview .op-docx .docx-wrapper > section.docx {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 14px 12px !important;
    box-shadow: none !important;
    border-radius: 10px;
    background: #fff;
    font-size: 15px;
    line-height: 1.75;
  }
  .office-preview .op-docx section.docx table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }
  .office-preview .op-docx section.docx table td,
  .office-preview .op-docx section.docx table th {
    padding: 4px 5px !important;
    font-size: 12.5px;
    word-break: break-word;
  }
  .office-preview .op-docx section.docx img { max-width: 100% !important; height: auto !important; }
  .office-preview .op-docx section.docx > * { max-width: 100%; }

  /* ==================== 9. 底部：页脚（仅版权 + 备案一行） ==================== */
  .site-footer { margin-top: 22px; padding: 16px 0 14px; font-size: 12px; }
  .site-footer .container { padding-left: 14px; padding-right: 14px; }
  .footer-bottom {
    padding-top: 0;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 10.5px;
    text-align: center;
  }
  .footer-bottom span { line-height: 1.6; }

  /* ==================== 10. 评论区 ==================== */
  .d-lg-none.mt-4 { margin-top: 10px !important; }
  #toggleCommentsBtn { height: 34px; font-size: 13px; border-radius: 10px; padding: 0; }
  #comments.card { margin-top: 10px !important; }
  #comments .card-header { padding: 10px 12px; font-size: 13.5px; }
  #comments .card-body { padding: 12px; }
  /* 登录提示改为上下两行，避免右侧按钮压住说明文字 */
  #comments .card-body > .alert.d-flex {
    flex-direction: column;
    align-items: flex-start !important;
    gap: 8px;
  }
  #comments .card-body > .alert.d-flex .btn { align-self: flex-end; min-height: 32px; font-size: 12.5px; }

  /* ==================== 11. 首页统计卡：奇数个时最后一张通栏 ==================== */
  .stats { gap: 10px; }
  .stats > .stat-card { padding: 11px 12px; gap: 9px; }
  .stats > .stat-card .stat-value { font-size: 20px; }
  .stats > .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }

  /* ==================== 12. 列表 / 检索页标题与排序胶囊 ==================== */
  .section-head { flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
  .section-head h2 { font-size: 19px; }
  .tabs a, .tabs button { padding: 7px 13px; font-size: 13px; }
}

/* ==========================================================
   v2.6.2 · 移动端底部导航栏（≤768px）
   取代顶栏汉堡下拉：4 个主入口 + 「我的」底部面板
   ========================================================== */
.m-tabbar, .m-sheet, .m-sheet-mask { display: none; }

@media (max-width: 768px), (max-width: 950px) and (max-height: 460px) and (orientation: landscape) {

  /* 顶栏汉堡与下拉菜单收起，交给底部导航 */
  .site-header .nav-toggle { display: none !important; }
  .site-header .nav-links { display: none !important; }
  /* 给固定底栏留出空间，最后一行内容不会被压住 */
  body:not(.no-tabbar) { padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px)); }
  body.sheet-open { overflow: hidden; }

  /* ---------------- 底栏本体 ---------------- */
  .m-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1035;
    padding: 0 4px env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    backdrop-filter: saturate(180%) blur(14px);
    border-top: 1px solid #e8eef7;
    box-shadow: 0 -8px 26px -20px rgba(15, 23, 42, .5);
  }

  .m-tab {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 58px;
    padding: 0;
    border: 0;
    background: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    color: #8b98a9;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s;
  }
  .m-tab svg { width: 22px; height: 22px; flex: 0 0 auto; transition: transform .15s; }
  .m-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-tab:active { color: var(--pri); }
  .m-tab:active svg { transform: scale(.94); }
  .m-tab.is-on { color: var(--pri); font-weight: 600; }
  /* 选中项：图标后面的浅色胶囊，比顶部细条更好认 */
  .m-tab.is-on::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    z-index: 0;
    width: 44px;
    height: 26px;
    margin-left: -22px;
    border-radius: 10px;
    background: var(--pri-50, #eef4ff);
  }
  .m-tab > svg, .m-tab > span { position: relative; z-index: 1; }

  /* 未读角标（「我的」tab 右上） */
  .m-tab-dot {
    position: absolute;
    top: 7px;
    left: 50%;
    margin-left: 7px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 600;
    line-height: 15px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
  }

  /* ---------------- 「我的」底部面板 ---------------- */
  .m-sheet-mask {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(15, 23, 42, .44);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s;
  }
  .m-sheet-mask.open { opacity: 1; visibility: visible; }

  .m-sheet {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1041;
    padding: 6px 16px calc(14px + env(safe-area-inset-bottom, 0px));
    max-height: 84vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -20px 46px -24px rgba(15, 23, 42, .55);
    transform: translateY(104%);
    transition: transform .28s cubic-bezier(.24, .86, .32, 1);
    visibility: hidden;
  }
  .m-sheet.open { transform: translateY(0); visibility: visible; }

  .m-sheet-grip {
    width: 38px;
    height: 4px;
    margin: 4px auto 12px;
    border-radius: 2px;
    background: #e3e9f2;
  }

  .m-sheet-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 2px 2px 14px;
  }
  .m-sheet-user .avatar {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(140deg, var(--pri), var(--violet));
    box-shadow: 0 8px 18px -10px rgba(37, 99, 235, .9);
  }
  .m-sheet-user-txt { min-width: 0; flex: 1; }
  .m-sheet-user-txt b { display: block; font-size: 15px; color: var(--ink); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-sheet-user-txt small { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
  .m-sheet-close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: #94a3b8;
    background: #f4f7fb;
  }
  .m-sheet-close svg { width: 15px; height: 15px; }

  .m-sheet-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px 0 6px;
    border-top: 1px solid #eef3f9;
  }
  .m-sheet-grid a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 13px 4px 11px;
    border-radius: 13px;
    color: #3f4d61;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }
  .m-sheet-grid a:active { background: #f4f8ff; }
  .m-sheet-grid a.is-on { color: var(--pri); }
  .m-sheet-ico {
    position: relative;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: #f2f7ff;
    color: var(--pri);
  }
  .m-sheet-grid a.is-on .m-sheet-ico { background: var(--pri); color: #fff; }
  .m-sheet-ico svg { width: 19px; height: 19px; }
  .m-sheet-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
  }

  .m-sheet-logout {
    display: block;
    margin-top: 8px;
    height: 44px;
    line-height: 44px;
    text-align: center;
    border-radius: 12px;
    background: #fef2f2;
    color: #dc2626;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
  }
  .m-sheet-logout:active { background: #fee2e2; }
}

/* 横屏矮屏：底栏稍微收薄，避免占掉阅读区 */
@media (max-width: 950px) and (max-height: 460px) and (orientation: landscape) {
  .m-tabbar { padding-top: 0; }
  .m-tab { height: 50px; font-size: 10px; }
  .m-tab svg { width: 19px; height: 19px; }
  body:not(.no-tabbar) { padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px)); }
}

/* ==========================================================
   v2.9.3 · 检索 / 查阅页（手机端）：能收的都收起来
   表单只留「关键词 + 检索 + 筛选」一行，筛选条件放进折叠面板；
   排序由胶囊换成下拉；结果卡只留标题两行 + 摘要两行 + 一条可横滑的元信息。
   ========================================================== */
@media (max-width: 768px) {

  .search-page { padding-top: 8px; }

  /* ---------------- 检索表单 ---------------- */
  .search-form { padding: 8px; gap: 6px; border-radius: 13px; }
  .sf-kw {
    order: 1;
    flex: 1 1 110px;
    height: 36px;
    padding: 0 4px 0 8px;
    gap: 6px;
  }
  .sf-kw svg { width: 16px; height: 16px; }
  .sf-kw input { font-size: 14px; padding: 0; height: 36px; }
  .search-form .sf-submit {
    order: 2;
    flex: 0 0 auto;
    height: 36px;
    padding: 0 14px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 10px;
  }
  .search-form .sf-toggle {
    order: 3;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    border-radius: 10px;
  }
  .search-form.is-open .sf-toggle {
    border-color: #c7d2fe;
    background: var(--pri-50, #eef4ff);
    color: var(--pri);
  }

  /* 折叠面板：两列网格，文件编号 / IMA / 按钮占整行 */
  .search-form .sf-more { display: none; }
  .search-form.is-open .sf-more {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    order: 9;
    flex: 1 1 100%;
    width: 100%;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px dashed #e8eef7;
  }
  /* 选择器带 .search-page 前缀：压过 app.css 里桌面端的固定宽度 */
  .search-page .search-form.is-open .sf-more > * { order: 0; width: 100%; min-width: 0; }
  .search-page .search-form.is-open .sf-more > select[name="org"] { order: 1; }
  .search-page .search-form.is-open .sf-more > select[name="cat"] { order: 2; }
  .search-page .search-form.is-open .sf-more > select[name="type"] { order: 3; }
  .search-page .search-form.is-open .sf-more > select[name="year"] { order: 4; }
  .search-page .search-form.is-open .sf-more > .sf-check { order: 5; }
  .search-page .search-form.is-open .sf-more > input[name="doc_no"] { order: 6; }
  .search-page .search-form.is-open .sf-more > .sf-actions { order: 7; }
  .search-form .sf-more > input[name="doc_no"],
  .search-form .sf-more > .sf-check,
  .search-form .sf-more > .sf-actions { grid-column: 1 / -1; }
  .search-form .sf-more .select {
    width: 100%;
    height: 34px;
    padding: 0 9px;
    font-size: 13px;
    border-radius: 9px;
  }
  .search-form .sf-more .sf-m-only { display: inline-flex; }
  .search-form .sf-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0;
    font-size: 12.5px;
  }
  .search-form .sf-check input { width: 15px; height: 15px; margin: 0; }
  .search-form .sf-actions { display: flex; gap: 8px; margin-top: 2px; }
  .search-form .sf-actions .btn {
    flex: 1 1 0;
    height: 34px;
    font-size: 13px;
    border-radius: 9px;
  }

  /* ---------------- 结果头：标题 + 数量 + 排序下拉，压成一行 ---------------- */
  .search-page .result-head {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
  }
  .search-page .result-head > div {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
  }
  .search-page .result-head h2 {
    font-size: 15.5px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .search-page .result-head p {
    flex: 0 0 auto;
    max-width: 48%;
    margin: 0;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .search-page .result-head .tabs { display: none; }
  /* 手机端不必显示检索耗时，把宽度让给标题 */
  .search-page .sf-time { display: none; }
  .search-page .sf-sort {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    max-width: 108px;
    height: 30px;
    padding: 0 24px 0 9px;
    font-size: 12px;
    border-radius: 9px;
    border-color: #e2e8f2;
    background-color: #fff;
    background-position: right 7px center;
    color: var(--text);
  }

  /* 当前筛选胶囊 */
  .search-page .chip-row { gap: 6px; margin-bottom: 10px !important; }
  .search-page .chip-row > .small { display: none; }
  .search-page .chip { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; }

  /* ---------------- 结果卡：收紧，只留最有用的两三行 ---------------- */
  .search-page .result-list { gap: 9px; }
  .search-page .result-item {
    padding: 11px 12px;
    gap: 10px;
    border-radius: 12px;
    align-items: flex-start;
  }
  .search-page .result-item .file-badge {
    width: 32px !important;
    height: 32px !important;
    border-radius: 9px;
    font-size: 9px;
  }
  .search-page .result-title {
    font-size: 14px;
    line-height: 1.45;
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .search-page .result-snippet {
    font-size: 12px;
    line-height: 1.6;
    -webkit-line-clamp: 2;
  }
  /* 元信息：一条可横滑的窄行，不折成三四行 */
  .search-page .result-foot {
    flex-wrap: nowrap;
    gap: 6px;
    margin-top: 6px;
    font-size: 10.5px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(90deg, #000 0, #000 94%, transparent 100%);
    mask-image: linear-gradient(90deg, #000 0, #000 94%, transparent 100%);
  }
  .search-page .result-foot::-webkit-scrollbar { height: 0; }
  .search-page .result-foot > span { flex: 0 0 auto; white-space: nowrap; }
  .search-page .result-foot .tag { font-size: 10px; padding: 1px 6px; }
  .search-page .result-foot .score-pill { margin-left: 0 !important; font-size: 10px; }
  .search-page .result-actions { gap: 6px; margin-top: 8px; }
  .search-page .result-actions .btn {
    flex: 1 1 0;
    max-width: 190px;   /* 平板宽屏下不把按钮拉成一整条 */
    height: 31px;
    padding: 0 8px;
    font-size: 12.5px;
    border-radius: 8px;
  }

  /* 手机上不再重复一整个筛选栏：条件已在上面板里 */
  .search-page .layout-side { display: none; }
  .search-page .layout-main { margin-top: 12px !important; }

  /* 分页更省高度 */
  .search-page .pager { margin-top: 16px; gap: 5px; }
  .search-page .pager-item {
    min-width: 30px;
    height: 30px;
    padding: 0 9px;
    font-size: 12.5px;
    border-radius: 8px;
  }
  .search-page .pager-total {
    width: 100%;
    margin: 4px 0 0;
    text-align: center;
    font-size: 11px;
  }

  /* 空结果面板也收紧一些 */
  .search-page .panel.empty { padding: 26px 16px; }
}
