/* 全局样式 */
* {
    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: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'KaiTi', '楷体', serif;
    background: linear-gradient(45deg, #FFD700, #FFA500, #FF6347, #FFD700);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.logo h1 a {
    color: inherit;
    text-decoration: none;
    background: inherit;
    background-size: inherit;
    -webkit-background-clip: inherit;
    -webkit-text-fill-color: inherit;
    background-clip: inherit;
    animation: inherit;
    text-shadow: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logo h1 a:hover {
    transform: scale(1.05);
}

.logo h1 i {
    -webkit-text-fill-color: #FFD700;
    margin-right: 0.5rem;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.5));
}

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
}

nav ul li a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

nav ul li a i {
    font-size: 0.8rem;
    opacity: 0.9;
}

nav ul li a:hover,
nav ul li a.active {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

nav ul li a:hover i,
nav ul li a.active i {
    opacity: 1;
    transform: scale(1.1);
}

/* 主要内容区域 */
main {
    margin-top: 80px; /* 为固定页眉留出空间 */
}

/* 搜索区域 */
.search-section {
    background: white;
    padding: 4rem 0 3rem 0;
    text-align: center;
    margin-top: 1rem;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem 4rem 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid #e9ecef;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #667eea;
    color: white;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #5a6fd8;
    transform: translateY(-50%) scale(1.05);
}

.search-suggestions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.suggestion-tag {
    background: #f8f9fa;
    color: #6c757d;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.suggestion-tag:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* 分类网格 */
.categories-section,
.popular-tools-section,
.all-tools-section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.category-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f1f3f4;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.category-count {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #f1f3f4;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.tool-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.tool-icon {
    font-size: 1.5rem;
    margin-right: 0.8rem;
    color: #667eea;
}

.tool-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
}

.tool-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.tool-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tool-tag {
    background: #f8f9fa;
    color: #6c757d;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid #e9ecef;
}

/* 过滤标签 */
.filter-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-tab {
    background: white;
    color: #6c757d;
    border: 2px solid #e9ecef;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-tab:hover,
.filter-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #ecf0f1;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
    color: #bdc3c7;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #34495e;
    color: #bdc3c7;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
    
    nav ul li a {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
    
    .search-input {
        font-size: 1rem;
        padding: 0.8rem 3.5rem 0.8rem 1rem;
    }
    
    .search-btn {
        padding: 0.6rem 1rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        gap: 0.5rem;
    }
    
    .filter-tab {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .search-section {
        padding: 2rem 0;
    }
    
    .categories-section,
    .popular-tools-section,
    .all-tools-section {
        padding: 2rem 0;
    }
    
    .category-card,
    .tool-card {
        padding: 1.2rem;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 高亮搜索结果 */
.highlight {
    background-color: #fff3cd;
    padding: 0.1rem 0.2rem;
    border-radius: 3px;
}