/**
 * Xdir v2.0.0 (http://www.xuxiaokun.com)
 * Copyright 2020 -2023 Mr.xu's blog, Inc.
**/

.sousuo-nome{display:none;}

/* ============================================================
 * 第十批 UI 补丁 · 搜索页（Xdir 20261119o）
 * 1) 电脑端：「索引共收录…」说明区与搜索结果的「文件」列上下对齐、间隔合理
 * 2) 移动端：说明区 / 表格排版重构，补回「大小 · 修改时间」信息
 * 3) 悬停：复用索引页 .xdir-idx-clear / .xdir-idx a:hover 的视觉语言
 * 本文件在 style.css / sousuo.css 之后加载，用于覆盖搜索页旧样式
 * ============================================================ */

/* ---------- 1. 说明区：左缘与「文件」列文字严格对齐 ---------- */
/* 依据：layui 单元格 padding 15px + .xdir-search-body 边框 1px = 16px */
.xdir-search-kw,
.xdir-search-meta { padding-left: 16px; }

.xdir-search-meta {
    margin: 8px 0 16px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #909399;
    text-align: left;
    word-break: break-word;
}

.xsm-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}
.xsm-item { display: inline-flex; align-items: center; white-space: nowrap; }
.xsm-item i,
.xsm-row-sub > i { margin-right: 4px; color: #1E9FFF; }
.xsm-item b { font-weight: 600; color: #5b6b7b; }

/* 「立即重建索引」：与索引页 .xdir-idx-clear 同款浅底胶囊 */
.xsm-rebuild {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12.5px;
    background: #f0f4f9;
    color: #5b6b7b;
    text-decoration: none !important;
    transition: color .18s ease, background .18s ease;
}
.xsm-rebuild:hover,
.xsm-rebuild:focus { background: #e2e9f2; color: #1E9FFF; text-decoration: none !important; }

/* 屏蔽声明：段落式，禁止两端对齐拉伸 */
.xsm-row.xsm-row-sub {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.65;
    color: #a0aab6;
    text-align: left;
}

/* ---------- 2. 结果容器：与索引页卡片统一 ---------- */
.xdir-search-body {
    border-color: #e6ecf3;
    border-radius: 14px;
    box-shadow: 0 8px 26px rgba(20, 40, 80, .06);
}

/* 桌面端由「大小 / 修改时间」独立列承载，行内小字隐藏 */
td.xs-file .xs-meta { display: none; }

/* Xdir 20261119q：展开键与操作浮层只服务移动端，桌面端一律不出现 */
.xdir-search-table td.xs-ops .xs-acts-btn,
.xdir-search-table td.xs-ops .xs-acts-panel { display: none; }

/* 桌面端文件名悬停：复用索引页 a:hover 语言（蓝字 + 下划线指示） */
td.xs-file a.preview {
    border-bottom: 1px solid transparent;
    transition: color .15s ease, border-bottom-color .15s ease;
}
td.xs-file a.preview:hover,
td.xs-file a.preview:focus { color: #1E9FFF; border-bottom-color: #1E9FFF; }

/* ---------- 3. 移动端重构（≤768px） ---------- */
@media screen and (max-width: 768px) {
    /* 关键词行与说明区同缘（单元格 padding 12px + 边框 1px = 13px） */
    .xdir-search-kw,
    .xdir-search-meta { padding-left: 13px; padding-right: 13px; }

    .xdir-search-kw { font-size: 14px; gap: 6px; }
    .xsk-count { flex: 0 0 auto; margin-left: 0; padding: 1px 8px; }

    .xdir-search-meta { margin: 6px 0 14px; font-size: 12px; line-height: 1.75; text-align: left; }
    .xsm-row { gap: 5px 10px; }
    .xsm-item { white-space: normal; }
    .xsm-rebuild { padding: 4px 11px; }
    .xsm-row.xsm-row-sub { margin-top: 6px; font-size: 11.5px; }

    /* 关键：解除 colgroup 固定列宽，否则隐藏的三列仍占用 390px 把「文件」列挤成窄条 */
    .xdir-search-table colgroup { display: none; }
    .xdir-search-table { table-layout: auto; width: 100%; }

    .xdir-search-table th,
    .xdir-search-table td { padding: 8px 12px; }

    /* 文件名放开单行省略，最多两行 */
    .xdir-search-table td.xs-file { white-space: normal; }

    /* —— 图标 + 文件名同行（左侧起、右侧键收），右侧展开键 —— */
    .xdir-search-table td.xs-file > .xs-main {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        min-width: 0;
    }
    .xdir-search-table td.xs-file > .xs-main > i.fa {
        flex: 0 0 auto;
        margin-right: 0;
        line-height: 1;
    }

    /* 逐条压掉 style.css 中 td.xs-file a.preview 的 inline-block / 单行省略 /
       max-width 限制，改为可两行折断并撑满图标与按钮之间的剩余空间 */
    .xdir-search-table td.xs-file > .xs-main > a.preview {
        flex: 1 1 auto;
        min-width: 0;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        max-width: none;
        white-space: normal;
        overflow: hidden;
        text-overflow: clip;
        word-break: break-all;
        vertical-align: baseline;
        line-height: 1.45;
    }

    /* 展开键：沿用索引页 .xdir-acts-btn 视觉（30×30、8px 圆角、灰→蓝） */
    .xdir-search-table td.xs-ops .xs-acts-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 30px;
        height: 30px;
        padding: 0;
        border: 1px solid transparent;
        border-radius: 8px;
        background: transparent;
        color: #8b98a8;
        font-size: 15px;
        line-height: 1;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
        transition: color .16s ease, background .16s ease;
    }
    .xdir-search-table td.xs-ops .xs-acts-btn:hover,
    .xdir-search-table td.xs-ops .xs-acts-btn:focus-visible {
        color: #1E9FFF;
        background: rgba(30, 159, 255, .09);
        outline: none;
    }
    .xdir-search-table td.xs-ops.xs-acts-open .xs-acts-btn {
        color: #1E9FFF;
        background: rgba(30, 159, 255, .13);
    }

    /* 操作浮层：贴合右缘向左侧展开，覆盖文件名（与索引页同构） */
    .xdir-search-table td.xs-ops .xs-acts-panel {
        position: absolute;
        right: 0;
        top: 50%;
        z-index: 30;
        display: none;
        align-items: center;
        gap: 4px;
        padding: 4px 4px 4px 0;
        background: #fff;
        border: 1px solid #dbe6f2;
        border-radius: 10px;
        box-shadow: 0 8px 22px rgba(20, 40, 80, .16);
        transform: translateY(-50%);
        transform-origin: 100% 50%;
    }
    .xdir-search-table td.xs-ops.xs-acts-open .xs-acts-panel {
        display: flex;
        animation: xsActsIn .16s ease-out;
    }
    @keyframes xsActsIn {
        from { opacity: 0; transform: translateY(-50%) scaleX(.82); }
        to   { opacity: 1; transform: translateY(-50%) scaleX(1); }
    }

    /* 收起键：贴面板左缘，蓝色右箭头 */
    .xdir-search-table td.xs-ops .xs-acts-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto;
        width: 28px;
        height: 30px;
        padding: 0;
        border: 0;
        border-right: 1px solid #e3ebf4;
        background: transparent;
        color: #1E9FFF;
        font-size: 14px;
        line-height: 1;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
        transition: background .16s ease;
    }
    .xdir-search-table td.xs-ops .xs-acts-close:hover { background: #f2f7fd; }

    /* 浮层内操作键放大到 30×30，与展开键同高 */
    .xdir-search-table td.xs-ops .xs-acts-panel .xs-op {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        border-radius: 7px;
        font-size: 14px;
    }

    /* 移动端补回「大小 · 修改时间」 */
    td.xs-file .xs-meta {
        display: block;
        margin-top: 5px;
        font-size: 12px;
        line-height: 1.5;
        color: #909399;
        white-space: nowrap;   /* 本批 #7：大小 · 时间 保持单行，不溢出换行 */
    }
    td.xs-file .xs-meta i { margin-right: 3px; color: #b0b8c2; }
    td.xs-file .xs-meta em { font-style: normal; margin: 0 3px; opacity: .5; }

    /* ---------- Xdir 20261119s 第十四批 #4.6：移动端「功能」列改回单触发键 + 悬停/点击展开 ---------- */
    /* 触发键与浮层已移入 td.xs-ops，按上方 :147 起的规则在移动端显示；
       桌面端由 min-width:769px 段的 display:none 兜底隐藏，故此处不再用 !important 收起。 */

    /* 「功能」列：移动端常显四键（复制 / 分享 / 下载 / 新窗口）。
       ★ 第十六批 #5：原 width:1% 把列宽压到约 1%，导致列头「功能」二字被挤成竖向换行；
       且窄列 + 单元格默认裁剪，使展开浮层向左伸出时被裁掉、看起来像「文件名盖住了按键」。
       改法：列宽改为 auto 并给 min-width（刚好容下触发键与列头二字），取消单元格裁剪，
       抬升本列 z-index 让展开浮层稳定覆盖在文件名之上。 */
    .xdir-search-table td.xs-ops {
        display: table-cell;
        position: relative;
        z-index: 5;                  /* 高于左侧 td.xs-file，展开浮层稳定压在文件名上方 */
        width: auto;
        min-width: 46px;             /* 容下列头「功能」与 30px 触发键，不再被压成竖排 */
        max-width: none;
        padding-left: 0;
        padding-right: 10px;
        white-space: nowrap;
        overflow: visible;           /* 浮层向左伸出不被裁切 */
        vertical-align: middle;
        text-align: right;
    }
    /* 列头「功能」：与数据列同款 nowrap + min-width，避免移动端挤成竖向换行 */
    .xdir-search-table th:last-child {
        white-space: nowrap;
        min-width: 46px;
        text-align: right;
    }
    .xdir-search-table td.xs-ops > a.xs-op { display: none; }   /* 移动端隐藏常显四键，改由触发键展开 */

    /* 文件列：一路收缩到底，长路径两行截断（.xs-main 的 min-width:0 已在 :119 落地，
       这里再兜一层，防止 style.css 里 td.xs-file 的 nowrap 残留把表格撑破）。 */
    /* 本批 #7：放宽文件列最小宽度，配合 .xs-meta 单行 nowrap，让「大小 · 修改时间」在一行内显示、时间不溢出换行 */
    .xdir-search-table td.xs-file { min-width: 150px; }
    .xdir-search-table td.xs-file > .xs-main { width: 100%; }

    /* 夜间：功能列按键换深底（style.css 的 .night .xs-op 已被本规则特异度覆盖） */
    .night .xdir-search-table td.xs-ops .xs-op { background: #1b2735; color: #9fb2c6; }
    .night .xdir-search-table td.xs-ops .xs-op:hover,
    .night .xdir-search-table td.xs-ops .xs-op:focus { background: #223040; color: #6db3ff; }

    /* 夜间模式：浮层与按键换深底 */
    .night .xdir-search-table td.xs-ops .xs-acts-btn { color: #9fb2c6; }
    .night .xdir-search-table td.xs-ops .xs-acts-btn:hover,
    .night .xdir-search-table td.xs-ops .xs-acts-btn:focus-visible { color: #6db3ff; background: rgba(109, 179, 255, .14); }
    .night .xdir-search-table td.xs-ops.xs-acts-open .xs-acts-btn { color: #6db3ff; background: rgba(109, 179, 255, .18); }
    .night .xdir-search-table td.xs-ops .xs-acts-panel {
        background: #16202c;
        border-color: #2c3e50;
        box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
    }
    .night .xdir-search-table td.xs-ops .xs-acts-close {
        border-right-color: #2c3e50;
        color: #6db3ff;
    }
    .night .xdir-search-table td.xs-ops .xs-acts-close:hover { background: #1b2735; }
}

/* 宽屏兜底：即便类名残留，展开键与浮层也不得出现 */
@media screen and (min-width: 769px) {
    .xdir-search-table td.xs-ops .xs-acts-btn,
    .xdir-search-table td.xs-ops .xs-acts-panel { display: none !important; }
}

/* 尊重系统「减少动态效果」 */
@media (prefers-reduced-motion: reduce) {
    .xdir-search-table td.xs-ops.xs-acts-open .xs-acts-panel { animation: none; }
    .xdir-search-table td.xs-ops .xs-acts-btn,
    .xdir-search-table td.xs-ops .xs-acts-close { transition: none; }
}

/* ---------- 4. 夜间模式适配 ---------- */
.night .xdir-search-meta { color: #7c8b9c; }
.night .xsm-item i,
.night .xsm-row-sub > i { color: #6db3ff; }
.night .xsm-item b { color: #9fb2c6; }
.night .xsm-rebuild { background: #1b2735; color: #9fb2c6; }
.night .xsm-rebuild:hover,
.night .xsm-rebuild:focus { background: #223040; color: #6db3ff; }
.night .xsm-row.xsm-row-sub { color: #6b7c8e; }
.night .xdir-search-body { background: #16202c; border-color: #2c3e50; box-shadow: none; }
.night td.xs-file a.preview:hover,
.night td.xs-file a.preview:focus { color: #6db3ff; border-bottom-color: #6db3ff; }
.night td.xs-file .xs-meta { color: #7c8b9c; }
.night td.xs-file .xs-meta i { color: #5d6d7e; }