/*
 * @file search.css
 * @description 搜索相关样式文件，包含搜索框、搜索结果、搜索引擎弹窗等组件的样式定义
 * @author raanan
 * @date 2025-12-11
 */

/* 主页容器样式 */
.homepage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 600px;
    text-align: center;
    color: var(--text-secondary);
    position: relative;
    z-index: 1;
    gap: 1rem;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    max-width: 900px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}


/* S 搜索容器模块 */

/* 搜索容器主样式，包含搜索标签、搜索框和搜索选项 */
.search-container {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 120px;
}

/* 搜索类型标签 */
.search-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
    justify-content: center;
}

.search-tabs .tab {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-secondary);
    background-color: transparent;
}

.search-tabs .tab:hover {
    color: var(--text-primary);
}

.search-tabs .tab.active {
    background-color: var(--accent-color);
    color: #fff;
    font-weight: 500;
}

/* 搜索盒子 */
.search-box {
    display: flex;
    align-items: center;
    gap: 0;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    /* 确保搜索盒子高度稳定 */
    height: auto;
    min-height: 60px;
}

/* 非书签搜索模式聚焦时的搜索盒子样式 */
.search-box.expanded {
    overflow: visible;
    align-items: flex-start;
    /* padding-bottom: 1rem; */
}

/* 搜索输入框容器 */
.search-input-container {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    transition: all 0.3s;
    width: 100%;
}

/* 非书签搜索模式聚焦时的布局 */
.search-box.expanded .search-input-container {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding-bottom: 0;
}

/* 搜索图标基础样式 */
.search-input-container .search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    color: var(--text-tertiary);
    font-size: 18px;
    pointer-events: auto;
    cursor: pointer;
    transition: all 0.3s;
    display: block;
    text-align: center;
    line-height: 30px;
    box-sizing: border-box;
    z-index: 1000;
    /* 确保图标在最上层 */
}

/* 非Web搜索选项卡下的搜索图标不可点击 */
.search-tabs .tab:not([data-type="web"]).active~.search-box .search-input-container .search-icon {
    pointer-events: none !important;
    cursor: default !important;
}

/* 确保Font Awesome图标正确显示 */
.search-input-container .search-icon.fas {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

/* 非书签搜索模式聚焦时隐藏搜索图标 */
.search-box.expanded .search-input-container .search-icon {
    display: none;
}

/* 非书签且非web选项卡时，无论是否聚焦都隐藏搜索图标 */
.search-tabs .tab:not([data-type="bookmarks"]):not([data-type="web"]).active~.search-box .search-input-container .search-icon {
    display: none;
}

/* 非Web搜索选项卡的搜索图标样式 */
.search-tabs .tab[data-type="bookmarks"].active~.search-box .search-input-container .search-icon {
    width: 20px;
    height: 20px;
    font-size: 14px;
    line-height: 20px;
    left: 1rem;
}

/* 书签搜索选项卡下的输入框样式，调整左侧内边距适配20px图标 */
.search-tabs .tab[data-type="bookmarks"].active~.search-box .search-input {
    padding: 1rem 1rem 1rem 3.25rem !important;
}

/* Web搜索选项卡下的搜索图标样式 */
.search-tabs .tab[data-type="web"].active~.search-box .search-input-container .search-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    font-size: 18px;
}

/* Web搜索选项卡下的引擎图标样式 */
.search-tabs .tab[data-type="web"].active~.search-box .search-input-container .search-icon.engine-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    left: 1rem;
    object-fit: contain;
    border: none;
    border-radius: 50%;
    padding: 0;
    margin: 0;
    font-size: 20px;
    line-height: 1;
}

