/**
 * Search Pages - 统一样式 (2026 v2)
 * 资源搜索 + 代码搜索 共用
 * 与首页/下载页/tag页/code页风格统一：1400px, 白色卡片, #1A56DB
 */

/* ========== PAGE WRAPPER ========== */
.search-wrapper {
    background: #F1F5F9;
    min-height: 100vh;
    padding-bottom: 60px;
}

/* ========== PAGE HEADER ========== */
.search-page-header {
    background: #fff;
    border-bottom: 1px solid #E2E8F0;
    padding: 28px 0 24px;
}

.search-page-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 面包屑 */
.sr-bc {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #94A3B8;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.sr-bc a {
    color: #64748B;
    text-decoration: none;
    transition: color 0.2s;
}

.sr-bc a:hover {
    color: #1A56DB;
}

.sr-bc-sep {
    color: #CBD5E1;
}

.sr-bc-cur {
    color: #334155;
    font-weight: 600;
}

/* 头部内容 */
.sr-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.sr-header-left {
    flex: 1;
    min-width: 0;
}

.sr-page-title {
    font-size: 24px;
    font-weight: 800;
    color: #0F172A;
    margin: 0 0 10px;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sr-title-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #1A56DB 0%, #3B82F6 100%);
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}

.sr-title-icon.code {
    background: linear-gradient(135deg, #7C3AED 0%, #A855F7 100%);
}

.sr-page-desc {
    font-size: 14px;
    color: #64748B;
    line-height: 1.7;
    margin: 0;
}

.sr-page-desc strong {
    color: #1A56DB;
    font-weight: 800;
}

/* 统计标签 */
.sr-stat-badges {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.sr-stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    font-size: 13px;
    color: #475569;
    font-weight: 600;
    white-space: nowrap;
}

.sr-stat-badge .num {
    font-size: 18px;
    font-weight: 900;
    color: #1A56DB;
    letter-spacing: -0.5px;
}

/* ========== 搜索框区域 ========== */
.sr-search-box {
    max-width: 1400px;
    margin: 20px auto 0;
    padding: 0 20px;
}

.sr-search-form {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    padding: 16px 20px;
    display: flex;
    gap: 10px;
    transition: box-shadow 0.2s;
}

.sr-search-form:focus-within {
    box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.1);
    border-color: #1A56DB;
}

.sr-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 14px;
    color: #0F172A;
    outline: none;
    transition: border-color 0.2s;
}

.sr-search-input:focus {
    border-color: #1A56DB;
}

.sr-search-input::placeholder {
    color: #94A3B8;
}

.sr-search-submit {
    padding: 12px 28px;
    background: #1A56DB;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sr-search-submit:hover {
    background: #1648B7;
}

/* ========== MAIN LAYOUT ========== */
.sr-layout {
    max-width: 1400px;
    margin: 20px auto 0;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    align-items: start;
}

/* 纯单列布局 */
.sr-layout.single {
    grid-template-columns: 1fr;
}

