/* Reset and Base Styles */
* {
    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: #1d1d1f;
    overflow-x: hidden;
    background: #fffef7;
}

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

/* Navigation Styles */
.navbar {
    background: #f8fafc; /* 改为与第二板块相同的背景色 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.2rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    color: #1d1d1f;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    /* 删除flex布局，移除图片相关样式 */
}

.nav-logo h2 {
    color: #1d1d1f;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.nav-link {
    text-decoration: none;
    color: #1d1d1f; /* 改回黑色文字 */
    font-weight: 400;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    border-radius: 12px;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: -0.01em;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.05); /* 悬停时黑色半透明背景 */
    color: #1d1d1f; /* 悬停时保持黑色文字 */
    transform: translateY(-1px);
}

.login-btn {
    background: linear-gradient(135deg, #fdf2c7, #fbeaa0); /* 改回原来的黄色背景 */
    color: #1d1d1f !important; /* 黑色文字 */
    font-weight: 500;
    border: 1px solid rgba(251, 234, 160, 0.3);
}

.login-btn:hover {
    background: linear-gradient(135deg, #fbebb3, #f8e186); /* 悬停时更深的黄色 */
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(251, 234, 160, 0.3);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 2px;
    background: #1d1d1f; /* 汉堡菜单线条改回黑色 */
    margin: 3px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* Search Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 20px;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}

.modal-content h2 {
    color: #1d1d1f;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-content p {
    color: #64748b;
    margin-bottom: 1.5rem;
}

.search-suggestions {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.search-suggestions p {
    color: #374151;
    font-weight: 500;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

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

.suggestion-tags span {
    background: #f1f5f9;
    color: #475569;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.suggestion-tags span:hover {
    background: #e2e8f0;
    color: #1e293b;
    transform: translateY(-1px);
}

/* Hero Section */
.hero {
    margin-top: 100px;
    padding: 4rem 0;
    background: linear-gradient(135deg, #fffef7 0%, #fefbf3 100%);
}

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero-description {
    font-size: 1.25rem;
    color: #64748b;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.25);
}

.btn-secondary {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

/* Main Content Sections */
.main-content {
    padding: 4rem 0;
}

.content-section {
    padding: 4rem 0;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.content-section.reverse .section-container {
    direction: rtl;
}

.content-section.reverse .section-text {
    direction: ltr;
}

.section-text h2 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.section-text p {
    font-size: 1.1rem;
    color: #64748b;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.section-image img {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

/* Features Section */
.features-section {
    padding: 5rem 0;
    background: #f8fafc;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.feature-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.3s ease;
    text-align: center;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.feature-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-image img {
    transform: scale(1.05);
}

.feature-content {
    padding: 2rem;
}

.feature-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.feature-content p {
    font-size: 1rem;
    color: #64748b;
    line-height: 1.6;
    margin: 0;
}

/* Featured Games Section */
.featured-games {
    padding: 5rem 0;
    background: linear-gradient(135deg, #fffef7 0%, #fefbf3 100%);
}

.section-title {
    text-align: center;
    font-size: 2.75rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 3rem;
    letter-spacing: -0.02em;
}

.carousel-container {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    overflow: hidden;
    padding: 0 60px; /* 给按钮留出空间 */
}

.carousel-track {
    display: flex;
    gap: 2rem;
    overflow-x: hidden; /* 改为隐藏滚动条，由JS控制 */
    scroll-behavior: auto; /* 改为auto，让JS完全控制 */
    padding: 1rem 0 2rem 0;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    scroll-snap-type: none; /* 移除snap，让滚动更流畅 */
    will-change: transform; /* 优化性能 */
    transform: translateX(0); /* 初始位置 */
    transition: none; /* 移除transition，由JS控制 */
}

.carousel-track::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.game-card {
    min-width: 320px;
    max-width: 320px;
    flex-shrink: 0;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    transform: translateY(0); /* 添加初始transform */
}

.game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.game-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 改为显示完整图片 */
    object-position: center;
    background: #f8fafc; /* 添加背景色 */
    transition: transform 0.3s ease;
}

.game-card:hover img {
    transform: scale(1.02); /* 减小缩放效果 */
}

.game-info {
    padding: 1.5rem;
}

.game-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.game-info p {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
    margin-bottom: 1rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.game-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.game-category,
.game-level {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.game-category {
    background: #fef3c7;
    color: #d97706;
}

.game-level {
    background: #f1f5f9;
    color: #64748b;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #374151;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0.7;
}

.carousel-btn:hover {
    background: #f9fafb;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-50%) scale(1.1);
    opacity: 1;
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.carousel-container:hover .carousel-btn {
    opacity: 1;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* 轮播指示器 */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: #fbbf24;
    transform: scale(1.2);
}

/* 添加无缝滚动的性能优化 */
.carousel-track {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000px;
    -webkit-perspective: 1000px;
}

/* 提升动画性能 */
@media (prefers-reduced-motion: no-preference) {
    .carousel-track {
        animation-fill-mode: forwards;
    }
}

/* 如果用户偏好减少动画，则禁用自动滚动 */
@media (prefers-reduced-motion: reduce) {
    .carousel-track {
        scroll-behavior: smooth;
    }
}

/* Game Modal */
.game-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
}

.game-modal-content {
    background-color: white;
    margin: 2% auto;
    width: 95%;
    max-width: 1200px;
    height: 90%;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-modal-header {
    padding: 1rem 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-game {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0.5rem;
    border-radius: 8px;
}

.close-game:hover {
    background: #e5e7eb;
    color: #374151;
}

.game-container {
    flex: 1;
    background: white;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #0891b2, #0e7490); /* 改为湖蓝色渐变背景，与导航栏一致 */
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

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

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8); /* 改为白色半透明 */
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white; /* 悬停时完全白色 */
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2); /* 改为白色半透明边框 */
    color: rgba(255, 255, 255, 0.7); /* 改为白色半透明文字 */
}

/* Message Container */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 300px;
}

.message {
    background: #3b82f6;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn 0.3s ease-out;
}

.message-success {
    background: #10b981;
}

.message-error {
    background: #ef4444;
}

.message-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    margin-left: auto;
    padding: 4px;
    border-radius: 4px;
}

.message-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* User Welcome */
.user-welcome {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.user-welcome p {
    margin: 0;
    color: #1e40af;
    font-weight: 500;
}

/* Game Library Styles */
.page-header {
    margin-top: 100px;
    padding: 3rem 0;
    background: linear-gradient(135deg, #fffef7 0%, #fefbf3 100%);
    text-align: center;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.page-header p {
    font-size: 1.1rem;
    color: #64748b;
    max-width: 600px;
    margin: 0 auto;
}

.game-categories {
    padding: 2rem 0;
    background: #fffef7;
}

.category-filters {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    background: white;
    color: #374151;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border-color: #fbbf24;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}

/* 修复主要的游戏网格容器 */
.games-grid {
    padding: 2rem 0;
    background: #fffef7;
}

.games-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 确保游戏卡片样式正确 */
.library-game-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    width: 100%; /* 改为100%以适应网格 */
    max-width: none; /* 移除固定最大宽度限制 */
}

.library-game-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.library-game-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    background: #f8fafc;
    transition: transform 0.3s ease;
}

.library-game-card:hover img {
    transform: scale(1.02);
}

.library-game-info {
    padding: 1.5rem;
}

.library-game-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.library-game-description {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.library-game-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.library-game-level,
.library-game-category {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
}

.library-game-level {
    background: #f1f5f9;
    color: #64748b;
}

.library-game-category {
    background: #fef3c7;
    color: #d97706;
}

.library-game-launch {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.library-game-launch:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}

.library-game-launch.disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.library-game-launch.disabled:hover {
    background: #9ca3af;
    transform: none;
    box-shadow: none;
}

/* Active category filter */
.category-btn.active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border-color: #fbbf24;
}

/* 首页新布局样式 */

/* 一、网页介绍板块 */
.intro-section {
    margin-top: 100px;
    padding: 4rem 0;
    background: linear-gradient(135deg, #fffef7 0%, #fefbf3 100%);
}

.intro-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    align-items: center;
    min-height: 400px;
}

.intro-left,
.intro-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.intro-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.intro-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.intro-center {
    text-align: center;
    padding: 2rem;
}

.intro-slogan {
    font-size: 3rem;
    font-weight: 700;
    color: #1d1d1f;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
    background: linear-gradient(135deg, #1d1d1f 0%, #374151 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 二、产品介绍板块 */
.product-section {
    padding: 5rem 0;
    background: #f8fafc;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 1000px;
    margin: 2rem auto 0;
}

.product-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.product-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    color: white;
}

/* 为每个产品卡片设置不同的图标颜色 */
.product-card:nth-child(1) .product-icon {
    background: linear-gradient(135deg, #ff8a00, #ff6b00); /* 橘黄色 */
}

.product-card:nth-child(2) .product-icon {
    background: linear-gradient(135deg, #ff9fb1, #ff758c); /* 淡粉红色 */
}

.product-card:nth-child(3) .product-icon {
    background: linear-gradient(135deg, #74c0fc, #339af0); /* 浅蓝色 */
}

.product-card:nth-child(4) .product-icon {
    background: linear-gradient(135deg, #69db7c, #51cf66); /* 淡绿色 */
}

.product-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.product-card p {
    font-size: 1rem;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.product-subtitle {
    font-size: 0.9rem !important;
    color: #64748b !important;
    font-style: italic;
    margin-bottom: 0 !important;
}

/* 三、工具展示板块 */
.tools-section {
    padding: 5rem 0;
    background: linear-gradient(135deg, #fffef7 0%, #fefbf3 100%);
}

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

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

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

.tool-featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.tool-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.tool-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: #f8fafc;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-image img {
    transform: scale(1.02);
}

.tool-info {
    padding: 1.5rem;
}

.tool-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

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

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

.tool-grade {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: 500;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .intro-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .intro-slogan {
        font-size: 2.5rem;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tools-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .intro-section {
        padding: 2rem 0;
    }
    
    .intro-slogan {
        font-size: 2rem;
    }
    
    .intro-image {
        max-width: 250px;
    }
    
    .product-section,
    .tools-section {
        padding: 3rem 0;
    }
    
    .product-card {
        padding: 1.5rem;
    }
    
    .product-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .product-card h3 {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .intro-container {
        padding: 0 1rem;
        gap: 2rem;
    }
    
    .intro-slogan {
        font-size: 1.75rem;
    }
    
    .intro-image {
        max-width: 200px;
    }
    
    .product-card {
        padding: 1.25rem;
    }
    
    .tool-info {
        padding: 1.25rem;
    }
    
    .tool-info h3 {
        font-size: 1.1rem;
    }
    
    .tool-description {
        font-size: 0.85rem;
    }
}

/* 搜索结果页面样式 */
.search-results-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.search-info {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-query-display {
    color: #374151;
    font-size: 1.1rem;
}

.search-query-display strong {
    color: #1d1d1f;
}

.search-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .search-info {
        flex-direction: column;
        text-align: center;
    }
    
    .search-actions {
        justify-content: center;
    }

    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 100px;
        flex-direction: column;
        background: linear-gradient(135deg, #e0f2fe, #b3e5fc); /* 改为浅蓝色渐变背景 */
        backdrop-filter: blur(20px);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1); /* 调整阴影颜色 */
        border-radius: 0 0 20px 20px;
        padding: 2rem 0;
        gap: 1rem;
    }

    .nav-menu .nav-link {
        color: #1d1d1f; /* 移动端菜单链接也改为黑色 */
    }

    .nav-menu .nav-link:hover {
        background: rgba(0, 0, 0, 0.05);
        color: #1d1d1f;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-text h2 {
        font-size: 2rem;
    }

    .game-card {
        min-width: 250px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .prev-btn {
        left: 5px;
    }

    .next-btn {
        right: 5px;
    }

    .games-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .category-filters {
        gap: 0.5rem;
    }

    .category-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tool-features {
        justify-content: center;
    }
    
    .tool-info {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 2rem 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .game-card {
        min-width: 220px;
    }

    .game-info {
        padding: 1rem;
    }

    .game-info h3 {
        font-size: 1.1rem;
    }

    .games-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .library-game-info {
        padding: 1rem;
    }

    .tool-thumbnail {
        height: 160px;
    }
    
    .tool-info h3 {
        font-size: 1.1rem;
    }
    
    .tool-description {
        font-size: 0.85rem;
    }
}

/* Responsive adjustments for game categories */
@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 280px));
        gap: 1.5rem;
        justify-content: start; /* 保持左对齐 */
    }
    
    .category-game-card {
        width: 280px;
        max-width: 280px;
    }
    
    .view-all-card {
        width: 280px;
        max-width: 280px;
        min-height: 250px;
    }
    
    .category-title {
        font-size: 1.5rem; /* 平板上稍微小一点但仍保持合理比例 */
    }
}

@media (max-width: 768px) {
    .game-categories-section {
        padding: 3rem 0;
    }
    
    .category-section {
        margin-bottom: 3rem;
    }
    
    .category-header {
        margin-bottom: 2rem;
        text-align: left; /* 保持左对齐 */
    }
    
    .category-title {
        font-size: 1.4rem; /* 手机上与导航栏保持相似比例 */
    }
    
    .category-description {
        font-size: 1rem;
        padding: 0 1rem;
        text-align: left; /* 保持左对齐 */
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 280px));
        gap: 1.5rem;
        padding: 0 1rem;
        justify-content: start; /* 保持左对齐 */
    }
    
    .category-game-card {
        width: 280px;
        max-width: 280px;
    }
    
    .view-all-card {
        width: 280px;
        max-width: 280px;
        min-height: 200px;
    }
    
    .view-all-content {
        padding: 1.5rem;
    }
    
    .view-all-content i {
        font-size: 2.5rem;
    }
    
    .view-all-content h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .category-title {
        font-size: 1.25rem; /* 小屏幕上保持可读性 */
        text-align: left; /* 保持左对齐 */
    }
    
    .games-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 280px));
        justify-content: start; /* 改为左对齐而不是居中 */
    }
    
    .category-game-card {
        width: 280px;
        max-width: 280px;
    }
    
    .view-all-card {
        width: 280px;
        max-width: 280px;
    }
    
    .category-game-card .game-info {
        padding: 1.25rem;
    }
    
    .category-game-card .game-info h3 {
        font-size: 1.1rem;
    }
    
    .category-game-card .game-info p {
        font-size: 0.85rem;
    }
}

#searchInput {
    width: 100%;
    padding: 12px;
    margin: 20px 0;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#searchInput:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#searchBtn {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

#searchBtn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Search Results Styles */
.search-results-header {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-results-header h3 {
    color: #1d1d1f;
    margin: 0;
    font-size: 1.25rem;
}

.favorites-header {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.favorites-header h3 {
    color: #1d1d1f;
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorites-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.no-games {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.no-games i {
    font-size: 4rem;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.no-games h3 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.no-games p {
    color: #6b7280;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Game Categories Section */
.game-categories-section {
    padding: 5rem 0;
    background: #fffef7;
}

.category-section {
    margin-bottom: 4rem;
}

.category-section:last-child {
    margin-bottom: 0;
}

.category-header {
    text-align: left; /* 改为左对齐 */
    margin-bottom: 3rem;
}

.category-title {
    font-size: 1.75rem; /* 改为和EduPlay导航栏文字相同大小 */
    font-weight: 600; /* 稍微减轻字重 */
    color: #1d1d1f;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.category-description {
    font-size: 1.1rem;
    color: #64748b;
    line-height: 1.6;
    max-width: 800px;
    margin: 0; /* 移除auto居中 */
}

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 320px));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    justify-content: start; /* 改为左对齐 */
}

.category-game-card .game-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 改为contain显示完整图片 */
    object-position: center; /* 居中显示 */
    background: #f8fafc; /* 添加背景色填补空白区域 */
    transition: transform 0.3s ease;
}

.category-game-card:hover .game-image img {
    transform: scale(1.02); /* 减小hover缩放效果 */
}

/* 特殊样式：展开全部游戏卡片 */
.view-all-card {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    width: 320px; /* 固定宽度 */
    max-width: 320px; /* 确保不会超过这个宽度 */
}

.view-all-card:hover {
    transform: translateY(-8px);
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #94a3b8;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}