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

body {
    font-family: 'Segoe UI', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
    font-size: 12px;
    background: #f3f3f3;
    min-height: 100vh;
    color: #323130;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

/* 响应式显示控制 */
.pc-only {
    display: block !important;
}

.wap-only {
    display: none !important;
}

/* PC端顶部栏 */
.top-bar {
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,.05);
    border-bottom: 1px solid #edebe9;
}

.top-bar-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 100px;
    display: flex;
}

.logo-area {
    width: 200px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0078d4;
}

.logo-area h1 {
    color: #fff;
    font-size: 24px;
    margin: 0;
}

.ad-area-top {
    width: 800px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

.controls-area {
    width: 200px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 15px;
    background: #fff;
}

.theme-toggle-wrapper {
    width: 100%;
    height: 32px;
    position: relative;
}

.theme-toggle {
    width: 100%;
    height: 100%;
    background: #f3f3f3;
    border-radius: 0;
    border: 1px solid #8a8886;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
}

.theme-toggle-slider {
    position: absolute;
    width: 50%;
    height: calc(100% - 2px);
    background: #0078d4;
    border-radius: 0;
    top: 1px;
    left: 1px;
    transition: transform 0.2s ease;
    z-index: 1;
}

.theme-toggle[data-theme="dark"] .theme-toggle-slider {
    transform: translateX(calc(100% - 2px));
}

.theme-icon {
    width: 16px;
    height: 16px;
    position: relative;
    z-index: 2;
    filter: brightness(0) saturate(100%) invert(35%) sepia(0%) saturate(0%) hue-rotate(0deg);
    transition: filter 0.2s ease;
}

.theme-toggle[data-theme="dark"] .theme-icon-light {
    filter: brightness(0) saturate(100%) invert(100%);
}

.theme-toggle[data-theme="light"] .theme-icon-dark {
    filter: brightness(0) saturate(100%) invert(35%) sepia(0%) saturate(0%) hue-rotate(0deg);
}

.theme-toggle[data-theme="dark"] .theme-icon-dark {
    filter: brightness(0) saturate(100%) invert(100%);
}

.language-select {
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    font-family: 'Segoe UI', 'Microsoft YaHei UI', sans-serif;
    border: 1px solid #8a8886;
    border-radius: 0;
    background: #fff;
    color: #323130;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23323130' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.language-select:hover {
    border-color: #323130;
}

.language-select:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: none;
}

/* WAP端头部 */
.mobile-header {
    background: #fff;
}

.mobile-logo {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0078d4;
}

.mobile-logo h1 {
    color: #fff;
    font-size: 20px;
    margin: 0;
}

.mobile-ad-top {
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
}

.mobile-controls-wrapper {
    padding: 15px;
    background: #fff;
    display: flex;
    gap: 10px;
    align-items: center;
}

.mobile-theme-toggle-wrapper {
    flex: 0 0 auto;
    width: 60px;
    height: 32px;
}

.mobile-theme-toggle {
    width: 100%;
    height: 100%;
    background: #f3f3f3;
    border-radius: 0;
    border: 1px solid #8a8886;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.mobile-theme-toggle-slider {
    position: absolute;
    width: 50%;
    height: calc(100% - 2px);
    background: #0078d4;
    border-radius: 0;
    top: 1px;
    left: 1px;
    transition: transform 0.2s ease;
    z-index: 1;
}

.mobile-theme-toggle[data-theme="dark"] .mobile-theme-toggle-slider {
    transform: translateX(calc(100% - 2px));
}

.mobile-theme-icon {
    width: 14px;
    height: 14px;
    position: relative;
    z-index: 2;
    filter: brightness(0) saturate(100%) invert(35%) sepia(0%) saturate(0%) hue-rotate(0deg);
    transition: filter 0.2s ease;
}

.mobile-theme-toggle[data-theme="dark"] .mobile-theme-icon-light {
    filter: brightness(0) saturate(100%) invert(100%);
}