/* ========== 工具栏 ========== */
.sr-toolbar {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    padding: 14px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.sr-sort-btns {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sr-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.sr-sort-btn:hover {
    border-color: #1A56DB;
    color: #1A56DB;
    text-decoration: none;
}

.sr-sort-btn.active {
    background: #EBF2FF;
    border-color: #1A56DB;
    color: #1A56DB;
    font-weight: 700;
}

.sr-result-count {
    font-size: 13px;
    color: #64748B;
    font-weight: 600;
}

/* ========== 热门搜索 ========== */
.sr-hot-words {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
}

.sr-hot-label {
    font-size: 13px;
    color: #94A3B8;
    font-weight: 600;
    margin-right: 4px;
}

.sr-hot-word {
    display: inline-block;
    padding: 4px 12px;
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    transition: all 0.2s;
}

.sr-hot-word:hover {
    border-color: #1A56DB;
    color: #1A56DB;
    background: #EBF2FF;
    text-decoration: none;
}

/* ========== 分类筛选 ========== */
.sr-category-filter {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    margin-bottom: 16px;
    overflow: hidden;
}

.sr-category-hd {
    padding: 14px 20px;
    border-bottom: 1px solid #F1F5F9;
    font-size: 14px;
    font-weight: 800;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sr-category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 20px;
    list-style: none;
    margin: 0;
    max-height: 100px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sr-category-list.expanded {
    max-height: none;
}

.sr-category-list li {
    margin: 0;
}

.sr-cat-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.sr-cat-item:hover {
    border-color: #1A56DB;
    color: #1A56DB;
    background: #F8FAFC;
    text-decoration: none;
}

.sr-cat-item.active {
    background: #1A56DB;
    border-color: #1A56DB;
    color: #fff;
}

.sr-cat-item .cnt {
    font-size: 11px;
    opacity: 0.7;
}

.sr-cat-item.active .cnt {
    color: rgba(255, 255, 255, 0.7);
}

.sr-cat-toggle {
    display: block;
    text-align: center;
    padding: 8px;
    border-top: 1px solid #F1F5F9;
    font-size: 12px;
    color: #1A56DB;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.sr-cat-toggle:hover {
    background: #F8FAFC;
    text-decoration: none;
}

/* ========== 搜索结果列表 (百度/谷歌风格) ========== */
.sr-results {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    overflow: hidden;
    padding: 8px 24px;
}

.sr-result-item {
    padding: 16px 0 18px;
    border-bottom: none;
    transition: none;
    margin-bottom: 4px;
}

.sr-result-item:last-child {
    border-bottom: none;
}

.sr-result-item:hover {
    background: transparent;
}

/* 结果URL (谷歌/百度风格 绿色链接) */
.sr-result-url {
    font-size: 13px;
    color: #006621;
    line-height: 1.3;
    margin-bottom: 3px;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sr-result-url cite {
    font-style: normal;
    color: #006621;
}

.sr-result-url .sr-result-cat {
    margin-left: 6px;
}

/* 结果标题 (谷歌/百度风格 蓝色大字) */
.sr-result-title {
    font-size: 18px;
    font-weight: 400;
    margin: 0 0 4px;
    line-height: 1.35;
    display: block;
}

.sr-result-title a {
    color: #1A0DAB;
    text-decoration: none;
    transition: none;
}

.sr-result-title a:hover {
    text-decoration: underline;
    color: #1A0DAB;
}

.sr-result-title a:visited {
    color: #681DA8;
}

.sr-result-cat {
    display: inline-block;
    padding: 1px 6px;
    background: #F1F5F9;
    color: #64748B;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    vertical-align: middle;
    margin-right: 6px;
}

.sr-result-cat:hover {
    background: #EBF2FF;
    color: #1A56DB;
    text-decoration: none;
}

/* 结果摘要 (谷歌/百度风格 灰色正文) */
.sr-result-content {
    font-size: 14px;
    color: #4D5156;
    line-height: 1.58;
    margin: 0 0 6px;
    max-width: 600px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* 代码预览 (代码搜索专用，保留暗色) */
.sr-code-preview {
    background: #1E1E2E;
    color: #CDD6F4;
    border-radius: 6px;
    padding: 12px 16px;
    margin: 8px 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 140px;
    overflow-y: auto;
    border-left: 3px solid #1A56DB;
}

.sr-code-preview mark {
    background: rgba(250, 204, 21, 0.25);
    color: #FACC15;
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 600;
}

/* 结果元信息 */
.sr-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #70757A;
    flex-wrap: wrap;
    margin-top: 4px;
}

.sr-result-meta i {
    margin-right: 3px;
    color: #9AA0A6;
}

.sr-result-meta a {
    color: #1A56DB;
    text-decoration: none;
    font-weight: 500;
}

.sr-result-meta a:hover {
    text-decoration: underline;
}

.sr-result-meta .sep {
    color: #DADCE0;
    font-size: 6px;
}

/* 标签 */
.sr-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}

.sr-result-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #F1F3F4;
    color: #5F6368;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
}

.sr-result-tag:hover {
    background: #E8F0FE;
    color: #1A56DB;
    text-decoration: none;
}

/* 文件扩展名标签 */
.sr-file-ext {
    display: inline-block;
    padding: 1px 6px;
    background: #E8F0FE;
    color: #1967D2;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
    vertical-align: middle;
    margin-right: 4px;
}

/* ========== 分页 ========== */
.sr-pagination {
    padding: 20px 24px;
    display: flex;
    justify-content: center;
    border-top: 1px solid #F1F5F9;
}

.sr-pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.sr-pagination .pagination li a,
.sr-pagination .pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    background: #fff;
    color: #1E293B;
    text-decoration: none;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}

.sr-pagination .pagination li a:hover {
    border-color: #1A56DB;
    color: #1A56DB;
}

.sr-pagination .pagination li.active a,
.sr-pagination .pagination li.active span {
    background: #1A56DB;
    border-color: #1A56DB;
    color: #fff;
}

.sr-pagination .pagination li.disabled a,
.sr-pagination .pagination li.disabled span {
    background: #F8FAFC;
    color: #CBD5E1;
    cursor: not-allowed;
    pointer-events: none;
}

/* ========== 空结果 ========== */
.sr-empty {
    text-align: center;
    padding: 60px 20px;
    color: #94A3B8;
}

.sr-empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #F1F5F9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: #CBD5E1;
}

