/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

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

/* Header Styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: auto !important; /* 使用auto并添加!important确保不被其他规则覆盖 */
    width: auto;
}

.logo h1 {
    font-size: 24px;
    color: #0066cc;
    font-weight: 700;
    display: none; /* 隐藏h1标签 */
}

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

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

nav a {
    text-decoration: none;
    color: #333;
    font-weight: 700;
    font-size: 16px;
    transition: color 0.3s;
}

nav a:hover,
nav a.active {
    color: #0066cc;
}

/* Hide About link in all pages */
a[href="about.html"],
a[href="../about.html"] {
    display: none;
}

/* Hero Section */
.hero {
    display: none; /* 隐藏hero section模块 */
    display: none;
}

/* 隐藏所有类别项 */
.category-item {
    display: none; /* 隐藏所有类别项div */
}

/* 隐藏Categories标题 */
section h2, /* 假设Categories标题在section内 */
h2:nth-of-type(2) { /* 根据页面结构选择第二个h2 */
    display: none; /* 隐藏Categories标题 */
}

/* 隐藏testimonials部分 */
.testimonials {
    display: none;
}

/* 为Image Tools标题和顶部栏添加行间距 */
h2:contains('Image Tools'), /* 包含Image Tools文本的h2 */
header + * h2:first-of-type, /* 顶部栏后的区域中的第一个h2 */
main h2:first-child { /* main区域中的第一个h2 */
    margin-top: 30px; /* 设置30px的顶部外边距 */
}

/* 也可以直接在header之后添加间距 */
header {
    margin-bottom: 30px; /* 顶部栏底部添加30px间距 */
}

/* 优化logo图片显示 - 适配所有页面 */
header .logo img, /* 更具体的选择器，提高优先级 */
.logo img, 
img[alt="OOPEN AII Logo"],
img[src*="logo"], /* 匹配任何包含logo的src路径 */
img[src*="Logo"] {
    display: inline-block !important;
    max-width: 100% !important;
    height: auto !important;
    width: 180px !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 9999 !important;
    background: none !important; /* 确保没有背景色干扰 */
    border: none !important; /* 确保没有边框 */
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.hero p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 20px;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 0 auto 30px;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.search-input:focus {
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 18px;
}

/* Category Filter */
.category-filter {
    text-align: center;
    margin-bottom: 30px;
}

.category-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.category-btn {
    background-color: #f0f0f0;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.category-btn:hover,
.category-btn.active {
    background-color: #0066cc;
    color: white;
}

.filter-info {
    font-size: 14px;
    color: #666;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

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

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

.tool-icon {
    margin-bottom: 10px;
    color: #0066cc;
    font-size: 36px;
}

.tool-card h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.tool-card p {
    color: #666;
    font-size: 13px;
    margin-bottom: 0;
    line-height: 1.4;
}

/* 移除tool-btn按钮 */
.tool-btn,
.tool-card-link .tool-btn,
.tool-content .tool-btn {
    display: none !important;
}

/* Features Section */
.features {
    background-color: white;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.features h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #0066cc;
}

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

.feature-item {
    text-align: center;
    padding: 20px;
}

.feature-icon {
    font-size: 48px;
    color: #0066cc;
    margin-bottom: 15px;
}

.feature-item h3 {
    margin-bottom: 10px;
    color: #333;
}

.feature-item p {
    color: #666;
    font-size: 14px;
}

/* Testimonials Section */
.testimonials {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 40px;
}

.testimonials h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #0066cc;
}

.testimonial-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.testimonial-card {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.testimonial-text {
    font-style: italic;
    color: #555;
    margin-bottom: 15px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 10px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #ddd;
}

.author-info h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 2px;
}

.author-info p {
    font-size: 14px;
    color: #666;
}

/* Footer Styles */
footer {
    background-color: #333;
    color: white;
    padding: 30px 0;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-info h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.footer-info p {
    color: #ccc;
    margin-bottom: 10px;
}

.footer-links {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #0099ff;
}

.copyright {
    border-top: 1px solid #555;
    padding-top: 20px;
    color: #aaa;
    font-size: 14px;
    text-align: center;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #0066cc;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #0052a3;
}

/* Breadcrumb Navigation */
.breadcrumb {
    max-width: 1200px;
    margin: 0 auto 20px;
    padding: 0 20px;
    font-size: 14px;
    color: #666;
}

.breadcrumb a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #0052a3;
    text-decoration: underline;
}

.breadcrumb span {
    color: #333;
    font-weight: 500;
}

.breadcrumb > * {
    display: inline-block;
    margin-right: 5px;
}

/* Tool Page Styles */
.tool-container {
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.tool-header {
    margin-bottom: 30px;
    text-align: center;
}

.tool-header h2 {
    font-size: 28px;
    color: #0066cc;
    margin-bottom: 10px;
}

.tool-header p {
    color: #666;
}

.tool-content {
    max-width: 800px;
    margin: 0 auto;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    margin-bottom: 30px;
    transition: border-color 0.3s;
}

.upload-area:hover {
    border-color: #0066cc;
}

.upload-area input[type="file"] {
    display: none;
}

.upload-btn {
    background-color: #0066cc;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
}

.upload-btn:hover {
    background-color: #0052a3;
}

.options {
    margin-bottom: 30px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.option-group input[type="range"],
.option-group select,
.option-group input[type="text"],
.option-group input[type="color"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.preview {
    margin-bottom: 30px;
    text-align: center;
}

.preview img {
    max-width: 100%;
    max-height: 400px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.action-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    margin-right: 10px;
}

.action-btn:hover {
    background-color: #218838;
}

.download-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
}

.download-btn:hover {
    background-color: #0056b3;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .hero h2 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 20px;
    }
    
    .logo img {
        height: auto !important;
        width: 150px !important; /* 小屏幕时调整宽度而不是高度 */
    }
    
    nav ul {
        gap: 10px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .upload-area {
        padding: 20px;
    }
}