:root {
    --apple-blue: #007AFF;
    --apple-gray: #8E8E93;
    --apple-background: #F2F2F7;
    --apple-dark: #1C1C1E;
    --apple-card: #FFFFFF;
    --sidebar-width: 240px;

    /* 糖果色主题色系 */
    --candy-pink: #FF61A6;
    --candy-blue: #5ACDEE;
    --candy-purple: #B39DFF;
    --candy-yellow: #FFD872;
    --candy-green: #61E8B1;
    --candy-orange: #FF9D61;
    --candy-gradient: linear-gradient(135deg, var(--candy-pink), var(--candy-purple));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

body {
    background-color: var(--apple-background);
    color: var(--apple-dark);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: var(--candy-gradient);
    padding: 0.7rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.search-container {
    flex: 1;
    max-width: 500px;
    margin: 0 2rem;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border: 1px solid var(--apple-gray);
    border-radius: 20px;
    font-size: 0.9rem;
    background: var(--apple-background);
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--candy-pink);
    background: white;
    box-shadow: 0 0 10px rgba(255, 97, 166, 0.3);
}

.search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--apple-gray);
}

.main-container {
    display: flex;
    flex: 1;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--apple-card);
    padding: 2rem 0;
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.category-menu {
    list-style: none;
}

.category-item {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 0 solid transparent;
    margin-bottom: 0.3rem;
}

.category-item:hover {
    background: rgba(255, 97, 166, 0.1);
    color: var(--candy-pink);
}

.category-item.active {
    background: rgba(255, 97, 166, 0.15);
    color: var(--candy-pink);
    font-weight: 500;
    border-left: 4px solid var(--candy-pink);
}

.category-count {
    float: right;
    color: var(--apple-gray);
    font-size: 0.8rem;
    background: rgba(179, 157, 255, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.main-content {
    flex: 1;
    padding: 20px;
    max-width: calc(100% - var(--sidebar-width));
    background-color: #f8f9fa;
}

.section-title {
    font-size: 1.8rem;
    color: var(--apple-dark);
    margin: 1rem 0;
    padding-left: 0.5rem;
    border-left: 4px solid var(--candy-pink);
    display: inline-block;
    background: linear-gradient(to right, rgba(255, 97, 166, 0.1), transparent);
    padding: 0.5rem 1rem;
    border-radius: 0 8px 8px 0;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1rem 0;
}

.game-card {
    background: var(--apple-card);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

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

.game-card:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--candy-gradient);
}

.game-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

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

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

.game-info {
    padding: 1rem;
    position: relative;
}

.game-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--apple-dark);
    margin-bottom: 0.8rem;
}

.game-description {
    font-size: 0.9rem;
    color: var(--apple-gray);
    margin: 0.8rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.play-button {
    display: inline-flex;
    align-items: center;
    background: var(--candy-gradient);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-shadow: 0 4px 8px rgba(255, 97, 166, 0.3);
}

.play-button:hover {
    background: linear-gradient(135deg, #ff4b96, #a178ff);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(255, 97, 166, 0.4);
}

/* 游戏标签区域优化 - 糖果色主题 */
.category-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.8rem;
    padding: 0.5rem 0;
    position: relative;
}

.category-tags-container::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 0;
    height: 100%;
    width: 5px;
    background: linear-gradient(to bottom, var(--candy-pink), var(--candy-purple));
    border-radius: 3px;
    opacity: 0.5;
}

.category-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    animation: tagPop 0.5s ease forwards;
    opacity: 0;
    transform: scale(0.9);
}

@keyframes tagPop {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 为不同类型的标签分配不同的糖果色 */
.category-tag:nth-child(6n+1) {
    background-color: rgba(255, 97, 166, 0.15);
    color: var(--candy-pink);
    border: 1px solid rgba(255, 97, 166, 0.3);
    animation-delay: 0.1s;
}

.category-tag:nth-child(6n+2) {
    background-color: rgba(90, 205, 238, 0.15);
    color: var(--candy-blue);
    border: 1px solid rgba(90, 205, 238, 0.3);
    animation-delay: 0.2s;
}

.category-tag:nth-child(6n+3) {
    background-color: rgba(179, 157, 255, 0.15);
    color: var(--candy-purple);
    border: 1px solid rgba(179, 157, 255, 0.3);
    animation-delay: 0.3s;
}

.category-tag:nth-child(6n+4) {
    background-color: rgba(255, 216, 114, 0.15);
    color: #d9a41d;
    border: 1px solid rgba(255, 216, 114, 0.3);
    animation-delay: 0.4s;
}

.category-tag:nth-child(6n+5) {
    background-color: rgba(97, 232, 177, 0.15);
    color: var(--candy-green);
    border: 1px solid rgba(97, 232, 177, 0.3);
    animation-delay: 0.5s;
}

.category-tag:nth-child(6n+6) {
    background-color: rgba(255, 157, 97, 0.15);
    color: var(--candy-orange);
    border: 1px solid rgba(255, 157, 97, 0.3);
    animation-delay: 0.6s;
}

.category-tag:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    .main-content {
        max-width: calc(100% - 200px);
    }
}

