/* 首页与独立文章页共用的搜索弹窗样式 */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 8vh;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}
.search-modal.active { visibility: visible; opacity: 1; pointer-events: auto; }
.search-modal-overlay { position: absolute; inset: 0; background: rgba(15,23,42,.2); backdrop-filter: blur(3px); }
.search-modal-content {
    position: relative;
    width: min(680px, calc(100% - 32px));
    max-height: min(78vh, 720px);
    overflow: hidden;
    border: 1px solid rgba(148,163,184,.25);
    border-radius: 22px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 24px 70px rgba(15,23,42,.2);
    transform: translateY(-12px) scale(.98);
    transition: transform .25s ease;
}
.search-modal.active .search-modal-content { transform: translateY(0) scale(1); }
.search-modal-header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid rgba(148,163,184,.2); }
.search-modal-header > svg { width: 20px; height: 20px; flex: 0 0 auto; color: #3b82f6; }
.search-input { flex: 1; min-width: 0; height: 38px; padding: 0 6px; border: 0; outline: 0; background: transparent; color: #1e293b; font-size: 16px; caret-color: #3b82f6; }
.search-input::placeholder { color: #94a3b8; }
.search-close { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; color: #64748b; cursor: pointer; }
.search-close:hover { background: #f1f5f9; color: #2563eb; }
.search-close svg { width: 19px; height: 19px; }
.search-results { max-height: calc(min(78vh, 720px) - 70px); overflow-y: auto; padding: 10px; }
.search-empty, .search-loading { padding: 42px 16px; color: #64748b; font-size: 14px; text-align: center; }
.search-item { display: block; margin-bottom: 8px; padding: 14px 16px; border: 1px solid transparent; border-radius: 14px; color: #1e293b; transition: background .2s ease, border-color .2s ease, transform .2s ease; }
.search-item:hover { border-color: rgba(59,130,246,.2); background: #f8fbff; transform: translateX(3px); }
.search-item-title { margin-bottom: 5px; color: #0f172a; font-size: 16px; font-weight: 700; line-height: 1.45; }
.search-item-excerpt { display: -webkit-box; overflow: hidden; color: #64748b; font-size: 13px; line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.search-item-meta { margin-top: 7px; color: #94a3b8; font-size: 11px; }
.search-item mark { padding: 1px 3px; border-radius: 3px; background: #fde68a; color: #172033; }
body.dark .search-modal-overlay { background: rgba(2,6,23,.48); }
body.dark .search-modal-content { border-color: rgba(148,163,184,.2); background: rgba(15,23,42,.97); box-shadow: 0 24px 70px rgba(0,0,0,.4); }
body.dark .search-modal-header { border-bottom-color: rgba(148,163,184,.18); }
body.dark .search-input, body.dark .search-item-title, body.dark .search-item { color: #e2e8f0; }
body.dark .search-close { color: #94a3b8; }
body.dark .search-close:hover, body.dark .search-item:hover { background: rgba(51,65,85,.5); }
body.dark .search-item-title { color: #f8fafc; }
body.dark .search-item-excerpt, body.dark .search-empty, body.dark .search-loading { color: #94a3b8; }
body.dark .search-item mark { background: #f59e0b; color: #111827; }
@media (max-width: 600px) {
    .search-modal { padding-top: 5vh; }
    .search-modal-content { width: calc(100% - 24px); border-radius: 18px; }
    .search-results { max-height: 78vh; }
}
