/* 搜索页面样式 */

/* 页面容器 */
.search-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 标题区域 */
.search-header {
    text-align: center;
    margin-bottom: 30px;
}

.search-header h1 {
    font-size: 2.5em;
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

.search-header .subtitle {
    font-size: 1.1em;
    color: #7f8c8d;
}

/* 模式切换标签 */
.search-mode-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 12px;
}

.mode-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #666;
    font-size: 1em;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.mode-tab:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.mode-tab.active {
    background: #3498db;
    color: white;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.mode-tab i {
    font-size: 1.2em;
}

/* 搜索输入区域 */
.search-input-area {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
}

.search-panel {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 输入组 */
.input-group {
    margin-bottom: 20px;
}

.input-group input[type="text"],
.input-group textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-group input[type="text"]:focus,
.input-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.input-group textarea {
    resize: vertical;
    min-height: 100px;
}

.input-hint {
    margin-top: 8px;
    color: #7f8c8d;
    font-size: 0.9em;
}

/* 搜索类型选择器 */
.search-type-selector {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.search-type-selector label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #555;
}

.search-type-selector input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

/* 高级筛选表单 */
.advanced-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row.full-width {
    width: 100%;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* 搜索按钮区域 */
.search-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.btn-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 40px;
    background: linear-gradient(180deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-search:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.2em;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.btn-reset {
    padding: 15px 30px;
    background: #ecf0f1;
    color: #666;
    border: none;
    border-radius: 10px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: #d5dbdb;
}

/* 搜索统计 */
.search-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
}

.stats-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 0.95em;
}

.stats-item i {
    color: #3498db;
}

/* 结果展示区 */
.results-area {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ecf0f1;
}

.results-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3em;
}

.results-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-sort select {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.95em;
    cursor: pointer;
    background: white;
}

.results-sort select:focus {
    outline: none;
    border-color: #3498db;
}

/* 结果列表 */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.result-rank {
    font-size: 0.9em;
    color: #7f8c8d;
    font-weight: 600;
}

.result-similarity {
    background: linear-gradient(180deg, #3498db, #2980b9);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
}

.case-id {
    color: #95a5a6;
    font-size: 0.85em;
    font-family: monospace;
}

.result-body {
    margin-bottom: 15px;
}

.case-title {
    margin: 0 0 12px 0;
    font-size: 1.25em;
    font-weight: 600;
}

.case-title a {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.3s ease;
}

.case-title a:hover {
    color: #3498db;
}

.case-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    color: #666;
    font-size: 0.9em;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-icon {
    font-size: 1.1em;
}

.meta-text {
    color: #555;
}

.doctor-info .doctor-title {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-left: 4px;
}

.source-info {
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 病名信息 */
.disease-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.disease-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.disease-label {
    font-weight: 600;
    color: #7f8c8d;
    min-width: 40px;
}

.disease-name {
    color: #2c3e50;
    font-weight: 500;
}

.disease-code {
    color: #95a5a6;
    font-size: 0.85em;
    font-family: monospace;
}

.disease-item.western .disease-label {
    color: #e74c3c;
}

.disease-item.tcm .disease-label {
    color: #27ae60;
}

/* 症状摘要 */
.case-symptoms {
    color: #555;
    font-size: 0.95em;
    line-height: 1.7;
    margin-bottom: 10px;
}

.symptoms-label {
    font-weight: 600;
    color: #2c3e50;
    margin-right: 8px;
}

.symptoms-text {
    color: #555;
}

.result-footer {
    text-align: right;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
}

.btn-view {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 24px;
    background: linear-gradient(180deg, #3498db, #2980b9);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

.btn-view:hover {
    background: linear-gradient(180deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-view .btn-icon {
    font-size: 1.1em;
}

/* 分页控制 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.page-btn {
    padding: 10px 20px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: #3498db;
    color: white;
    border-color: #3498db;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: #666;
    font-size: 0.95em;
}

.page-info span {
    font-weight: 600;
    color: #3498db;
}

/* 无结果提示 */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.no-results-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

.no-results h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.no-results p {
    color: #7f8c8d;
    margin-bottom: 20px;
}

.no-results ul {
    list-style: none;
    padding: 0;
    display: inline-block;
    text-align: left;
}

.no-results li {
    color: #666;
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.no-results li::before {
    content: "•";
    color: #3498db;
    font-size: 1.5em;
    position: absolute;
    left: 0;
    top: 2px;
}

/* 搜索提示 */
.search-tips {
    margin-top: 30px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 16px;
}

.search-tips h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.tip-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tip-card h4 {
    color: #3498db;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.tip-card p {
    color: #666;
    font-size: 0.95em;
    line-height: 1.6;
    margin: 0;
}

/* 筛选标签区域 */
.filter-tags {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    flex-wrap: wrap;
}

.filter-label {
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex: 1;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #3498db;
    color: white;
    border-radius: 20px;
    font-size: 0.85em;
    animation: fadeIn 0.3s ease;
}

.filter-tag .tag-label {
    opacity: 0.9;
}

.filter-tag .tag-value {
    font-weight: 600;
}

.filter-tag .tag-remove {
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-size: 1.1em;
    line-height: 1;
}

.filter-tag .tag-remove:hover {
    opacity: 1;
}

.btn-clear-filters {
    padding: 6px 15px;
    background: transparent;
    border: 1px solid #e74c3c;
    color: #e74c3c;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-clear-filters:hover {
    background: #e74c3c;
    color: white;
}

/* 下拉框样式 */
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group select option {
    padding: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .search-page {
        padding: 15px;
    }
    
    .search-header h1 {
        font-size: 1.8em;
    }
    
    .search-mode-tabs {
        flex-wrap: wrap;
    }
    
    .mode-tab {
        padding: 10px 16px;
        font-size: 0.9em;
    }
    
    .search-input-area {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .search-actions {
        flex-direction: column;
    }
    
    .btn-search,
    .btn-reset {
        width: 100%;
        justify-content: center;
    }
    
    .search-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .results-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .case-meta {
        flex-direction: column;
        gap: 5px;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}

/* 动画效果 */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card {
    animation: slideUp 0.3s ease;
}
