/* ===== 夜间模式切换按钮 ===== */
.theme-toggle {
    background: none;
    border: none;
    font-size: 22px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}
.theme-toggle:hover {
    background: rgba(74, 108, 247, 0.1);
    color: #4a6cf7;
}
.theme-toggle .ri-moon-line {
    transition: transform 0.3s ease;
}
body.dark-mode .theme-toggle .ri-moon-line {
    transform: rotate(-20deg);
}

/* ===== 夜间模式全局样式 ===== */
body.dark-mode {
    background: #1a1a2e !important;
    color: #d0d0d0;
}

/* 侧边栏 */
body.dark-mode .main-sidebar {
    background: #16213e;
    border-right-color: #2a2a4a;
}
body.dark-mode .sidebar-logo {
    border-bottom-color: #2a2a4a;
}
body.dark-mode .sidebar-menu li a {
    color: #aaa;
}
body.dark-mode .sidebar-menu li a:hover,
body.dark-mode .sidebar-menu li a.on {
    background: rgba(74, 108, 247, 0.15);
    color: #6a8cff;
}
body.dark-mode .sidebar-menu li a .dh-item-icon {
    color: #888;
}
body.dark-mode .sidebar-menu.sidebar-bottom {
    border-top-color: #2a2a4a;
}
body.dark-mode .sidebar-toggle {
    background: #2a2a4a;
    color: #888;
}
body.dark-mode .sidebar-toggle:hover {
    background: #3a3a5a;
    color: #6a8cff;
}

/* 主内容区 */
body.dark-mode .main-content {
    background: #1a1a2e;
}
body.dark-mode .dh-header {
    background: transparent;
}

/* 搜索框 */
body.dark-mode .dh-search-tabs {
    background: #2a2a4a;
}
body.dark-mode .search-tab {
    color: #999;
}
body.dark-mode .search-tab.active {
    background: #4a6cf7;
    color: #fff;
}
body.dark-mode .search-form {
    background: #2a2a4a;
    border-color: #3a3a5a;
}
body.dark-mode .search-input {
    color: #d0d0d0;
    background: transparent;
}
body.dark-mode .search-input::placeholder {
    color: #777;
}
body.dark-mode .dh-search-engines .engine-item {
    color: #999;
}
body.dark-mode .dh-search-engines .engine-item:hover {
    background: #3a3a5a;
}
body.dark-mode .dh-search-engines .engine-item.active {
    background: #4a6cf7;
    color: #fff;
}

