/* ========== 字幕聚合搜索专区 ========== */
.subtitle-search-main {
    padding: 10px 5px 15px;
}
.subtitle-search-input-wrap {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.subtitle-search-input-wrap input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 15px;
    background: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
    box-sizing: border-box;
}
.subtitle-search-input-wrap input:focus {
    outline: none;
    border-color: #f436a1;
}
.subtitle-search-input-wrap button {
    padding: 0 22px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #f436a1, #e62b8c);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.subtitle-search-input-wrap button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(244, 54, 161, 0.4);
}

.subtitle-hot-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
}

/* ========== 字幕搜索结果弹窗 ========== */
.subtitle-search-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    display: none;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.25s ease;
}

.subtitle-search-box {
    background: #fff;
    border-radius: 14px;
    padding: 24px 20px;
    max-width: 680px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    position: relative;
    box-sizing: border-box;
}

.subtitle-search-box h3 {
    margin: 0 0 6px 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 8px;
}

.subtitle-search-box .close-btn {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
    line-height: 1;
    padding: 0;
}
.subtitle-search-box .close-btn:hover { color: #333; }

.subtitle-search-keyword {
    color: #06f;
    font-weight: 600;
    word-break: break-all;
    margin-bottom: 16px;
    font-size: 14px;
}

.subtitle-search-category {
    margin-bottom: 16px;
}
.subtitle-search-category h4 {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
    padding-left: 8px;
    border-left: 3px solid #f436a1;
    font-weight: 600;
}

.subtitle-site-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.subtitle-site-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #999;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    font-size: 13px;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.subtitle-site-item:hover {
    background: #eef5ff;
    border-color: #06f;
    color: #06f;
    transform: translateY(-1px);
}
.subtitle-site-item .site-name {
    font-weight: 500;
}
.subtitle-site-item .site-tag {
    font-size: 11px;
    color: #999;
    background: #fff;
    padding: 1px 6px;
    border-radius: 10px;
    flex-shrink: 0;
    margin-left: 8px;
}

/* 搜索历史 */
.subtitle-search-history {
    margin-top: 14px;
}
.subtitle-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.subtitle-history-header h4 {
    font-size: 13px;
    color: #999;
    margin: 0;
    font-weight: 500;
}
.subtitle-history-clear {
    font-size: 12px;
    color: #999;
    cursor: pointer;
    transition: color 0.2s;
}
.subtitle-history-clear:hover { color: #f436a1; }

.subtitle-history-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.subtitle-history-tag {
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 14px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.subtitle-history-tag:hover {
    background: #06f;
    color: #fff;
}

.subtitle-search-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}
.subtitle-search-actions button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.btn-open-all {
    background: linear-gradient(135deg, #f436a1, #e62b8c);
    color: #fff;
}
.btn-open-all:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(244, 54, 161, 0.35);
}
.btn-cancel {
    background: #f0f0f0;
    color: #666;
}
.btn-cancel:hover { background: #e0e0e0; }

/* ========== 暗黑模式适配 ========== */
.dark-mode .subtitle-search-input-wrap input {
    background: #2a2a3e;
    border-color: #444;
    color: #e0e0e0;
}
.dark-mode .subtitle-search-input-wrap input:focus { border-color: #ff7eb3; }

.dark-mode .subtitle-search-box {
    background: #1e1e2f;
    color: #e0e0e0;
}
.dark-mode .subtitle-search-box h3 { color: #fff; }
.dark-mode .subtitle-search-keyword { color: #6fb3ff; }
.dark-mode .subtitle-site-item {
    background: #2a2a3e;
    color: #e0e0e0;
}
.dark-mode .subtitle-site-item:hover {
    background: #1f3a5f;
    border-color: #3b82f6;
}
.dark-mode .subtitle-site-item .site-tag {
    background: #3a3a50;
    color: #aaa;
}
.dark-mode .subtitle-search-actions { border-top-color: #333; }
.dark-mode .btn-cancel {
    background: #333;
    color: #ccc;
}
.dark-mode .btn-cancel:hover { background: #444; }
.dark-mode .subtitle-history-tag {
    background: #2a2a3e;
    color: #aaa;
}
.dark-mode .subtitle-history-tag:hover {
    background: #06f;
    color: #fff;
}

/* ========== 移动端适配 ========== */
@media (max-width: 600px) {
    .subtitle-search-input-wrap { flex-direction: column; }
    .subtitle-search-input-wrap button { padding: 10px; }
    .subtitle-site-grid { grid-template-columns: 1fr; }
    .subtitle-search-box { padding: 20px 16px; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}