@media (max-width: 768px) {
    .search-container {
        display: none;
    }
    .sidebar {
        display: none;
    }
    .main-content {
        max-width: 100%;
    }
    .mobile-menu-button {
        display: block;
    }
}

/* 游戏模态框样式 */
.game-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.game-modal-content {
    background: #000;
    width: 95%;
    height: 95%;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.game-modal-header {
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--candy-gradient);
}

.game-modal-header h2 {
    color: white;
    margin: 0;
    text-shadow: 0 2px 3px rgba(0,0,0,0.2);
}

.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0 0.5rem;
    transition: all 0.3s;
}

.close-button:hover {
    transform: rotate(90deg);
}

.game-modal-body {
    flex: 1;
    display: flex;
}

.game-modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* 搜索装饰和宣传区域样式 */
.search-decoration {
    position: absolute;
    font-size: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    animation: bounce 2s infinite;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.2));
}

.search-decoration.left {
    left: -30px;
}

.search-decoration.right {
    right: -30px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(-50%); }
    50% { transform: translateY(-65%); }
}

/* 宣传横幅样式 */
.promo-banner {
    background: var(--candy-gradient);
    color: white;
    padding: 2rem 0;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.promo-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 10%, transparent 10.5%);
    background-size: 20px 20px;
    opacity: 0.3;
    animation: move-background 20s linear infinite;
}

@keyframes move-background {
    0% { transform: translate(0,0) rotate(0); }
    100% { transform: translate(-10%,-10%) rotate(5deg); }
}

.promo-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.promo-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.promo-content p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.promo-search-tip {
    margin-bottom: 1.5rem;
}

.search-tip-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.search-tip-text {
    font-size: 1rem;
}

.promo-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 1.5rem;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.2);
    padding: 1.2rem 1.5rem;
    border-radius: 12px;
    width: 150px;
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    background: rgba(255,255,255,0.25);
}

.feature-icon {
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.2));
}

.feature-text {
    font-weight: 600;
    text-align: center;
}

.trending-tags {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8rem;
}

.trending-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-right: 0.8rem;
    display: inline-block;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.tag-bubble {
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.3);
}

.tag-bubble:nth-child(6n+2) { background: rgba(255, 97, 166, 0.2); }
.tag-bubble:nth-child(6n+3) { background: rgba(90, 205, 238, 0.2); }
.tag-bubble:nth-child(6n+4) { background: rgba(179, 157, 255, 0.2); }
.tag-bubble:nth-child(6n+5) { background: rgba(255, 216, 114, 0.2); }
.tag-bubble:nth-child(6n+6) { background: rgba(97, 232, 177, 0.2); }
.tag-bubble:nth-child(6n+7) { background: rgba(255, 157, 97, 0.2); }

.tag-bubble:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 5px 12px rgba(0,0,0,0.18);
}

.tag-bubble:active {
    transform: scale(0.98);
}

/* 粒子背景效果 */
.promo-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: none;
}

/* 媒体查询适配 */
@media (max-width: 768px) {
    .search-decoration {
        display: none;
    }

    .promo-content h2 {
        font-size: 1.8rem;
    }

    .promo-content p {
        font-size: 1rem;
    }

    .promo-features {
        gap: 1rem;
    }

    .feature {
        width: 120px;
        padding: 0.8rem;
    }

    .feature-icon {
        font-size: 1.5rem;
    }

    .feature-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .promo-features {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }

    .feature {
        width: 80%;
        flex-direction: row;
        justify-content: flex-start;
        gap: 1rem;
    }

    .feature-icon {
        margin-bottom: 0;
    }
}

/* 宣传区域中的搜索框样式 */
.promo-search {
    max-width: 600px;
    margin: 1.5rem auto;
    flex: none;
}

.promo-search .search-input {
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid rgba(255, 255, 255, 0.8);
    padding: 12px 20px 12px 40px;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.promo-search .search-input:focus {
    background: #fff;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.promo-search .search-icon {
    left: 15px;
    font-size: 1.2rem;
    color: var(--candy-pink);
}

/* 无游戏消息样式 */
.no-games-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    background: rgba(255, 97, 166, 0.05);
    border-radius: 12px;
    border: 2px dashed rgba(255, 97, 166, 0.3);
    color: var(--candy-pink);
    font-size: 1.2rem;
    margin: 2rem 0;
}