.sr-empty h3 {
    font-size: 18px;
    font-weight: 800;
    color: #334155;
    margin: 0 0 8px;
}

.sr-empty p {
    font-size: 13px;
    color: #94A3B8;
    margin: 4px 0;
}

.sr-empty-tips {
    text-align: left;
    max-width: 460px;
    margin: 24px auto 0;
    background: #F8FAFC;
    border-radius: 10px;
    padding: 18px 24px;
    border: 1px solid #E2E8F0;
}

.sr-empty-tips h4 {
    font-size: 14px;
    font-weight: 800;
    color: #334155;
    margin: 0 0 10px;
}

.sr-empty-tips ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sr-empty-tips li {
    font-size: 13px;
    color: #64748B;
    padding: 4px 0;
    line-height: 1.6;
}

.sr-empty-tips li::before {
    content: '•';
    color: #1A56DB;
    font-weight: 700;
    margin-right: 8px;
}

.sr-empty-tips a {
    color: #1A56DB;
    text-decoration: none;
    font-weight: 600;
}

.sr-empty-tips a:hover {
    text-decoration: underline;
}

.sr-empty-hot {
    margin-top: 16px;
}

.sr-empty-hot h4 {
    font-size: 13px;
    font-weight: 800;
    color: #334155;
    margin: 0 0 8px;
}

.sr-empty-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.sr-empty-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #1A56DB;
    color: #fff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.sr-empty-btn:hover {
    background: #1648B7;
    color: #fff;
}

.sr-empty-btn.outline {
    background: #fff;
    color: #1A56DB;
    border: 1px solid #1A56DB;
}

.sr-empty-btn.outline:hover {
    background: #EBF2FF;
}

/* ========== SIDEBAR ========== */
.sr-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 80px;
}

.sr-widget {
    background: #fff;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
    overflow: hidden;
}

.sr-widget-title {
    font-size: 15px;
    font-weight: 800;
    color: #0F172A;
    padding: 16px 20px;
    border-bottom: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding-left: 32px;
    position: relative;
}

.sr-widget-title::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background: #1A56DB;
    border-radius: 2px;
}

/* 导航链接 */
.sr-nav-links {
    padding: 8px 0;
}

.sr-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    color: #475569;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s;
}

.sr-nav-link:hover {
    background: #F8FAFC;
    color: #1A56DB;
    text-decoration: none;
}

.sr-nav-link.primary {
    color: #1A56DB;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .sr-layout {
        grid-template-columns: 1fr;
    }

    .sr-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .sr-header-row {
        flex-direction: column;
    }

    .sr-stat-badges {
        width: 100%;
    }

    .sr-search-form {
        flex-direction: column;
    }

    .sr-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .sr-result-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}