/* 主色调配置 #ff6666 */
:root {
    --primary-color: #ff6666;
    --primary-light: #ff8a8a;
    --primary-dark: #e65c5c;
    --primary-bg: #ffebeb;
    --primary-shadow: rgba(255, 102, 102, 0.2);
}

/* 搜索浮层背景 */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 浮层激活状态 */
.search-overlay.active {
    display: flex;
    opacity: 1;
}

/* 搜索容器 */
.search-container {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
    width: 90%;
    height: 90%;
    max-width: 800px;
    margin: auto;
    overflow: hidden;
    transform: translateY(-20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex; /* 添加弹性布局 */
    flex-direction: column; /* 设置主轴方向为垂直 */
}

/* 容器激活时的位移效果 */
.search-overlay.active .search-container {
    transform: translateY(0);
}

/* 搜索头部 */
.search-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.search-input {
    flex: 1;
    margin-right: 1rem;
}

/* 激活的标签样式 */
.search-tabs {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.search-tabs button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: none;
    cursor: pointer;
}

.search-tabs button.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    font-weight: 500;
}

/* 结果项样式优化 */
.search-results .result-item {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 1rem; /* 减小内边距 */
    margin-bottom: 0.8rem; /* 减小底部外边距 */
    transition: all 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    background-color: #fff; /* 明确背景色 */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* 添加轻微阴影 */
}

.search-results .result-item:last-child {
    margin-bottom: 0;
}

.search-results .result-item:hover {
    background-color: #fafafa;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.result-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.6rem; /* 减小底部外边距 */
}

.result-icon {
    font-size: 1rem; /* 减小图标大小 */
    color: var(--primary-color);
    margin-right: 0.6rem; /* 减小右边距 */
}

.result-title {
    margin: 0;
    font-size: 1rem; /* 减小标题字体大小 */
    color: #333;
    flex: 1;
}

.result-desc {
    margin: 0 0 0.6rem 0; /* 减小底部外边距 */
    color: #666;
    line-height: 1.4; /* 调整行高 */
    font-size: 0.9rem; /* 减小描述字体大小 */
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem; /* 减小间距 */
    font-size: 0.8rem; /* 减小元数据字体大小 */
    color: #999;
}

.meta-item {
    display: flex;
    align-items: center;
}

.search-results {
    overflow-y: auto; /* 添加垂直滚动条 */
    flex: 1; /* 占据剩余空间 */
    padding: 1rem;
}

/* 输入框样式 */
.search-input {
    border: 1px solid #e0e0e0; /* 灰色边框 */
    border-radius: 4px; /* 圆角边框 */
    background-color: #f8f9fa; /* 浅灰色背景 */
    padding: 0.8rem 1rem 0.8rem 2.5rem; /* 左侧留出空间给图标 */
    font-size: 1rem;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
    position: relative;
}

.search-input::placeholder {
    color: #999; /* 灰色占位符文字 */
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-shadow);
}

/* 添加搜索图标 */
.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input-wrapper::before {
    content: "\f002"; /* Font Awesome 搜索图标的 Unicode */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999; /* 灰色图标 */
    pointer-events: none; /* 防止图标干扰输入 */
}

/* 若需要添加 "Search" 文字，可使用以下样式 */
.search-input-wrapper::after {
    content: "Search";
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #999; /* 灰色文字 */
    pointer-events: none; /* 防止文字干扰输入 */
}

/* 加载动画 */
.loading {
    display: none;
    text-align: center;
    padding: 2rem 0;
}

.loading.active {
    display: block;
}

/* 空状态 */
.empty-state {
    display: none;
    text-align: center;
    padding: 3rem 0;
    color: #6b7280;
}

.empty-state.active {
    display: block;
}

/* 搜索按钮样式 */
.search-btn {
    background-color: var(--primary-color);
    transition: all 0.2s ease;
}

.search-btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(255, 102, 102, 0.3);
}

.search-btn:active {
    transform: translateY(0);
}

.nav-links {
    text-align: center;
}

/* 移动端菜单样式 */
#mobile-menu {
    background-color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    /* 小屏样式调整 */
    header .container {
        padding: 0 1rem;
    }
}

@media (min-width: 769px) {
    /* 大屏样式调整 */
    header .container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

