/* ==========================================
   search.css  - 搜索页面完整样式
   ========================================== */

/* Hero */
.search-hero {
    position: relative;
    padding: 56px 0 44px;
    background: linear-gradient(160deg, #f5ede4 0%, #efe6db 35%, #e8ddd0 70%, #ddd3c5 100%);
    overflow: hidden;
}

.search-hero__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 40%, rgba(145,51,0,0.07) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(180,120,60,0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 90%, rgba(145,51,0,0.04) 0%, transparent 55%);
}

.search-hero__pattern {
    position: absolute;
    inset: 0;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M40 8 L68 32 L52 64 L28 64 L12 32Z' fill='none' stroke='%23913300' stroke-width='1'/%3E%3Ccircle cx='40' cy='36' r='10' fill='none' stroke='%23913300' stroke-width='0.7'/%3E%3C/svg%3E");
}

.search-hero__inner {
    position: relative;
    text-align: center;
    z-index: 1;
}

.search-hero__title {
    font-size: 36px;
    font-weight: 700;
    color: #913300;
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.search-hero__desc {
    font-size: 15px;
    color: #8a7a6a;
    margin-bottom: 28px;
}

/* Form */
.search-form {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.search-hero .container {
    max-width: 1000px;
}

/* Type Filter (above search box) */
.search-type-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    padding: 8px 24px;
    border-radius: 28px;
    background: rgba(255,255,255,0.65);
    backdrop-filter: blur(8px);
    transition: all 0.3s ease;
    user-select: none;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(145,51,0,0.06);
}

.search-type-label {
    padding: 7px 18px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: none;
    border-radius: 30px 0 0 30px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(145,51,0,0.1);
    flex: 1;
    height: 60px;
}

/* Search input row (input + filter btn + search btn) */
.search-input-row {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 0;
}

.search-input-wrapper:focus-within {
    box-shadow: 0 4px 24px rgba(145,51,0,0.15);
}

/* Focus on the whole row */
.search-input-row:focus-within .search-input-wrapper {
    box-shadow: 0 4px 24px rgba(145,51,0,0.15);
}

.search-input-icon {
    display: none;
}

.search-input {
    flex: 1;
    padding: 0 24px;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    color: #333;
    font-size: 16px;
    min-width: 0;
    height: 60px;
    line-height: 60px;
}

.search-input::placeholder {
    color: #bbb;
}

.search-btn {
    padding: 0 32px;
    background: linear-gradient(135deg, #913300 0%, #7a2c00 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    height: 60px;
    border-radius: 0 30px 30px 0;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.search-btn:hover {
    opacity: 0.9;
    transform: none;
}

.search-btn svg {
    flex-shrink: 0;
}

/* Type Filter */
.search-type-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    padding: 8px 20px;
    border-radius: 25px;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
    user-select: none;
    margin-top: 16px;
}

.search-type-label:hover {
    color: #913300;
}

.search-type-label.active {
    color: #fff;
    background: linear-gradient(135deg, #913300 0%, #7a2c00 100%);
    font-weight: 600;
    box-shadow: 0 3px 10px rgba(145,51,0,0.25);
}

.search-type-label input[type="radio"] {
    display: none;
}

/* Advanced Filter Toggle Button (inline right of search) */
.adv-toggle-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 20px;
    height: 60px;
    background: #fff;
    border: none;
    border-left: 1px solid #e8e0d6;
    color: #913300;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.25s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.adv-toggle-btn:hover {
    background: #f8f4ef;
    color: #7a2c00;
}

.adv-toggle-btn svg {
    flex-shrink: 0;
}

.search-advanced-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 12px;
    padding: 18px 24px;
    background: rgba(255,255,255,0.95);
    border-radius: 14px;
    box-shadow: 0 8px 28px rgba(145,51,0,0.1);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.35s ease;
}

.search-advanced-panel.open {
    max-height: 200px;
    opacity: 1;
    overflow: visible;
}

.adv-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.adv-label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.adv-select {
    padding: 6px 12px;
    border: 1px solid #e0d8d0;
    border-radius: 8px;
    font-size: 13px;
    color: #333;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.adv-select:focus {
    border-color: #913300;
}

.adv-clear {
    font-size: 13px;
    color: #999;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

.adv-clear:hover {
    color: #913300;
    background: rgba(145,51,0,0.08);
}

/* Hot Search */
.hot-search-section {
    margin-top: 28px;
    text-align: left;
    width: 100%;
    max-width: 800px;
}

.hot-search-title {
    font-size: 16px;
    color: #913300;
    margin-bottom: 14px;
    letter-spacing: 1px;
    font-weight: 600;
}

.hot-search-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hot-search-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: #fff;
    border-radius: 22px;
    text-decoration: none;
    font-size: 15px;
    color: #444;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.hot-search-item:hover {
    color: #913300;
    box-shadow: 0 4px 12px rgba(145,51,0,0.15);
    transform: translateY(-1px);
}

.hot-search-item.top {
    background: linear-gradient(135deg, #913300 0%, #7a2c00 100%);
    color: #fff;
}

.hot-search-item.top:hover {
    color: #fff;
    opacity: 0.9;
}

.hot-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    background: rgba(145,51,0,0.08);
    color: #913300;
}

.hot-search-item.top .hot-rank {
    background: linear-gradient(135deg, #913300 0%, #7a2c00 100%);
    color: #fff;
}

.hot-keyword {
    font-weight: 500;
    font-size: 15px;
}

.hot-count {
    font-size: 12px;
    opacity: 0.5;
}

/* Search History - shown inside autocomplete dropdown, not a standalone panel */
.search-suggestion-item .history-remove {
    margin-left: auto;
    color: #ccc;
    font-size: 16px;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}
.search-suggestion-item .history-remove:hover {
    color: #e74c3c;
}

/* Results Section */
.search-results-section {
    padding: 36px 0 60px;
    min-height: 400px;
    background: #faf7f3;
}

/* Results Layout: main + sidebar */
.search-results-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.search-results-main {
    flex: 1;
    min-width: 0;
}

/* Sidebar */
.search-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 80px;
}

.sidebar-block {
    background: #fff;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(145,51,0,0.06);
}

.sidebar-block-title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0 0 14px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0ebe4;
    letter-spacing: 1px;
}