.mobile-theme-toggle[data-theme="light"] .mobile-theme-icon-dark {
    filter: brightness(0) saturate(100%) invert(35%) sepia(0%) saturate(0%) hue-rotate(0deg);
}

.mobile-theme-toggle[data-theme="dark"] .mobile-theme-icon-dark {
    filter: brightness(0) saturate(100%) invert(100%);
}

.mobile-language-select {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    font-family: 'Segoe UI', 'Microsoft YaHei UI', sans-serif;
    border: 1px solid #8a8886;
    border-radius: 0;
    background: #fff;
    color: #323130;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23323130' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.mobile-language-select:hover {
    border-color: #323130;
}

.mobile-language-select:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: none;
}

.mobile-menu-wrapper {
    padding: 0 15px 15px;
    background: #fff;
}

.mobile-menu {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    font-family: 'Segoe UI', 'Microsoft YaHei UI', sans-serif;
    border: 1px solid #8a8886;
    border-radius: 0;
    background: #fff;
    color: #323130;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23323130' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
}

.mobile-menu:hover {
    border-color: #323130;
}

.mobile-menu:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: none;
}

.mobile-menu option {
    padding: 8px;
    font-size: 12px;
}

/* 分隔线 */
.divider {
    height: 1px;
    background: #edebe9;
    margin: 0;
}

/* 内容区域 */
.content-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
    padding: 20px 0;
    min-height: 500px;
}

/* PC端侧边栏 */
.sidebar {
    width: 200px;
    background: #fff;
    border-radius: 0;
    border-right: 1px solid #edebe9;
    padding: 20px;
    box-shadow: none;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c8c6c4;
    border-radius: 0;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a19f9d;
}

.sidebar::-webkit-scrollbar-track {
    background: #faf9f8;
}

.menu-section {
    margin-bottom: 25px;
}

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

.menu-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #323130;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #edebe9;
}

.menu ul {
    list-style: none;
}

.menu li {
    margin-bottom: 5px;
}

.menu a {
    display: block;
    padding: 8px 12px;
    color: #323130;
    text-decoration: none;
    border-radius: 0;
    transition: all 0.1s ease;
    font-size: 12px;
    border-left: 2px solid transparent;
}

.menu a:hover {
    background: #f3f2f1;
    color: #323130;
}

.menu a.active {
    background: #f3f2f1;
    color: #0078d4;
    border-left-color: #0078d4;
}

/* 游戏列表 */
.game-list {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    align-content: start;
    padding-right: 20px;
}

.game-item {
    background: #fff;
    border-radius: 0;
    border: 1px solid #edebe9;
    padding: 15px;
    box-shadow: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.game-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 3.2px 7.2px 0 rgba(0,0,0,.132), 0 0.6px 1.8px 0 rgba(0,0,0,.108);
    border-color: #c8c6c4;
}

.game-thumbnail {
    width: 100%;
    height: 150px;
    background: #f3f2f1;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a19f9d;
    font-size: 14px;
}

.game-item h3 {
    font-size: 14px;
    margin-bottom: 5px;
    color: #323130;
    font-weight: 600;
}

.game-item p {
    font-size: 12px;
    color: #605e5c;
    margin: 0;
}

/* 广告占位符样式 */
.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* 底部区域 */
footer {
    background: #fff;
    padding: 20px;
    box-shadow: 0 -1px 2px rgba(0,0,0,.05);
    border-top: 1px solid #edebe9;
}

.footer-ad {
    max-width: 1200px;
    margin: 0 auto 20px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: 0;
}

.copyright {
    text-align: center;
    padding: 30px 20px;
}

.copyright p {
    color: #605e5c;
    font-size: 12px;
    margin: 0;
}

/* 暗色主题 */
[data-theme="dark"] {
    background: #1b1a19;
}

[data-theme="dark"] body {
    background: transparent;
    color: #f3f2f1;
}

