/* static/css/pages/search_results.css */
/* 搜索结果页面特定样式 - 修复版本 */

/* 确保使用更具体的选择器避免冲突 */
.search-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.search-results-header {
    margin-bottom: 30px;
}

.search-results-header h1 {
    margin-bottom: 20px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 24px;
    flex-wrap: wrap;
}

/* 搜索示例样式 */
.search-examples-section {
    margin-bottom: 20px;
    width: 100%;
}

.search-examples {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin-top: 10px;
    font-size: 14px;
}

.example-title {
    font-weight: bold;
    margin-bottom: 10px;
    color: #495057;
}

.example-item {
    margin-left: 15px;
    margin-bottom: 5px;
    color: #6c757d;
}

/* 搜索表单 */
.search-results-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.search-results-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-results-input:focus {
    outline: none;
    border-color: #007bff;
}

.search-results-form .search-button {
    padding: 12px 25px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    min-width: 100px;
}

.search-results-form .search-button:hover {
    background-color: #0056b3;
}

/* 通配符信息 */
.wildcard-info {
    background-color: #e7f3ff;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #007bff;
}

/* 结果摘要 */
.results-summary {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 25px;
    border-left: 4px solid #28a745;
}

/* 结果项 */
.search-result-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s, transform 0.2s;
}

.search-result-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 15px;
}

.result-header h3 {
    margin: 0;
    font-size: 1.5rem;
}

/* 切换按钮 */
.result-toggle-btn {
    background: none;
    border: 1px solid #dee2e6;
    color: #007bff;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.result-toggle-btn:hover {
    background-color: #f8f9fa;
    color: #0056b3;
    border-color: #007bff;
}

.result-toggle-btn i {
    transition: transform 0.3s;
}

.result-toggle-btn.collapsed i {
    transform: rotate(-90deg);
}

/* 结果内容 */
.result-content-wrapper {
    max-height: none;
    overflow: visible;
    transition: max-height 0.3s ease-out;
}

.result-content-wrapper.collapsed {
    max-height: 0;
    overflow: hidden;
}

/* 文献链接 */
.literature-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.literature-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* 文件信息 */
.search-file-info {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 8px;
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
}

/* 匹配计数 */
.match-count {
    background-color: #6f42c1;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
}

/* 页面匹配项 */
.page-match-item {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    border-left: 3px solid #007bff;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.page-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.page-link {
    color: #28a745;
    text-decoration: none;
    font-weight: 600;
}

.page-link:hover {
    text-decoration: underline;
    color: #1e7e34;
}

.page-info {
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 5px;
}

.page-match-count {
    background-color: #fd7e14;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

/* 完整内容 */
.search-full-content {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    position: relative;
    max-height: 400px;
    overflow-y: auto;
}

.search-full-content mark {
    background-color: #ffc107;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: bold;
}

/* 页面操作按钮 */
.page-action {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.open-page-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 20px !important;
    font-size: 14px !important;
    min-width: 130px !important;
    height: 40px !important;
    gap: 8px !important;
    background-color: #007bff !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    text-decoration: none !important;
}

.open-page-btn:hover {
    background-color: #0056b3 !important;
    color: white !important;
    text-decoration: none !important;
}

/* 无结果样式 */
.no-results-container {
    text-align: center;
    padding: 60px 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 30px 0;
}

.no-results-container h3 {
    color: #dc3545;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.no-results-container ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
    display: inline-block;
}

.no-results-container li {
    margin-bottom: 10px;
    color: #6c757d;
    text-align: left;
}

/* 返回链接 */
.back-to-home {
    display: inline-block;
    margin-top: 30px;
    color: #6c757d;
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.3s;
}

.back-to-home:hover {
    background-color: #f8f9fa;
    color: #495057;
    text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-results-form {
        flex-direction: column;
    }

    .search-results-form .search-button {
        width: 100%;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .match-count, .page-match-count {
        align-self: flex-start;
    }

    .search-results-header h1 {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-examples-section {
        width: 100%;
        margin-top: 10px;
    }

    .open-page-btn {
        width: 100%;
    }
}