/* 搜索结果页面样式 - 简洁网盘风格 2024-01-22 */

/* === 强制全宽布局 === */
.search-results-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.zib-123pan-search-container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* === 搜索结果容器 === */
.zib-search-results {
    width: 100% !important;
    max-width: none !important;
    margin: 0px 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    border-radius: 8px;
    box-sizing: border-box !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

/* === 文件列表容器 - 格子样式 === */
.zib-search-results .zib-file-list {
    width: 100% !important;
    border: 2px dashed #e0e0e0 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
}

/* === 无结果状态 === */
.zib-search-no-results {
    text-align: center;
    padding: 2rem 1rem;
    background: #fafafa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    margin: 1rem 0;
}

.no-results-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
    color: #666;
}

.no-results-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.no-results-tip {
    font-size: 0.875rem;
    color: #666;
}

/* === 搜索统计信息 === */
.zib-search-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border-bottom: 1px solid #dee2e6 !important;
    margin-bottom: 16px;
    font-size: 14px !important;
    color: #495057 !important;
    font-weight: 500 !important;
    border-radius: 8px 8px 0 0 !important;
}

/* === 表格容器样式 === */
.search-results-table-container {
    width: 100% !important;
    overflow-x: auto !important;
    margin: 16px 0 !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    background: #ffffff !important;
}

.search-results-table {
    width: 100% !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    margin: 0 !important;
    background: #ffffff !important;
}

/* === 表格表头样式 === */
.search-results-table thead {
    background: #f8f9fa !important;
    border-bottom: 2px solid #dee2e6 !important;
    display: table-header-group !important;
}

.search-results-table th {
    background: #f8f9fa !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 12px 8px !important;
    text-align: left !important;
    border-bottom: 2px solid #dee2e6 !important;
    border-right: 1px solid #dee2e6 !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    display: table-cell !important;
}

.search-results-table th:last-child {
    border-right: none !important;
}

.search-results-table .file-name-header {
    width: 60% !important;
    min-width: 200px !important;
}

.search-results-table .file-size-header {
    width: 20% !important;
    min-width: 80px !important;
    text-align: center !important;
}

.search-results-table .file-actions-header {
    width: 20% !important;
    min-width: 80px !important;
    text-align: center !important;
}

/* === 表格主体样式 === */
.search-results-table tbody {
    display: table-row-group !important;
}

.search-results-table tbody tr {
    display: table-row !important;
    border-bottom: 1px solid #e0e0e0 !important;
}

.search-results-table tbody tr:hover {
    background-color: #f8f9fa !important;
}

.search-results-table tbody tr:last-child {
    border-bottom: none !important;
}

.search-results-table td {
    padding: 12px 8px !important;
    border-right: 1px solid #e0e0e0 !important;
    vertical-align: middle !important;
    display: table-cell !important;
}

.search-results-table td:last-child {
    border-right: none !important;
}

