/* 搜索面板样式 */
.search-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
    min-height: 60px;
    max-height: 90vh;
    padding: 12px 16px;
    padding-top: 75px;
    background: var(--card-bg-light);
    backdrop-filter: blur(var(--blur-amount));
    border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    -webkit-transform: translateY(-100%);
    transition: transform 0.3s ease-out;
    -webkit-transition: -webkit-transform 0.3s ease-out;
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    will-change: transform;
}

.dark-mode .search-panel {
    background: var(--card-bg-dark);
    border-bottom: 0.5px solid rgba(255, 255, 255, 0.1);
}

/* 搜索容器样式 */
.search-container {
    display: flex;
    align-items: center;
    background: var(--system-bg-light);
    border-radius: 12px;
    padding: 6px 16px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
    border: 0.5px solid rgba(10, 132, 255, 0.2);
    box-shadow: 0 2px 8px rgba(10, 132, 255, 0.05);
    transition: all 0.3s ease-out;
}

.search-container:hover {
    border-color: rgba(10, 132, 255, 0.4);
    box-shadow: 0 4px 12px rgba(10, 132, 255, 0.1);
}

/* 搜索图标样式 */
.search-icon {
    color: var(--system-blue);
    margin-right: 10px;
    font-size: 16px;
    transition: color 0.3s ease-out;
}

/* 输入框样式 */
#searchInput {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: var(--text-primary-light);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* 清除图标样式 */
.clear-icon {
    color: var(--system-gray);
    margin-left: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.3s ease-out;
}

.clear-icon:hover {
    color: var(--system-blue);
}

/* 强化关闭按钮样式 */
.close-icon {
    position: absolute;
    right: 16px;
    top: 16px;
    font-size: 20px;
    color: #666;
    transition: all 0.3s ease;
}

/* 新增：提交搜索按钮样式 */
.search-submit-icon {
    margin-left: 8px;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
}

/* 更新：优化搜索按钮悬停效果 */
.search-submit-icon:hover {
    color: #0056b3;
    transform: scale(1.2) rotate(5deg);
}

/* 新增：关闭面板按钮样式 */
.close-panel-btn {
    margin-left: 0;
    background-color: #ff4444;
    color: white;
    border-radius: 24px;
    padding: 10px 14px;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    outline: none;
    line-height: 1;
}

.close-panel-btn:hover {
    background-color: #cc0000;
    transform: rotate(180deg);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 按钮容器样式 */
#clearHistoryContainer {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    justify-content: space-between; /* 按钮均匀分布 */
}

/* 在搜索容器中调整关闭按钮位置 */
.search-container {
    display: flex;
    align-items: center;
    background: var(--system-bg-light);
    border-radius: 12px;
    padding: 6px 16px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
    border: 0.5px solid rgba(10, 132, 255, 0.2);
    box-shadow: 0 2px 8px rgba(10, 132, 255, 0.05);
    transition: all 0.3s ease-out;
}

/* 新增：调整关闭按钮在容器中的位置 */
.search-container .close-icon {
    margin-left: 12px;
    padding: 8px;
}

/* 新增：常用搜索词区域 */
.search-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 0.5px solid rgba(0, 0, 0, 0.1);
}

.search-section-title {
    font-size: 14px;
    color: var(--text-secondary-light);
    margin-bottom: 8px;
    padding-left: 4px;
}

/* 搜索标签样式 */
.search-tags,
.search-history {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-tag {
    padding: 6px 12px;
    background: rgba(10, 132, 255, 0.1);
    color: var(--system-blue);
    border-radius: 100px;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.search-tag:hover {
    background: rgba(10, 132, 255, 0.2);
}

/* 清除历史按钮样式 */
.clear-history-btn {
    margin-top: 12px;
    width: 100%;
    font-size: 14px;
}

/* 优化搜索面板动画 */
#searchPanel {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: none !important;
    display: none !important; /* 确保面板初始关闭 */
}