[data-theme="dark"] .top-bar,
[data-theme="dark"] .mobile-header,
[data-theme="dark"] .sidebar,
[data-theme="dark"] .game-item,
[data-theme="dark"] footer,
[data-theme="dark"] .controls-area,
[data-theme="dark"] .mobile-controls-wrapper,
[data-theme="dark"] .mobile-menu-wrapper {
    background: #292827;
    border-color: #3b3a39;
}

[data-theme="dark"] .logo-area,
[data-theme="dark"] .mobile-logo {
    background: #0078d4;
}

[data-theme="dark"] .ad-area-top,
[data-theme="dark"] .mobile-ad-top,
[data-theme="dark"] .footer-ad {
    background: #323130;
}

[data-theme="dark"] .menu a,
[data-theme="dark"] .game-item h3 {
    color: #f3f2f1;
}

[data-theme="dark"] .menu a:hover {
    background: #3b3a39;
    color: #f3f2f1;
}

[data-theme="dark"] .menu a.active {
    background: #3b3a39;
    color: #0078d4;
    border-left-color: #0078d4;
}

[data-theme="dark"] .game-item p {
    color: #d2d0ce;
}

[data-theme="dark"] .menu-section-title {
    color: #e1dfdd;
    border-bottom-color: #3b3a39;
}