/* 内容卡片 */
body.dark-mode .content-item {
    background: #16213e;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
body.dark-mode .content-item-head-left h4 {
    color: #e0e0e0;
}
body.dark-mode .content-item-head a {
    color: #666;
}
body.dark-mode .content-item-head a:hover {
    color: #6a8cff;
}

/* 站点卡片 */
body.dark-mode .content-urls-card {
    background: #1e2a4a;
    border-color: #2a3a5a;
}
body.dark-mode .content-urls-card:hover {
    background: #2a3a6a;
    border-color: #4a6cf7;
}
body.dark-mode .content-urls-card.is-recommend {
    background: #2a2a3a;
    border-color: #5a4a2a;
}
body.dark-mode .content-urls-card.is-recommend:hover {
    background: #3a3a4a;
    border-color: #8a7a3a;
}
body.dark-mode .content-url-info strong {
    color: #e0e0e0;
}
body.dark-mode .content-url-info p {
    color: #888;
}
body.dark-mode .content-url-togo {
    color: #555;
}
body.dark-mode .content-url-togo:hover {
    color: #6a8cff;
}
body.dark-mode .card-badge-recommend {
    background: #ff6b6b;
}

/* 分组标签 */
body.dark-mode .group-tab {
    color: #999;
    background: #2a2a4a;
}
body.dark-mode .group-tab:hover {
    background: #3a3a5a;
}
body.dark-mode .group-tab.active {
    background: #4a6cf7;
    color: #fff;
}

/* 分类头部 */
body.dark-mode .category-header {
    border-bottom-color: #2a2a4a;
}
body.dark-mode .category-header h1 {
    color: #e0e0e0;
}
body.dark-mode .category-header .category-count {
    background: #2a2a4a;
    color: #888;
}
body.dark-mode .group-title {
    background: linear-gradient(135deg, #1e2a4a, #2a3a5a);
    color: #e0e0e0;
}
body.dark-mode .group-title .group-count {
    color: #888;
}

/* 分页 */
body.dark-mode .pagination {
    background: #16213e;
    border-top-color: #2a2a4a;
}
body.dark-mode .pagination .pagination-total {
    color: #777;
}
body.dark-mode .pagination a {
    color: #6a8cff;
}
body.dark-mode .pagination a:hover {
    background: #2a2a4a;
    border-color: #3a3a5a;
}
body.dark-mode .pagination .pagination-page.active {
    background: #4a6cf7;
    color: #fff;
}

/* 排行榜 */
body.dark-mode .rank-card {
    background: #16213e;
    border-color: #2a2a4a;
}
body.dark-mode .rank-card .rank-title {
    color: #e0e0e0;
    border-bottom-color: #2a2a4a;
}
body.dark-mode .rank-name {
    color: #d0d0d0;
}
body.dark-mode .rank-list li {
    border-bottom-color: #2a2a4a;
}
body.dark-mode .rank-list li:hover {
    background: #1e2a4a;
}
body.dark-mode .rank-empty {
    color: #777;
}

/* 详情页 */
body.dark-mode .dh-breadcrumb {
    color: #888;
}
body.dark-mode .dh-breadcrumb a {
    color: #6a8cff;
}
body.dark-mode .dh-site-card {
    background: #16213e;
    border-color: #2a2a4a;
}
body.dark-mode .dh-site-title {
    color: #e0e0e0;
}
body.dark-mode .dh-site-subtitle {
    color: #999;
}
body.dark-mode .dh-site-meta {
    color: #888;
}
body.dark-mode .dh-btn-outline {
    color: #aaa;
    border-color: #3a3a5a;
}
body.dark-mode .dh-btn-outline:hover {
    background: #2a2a4a;
    border-color: #4a6cf7;
}
body.dark-mode .dh-entry {
    background: #16213e;
}
body.dark-mode .dh-entry-title {
    color: #e0e0e0;
}
body.dark-mode .dh-entry-content {
    color: #bbb;
}
body.dark-mode .dh-entry-xinxi p {
    color: #bbb;
    border-bottom-color: #2a2a4a;
}
body.dark-mode .dh-entry-tips {
    background: #2a2a2a;
    color: #c8a040;
    border-left-color: #c8a040;
}
body.dark-mode .dh-related-card {
    background: #1e2a4a;
    border-color: #2a3a5a;
}
body.dark-mode .dh-related-card:hover {
    background: #2a3a6a;
    border-color: #4a6cf7;
}
body.dark-mode .dh-card-name {
    color: #e0e0e0;
}
body.dark-mode .dh-card-desc {
    color: #888;
}
body.dark-mode .dh-reload-btn {
    color: #aaa;
    border-color: #3a3a5a;
}
body.dark-mode .dh-reload-btn:hover {
    background: #2a2a4a;
}

/* SEO数据 */
body.dark-mode .seo-item-box {
    background: #1e2a4a;
    border-color: #2a3a5a;
}
body.dark-mode .seo-item-box:hover {
    background: #2a3a6a;
    border-color: #4a6cf7;
}
body.dark-mode .seo-item-box .seo-value {
    color: #e0e0e0;
}
body.dark-mode .query-links .ql-label {
    color: #888;
}
body.dark-mode .query-links a {
    color: #6a8cff;
    background: #1e2a4a;
    border-color: #2a3a5a;
}
body.dark-mode .query-links a:hover {
    background: #4a6cf7;
    color: #fff;
}

/* 福利社 */
body.dark-mode .welfare-card {
    background: linear-gradient(145deg, #1e2a3a, #16213e);
    border-color: #3a3a2a;
}
body.dark-mode .welfare-card .welfare-title {
    color: #c8a040;
}
body.dark-mode .welfare-list .welfare-item {
    background: #1e2a4a;
    border-color: #2a3a5a;
}
body.dark-mode .welfare-list .welfare-item:hover {
    border-color: #c8a040;
}
body.dark-mode .welfare-list .welfare-item .wi-content h5 {
    color: #e0e0e0;
}
body.dark-mode .welfare-list .welfare-item .wi-content p {
    color: #888;
}

/* 浮窗 */
body.dark-mode .dh-float-banner {
    background: linear-gradient(135deg, #2a2a5a, #3a2a6a, #4a2a7a);
}

/* 底部 */
body.dark-mode .site-footer {
    background: #0e1a2e;
    border-top-color: #2a2a4a;
    color: #888;
}
body.dark-mode .footer-copyright a {
    color: #6a8cff;
}
body.dark-mode .footer-links a {
    color: #6a8cff;
}

/* 首页简介 */
body.dark-mode .content-item[style*="background:#f8fbff"] {
    background: #16213e !important;
    border-left-color: #4a6cf7 !important;
}
body.dark-mode .content-item[style*="background:#f8fbff"] div {
    color: #bbb !important;
}

/* 搜索建议下拉框 */
body.dark-mode .suggestions-box {
    background: #1e2a4a;
    border-color: #3a3a5a;
}
body.dark-mode .suggestions-box .suggestion-item {
    color: #d0d0d0;
    border-bottom-color: #2a3a5a;
}
body.dark-mode .suggestions-box .suggestion-item:hover {
    background: #2a3a6a;
}
body.dark-mode .suggestions-box .suggestion-item .suggestion-highlight {
    color: #6a8cff;
}
body.dark-mode .suggestions-loading {
    color: #888;
}

/* Tooltip（悬停提示） */
body.dark-mode #clickTooltip {
    background: rgba(30, 30, 50, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* 天气小部件 */
body.dark-mode .weather-widget {
    color: #d0d0d0;
}
body.dark-mode .weather-widget .weather-temp {
    color: #6a8cff;
}

/* 首页分组标签 */
body.dark-mode .home-group-tab {
    color: #888;
}
body.dark-mode .home-group-tab:hover {
    color: #6a8cff;
}
body.dark-mode .home-group-tab.active {
    color: #6a8cff;
    background: rgba(74, 108, 247, 0.15);
}

/* 导航栏 */
body.dark-mode #dh-nav .navbar-item a {
    color: #aaa;
}
body.dark-mode #dh-nav .navbar-item a:hover {
    color: #6a8cff;
}
body.dark-mode #dh-nav .navbar-item a.on,
body.dark-mode #dh-nav .navbar-item a.active {
    background: #4a6cf7;
    color: #fff;
}

/* 移动端汉堡菜单 */
body.dark-mode .navbar-left-btn {
    color: #d0d0d0;
}

/* 侧边栏遮罩 */
body.dark-mode .sidebar-overlay {
    background: rgba(0, 0, 0, 0.7);
}
/* ===== 夜间模式 - 补充覆盖（解决白色残留） ===== */

/* 所有卡片内部元素 */
body.dark-mode .content-item-urls {
    background: transparent !important;
}

/* 推荐资源卡片 */
body.dark-mode .content-urls-card.is-recommend {
    background: #1e2a4a !important;
    border-color: #3a3a5a !important;
}
body.dark-mode .content-urls-card.is-recommend:hover {
    background: #2a3a6a !important;
    border-color: #4a6cf7 !important;
}

/* 强制所有卡片背景 */
body.dark-mode .content-urls-card {
    background: #1a2a4a !important;
    border-color: #2a3a5a !important;
}
body.dark-mode .content-urls-card:hover {
    background: #253a5a !important;
    border-color: #4a6cf7 !important;
}

/* 卡片内所有文字 */
body.dark-mode .content-url-info strong,
body.dark-mode .content-url-info p,
body.dark-mode .content-url-info span {
    color: #d0d0d0 !important;
}
body.dark-mode .content-url-info p {
    color: #999 !important;
}

/* 侧边栏菜单项文字 */
body.dark-mode .sidebar-menu li a span {
    color: #bbb !important;
}
body.dark-mode .sidebar-menu li a:hover span,
body.dark-mode .sidebar-menu li a.on span {
    color: #6a8cff !important;
}

/* 侧边栏图标 */
body.dark-mode .sidebar-menu li a .dh-item-icon {
    color: #888 !important;
}
body.dark-mode .sidebar-menu li a:hover .dh-item-icon,
body.dark-mode .sidebar-menu li a.on .dh-item-icon {
    color: #6a8cff !important;
}

/* 分类页面所有内容 */
body.dark-mode .category-main .main-list {
    background: transparent !important;
}

/* 分组内容区 */
body.dark-mode .group-content .content-item-urls {
    background: transparent !important;
}

/* 排行榜侧边栏 */
body.dark-mode .rank-sidebar .rank-card {
    background: #16213e !important;
    border-color: #2a2a4a !important;
}
body.dark-mode .rank-sidebar .rank-card .rank-title {
    color: #e0e0e0 !important;
}
body.dark-mode .rank-sidebar .rank-list li {
    border-bottom-color: #2a2a4a !important;
}
body.dark-mode .rank-sidebar .rank-list li:hover {
    background: #1e2a4a !important;
}
body.dark-mode .rank-sidebar .rank-name {
    color: #d0d0d0 !important;
}
body.dark-mode .rank-sidebar .rank-name a {
    color: #d0d0d0 !important;
}
body.dark-mode .rank-sidebar .rank-name a:hover {
    color: #6a8cff !important;
}
body.dark-mode .rank-sidebar .rank-count {
    color: #888 !important;
}
body.dark-mode .rank-sidebar .rank-empty {
    color: #777 !important;
}
body.dark-mode .rank-sidebar .rank-num.default {
    background: #2a3a5a !important;
    color: #999 !important;
}

/* 首页简介区域 */
body.dark-mode .content-item[style*="background:#f8fbff"] {
    background: #16213e !important;
    border-left-color: #4a6cf7 !important;
}
body.dark-mode .content-item[style*="background:#f8fbff"] p {
    color: #bbb !important;
}

/* 底部版权信息 */
body.dark-mode .site-footer .footer-copyright {
    color: #888 !important;
}
body.dark-mode .site-footer .footer-copyright a {
    color: #6a8cff !important;
}
body.dark-mode .site-footer .footer-links a {
    color: #6a8cff !important;
}
body.dark-mode .site-footer .footer-divider {
    color: #444 !important;
}

/* 浮动横幅 */
body.dark-mode .dh-float-banner {
    background: linear-gradient(135deg, #1a1a3e, #2a1a5e, #3a1a6e) !important;
}
body.dark-mode .dh-float-banner .float-title {
    color: #fff !important;
}
body.dark-mode .dh-float-banner .float-desc {
    color: rgba(255, 255, 255, 0.8) !important;
}
body.dark-mode .dh-float-banner .float-btn-primary {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #4a6cf7 !important;
}
body.dark-mode .dh-float-banner .float-btn-primary:hover {
    background: #ffffff !important;
}
body.dark-mode .dh-float-banner .float-btn-outline {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
}
body.dark-mode .dh-float-banner .float-btn-outline:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* AI工具卡片 */
body.dark-mode .ai-tool-card {
    background: #1a2a4a !important;
    border-color: #2a3a5a !important;
}
body.dark-mode .ai-tool-card:hover {
    background: #2a3a6a !important;
    border-color: #4a6cf7 !important;
}
body.dark-mode .ai-tool-card span {
    color: #d0d0d0 !important;
}

/* 搜索建议框 */
body.dark-mode .search-wrapper .suggestions-box {
    background: #1a2a4a !important;
    border-color: #3a3a5a !important;
}
body.dark-mode .search-wrapper .suggestion-item {
    color: #d0d0d0 !important;
    border-bottom-color: #2a3a5a !important;
}
body.dark-mode .search-wrapper .suggestion-item:hover {
    background: #2a3a6a !important;
}
body.dark-mode .search-wrapper .suggestions-loading {
    color: #888 !important;
}

/* 分组标签（首页） */
body.dark-mode .home-group-tabs .home-group-tab {
    color: #888 !important;
}
body.dark-mode .home-group-tabs .home-group-tab:hover {
    color: #6a8cff !important;
}
body.dark-mode .home-group-tabs .home-group-tab.active {
    color: #6a8cff !important;
    background: rgba(74, 108, 247, 0.15) !important;
}

/* 分组内容切换 */
body.dark-mode .home-group-item .content-item-urls {
    background: transparent !important;
}

/* 所有分隔线 */
body.dark-mode .content-item-head {
    border-bottom: 1px solid #2a2a4a !important;
}
body.dark-mode .pagination {
    border-top-color: #2a2a4a !important;
}
body.dark-mode .category-header {
    border-bottom-color: #2a2a4a !important;
}
body.dark-mode .rank-card .rank-title {
    border-bottom-color: #2a2a4a !important;
}

/* 提交页面 */
body.dark-mode .submit-form .form-group label {
    color: #ccc !important;
}
body.dark-mode .submit-form input[type="text"],
body.dark-mode .submit-form input[type="url"],
body.dark-mode .submit-form textarea,
body.dark-mode .submit-form select {
    background: #1a2a4a !important;
    border-color: #2a3a5a !important;
    color: #d0d0d0 !important;
}
body.dark-mode .submit-form input:focus,
body.dark-mode .submit-form textarea:focus,
body.dark-mode .submit-form select:focus {
    border-color: #4a6cf7 !important;
}
body.dark-mode .submit-tips {
    background: #1a2a2a !important;
    border-left-color: #c8a040 !important;
    color: #bbb !important;
}
body.dark-mode .submit-tips .tips-title {
    color: #e0e0e0 !important;
}
body.dark-mode .submit-tips a {
    color: #6a8cff !important;
}
body.dark-mode .submit-form .alert-success {
    background: #1a2a1a !important;
    color: #8ac88a !important;
    border-color: #2a4a2a !important;
}
body.dark-mode .submit-form .alert-error {
    background: #2a1a1a !important;
    color: #c88a8a !important;
    border-color: #4a2a2a !important;
}

/* 主题切换器 */
body.dark-mode .theme-switcher {
    border-top-color: #2a2a4a !important;
}
body.dark-mode .theme-label {
    color: #888 !important;
}

/* 天气小部件（侧边栏内） */
body.dark-mode .weather-widget {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: #2a2a4a !important;
    color: #bbb !important;
}
body.dark-mode .weather-widget .weather-city {
    color: #aaa !important;
}
body.dark-mode .weather-widget .weather-temp {
    color: #6a8cff !important;
}
body.dark-mode .weather-widget .weather-desc {
    color: #888 !important;
}

/* 搜索模式资源 */
body.dark-mode .dh-search-mode .dh-search-engines span {
    color: #999 !important;
}

/* 面包屑 */
body.dark-mode .dh-breadcrumb span {
    color: #888 !important;
}

/* 详情页站点信息 */
body.dark-mode .dh-site-card .dh-site-avatar {
    background: #1a2a4a !important;
    border-color: #2a3a5a !important;
}
body.dark-mode .dh-site-card .dh-site-info .dh-site-meta .dh-meta-item {
    color: #888 !important;
}
body.dark-mode .dh-site-card .dh-site-info .dh-site-meta .dh-meta-item i {
    color: #666 !important;
}

/* 反馈弹窗 */
body.dark-mode .dh-modal-overlay .dh-modal-box {
    background: #16213e !important;
}
body.dark-mode .dh-modal-overlay .dh-modal-title {
    color: #e0e0e0 !important;
}
body.dark-mode .dh-modal-overlay .dh-modal-title .close-btn {
    color: #888 !important;
}
body.dark-mode .dh-modal-overlay .dh-modal-title .close-btn:hover {
    color: #fff !important;
}
body.dark-mode .dh-modal-overlay .dh-modal-body label {
    color: #ccc !important;
}
body.dark-mode .dh-modal-overlay .dh-modal-body .radio-group label {
    background: #1a2a4a !important;
    color: #ccc !important;
}
body.dark-mode .dh-modal-overlay .dh-modal-body .radio-group label:hover {
    background: #2a3a5a !important;
}
body.dark-mode .dh-modal-overlay .dh-modal-body textarea {
    background: #1a2a4a !important;
    border-color: #2a3a5a !important;
    color: #d0d0d0 !important;
}
body.dark-mode .dh-modal-overlay .dh-modal-body textarea:focus {
    border-color: #4a6cf7 !important;
}
body.dark-mode .dh-modal-overlay .feedback-tip {
    background: #1a2a3a !important;
    border-left-color: #4a6cf7 !important;
    color: #bbb !important;
}

/* 相关导航卡片 */
body.dark-mode .dh-related-card {
    background: #1a2a4a !important;
    border-color: #2a3a5a !important;
}
body.dark-mode .dh-related-card:hover {
    background: #2a3a6a !important;
    border-color: #4a6cf7 !important;
}
body.dark-mode .dh-related-card .dh-card-name {
    color: #d0d0d0 !important;
}
body.dark-mode .dh-related-card .dh-card-desc {
    color: #888 !important;
}
body.dark-mode .dh-related-card .dh-card-icon {
    background: #1a2a4a !important;
}
body.dark-mode .dh-related-card .dh-card-badge {
    background: #ff6b6b !important;
}

/* 移动端汉堡菜单按钮 */
body.dark-mode .navbar-left-btn {
    color: #d0d0d0 !important;
}
body.dark-mode .navbar-left-btn:hover {
    color: #6a8cff !important;
}

/* 移动端 Logo */
body.dark-mode .mobile-logo img {
    filter: brightness(0.9);
}

/* 全局按钮文字 */
body.dark-mode .btn,
body.dark-mode .go-btn {
    color: #fff !important;
}
body.dark-mode .go-btn-secondary {
    background: #2a2a4a !important;
    color: #aaa !important;
}
body.dark-mode .go-btn-secondary:hover {
    background: #3a3a5a !important;
}

/* 跳转页面 */
body.dark-mode .go-container {
    background: #16213e !important;
    border-color: #2a2a4a !important;
}
body.dark-mode .go-container .go-title {
    color: #e0e0e0 !important;
}
body.dark-mode .go-container .go-target {
    background: #1a2a4a !important;
    border-color: #2a3a5a !important;
}
body.dark-mode .go-container .go-target .url {
    color: #6a8cff !important;
}
body.dark-mode .go-container .go-safety-tip {
    background: #1a2a2a !important;
}
body.dark-mode .go-container .go-safety-tip p {
    color: #c8a060 !important;
}
body.dark-mode .go-container .go-countdown {
    color: #888 !important;
}
body.dark-mode .go-container .go-footer {
    color: #666 !important;
}
body.dark-mode .go-container .go-footer a {
    color: #6a8cff !important;
}
/* ===== 搜索模式容器 - 固定高度，防止页面跳动 ===== */
.dh-search-modes-wrapper {
    position: relative;
    min-height: 110px;
    /* 固定最小高度，防止切换时跳动 */
}

/* 两个搜索模式重叠定位 */
.dh-search-mode {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
    min-height: 110px;
}

/* 激活的模式显示 */
.dh-search-mode.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 保持原有的 display 控制作为 fallback，但用 opacity/visibility 实现平滑切换 */
.dh-search-mode {
    display: block !important;
}

/* 重置原来的 display:none 控制，由 opacity/visibility 接管 */
.dh-search-mode[style*="display:none"],
.dh-search-mode[style*="display: none"] {
    display: block !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.dh-search-mode.active[style*="display:none"],
.dh-search-mode.active[style*="display: none"] {
    display: block !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .dh-search-modes-wrapper {
        min-height: 100px;
    }
    .dh-search-mode {
        min-height: 100px;
    }
}

@media (max-width: 480px) {
    .dh-search-modes-wrapper {
        min-height: 90px;
    }
    .dh-search-mode {
        min-height: 90px;
    }
}
/* ===== 搜索模式容器 - 固定高度，防止页面跳动 ===== */
.dh-search-modes-wrapper {
    position: relative;
    min-height: 110px;  /* 固定最小高度，保证两个模式高度一致 */
}

/* 两个搜索模式重叠定位 */
.dh-search-mode {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    pointer-events: none;
    min-height: 110px;
}

/* 激活的模式显示 */
.dh-search-mode.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 兼容旧的 display 控制，确保 active 类生效 */
.dh-search-mode {
    display: block !important;
}
.dh-search-mode[style*="display:none"],
.dh-search-mode[style*="display: none"] {
    display: block !important;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.dh-search-mode.active[style*="display:none"],
.dh-search-mode.active[style*="display: none"] {
    display: block !important;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .dh-search-modes-wrapper {
        min-height: 100px;
    }
    .dh-search-mode {
        min-height: 100px;
    }
}
@media (max-width: 480px) {
    .dh-search-modes-wrapper {
        min-height: 90px;
    }
    .dh-search-mode {
        min-height: 90px;
    }
}

/* ===== 确保顶部导航显示 ===== */
#dh-nav {
    display: flex !important;
}
@media (max-width: 768px) {
    #dh-nav {
        display: none !important;
    }
}