/* 搜索输入框图标容器 */
.search-input-container .search-icon.engine-icon-container {
    width: 30px;
    height: 30px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 有背景色的搜索输入框图标容器 */
.search-input-container .search-icon.engine-icon-container[style*="background"] {
    border-radius: 50%;
}

/* 搜索输入框图标图片 */
.search-input-container .search-icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 确保搜索输入框中的FontAwesome图标正确垂直居中 */
.search-tabs .tab[data-type="web"].active~.search-box .search-input-container .search-icon.engine-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 搜索输入框中的FontAwesome图标样式 */
.search-input-container .search-icon.engine-icon {
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 有背景色的搜索输入框中的FontAwesome图标样式 */
.search-input-container .search-icon.engine-icon[style*="background"] {
    border-radius: 50%;
    color: white;
}

/* 搜索输入框 */
.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3.25rem;
    border: none;
    border-radius: 0;
    background-color: transparent;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
    outline: none;
}

/* 非书签搜索模式聚焦时的输入框样式 */
.search-box.expanded .search-input {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.5rem;
}

/* 非书签且非web选项卡时的输入框样式，移除图标后的内边距调整 */
.search-tabs .tab:not([data-type="bookmarks"]):not([data-type="web"]).active~.search-box .search-input {
    padding-left: 1rem;
}

/* Web搜索选项卡下的输入框样式，调整左侧内边距适配30px图标 */
.search-tabs .tab[data-type="web"].active~.search-box .search-input {
    padding: 1rem 1rem 1rem 3.25rem !important;
}

/* 搜索输入框占位符样式 */
.search-input::placeholder {
    font-size: 0.9rem;
    color: var(--text-tertiary);
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    box-shadow: none;
    border: none;
}

/* 搜索选项 */
.search-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    z-index: 10;
    display: none;
    margin-top: 0;
}

/* 非书签搜索模式时显示搜索选项 */
.search-tabs .tab:not([data-type="bookmarks"]).active~.search-box .search-options {
    display: block;
    position: relative;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

/* 非书签搜索模式聚焦时的搜索选项位置 */
.search-box.expanded .search-options {
    position: relative;
    top: auto;
    bottom: auto;
    margin-top: 0;
    background-color: transparent;
    border: none;
    box-shadow: none;
}

/* 搜索引擎选项 */
.search-engines {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    flex-wrap: wrap;
    background-color: transparent;
}

.search-engines .engine {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 14px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    color: var(--text-primary);
    background-color: transparent;
}

/* 搜索引擎图标样式 - 只影响搜索引擎列表中的图标 */
.search-engines .engine .engine-icon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    object-fit: contain;
    vertical-align: middle;
}

.search-engines .engine:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.search-engines .engine.active {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* 选中状态的搜索引擎样式 */
.search-engines .engine.selected {
    background-color: var(--selected-color-2);
    color: var(--selected-color-1);
    border-color: var(--selected-color-3);
}

/* 搜索提交按钮 */
.search-submit-btn {
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    padding: 1rem;
    margin-right: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    transition: all 0.3s ease;
    border-radius: 50%;
}

/* 非书签搜索模式聚焦时的按钮样式 */
.search-box.expanded .search-submit-btn {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    height: 30px;
    z-index: 20;
    /* 确保按钮在搜索选项上方 */
}

.search-submit-btn:hover {
    background-color: var(--accent-hover);
}

.search-submit-btn i {
    font-size: 1rem;
}

/* Web Search 搜索引擎弹窗 */
.search-engines-popup {
    position: absolute;
    top: calc(100% - 2.25rem);
    left: 0;
    width: 100%;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    display: none;
    overflow: hidden;
}

.search-engines-popup.show {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 引擎选择动画 */
@keyframes engineSelectAnimation {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.engine-select-animation {
    animation: engineSelectAnimation 0.3s ease-in-out;
}

/* 搜索引擎控件区域 */
.search-engines-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    gap: 1rem;
}

/* 搜索引擎筛选区域 */
.search-engines-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 筛选标签 */
.search-engines-filter label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
}

/* 筛选下拉框 */
.engine-filter-select {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.engine-filter-select:hover {
    border-color: var(--accent-color);
}

.engine-filter-select:focus {
    border-color: var(--selected-color-1);
    box-shadow: 0 0 0 2px rgba(42, 153, 77, 0.2);
}

/* 搜索引擎操作按钮区域 */
.search-engines-actions {
    display: flex;
    gap: 0.5rem;
}

/* 引擎操作按钮 */
.engine-action-btn {
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.engine-action-btn:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.engine-action-btn:active {
    transform: translateY(1px);
}

/* 本次使用的搜索引擎区域 */
.search-engines-used {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    min-height: 50px;
}

/* 搜索引擎标签 */
.search-engines-label {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.8rem;
    white-space: nowrap;
}

/* 最近使用的搜索引擎容器 */
.recently-used-engines {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* 最近使用的搜索引擎项 */
.recently-used-engine {
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.recently-used-engine:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--accent-color);
}

.recently-used-engine.active {
    background-color: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    font-weight: 600;
}

/* 搜索引擎列表 */
.search-engines-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

/* 搜索引擎项 */
.search-engine-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    gap: 0.5rem;
    background-color: var(--bg-secondary);
}

/* .search-engine-item:hover {
    background-color: var(--bg-secondary);
} */

/* 键盘焦点状态样式 */
.search-engine-item.focused {
    background-color: var(--bg-secondary);
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}

.search-engine-item.active {
    color: var(--accent-color);
    font-weight: 600;
    /* color: white; */
}

/* 选中状态样式 */
.search-engine-item.selected {
    background-color: var(--selected-color-2);
    border: 1px solid var(--selected-color-3);
    color: var(--selected-color-1);
}

/* 聚焦且选中状态样式 */
.search-engine-item.focused.selected {
    outline: 2px solid var(--accent-color);
    outline-offset: -2px;
}

/* 当前引擎为选中状态时的样式 */
.search-engine-item.active.selected {
    background-color: var(--selected-color-2);
    color: var(--accent-color);
    border-color: var(--selected-color-3);
}

/* 搜索引擎图标容器 */
.search-engine-item .engine-icon-container {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    overflow: hidden;
}

/* 有背景色的搜索引擎图标容器 */
.search-engine-item .engine-icon-container[style*="background"] {
    border-radius: 4px;
}

/* 搜索引擎图标图片 */
.search-engine-item .engine-icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 搜索引擎图标 */
.search-engine-item .engine-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    color: var(--text-primary);
}

/* 有背景色的搜索引擎图标 */
.search-engine-item .engine-icon[style*="background"] {
    border-radius: 4px;
    color: white;
}

/* 确保FontAwesome图标正确垂直居中 */
.search-engine-item .engine-icon i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* 搜索引擎名称 */
.search-engine-item .engine-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    text-align: left;
}

