/* 全局样式 */
:root {
    --primary-color: #4a6bff;
    --primary-dark: #3a56cc;
    --secondary-color: #ff6b6b;
    --text-color: #333333;
    --text-light: #666666;
    --background-color: #ffffff;
    --background-light: #f5f7ff;
    --border-color: #e0e0e0;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --focus-type-color: #4a6bff;
    --creative-type-color: #ff6b6b;
    --logic-type-color: #6b66ff;
    --calm-type-color: #66c7ff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--background-color);
}

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

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

button {
    cursor: pointer;
    font-family: 'Noto Sans SC', sans-serif;
}

/* 头部样式 */
.header {
    background-color: var(--background-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 12px 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

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

.logo a {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.logo-highlight {
    color: var(--primary-color);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-container {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background-color: rgba(142, 142, 147, 0.12);
    border-radius: 20px;
    padding: 0 10px;
    transition: all 0.2s ease;
    width: 200px;
}

.search-input-wrapper:hover, 
.search-input-wrapper:focus-within {
    background-color: rgba(142, 142, 147, 0.18);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.search-icon {
    color: #8e8e93;
    margin-right: 6px;
    width: 14px;
    height: 14px;
}

.search-input {
    border: none;
    background: transparent;
    height: 32px;
    font-size: 0.9rem;
    color: var(--text-color);
    outline: none;
    width: 100%;
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

.search-input::placeholder {
    color: #8e8e93;
}

.clear-search {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    border-radius: 50%;
    color: #8e8e93;
    transition: background-color 0.2s ease;
}

.clear-search:hover {
    background-color: rgba(142, 142, 147, 0.2);
}

.nav-list {
    display: flex;
}

.nav-list li {
    margin-left: 30px;
}

.nav-list a {
    color: var(--text-color);
    font-weight: 500;
}

.nav-list a:hover,
.nav-list a.active {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
}

.mobile-menu-btn span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-color);
    transition: var(--transition);
}

/* 首页样式 */
.hero {
    background-color: var(--background-light);
    padding: 80px 0;
    text-align: center;
}

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

.hero-title {
    font-size: 48px;
    margin-bottom: 20px;
    color: var(--text-color);
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-light);
    margin-bottom: 40px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    font-size: 16px;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    color: white;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 22px;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-group {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 36px;
    margin-bottom: 15px;
}

.section-subtitle {
    font-size: 18px;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto;
}

/* 游戏卡片样式 */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

/* 更新游戏卡片样式 */
.game-card {
    background-color: transparent;
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

/* 覆盖图片容器样式，因为这些现在在组件中定义 */
.game-image-container {
    overflow: hidden;
    border-radius: 12px;
    position: relative;
}

/* 移除顶部遮罩层，因为现在我们使用底部渐变遮罩 */
.game-image-container::after {
    content: none;
}

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

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

/* 移除游戏内容样式，因为现在文本直接覆盖在图片上 */
.game-content {
    display: none;
}

/* 游戏类型样式更新 */
.game-type {
    display: inline-block;
    padding: 4px 10px 4px 26px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    background-color: white;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.game-type::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Type colors */
.game-type.focus {
    color: var(--focus-type-color);
}

.game-type.focus::before {
    background-color: var(--focus-type-color);
}

.game-type.creative {
    color: var(--creative-type-color);
}

.game-type.creative::before {
    background-color: var(--creative-type-color);
}

.game-type.logic {
    color: var(--logic-type-color);
}

.game-type.logic::before {
    background-color: var(--logic-type-color);
}

.game-type.calm {
    color: var(--calm-type-color);
}

.game-type.calm::before {
    background-color: var(--calm-type-color);
}

.game-duration {
    color: var(--text-light);
}

.view-all {
    display: block;
    text-align: center;
    margin-top: 40px;
    font-weight: 500;
}

/* 益处部分样式 */
.benefits-section {
    background-color: var(--background-light);
}

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

.benefit-card {
    background-color: var(--background-color);
    border-radius: 10px;
    padding: 30px;
    box-shadow: var(--shadow);
    text-align: center;
}

.benefit-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
}

.benefit-title {
    font-size: 20px;
    margin-bottom: 15px;
}

.benefit-description {
    color: var(--text-light);
}

/* 页脚样式 */
.footer {
    background-color: var(--background-light);
    padding: 40px 0 15px;
}

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

.footer-logo a {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
}

.footer-links ul {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    color: var(--text-light);
    font-size: 14px;
}

/* 游戏列表页面样式 */
.page-header {
    background-color: var(--background-light);
    padding: 30px 0;
    font-size: 28px;
    font-weight: 800;
    text-align: center;
}

.page-title {
    font-size: 36px;
    margin-bottom: 15px;
}

.page-description {
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-color);
}

.games-filter {
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.filter-group {
    margin-bottom: 10px;
}

.filter-title {
    font-size: 16px;
    margin-bottom: 10px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 6px 15px;
    font-size: 14px;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.games-list {
    padding: 50px 0;
}

.no-results {
    text-align: center;
    padding: 40px 0;
    color: var(--text-light);
}

/* 游戏详情页样式 */
.game-header {
    background-color: var(--background-light);
    padding: 60px 0;
}

.game-header-content {
    display: flex;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
}

.game-header-image {
    width: 300px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.game-header-info {
    flex: 1;
    min-width: 300px;
}

.game-header-title {
    font-size: 36px;
    margin-bottom: 15px;
}

.game-header-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.game-header-description {
    margin-bottom: 30px;
    color: var(--text-light);
}

.game-container {
    padding: 50px 0;
}

.game-instructions {
    max-width: 800px;
    margin: 0 auto 40px;
    padding: 30px;
    background-color: var(--background-light);
    border-radius: 10px;
}

.instructions-title {
    font-size: 24px;
    margin-bottom: 15px;
}

.game-area {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 30px;
    min-height: 400px;
}

/* 响应式样式 */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }
    
    .search-input-wrapper {
        width: 160px;
        transition: width 0.3s ease;
    }
    
    .search-input-wrapper:focus-within {
        width: 180px;
    }
    
    .search-input {
        font-size: 0.85rem;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .section-title {
        font-size: 30px;
    }

    .game-header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .game-header-image {
        width: 100%;
        height: 200px;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .game-image-container {
        height: 140px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .btn-group {
        flex-direction: column;
        gap: 15px;
    }

    .section {
        padding: 50px 0;
    }
    
    .search-input-wrapper {
        width: 36px;
        padding: 0 8px;
        border-radius: 36px;
        overflow: hidden;
        transition: all 0.3s ease;
    }
    
    .search-input-wrapper .search-icon {
        margin-right: 0;
    }
    
    .search-input {
        width: 0;
        padding: 0;
    }
    
    .search-input-wrapper:focus-within {
        width: 160px;
        padding: 0 10px;
    }
    
    .search-input-wrapper:focus-within .search-icon {
        margin-right: 6px;
    }
    
    .search-input-wrapper:focus-within .search-input {
        width: 100%;
    }
    
    .game-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }
    
    .game-image-container {
        height: 120px;
    }
    
    .game-title {
        font-size: 0.95rem;
    }
    
    .game-type {
        font-size: 0.7rem;
        padding: 3px 8px 3px 22px;
    }
    
    .game-type::before {
        width: 6px;
        height: 6px;
    }
}

/* 添加搜索聚焦相关样式 */
body.search-focused {
    position: relative;
}

@media (max-width: 480px) {
    body.search-focused .filter-group,
    body.search-focused .games-list {
        opacity: 0.6;
        pointer-events: none;
    }
    
    body.search-focused .search-input-wrapper {
        position: relative;
        z-index: 110;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
} 