/* Sidebar: Hot Search */
.sidebar-hot-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-hot-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #444;
    font-size: 14px;
    transition: background 0.2s;
}

.sidebar-hot-item:hover {
    background: #f8f4ef;
    color: #913300;
}

.sidebar-hot-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    background: #f0ebe4;
    color: #888;
    flex-shrink: 0;
}

.sidebar-hot-rank.top {
    background: linear-gradient(135deg, #913300 0%, #7a2c00 100%);
    color: #fff;
}

.sidebar-hot-kw {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-hot-cnt {
    font-size: 11px;
    color: #bbb;
    flex-shrink: 0;
}

/* Sidebar: Related Search */
.sidebar-related-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sidebar-related-tag {
    display: inline-block;
    padding: 5px 12px;
    background: #f8f4ef;
    color: #913300;
    text-decoration: none;
    border-radius: 16px;
    font-size: 13px;
    transition: all 0.2s;
}

.sidebar-related-tag:hover {
    background: #913300;
    color: #fff;
}

/* Sidebar: Search History */
.sidebar-history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
}

.sidebar-history-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: background 0.2s;
}

.sidebar-history-item:hover {
    background: #f8f4ef;
    color: #913300;
}

.sidebar-history-item svg {
    flex-shrink: 0;
    color: #bbb;
}

.sidebar-history-remove {
    margin-left: auto;
    color: #ccc;
    cursor: pointer;
    padding: 0 2px;
    font-size: 15px;
}

.sidebar-history-remove:hover {
    color: #e74c3c;
}

.sidebar-clear-history {
    font-size: 12px;
    color: #999;
    cursor: pointer;
    text-align: center;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.sidebar-clear-history:hover {
    background: #f8f4ef;
    color: #913300;
}

/* Results Header */
.search-results-header {
    margin-bottom: 24px;
}

.search-results-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.search-results-title span {
    color: #913300;
}

/* Results Tabs */
.search-results-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #f0ebe4;
    margin-bottom: 28px;
    overflow-x: auto;
}

.search-results-tab {
    padding: 12px 24px;
    font-size: 15px;
    color: #666;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    transition: color 0.25s;
}

.search-results-tab:hover {
    color: #913300;
}

.search-results-tab.active {
    color: #913300;
    font-weight: 600;
}

.search-results-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #913300 0%, #7a2c00 100%);
    border-radius: 3px 3px 0 0;
}

.search-results-tab-count {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    font-size: 12px;
    background: #f0ebe4;
    color: #913300;
    border-radius: 10px;
    font-weight: 600;
}

.search-results-tab.active .search-results-tab-count {
    background: #fff;
    color: #913300;
    font-weight: 700;
}

/* Hide external injected ⋮ buttons (browser extensions, etc.) in search results area */
.search-results-tabs ~ [class*="more"],
.search-results-tabs ~ [class*="menu"],
.search-results-tabs ~ [class*="dot"],
.search-results-tabs ~ [class*="ellipsis"],
.search-results-section [class*="more-btn"],
.search-results-section [class*="three-dot"],
.search-results-section [class*="overflow-menu"] {
    display: none !important;
}

/* Results Content */
.search-results-content {
    display: none;
}

.search-results-content.active {
    display: block;
}

/* Results Group */
.search-results-group {
    margin-bottom: 32px;
}

.search-results-group-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0ebe4;
    margin-bottom: 16px;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Result Item */
.search-result-item {
    border-radius: 12px;
    overflow: hidden;
    transition: background-color 0.2s;
}

.search-result-item:hover {
    background-color: #f8f4ef;
}

.search-result-link {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
}

.search-result-cover {
    width: 100px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background-color: #f0ebe4;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-link:hover .search-result-title {
    color: #913300;
}