/* 搜索引擎标签 */
.search-engine-item .engine-tag {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    flex-shrink: 0;
    margin-right: 0.5rem;
}

.search-engine-item.active .engine-tag {
    /* color: rgba(255, 255, 255, 0.8); */
    color: var(--accent-color);
}

/* 选中指示器，改为普通flex项，位于最右侧 */
.engine-select-indicator {
    width: 16px;
    height: 16px;
    transition: all 0.2s;
    margin-left: auto;
    /* 默认隐藏 */
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: var(--selected-color-1);
}

/* 选中状态下的指示器 */
.search-engine-item.selected .engine-select-indicator::before {
    /* 显示对勾 */
    content: "✓";
}

/* 当前引擎为选中状态时的指示器 */
.search-engine-item.active.selected .engine-select-indicator::before {
    content: "✓";
    color: var(--selected-color-1);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 选中状态下显示指示器 */
.search-engine-item.selected .engine-select-indicator {
    opacity: 1;
}

/* 当前引擎为选中状态时显示指示器 */
.search-engine-item.active.selected .engine-select-indicator {
    opacity: 1;
}

/* 搜索结果展示区域 */
.search-results {
    position: absolute;
    top: calc(100% + -2.25rem);
    width: 100%;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 添加清除浮动 */
    clear: both;
}

/* 搜索结果显示时的样式 */
.search-results.show {
    display: block;
}

/* 搜索结果项 */
.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

/* 确保active类优先级高于hover */
.search-result-item.active {
    background-color: #f5f5f5 !important;
}

/* 搜索结果图标 */
.search-result-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* 搜索结果内容 */
.search-result-content {
    flex: 1;
    min-width: 0;
    text-align: left;
}

/* 搜索结果标题 */
.search-result-title {
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
    text-decoration: none;
    text-align: left;
}

/* 搜索结果URL */
.search-result-url {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
    text-align: left;
}

/* 搜索结果链接去除下划线 */
.search-result-item,
.search-result-item:link,
.search-result-item:visited,
.search-result-item:hover,
.search-result-item:active {
    text-decoration: none;
}

/* 确保搜索结果内容中的文本也无下划线 */
.search-result-title,
.search-result-url {
    text-decoration: none !important;
}

/* 搜索结果类型标识 */
.search-result-type {
    font-size: 0.7rem;
    padding: 0.125rem 0.5rem;
    border-radius: 10px;
    background-color: #e0e0e0;
    color: #666;
}

/* 文件夹类型标识 */
.search-result-type.folder {
    background-color: #ffb74d;
    color: #fff;
}

/* 链接类型标识 */
.search-result-type.link {
    background-color: #4a90e2;
    color: #fff;
}

/* 快捷键说明样式 */
.search-shortcuts {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.search-shortcuts i {
    color: var(--accent-color);
    font-size: 1rem;
}

.search-shortcuts strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 深色主题适配 */
[data-theme="dark"] .search-box {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .search-options {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .search-tabs .tab.active {
    background-color: var(--accent-color);
    color: #fff;
}

[data-theme="dark"] .search-submit-btn {
    background-color: var(--accent-color);
}

[data-theme="dark"] .search-submit-btn:hover {
    background-color: var(--accent-hover);
}

[data-theme="dark"] .search-result-item:hover {
    background-color: var(--bg-tertiary);
}

/* 确保active类优先级高于hover */
[data-theme="dark"] .search-result-item.active {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .search-results {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .search-result-item {
    border-bottom-color: var(--border-color);
}

/* 深色主题适配 */
[data-theme="dark"] .search-shortcuts {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* E 搜索容器模块 */

/* S 常用网站模块 */

/* 常用网站 */
.favorites {
    margin: 0.25rem;
    border-radius: 8px;
    width: 100%;
    align-self: stretch;
}

.favorites-list {
    background-color: var(--card-bg);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 0;
    width: 100%;
}

.favorites-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.favorites-items li {
    display: flex;
    justify-content: center;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s ease;
    text-align: center;
}

.favorites-items a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    width: 100%;
    height: 100%;
    transition: all 0.3s;
    text-align: center;
}

.favorites-items li:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.favorites-items li:hover a {
    color: #fff;
}

/* 深色主题适配 */
[data-theme="dark"] .favorites {
    background-color: var(--bg-tertiary);
}

[data-theme="dark"] .favorites-list {
    background-color: var(--bg-secondary);
    box-shadow: var(--shadow);
}

[data-theme="dark"] .favorites-category {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .favorites-items li {
    background-color: var(--bg-primary);
    border-color: var(--border-color);
}

[data-theme="dark"] .favorites-items li a {
    color: var(--text-primary);
}

[data-theme="dark"] .favorites-items li:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

[data-theme="dark"] .favorites-items li:hover a {
    color: #fff;
}

/* E 常用网站模块 */

/* S 组件模块 */

/* 组件容器样式，包含图片组件和纪念日时钟组件 */
.components {
    /* margin: 1rem 0; */
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    overflow: hidden;
}

/* 图片组件 */
.component-image {
    flex: 2;
    height: 120px;
    border-radius: 12px;
    background-color: var(--card-bg);
    background: url('../images/home1.gif') center/cover no-repeat;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    min-width: 0;
}

/* 纪念日组件 */
.component-clock {
    flex: 1;
    height: 120px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.5) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-left: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.anniversary-info {
    position: absolute;
    left: 10px;
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 8px;
    z-index: 1;
    color: white;
}

.component-clock::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../images/home2.png') center/cover no-repeat;
    opacity: 0.3;
    z-index: 0;
}

.anniversary-title {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin: 0;
}

.anniversary-days {
    font-size: 32px;
    font-weight: bold;
    margin: 0;
    line-height: 1;
}

.anniversary-date {
    font-size: 12px;
    opacity: 0.8;
    margin: 0;
}

.clock-container {
    width: 120px;
    height: 120px;
    z-index: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

#clockCanvas {
    width: 120px;
    height: 120px;
    display: block;
}

#digitalTime {
    display: none;
}

/* 移动端样式 */
@media (max-width: 480px) {
    .search-container {
        max-width: none;
    }

    .search-results {
        position: absolute;
        top: calc(100% + 0.25rem);
        /* left: 0;
        right: 0; */
    }

    .search-engines-popup {
        position: absolute;
        top: calc(100% + 0.25rem);
    }

    /* 在移动端隐藏搜索快捷键提示 */
    .search-shortcuts {
        display: none;
    }

    .components {
        max-width: none;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin: 0 -1rem;
    }

    .component-clock,
    .component-image {
        width: 100%;
        /* 确保组件宽度铺满屏幕，但不改变原始高度 */
        max-width: 100%;
    }
}

/* E 组件模块 */