/* 搜索页 */

.search-hero h1 {
    font-size: 2.1rem;
}

.search-panel {
    background: #fff;
    border: 1px solid #ffe2be;
    border-radius: 36px;
    padding: 22px;
    margin-bottom: 24px;
    box-shadow: 0 12px 28px -10px rgba(0, 0, 0, 0.06);
}

.search-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-input-wrap {
    position: relative;
}

.search-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.search-input-row input[type="search"] {
    flex: 1;
    min-width: 0;
    border: 1px solid #ffd7a8;
    background: #fffaf2;
    border-radius: 999px;
    padding: 14px 20px;
    font-size: 1.05rem;
    color: #3b2a1f;
    font-weight: 600;
    outline: none;
}

.search-input-row input[type="search"]:focus {
    border-color: #E67E22;
    box-shadow: 0 0 0 3px rgba(230, 126, 34, 0.15);
}

.keyword-popup {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 40;
    background: #fff;
    border: 1px solid #ffe2be;
    border-radius: 22px;
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.2);
    padding: 14px;
    max-height: min(420px, 55vh);
    overflow: auto;
}

.keyword-popup-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0 4px 10px;
    border-bottom: 1px dashed #ffe2be;
}

.keyword-popup-head strong {
    color: #3b2a1f;
    font-size: 0.95rem;
}

.keyword-popup-head span {
    color: #876b4f;
    font-size: 0.8rem;
    font-weight: 600;
}

.keyword-popup-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-chip {
    appearance: none;
    border: 1px solid #ffe2be;
    background: #fffaf2;
    color: #3b2a1f;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s;
    line-height: 1.2;
}

.keyword-chip:hover,
.keyword-chip:focus {
    background: linear-gradient(135deg, #FFE6C7, #FFD0A4);
    border-color: #E67E22;
    color: #c26a1a;
    outline: none;
}

.keyword-chip.is-hot {
    background: #fff3e4;
    border-color: #f0b27a;
}

.search-submit {
    border: none;
    border-radius: 999px;
    padding: 0 26px;
    background: #E67E22;
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 6px 12px rgba(230, 126, 34, 0.22);
    white-space: nowrap;
    transition: transform 0.2s, background 0.2s;
}

.search-submit:hover {
    background: #d35400;
    transform: translateY(-1px);
}

.search-submit.is-external {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 6px 12px rgba(37, 99, 235, 0.25);
}

.search-options {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    align-items: center;
}

.search-option-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.search-option-group label,
.option-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #876b4f;
}

.search-option-group select,
.search-date-controls input[type="date"] {
    border: 1px solid #ffd7a8;
    background: #fffaf2;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 600;
    color: #3b2a1f;
    outline: none;
}

.seg-control {
    display: inline-flex;
    background: #fff3e4;
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
}

.seg-btn {
    border: none;
    background: transparent;
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 700;
    font-size: 0.88rem;
    color: #876b4f;
    cursor: pointer;
    transition: 0.15s;
}

.seg-btn:hover {
    color: #c26a1a;
}

.seg-btn.is-active {
    background: #E67E22;
    color: #fff;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.25);
}

.search-date-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.search-hint {
    font-size: 0.88rem;
    color: #876b4f;
    line-height: 1.5;
}

.engine-block {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px dashed #ffe2be;
}

.engine-block-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}

.engine-block-head h2 {
    font-size: 1.05rem;
    color: #3b2a1f;
}

.engine-current {
    font-size: 0.88rem;
    font-weight: 700;
    color: #c26a1a;
    background: #fff3e4;
    padding: 4px 12px;
    border-radius: 999px;
}

.engine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.engine-chip {
    appearance: none;
    border: 1px solid #ffe2be;
    background: #fffaf2;
    border-radius: 18px;
    padding: 12px 12px 10px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
    color: #3b2a1f;
}

.engine-chip:hover {
    transform: translateY(-2px);
    border-color: #f0b27a;
    box-shadow: 0 8px 16px -10px rgba(230, 126, 34, 0.35);
}

.engine-chip.is-active {
    background: linear-gradient(135deg, #FFE6C7, #FFD0A4);
    border-color: #E67E22;
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.2);
}

.engine-chip.is-site.is-active {
    background: linear-gradient(135deg, #FFB347, #E67E22);
    color: #fff;
    border-color: #d35400;
}

.engine-chip .engine-name {
    display: block;
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.2;
}

.engine-chip .engine-region {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    opacity: 0.75;
    font-weight: 600;
}

.engine-chip.is-site.is-active .engine-region {
    opacity: 0.9;
}

.search-results-wrap {
    min-height: 30vh;
    margin-bottom: 24px;
}

.search-results-head {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
}

.search-results-head h2 {
    font-size: 1.25rem;
    color: #3b2a1f;
}

/* 卡片网格：PC 一排 3 个 */
.search-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.search-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #ffe2be;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 8px 18px -10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 0;
}

.search-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px -12px rgba(230, 126, 34, 0.25);
}

.search-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.search-card-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, #FFE6C7, #FFD0A4);
    overflow: hidden;
}

.search-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.search-card-cover-text {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 16px 18px;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.45;
    color: #3b2a1f;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.45), transparent 45%),
        linear-gradient(135deg, #FFE6C7, #FFBC80);
}

.search-card-rank {
    position: absolute;
    top: 10px;
    left: 10px;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.92);
    color: #c26a1a;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.search-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 14px 8px;
    flex: 1;
}

.search-card-title {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.45;
    color: #2c241a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-snippet {
    font-size: 0.86rem;
    color: #6f553b;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 0.8rem;
    color: #876b4f;
}

.search-card-foot .hot-site {
    background: #fffaf2;
    border-radius: 999px;
    padding: 3px 8px;
    font-weight: 600;
}

.search-card-actions {
    padding: 0 14px 14px;
}

.search-card-actions .read-origin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 12px;
    border-radius: 999px;
    text-align: center;
}

.search-hit {
    background: #fff3bf;
    color: inherit;
    border-radius: 4px;
    padding: 0 2px;
}

.search-pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-top: 22px;
}

.search-page-btn {
    border: 1px solid #ffd7a8;
    background: #fffaf2;
    color: #3b2a1f;
    border-radius: 999px;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s;
}

.search-page-btn:hover:not(:disabled) {
    border-color: #E67E22;
    color: #c26a1a;
}

.search-page-btn.is-active {
    background: #E67E22;
    border-color: #E67E22;
    color: #fff;
}

.search-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.search-page-info {
    font-weight: 700;
    color: #876b4f;
    font-size: 0.9rem;
    margin: 0 6px;
}

.search-scroll-more {
    margin-top: 8px;
}

.external-tip {
    margin-top: 12px;
    padding: 18px 20px;
    border-radius: 24px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e3a8a;
    line-height: 1.6;
}

.external-tip a {
    color: #1d4ed8;
    font-weight: 700;
}

.search-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 16px;
    color: #876b4f;
    background: #fffaf2;
    border-radius: 28px;
    border: 1px dashed #ffd7a8;
}

@media (max-width: 980px) {
    .search-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .search-panel {
        border-radius: 24px;
        padding: 16px;
    }

    .search-input-row {
        flex-direction: column;
    }

    .search-submit {
        padding: 14px 20px;
    }

    .keyword-popup {
        border-radius: 18px;
        max-height: min(360px, 50vh);
    }

    .engine-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .search-card-grid {
        grid-template-columns: 1fr;
    }

    .search-card-cover-text {
        font-size: 0.98rem;
    }
}
