/* ============================================================
   index.css —— 首页（软件搜索）专属样式
   通用变量与基础组件已在 main.css 定义，此处仅补充本页布局细节。
   ============================================================ */

.page-home .results .table {
    font-size: 0.92em;
}

/* 操作列右对齐，宽度收紧，避免下载按钮换行 */
.page-home .results th:last-child,
.page-home .results td:last-child {
    text-align: right;
    white-space: nowrap;
    width: 90px;
}

/* ID 列等宽、居中、次要色 */
.page-home .results td:first-child {
    font-family: var(--mw-font-mono);
    color: var(--mw-muted);
    width: 64px;
}

/* 大小列不换行，右对齐更像文件列表 */
.page-home .results td:nth-child(3) {
    white-space: nowrap;
    color: var(--mw-text);
}

/* 更新时间列次要色 */
.page-home .results td:nth-child(4) {
    color: var(--mw-muted);
    white-space: nowrap;
}

/* 结果头部计数说明 */
.results-note {
    padding: 10px 20px;
    color: var(--mw-muted);
    font-size: 0.85em;
    border-bottom: 1px solid var(--mw-cell-border);
}

/* ============================================================
   结果表横向滚动包裹层
   ------------------------------------------------------------
   外层 .card 为了圆角裁切是 overflow:hidden，表格一旦比卡片宽，
   「下载」列就会被直接裁掉且不可达（窄屏实测 scrollWidth 496 > clientWidth 403）。
   本层接管横向滚动：表格超宽时在本层内滑动，页面 body 不会被撑出横向溢出。
   （与 account.css .acct-table-wrap / admin.css .admin-table-wrap 同一范式）
   ============================================================ */
.page-home .result-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

/* 窄屏（≤640px）：隐藏次要列，保住「ID + 文件名 + 下载」三列；
   同时把表格切成固定布局，文件名按剩余宽度省略号截断，
   表格宽度恒等于包裹层宽度 → 下载按钮不靠滚动也在视口内。 */
@media (max-width: 640px) {
    /* 大小列、更新时间列在窄屏退出（含表头） */
    .page-home .results th:nth-child(3),
    .page-home .results td:nth-child(3),
    .page-home .results th:nth-child(4),
    .page-home .results td:nth-child(4) {
        display: none;
    }

    .page-home .results .table {
        table-layout: fixed;
        width: 100%;
    }

    /* 单元格横向内边距收紧（先写，让下面按列定位的规则可以再单独覆盖） */
    .page-home .results .table th,
    .page-home .results .table td {
        padding-left: 8px;
        padding-right: 8px;
    }

    /* 收紧固定列，给文件名留出可截断的弹性空间 */
    .page-home .results th:first-child,
    .page-home .results td:first-child {
        width: 66px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .page-home .results th:last-child,
    .page-home .results td:last-child {
        width: 82px;
    }

    /* 文件名列占满剩余宽度，单行省略号（title 属性已带完整名，悬停可读） */
    .page-home .results .filename {
        max-width: none;
    }

    /* 下载按钮宽度压在固定列内，不靠 overflow 外溢 */
    .page-home .results .btn-download {
        padding: 4px 10px;
    }
}

/* 搜索中禁用提交按钮的视觉反馈由 .btn-primary:disabled 提供 */