[data-theme="dark"] .game-thumbnail {
    background: #323130;
    color: #8a8886;
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-track {
    background: #323130;
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb {
    background: #605e5c;
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb:hover {
    background: #797775;
}

[data-theme="dark"] .language-select,
[data-theme="dark"] .mobile-language-select,
[data-theme="dark"] .mobile-menu {
    background: #323130;
    color: #f3f2f1;
    border-color: #605e5c;
}

[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .mobile-theme-toggle {
    background: #3b3a39;
    border-color: #605e5c;
}

[data-theme="dark"] .copyright p {
    color: #d2d0ce;
}

[data-theme="dark"] .game-item {
    border-color: #3b3a39;
}

[data-theme="dark"] .game-item:hover {
    border-color: #605e5c;
    box-shadow: 0 3.2px 7.2px 0 rgba(0,0,0,.3), 0 0.6px 1.8px 0 rgba(0,0,0,.24);
}

/* 游戏详情页面样式 */
.game-detail-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

/* 对联广告 */
.game-detail-ad-left,
.game-detail-ad-right {
    width: 160px;
    flex-shrink: 0;
}

.ad-couplet {
    width: 160px;
    height: 600px;
    background: #fafafa;
    border: 1px solid #edebe9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
    position: sticky;
    top: 0;
}

.game-detail-content {
    flex: 1;
    background: #fff;
    border: 1px solid #edebe9;
    padding: 20px;
}

.game-detail-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #edebe9;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.game-detail-header h1 {
    font-size: 24px;
    color: #323130;
    margin: 0;
    font-weight: 700;
    flex: 1;
}

.game-header-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    align-items: flex-start;
    margin-top: 2px;
}

.game-header-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-family: 'Segoe UI', 'Microsoft YaHei UI', sans-serif;
    border: 1px solid #8a8886;
    border-radius: 0;
    background: #fff;
    color: #323130;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    font-weight: 600;
    line-height: 1;
}

.game-header-btn:hover {
    background: #f3f2f1;
    border-color: #323130;
}

.game-header-btn:active {
    background: #edebe9;
}

.game-header-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.game-frame-container {
    width: 800px;
    height: 600px;
    position: relative;
    background: #000;
    margin: 0 auto 20px;
    border: 1px solid #edebe9;
}

.game-frame-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.game-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.game-btn {
    flex: 1;
    padding: 10px 15px;
    font-size: 12px;
    font-family: 'Segoe UI', 'Microsoft YaHei UI', sans-serif;
    border: 1px solid #8a8886;
    border-radius: 0;
    background: #fff;
    color: #323130;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.game-btn:hover {
    background: #f3f2f1;
    border-color: #323130;
}

.game-btn:active {
    background: #edebe9;
}

.game-btn svg {
    flex-shrink: 0;
}

.game-description {
    padding: 20px 0;
}

.game-description h2 {
    font-size: 16px;
    color: #323130;
    margin-bottom: 15px;
    font-weight: 700;
}

.game-description p {
    font-size: 12px;
    color: #605e5c;
    line-height: 1.6;
    margin: 0;
}

.game-detail-ad-mobile {
    padding: 20px;
    display: flex;
    justify-content: center;
}

.game-detail-ad-mobile > div {
    background: #fafafa;
    border: 1px solid #edebe9;
    height: 100px;
    width: 100%;
    max-width: 728px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 12px;
}

/* 暗色主题 - 游戏详情页 */
[data-theme="dark"] .game-detail-content {
    background: #292827;
    border-color: #3b3a39;
}

[data-theme="dark"] .game-detail-header h1 {
    color: #f3f2f1;
}

[data-theme="dark"] .game-detail-header {
    border-bottom-color: #3b3a39;
}

[data-theme="dark"] .game-header-btn {
    background: #323130;
    color: #f3f2f1;
    border-color: #605e5c;
}

[data-theme="dark"] .game-header-btn:hover {
    background: #3b3a39;
    border-color: #797775;
}

[data-theme="dark"] .game-header-btn:active {
    background: #292827;
}

[data-theme="dark"] .ad-couplet {
    background: #323130;
    border-color: #3b3a39;
    color: #8a8886;
}

[data-theme="dark"] .game-frame-container {
    border-color: #3b3a39;
}

[data-theme="dark"] .game-btn {
    background: #323130;
    color: #f3f2f1;
    border-color: #605e5c;
}

[data-theme="dark"] .game-btn:hover {
    background: #3b3a39;
    border-color: #797775;
}

[data-theme="dark"] .game-btn:active {
    background: #292827;
}

[data-theme="dark"] .game-description h2 {
    color: #f3f2f1;
}

[data-theme="dark"] .game-description p {
    color: #d2d0ce;
}

[data-theme="dark"] .game-detail-ad-mobile > div {
    background: #323130;
    border-color: #3b3a39;
    color: #8a8886;
}

/* 推荐游戏区域 */
.recommended-games {
    background: #fff;
    padding: 30px 0;
}

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

.recommended-games h2 {
    font-size: 20px;
    color: #323130;
    margin-bottom: 20px;
    font-weight: 700;
}

.recommended-games-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

[data-theme="dark"] .recommended-games {
    background: #292827;
}

[data-theme="dark"] .recommended-games h2 {
    color: #f3f2f1;
}

/* 平板和移动端响应式 */
@media screen and (max-width: 768px) {
    .pc-only {
        display: none !important;
    }
    
    .wap-only {
        display: block !important;
    }
    
    .content-wrapper {
        padding: 10px;
        flex-direction: column;
    }
    
    .game-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding-right: 0;
    }
    
    .game-thumbnail {
        height: 120px;
    }
    
    .footer-ad {
        height: 80px;
    }
    
    /* 游戏详情页移动端适配 */
    .game-detail-wrapper {
        padding: 10px;
    }
    
    .game-detail-ad-left,
    .game-detail-ad-right {
        display: none !important;
    }
    
    .game-detail-content {
        padding: 15px;
        max-width: 100%;
    }
    
    .game-detail-header {
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }
    
    .game-detail-header h1 {
        font-size: 18px;
    }
    
    .game-header-actions {
        width: auto;
        flex-shrink: 0;
    }
    
    .game-header-btn.wap-only {
        padding: 8px;
        min-width: 32px;
    }
    
    .game-frame-container {
        width: 100%;
        height: auto;
        aspect-ratio: 4/3;
    }
    
    .game-controls {
        flex-direction: column;
    }
    
    .game-btn {
        width: 100%;
    }
    
    /* 推荐游戏移动端 */
    .recommended-games-container {
        padding: 0 10px;
    }
    
    .recommended-games-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}
