/* =============================================================
   Midnight · 搜索
   ============================================================= */

.md-search-page { padding-top: 10px; }

.md-search-hero {
    padding: 42px 0 30px;
    border-bottom: 1px solid var(--md-line);
}
.md-search-hero h1 {
    font: 600 clamp(30px, 3.4vw, 46px)/1.15 var(--md-serif);
    letter-spacing: .04em;
}
.md-search-hero h1 em { color: var(--md-gold); font-style: normal; }
.md-search-hero p { margin-top: 8px; color: var(--md-muted); font-size: 13px; }
.md-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(720px, 100%);
    height: 54px;
    margin-top: 22px;
    padding: 0 6px 0 18px;
    background: var(--md-panel);
    border: 1px solid var(--md-line);
    border-radius: 999px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.md-search-form:focus-within { border-color: var(--md-line-gold); box-shadow: 0 0 0 4px rgba(226, 178, 109, .07); }
.md-search-form svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--md-muted); stroke-width: 1.8; stroke-linecap: round; }
.md-search-form input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: var(--md-text);
    font-size: 15px;
}
.md-search-form input::placeholder { color: var(--md-dim); }
.md-search-form button {
    flex: 0 0 auto;
    height: 42px;
    padding: 0 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--md-gold-2), var(--md-gold));
    color: #1a1206;
    font-size: 13.5px;
    font-weight: 700;
}
.md-search-form button:hover { filter: brightness(1.05); }

.md-search-history { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; color: var(--md-dim); font-size: 12px; }
.md-search-history a { padding: 4px 11px; border: 1px solid var(--md-line); border-radius: 999px; color: var(--md-muted); font-size: 12px; }
.md-search-history a:hover { color: var(--md-gold); border-color: var(--md-line-gold); }
.md-search-history button { color: var(--md-dim); font-size: 11.5px; }
.md-search-history button:hover { color: var(--md-terra); }

.md-search-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 26px;
    margin-top: 30px;
    align-items: start;
}
.md-search-results { min-width: 0; }
.md-search-count { margin-bottom: 14px; color: var(--md-muted); font-size: 13px; }
.md-search-count b { color: var(--md-gold); font: 600 19px var(--md-serif); margin: 0 3px; }
.md-search-count em { color: var(--md-text-2); font-style: normal; }

.md-result {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 16px;
    margin-bottom: 10px;
    background: var(--md-panel);
    border: 1px solid var(--md-line);
    border-radius: var(--md-r-sm);
    transition: border-color .2s ease, transform .2s ease;
}
.md-result:hover { border-color: var(--md-line-gold); transform: translateY(-1px); }
.md-result-cover { display: block; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--md-panel-3); }
.md-result-cover img { width: 100%; height: 100%; object-fit: cover; }
.md-result-body { min-width: 0; }
.md-result-title { font: 600 16px/1.45 var(--md-sans); }
.md-result-title a:hover { color: var(--md-gold); }
.md-result-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 5px; color: var(--md-dim); font-size: 12px; }
.md-result-meta em { color: var(--md-muted); font-style: normal; }
.md-result-desc {
    margin-top: 8px;
    color: var(--md-muted);
    font-size: 12.5px;
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.md-result-desc .highlight, .md-result-title .highlight { color: var(--md-gold); }
.md-result-link { align-self: center; }

.md-search-side { display: flex; flex-direction: column; gap: 16px; }
.md-hot-item-sm { display: flex; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--md-line); }
.md-hot-item-sm:first-child { border-top: 0; }
.md-hot-item-sm .cover { flex: 0 0 46px; aspect-ratio: 3 / 4; border-radius: 5px; overflow: hidden; background: var(--md-panel-3); }
.md-hot-item-sm .cover img { width: 100%; height: 100%; object-fit: cover; }
.md-hot-item-sm .info { min-width: 0; flex: 1; }
.md-hot-item-sm b { display: block; color: var(--md-text-2); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-hot-item-sm i { display: block; margin-top: 2px; color: var(--md-dim); font-size: 11px; font-style: normal; }
.md-hot-item-sm em { display: block; margin-top: 3px; color: var(--md-muted); font-size: 11px; font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.md-search-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 64px 20px; border: 1px dashed var(--md-line-2); border-radius: var(--md-r); text-align: center; }
.md-search-empty h3 { font: 600 20px var(--md-serif); }
.md-search-empty p { color: var(--md-muted); font-size: 12.5px; }
.md-search-sugs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.md-search-sugs a { padding: 5px 12px; border: 1px solid var(--md-line); border-radius: 999px; color: var(--md-muted); font-size: 12px; }
.md-search-sugs a:hover { color: var(--md-gold); border-color: var(--md-line-gold); }

@media (max-width: 1024px) {
    .md-search-body { grid-template-columns: 1fr; }
    .md-search-side { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
    .md-search-hero { padding: 26px 0 22px; }
    .md-search-form { height: 48px; }
    .md-search-form button { height: 36px; padding: 0 18px; }
    .md-result { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; padding: 12px; }
    .md-result-link { display: none; }
    .md-search-side { grid-template-columns: 1fr; }
}
