:root {
    --primary-color: #d74a4a;
    --secondary-color: #f5f6fa;
    --text-color: #333;
}

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

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.header {
    background: transparent;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 10;
}

.header .nav a {
    color: black;
    text-decoration: none;
}

.logo img {
    height: 40px;
}

.banner {
    background: linear-gradient(135deg, #ff0000, #cc0033);
    color: white;
    text-align: center;
    padding: 60px 0;
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.banner h1 {
    margin-bottom: 1rem;
    font-size: 2.5em;
}

.banner p {
    font-size: 1.2em;
    opacity: 0.9;
}

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

.ai-plaza .plaza-content {
    display: flex;
    gap: 2rem;
}

.section-title {
    font-size: 24px;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

.filters {
    width: 250px;
    padding: 1.5rem;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.filters h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.categories {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    flex-direction: column;
    align-items: stretch;
}

.category {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    text-align: left;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 16px;
}

.category:hover {
    background: #f0f0f0;
}

.category.active {
    background: var(--primary-color);
    color: white;
}

.tools-and-search {
    flex: 1;
}

.search-bar {
    display: flex;
    align-items: center;
    background: white;
    padding: 0.5rem;
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.search-bar input {
    flex: 1;
    border: none;
    padding: 0.5rem;
    outline: none;
    font-size: 14px;
}

.search-bar button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--primary-color);
}

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

.tool-card {
    max-width: 223px; /* 设置卡片的最大宽度 */
    max-height: 400px; /* 设置卡片的最大高度 */
    width: 100%; /* 让卡片的宽度根据父容器的宽度自适应调整 */
    background: white;
    border-radius: 10px;
    padding: 0.7rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-5px);
}

.tool-icon {
    width: 100%;  /* 宽度自适应父容器 */
    height: auto;  /* 高度自动，保持宽高比 */
    max-height: 200px;  /* 限制最大高度 */
    margin-bottom: 10px;
    object-fit: cover; /* Ensure the image fills the square */
}
.tool-title {
    font-size: 18px;
    margin-bottom: 0.5rem;
}

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

.tool-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
}

.tool-button:hover {
    cursor: pointer;
    background-color: #cc0033;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
}

.pagination button {
    padding: 8px 16px;
    background: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: #f0f0f0;
}

.pagination button.active {
    background: var(--primary-color);
    color: white;
}

.pagination button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.carousel {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.carousel-item.active {
    opacity: 1;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 10;
}

.carousel-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator:hover {
    background-color: rgba(255, 255, 255, 0.8);
}

.carousel-indicator.active {
    background-color: white;
}

.slideshow-container {
    max-width: 1000px;
    position: relative;
    margin: auto;
    height: 300px;
}

.mySlides {
    display: none;
    height: 300px;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    margin-top: -22px;
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

.fade {
    -webkit-animation-name: fade;
    -webkit-animation-duration: 1.5s;
    animation-name: fade;
    animation-duration: 1.5s;
}

@-webkit-keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
}

@keyframes fade {
    from {opacity: .4} 
    to {opacity: 1}
}

.dot {
    cursor: pointer;
    height: 15px;
    width: 15px;
    margin: 0 2px;
    background-color: #bbb;
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.active, .dot:hover {
    background-color: #717171;
}

.carousel .carousel-indicators li.active {
    background-color: #333;
    width: 30px;
    height: 10px;
    border-radius: 5px;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .categories {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .banner h1 {
        font-size: 2em;
    }
}

@media screen and (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .ai-plaza .plaza-content {
        flex-direction: column;
        gap: 1rem;
    }

    .filters {
        width: 100%;
        padding: 1rem;
    }

    .categories {
        flex-direction: row;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .category {
        white-space: nowrap;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .tool-card {
        max-width: none;
    }

    .search-bar {
        margin-bottom: 1rem;
    }
}