.stats-main {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stats-count {
    font-weight: 500;
    color: #333;
}

.stats-time {
    color: #999;
    font-size: 13px;
}

.stats-actions {
    display: flex;
    gap: 8px;
}

/* === 文件列表容器 === */
.zib-file-list {
    display: block !important;
    width: 100% !important;
    border: none;
    background: transparent;
    box-sizing: border-box !important;
}

/* === 表格头部 - 格子样式 === */
.zib-file-header {
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%) !important;
    border: none !important;
    border-bottom: 2px solid #dee2e6 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #495057 !important;
    min-height: 40px !important;
    max-height: 40px !important;
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.zib-file-header .file-icon-header {
    width: 20px !important;
    margin-right: 12px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.zib-file-header .file-name-header {
    flex: 1 !important;
    margin-right: 12px !important;
    text-align: left !important;
    min-width: 0 !important;
    display: flex !important;
    align-items: center !important;
}

.zib-file-header .file-size-header {
    width: 100px !important;
    margin-right: 12px !important;
    text-align: right !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

.zib-file-header .file-actions-header {
    width: 100px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
    margin-right: 0px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}



.zib-file-list-header {
    display: flex !important;
    align-items: center !important;
    padding: 3px 8px !important;
    background: #f0f0f0 !important;
    border: 1px solid #e0e0e0 !important;
    border-bottom: 1px solid #d0d0d0 !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #555 !important;
    min-height: 26px !important;
    max-height: 26px !important;
}

.zib-file-list-header .header-icon {
    width: 16px !important;
    margin-right: 6px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
}

.zib-file-list-header .header-name {
    flex: 1 !important;
    margin-right: 6px !important;
    text-align: left !important;
}

.zib-file-list-header .header-size {
    width: 50px !important;
    margin-right: 6px !important;
    text-align: right !important;
    flex-shrink: 0 !important;
}

.zib-file-list-header .header-actions {
    width: 50px !important;
    text-align: right !important;
    flex-shrink: 0 !important;
}

/* === 文件项 - 格子布局 === */
.zib-search-results .zib-file-item {
    display: flex !important;
    align-items: center !important;
    padding: 12px 16px !important;
    margin: 0 !important;
    background: #ffffff !important;
    border: none !important;
    border-bottom: 1px solid #f1f3f4 !important;
    border-radius: 0 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    min-height: 48px !important;
    max-height: 48px !important;
}

.zib-search-results .zib-file-item:hover {
    background: #f8f9fa !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
}

.zib-search-results .zib-file-item:last-child {
    border-bottom: none !important;
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

.zib-search-results .zib-file-item > div {
    align-items: center !important;
    padding: 0 !important;
    border: none !important;
}

/* === 文件图标 === */
.zib-search-results .file-icon {
    width: 20px !important;
    height: 20px !important;
    margin-right: 12px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #e3f2fd !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    color: #1976d2 !important;
    flex-shrink: 0 !important;
}

/* === 文件名列 === */
.zib-search-results .file-name-cell {
    flex: 1 !important;
    min-width: 0 !important;
    margin-right: 12px !important;
}

.zib-search-results .file-name {
    margin: 0 !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #212529 !important;
    line-height: 1.4 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
    transition: color 0.2s ease !important;
}

.zib-search-results .file-name:hover {
    color: #1976d2 !important;
}

/* === 文件大小列 === */
.zib-search-results .file-size-cell {
    width: 100px !important;
    text-align: right !important;
    font-size: 12px !important;
    color: #6c757d !important;
    font-weight: 500 !important;
    margin-right: 12px !important;
    flex-shrink: 0 !important;
}

/* === 操作按钮列 === */
.zib-search-results .file-actions-cell {
    width: 100px !important;
    text-align: center !important;
    flex-shrink: 0 !important;
    margin-right: 0px !important;
}

.zib-search-results .file-actions {
    display: flex !important;
    justify-content: center !important;
    gap: 8px !important;
}

.zib-search-results .download-btn {
    padding: 6px 12px !important;
    background: #1976d2 !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    height: 32px !important;
    box-shadow: 0 2px 4px rgba(25, 118, 210, 0.2) !important;
}

.zib-search-results .download-btn:hover {
    background: #1565c0 !important;
    color: white !important;
    box-shadow: 0 4px 8px rgba(25, 118, 210, 0.3) !important;
}

.zib-search-results .zib-btn {
    display: inline-flex !important;
    align-items: center !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    border-radius: 4px !important;
    border: 1px solid #d0d0d0 !important;
    background: #ffffff !important;
    color: #666 !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
}

.zib-search-results .zib-btn:hover {
    background: #f5f5f5 !important;
    border-color: #1976d2 !important;
    color: #1976d2 !important;
}

.zib-search-results .zib-btn-primary {
    background: #1976d2 !important;
    border-color: #1976d2 !important;
    color: #ffffff !important;
}

.zib-search-results .zib-btn-primary:hover {
    background: #1565c0 !important;
    border-color: #1565c0 !important;
}

/* 关键词高亮样式 */
.search-highlight,
mark.search-highlight,
mark {
    background: none !important;
    color: #dc2626 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-weight: bold !important;
    font-size: 1.2em !important;
}

/* 夜间模式下的关键词高亮 */
body.dark-theme .search-highlight,
body.theme-dark .search-highlight,
.zib-theme-dark .search-highlight,
.dark-mode .search-highlight,
body[data-theme="dark"] .search-highlight,
html[data-theme="dark"] .search-highlight,
html.dark .search-highlight,
body.dark .search-highlight,
body.dark-theme mark.search-highlight,
body.theme-dark mark.search-highlight,
.zib-theme-dark mark.search-highlight,
.dark-mode mark.search-highlight,
body[data-theme="dark"] mark.search-highlight,
html[data-theme="dark"] mark.search-highlight,
html.dark mark.search-highlight,
body.dark mark.search-highlight,
body.dark-theme mark,
body.theme-dark mark,
.zib-theme-dark mark,
.dark-mode mark,
body[data-theme="dark"] mark,
html[data-theme="dark"] mark,
html.dark mark,
body.dark mark {
    color: #f87171 !important; /* 浅红色 */
    background: none !important;
    font-weight: bold !important;
}

/* === 夜间模式表头样式 === */
body.dark-theme .search-results-table thead,
body.theme-dark .search-results-table thead,
.zib-theme-dark .search-results-table thead,
.dark-mode .search-results-table thead,
body[data-theme="dark"] .search-results-table thead,
html[data-theme="dark"] .search-results-table thead,
html.dark .search-results-table thead,
body.dark .search-results-table thead {
    background: #2d3748 !important;
    border-bottom: 2px solid #4a5568 !important;
}

body.dark-theme .search-results-table th,
body.theme-dark .search-results-table th,
.zib-theme-dark .search-results-table th,
.dark-mode .search-results-table th,
body[data-theme="dark"] .search-results-table th,
html[data-theme="dark"] .search-results-table th,
html.dark .search-results-table th,
body.dark .search-results-table th {
    background: #2d3748 !important;
    color: #e2e8f0 !important;
    border-bottom: 2px solid #4a5568 !important;
}

/* === 响应式设计 === */
@media (max-width: 768px) {
    .zib-search-results {
        padding: 12px;
        border-radius: 6px;
    }
    
    .zib-search-stats {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .stats-main {
        flex-direction: column;
        gap: 4px;
    }
    
    .zib-search-results .zib-file-item {
        display: block !important;
        padding: 12px !important;
        margin-bottom: 12px !important;
    }
    
    .zib-search-results .zib-file-item > div {
        display: block !important;
        margin-bottom: 8px !important;
    }
    
    .zib-search-results .zib-file-item > div:last-child {
        margin-bottom: 0 !important;
    }
    
    .zib-search-results .file-name-cell {
        width: auto !important;
        margin-right: 0 !important;
        margin-bottom: 8px !important;
        text-align: center !important;
    }
    
    .zib-search-results .file-name {
        white-space: normal !important;
        font-size: 12px !important;
        font-weight: 500 !important;
    }
    
    .zib-search-results .file-size-cell {
        width: auto !important;
        text-align: center !important;
        margin-right: 0 !important;
        margin-bottom: 8px !important;
    }
    
    .zib-search-results .file-actions-cell {
        width: auto !important;
        text-align: center !important;
    }
    
    .zib-search-results .download-btn {
        padding: 8px 16px !important;
        font-size: 13px !important;
    }
}

/* === 加载动画 === */
.zib-file-item {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === 动画延迟 === */
.zib-file-item:nth-child(1) { animation-delay: 0.05s; }
.zib-file-item:nth-child(2) { animation-delay: 0.1s; }
.zib-file-item:nth-child(3) { animation-delay: 0.15s; }
.zib-file-item:nth-child(4) { animation-delay: 0.2s; }
.zib-file-item:nth-child(5) { animation-delay: 0.25s; }
.zib-file-item:nth-child(n+6) { animation-delay: 0.3s; }

/* === 强制下载按钮颜色修复 === */
.zib-search-results .zib-file-item .file-actions .download-btn:hover,
.zib-search-results .download-btn:hover {
    color: white !important;
    background: #1565c0 !important;
}