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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

/* 统一所有页面的主容器 */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 统一页面头部容器 */
.page-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.2rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
}

.header-left {
    display: flex;
    align-items: baseline;
    gap: 1.5rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo a {
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo a:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

.header-title {
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.85;
    margin: 0;
    padding-left: 1.5rem;
    border-left: 2px solid rgba(255,255,255,0.3);
    line-height: 1.2;
    align-self: flex-end;
    margin-bottom: 0.2rem;
}

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

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.nav a:hover {
    background: rgba(255,255,255,0.15);
    transform: translateY(-1px);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: rgba(255,255,255,0.8);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav a:hover::after {
    width: 60%;
}

/* 主要内容区域 */
.main {
    min-height: calc(100vh - 140px);
}

/* 内容包装器 */
.content-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 2rem;
}

/* 首页全屏样式 - 通过存在.hero元素来识别首页 */
.hero ~ .content-wrapper {
    max-width: none;
    padding: 0 2rem;
}

.hero ~ .content-wrapper .tools-sections .container {
    max-width: none;
    padding: 0;
}

/* 确保首页的侧边栏在全屏模式下仍然保持合适的宽度 */
.hero ~ .content-wrapper .sidebar-nav {
    width: 250px;
    flex-shrink: 0;
}

.hero ~ .content-wrapper .tools-sections {
    flex: 1;
    min-width: 0;
}

/* 左侧固定导航 */
.sidebar-nav {
    position: sticky;
    top: 20px;
    width: 250px;
    height: fit-content;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 1.5rem;
    flex-shrink: 0;
}

.nav-container {
    position: relative;
}

.nav-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #f0f0f0;
    text-align: center;
}

.category-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-nav li {
    margin-bottom: 0.5rem;
}

.category-nav a {
    display: block;
    padding: 0.8rem 1rem;
    color: #666;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.category-nav a:hover {
    background: #f8f9fa;
    color: #333;
    transform: translateX(5px);
}

.category-nav a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

/* 右侧主要内容区域 */
.tools-sections {
    flex: 1;
    min-width: 0;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.85;
    line-height: 1.5;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.search-box input:focus {
    border-color: #007bff;
}

.search-box button {
    padding: 12px 24px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.search-box button:hover {
    background: #0056b3;
}

/* 分类区域 */
.categories {
    padding: 4rem 0;
    background: white;
}

.categories h3 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

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

.category-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

.category-card h4 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: #333;
}

.category-card p {
    color: #666;
    margin-bottom: 1rem;
}

.category-count {
    background: #667eea;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
}

/* 工具区域 */
.tools {
    padding: 4rem 0;
    background: #f8f9fa;
}

.tools h3 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #333;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.tool-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

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

.tool-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    margin-right: 1rem;
    object-fit: cover;
}

.tool-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.tool-description {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

.tool-tag {
    background: #e9ecef;
    color: #495057;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
}

.tool-link {
    display: inline-block;
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    transition: background 0.3s;
}

.tool-link:hover {
    background: #5a6fd8;
}

/* 底部样式 */
.footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 2rem 0;
}
.footer a {
    color: #a1a1a1;
    text-decoration: none;
}

/* 响应式设计 */
/* 工具分类区域样式 */
.tools-section {
    margin-bottom: 4rem;
}

.section-header {
    margin-bottom: 2rem; 
}

.section-title {
    font-size: 2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 1rem;
    text-align: center;
}

.filter-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.filter-buttons-container {
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    row-gap: 15px;
}

.more-links-container {
    display: flex;
    align-items: center;
    margin-left: 1rem;
}

.more-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.more-link:hover {
    color: #5a6fd8;
    background: #f8f9fa;
    text-decoration: underline;
}

.filter-button {
    padding: 8px 16px;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-button.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.filter-button:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.filter-button.active:hover {
    background: #5a6fd8;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 2rem;
}

.tool-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.tool-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.tool-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    margin-right: 12px;
    object-fit: cover;
}

.tool-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.tool-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.tool-tag {
    padding: 4px 8px;
    background: #f0f0f0;
    color: #666;
    border-radius: 12px;
    font-size: 0.8rem;
}



.free-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #28a745;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
        gap: 1rem;
        padding: 0 15px;
    }
    
    .sidebar-nav {
        position: static;
        width: 100%;
        order: 2;
    }
    
    .tools-sections {
        order: 1;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .filter-buttons {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .filter-buttons-container {
        gap: 8px;
        row-gap: 12px;
        justify-content: flex-start;
    }
    
    .more-links-container {
        margin-left: 0;
    }
    
    .filter-button {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tool-card {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 1rem 0;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

    .header-left {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        align-items: center;
    }

    .logo {
        font-size: 1.8rem;
        line-height: 1;
    }

    .header-title {
        font-size: 1rem;
        padding-left: 0;
        border-left: none;
        border-top: 2px solid rgba(255,255,255,0.3);
        padding-top: 0.5rem;
        align-self: center;
        margin-bottom: 0;
        line-height: 1.2;
    }
    
    .nav ul {
        gap: 1.5rem;
    }
    
    .nav a {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .nav ul {
        gap: 1rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .category-grid,
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .category-tags {
        gap: 6px;
    }
    
    .category-tag {
        font-size: 0.8rem;
        padding: 3px 10px;
    }
    
    /* 首页全屏样式的移动端适配 */
    .hero ~ .content-wrapper {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero ~ .content-wrapper .sidebar-nav {
        width: 100%;
        position: static;
        order: 2;
    }
    
    .hero ~ .content-wrapper .tools-sections {
        order: 1;
    }
    
    /* 移动端分类和标签优化 */
    .result-categories,
    .result-tags {
        padding: 10px 10px;
        gap: 6px;
    }
    
    .result-category {
        font-size: 11px;
        padding: 3px 8px;
    }
    
    .result-tag {
        font-size: 11px;
        padding: 2px 8px;
    }
}

/* 统一的分类和标签样式 - 适用于所有页面 */
.result-categories {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
    margin-top: auto;
    overflow: hidden;
}

.result-category { 
    display: inline-block; 
    background: #e9ecef; 
    color: #666; 
    padding: 4px 12px; 
    border-radius: 6px; 
    font-size: 12px; 
    text-decoration: none;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.result-category:hover {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
}

/* 标签样式 */
.result-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 12px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.result-tag {
    display: inline-block;
    padding: 3px 10px;
    background: #f0f0f0;
    color: #666;
    border-radius: 12px;
    font-size: 12px;
    text-decoration: none;
    transition: all 0.3s;
    border: 1px solid #e9ecef;
    white-space: nowrap;
    flex-shrink: 0;
}

.result-tag:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
    transform: translateY(-1px);
} 