/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 0;
    margin: 0;
    min-height: 100vh;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #4a6fa5 0%, #6b8cb7 100%);
    color: white;
    padding: 1.5rem 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

/* 搜索栏样式 */
.search-bar {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

/* 搜索引擎标签 */
.search-engine-tabs {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

.search-tab {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.search-tab:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.search-tab.active {
    background-color: white;
    color: #4a6fa5;
    font-weight: 600;
}

/* 搜索输入框包装器 */
.search-input-wrapper {
    display: flex;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* 搜索输入框 */
#search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    font-size: 1rem;
    outline: none;
}

/* 搜索按钮 */
#search-btn {
    padding: 15px 30px;
    background-color: #4a6fa5;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#search-btn:hover {
    background-color: #3a5a85;
}

#search-btn:active {
    transform: scale(0.98);
}

/* 搜索历史记录样式 */
.search-history {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-history-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-history-item:hover {
    background-color: #f5f7fa;
}

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

.search-history-item .remove-history {
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.search-history-item .remove-history:hover {
    color: #ff4d4f;
}

/* 主内容区域 */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* 分类容器 - 每行两个分类 */
.categories-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

/* 分类行布局 */
.category-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* 分类区域 */
.category-section {
    margin-bottom: 0;
    flex: 1;
    background-color: white;
    border-radius: 15px;
    padding: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 分类标题 */
.category-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e8e8e8;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 导航网格布局 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

/* 导航项样式 */
.nav-item {
    text-decoration: none;
    color: #333;
    background-color: #f5f7fa;
    border-radius: 10px;
    padding: 1.2rem 1rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.nav-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background-color: white;
    border-color: #4a6fa5;
}

.nav-item:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 导航图标 */
.nav-icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

/* 导航名称 */
.nav-name {
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-item:hover .nav-name {
    color: #4a6fa5;
}

/* 页脚样式 */
footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 波纹效果 */
.ripple {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* 高亮效果 */
.highlight {
    background-color: #fff3cd;
    animation: highlightPulse 0.5s ease-in-out;
}

@keyframes highlightPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-section {
    animation: fadeIn 0.5s ease-out;
}

.category-section:nth-child(2) {
    animation-delay: 0.1s;
}

.category-section:nth-child(3) {
    animation-delay: 0.2s;
}

.category-section:nth-child(4) {
    animation-delay: 0.3s;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .category-row {
        flex-direction: column;
        margin-bottom: 0;
    }
    
    .category-row .category-section {
        margin-bottom: 1rem;
    }
    
    /* 在中等屏幕上分类改为垂直排列 */
    .categories-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .search-engine-tabs {
        flex-wrap: wrap;
    }
    
    .search-tab {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .search-input-wrapper {
        flex-direction: column;
    }
    
    #search-input,
    #search-btn {
        width: 100%;
        border-radius: 0;
    }
    
    #search-input {
        border-radius: 10px 10px 0 0;
    }
    
    #search-btn {
        border-radius: 0 0 10px 10px;
    }
    
    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .nav-icon {
        font-size: 1.8rem;
    }
    
    .nav-icon img {
        width: 1.8rem;
        height: 1.8rem;
    }
    
    .nav-name {
        font-size: 0.8rem;
    }
    
    .category-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1.5rem 1rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .category-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .nav-item {
        padding: 1rem 0.8rem;
        min-height: 80px;
    }
}

/* 图片图标样式 */
.nav-icon img {
    width: 2.2rem;
    height: 2.2rem;
    object-fit: contain;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}