.search-result-summary {
    font-size: 13px;
    color: #777;
    line-height: 1.6;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #999;
}

.meta-type {
    padding: 2px 8px;
    background: rgba(145,51,0,0.08);
    color: #913300;
    border-radius: 4px;
    font-size: 11px;
}

.meta-date {
    font-size: 12px;
    color: #aaa;
}

.meta-author {
    font-size: 12px;
    color: #888;
}

/* Highlight */
.search-high-light {
    background: #fff3cd;
    color: #913300;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

/* Pagination */
.search-pagination {
    margin-top: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 13px;
    color: #999;
    margin-right: 12px;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #555;
    text-decoration: none;
    background: #f8f4ef;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.pagination-btn:hover {
    background: #913300;
    color: #fff;
}

.pagination-btn.active {
    background: linear-gradient(135deg, #913300 0%, #7a2c00 100%);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(145,51,0,0.3);
}

.pagination-ellipsis {
    color: #ccc;
    padding: 0 6px;
}

/* Related Search */
.related-search-section {
    margin-top: 36px;
    padding: 20px 24px;
    background: #f8f4ef;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.related-search-label {
    font-size: 14px;
    color: #888;
    white-space: nowrap;
}

.related-search-tag {
    display: inline-block;
    padding: 5px 14px;
    background: #fff;
    color: #913300;
    text-decoration: none;
    border-radius: 20px;
    font-size: 13px;
    transition: all 0.25s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.related-search-tag:hover {
    background: #913300;
    color: #fff;
    box-shadow: 0 4px 12px rgba(145,51,0,0.25);
}

/* Recommend Section (no results) */
.recommend-section {
    margin-top: 28px;
}

.recommend-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f0ebe4;
}

.recommend-list {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.recommend-item {
    flex-shrink: 0;
    width: 140px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s;
}

.recommend-item:hover {
    transform: translateY(-3px);
}

.recommend-cover {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    background: #f0ebe4;
}

.recommend-name {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #444;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #bbb;
}

.empty-state svg {
    margin-bottom: 16px;
    color: #ddd;
}

.empty-state p {
    font-size: 16px;
    color: #999;
}

.empty-suggest {
    font-size: 14px !important;
    color: #bbb !important;
    margin-top: 6px;
}

/* Suggestions dropdown */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #e0d8d0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.search-suggestions.show {
    display: block;
}

.search-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.search-suggestion-item:hover {
    background-color: #f8f4ef;
}

.suggestion-type {
    padding: 2px 8px;
    background-color: #f8f4ef;
    color: #999;
    border-radius: 4px;
    font-size: 11px;
    flex-shrink: 0;
}

.suggestion-title {
    flex: 1;
    font-size: 14px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-suggestion-empty {
    padding: 16px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ==========================================
   Responsive
   ========================================== */
@media (max-width: 768px) {
    .search-hero {
        padding: 40px 0 28px;
    }

    .search-hero__title {
        font-size: 26px;
    }

    .search-results-layout {
        flex-direction: column;
    }

    .search-sidebar {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }

    .sidebar-block {
        flex: 1;
        min-width: 200px;
    }

    .search-input-row {
        flex-wrap: nowrap;
        width: 95%;
    }

    .search-input-wrapper {
        height: 46px;
        border-radius: 14px 0 0 14px;
    }

    .search-input {
        font-size: 15px;
        padding: 0 16px;
        height: 46px;
        line-height: 46px;
    }

    .search-btn {
        height: 46px;
        padding: 0 16px;
        border-radius: 0 14px 14px 0;
    }

    .adv-toggle-btn {
        height: 46px;
        padding: 0 10px;
        font-size: 13px;
    }

    .adv-toggle-btn span {
        display: none;
    }

    .search-type-filter {
        gap: 4px;
        padding: 6px 12px;
        margin-bottom: 14px;
    }

    .search-type-label {
        font-size: 13px;
        padding: 6px 14px;
    }

    .hot-search-section {
        max-width: 95%;
    }

    .search-results-tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    .search-result-link {
        gap: 12px;
        padding: 10px 12px;
    }

    .search-result-cover {
        width: 72px;
        height: 54px;
    }

    .search-result-title {
        font-size: 14px;
    }

    .search-advanced-panel {
        flex-direction: column;
        align-items: flex-start;
    }

    .related-search-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .recommend-list {
        gap: 10px;
    }

    .recommend-item {
        width: 110px;
    }

    .recommend-cover {
        width: 110px;
        height: 78px;
    }
}

@media (max-width: 480px) {
    .search-hero__title {
        font-size: 22px;
    }

    .search-type-filter {
        flex-wrap: wrap;
        justify-content: center;
        gap: 4px;
    }

    .search-type-label {
        font-size: 12px;
        padding: 5px 11px;
    }

    .hot-search-item {
        font-size: 13px;
        padding: 6px 12px;
    }

    .search-results-tabs {
        gap: 0;
    }

    .search-results-tab {
        padding: 8px 10px;
        font-size: 12px;
    }
}
