/* 基础重置和全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3a0ca3;
    --secondary-color: #4361ee;
    --accent-color: #f72585;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 12px;
    --box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7ff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 680px;
    margin: 0 auto;
}

pre img{
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

#game-links {
    scroll-margin-top: 100px;
}

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

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 680px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 680px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
	width:150px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background-image:url('img/logo.jpg');
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 1.2rem;
    background-size: 100%;
    background-repeat: no-repeat;
    background-position: center;
}

.logo-text {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
	white-space: nowrap;
	padding-right:5px;
}

.search-bar {
    display: flex;
    max-width: 300px;
    width: 100%;
	gap:5px;
}

.search-bar input {
    flex-grow: 1;
    padding: 10px 15px;
    border: none;
    border-radius: var(--border-radius) var(--border-radius);
    font-size: 0.9rem;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
	width: 100%;
}

.search-bar button {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0 12px;
    border-radius: var(--border-radius) var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
	white-space: nowrap;
}

.search-bar button:hover {
    background: #e11574;
}

/* 导航和返回按钮 */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-back {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 主内容区域 */
main {
    flex-grow: 1;
    padding: 1.5rem 0;
}

.page-title {
    margin-bottom: 1rem;
    color: var(--dark-color);
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 8px;
}

.page-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* 游戏网格 - 修改：将.game-card改为<a>标签样式 */
.games-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 2.5rem;
}

/* 修改：将.game-card改为链接样式 */
.game-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
    min-width: 0;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.game-card-xg {
    display: block;
    width:150px;
    overflow: hidden;
    cursor: pointer;
    height: 100%;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.game-card-xg:hover {
    opacity: 0.9;
}

/* 确保卡片内容正常显示 */
.game-card-content,
.game-card-content-xg {
    display: block;
    width: 100%;
    height: 100%;
}

/* 图标区域布局 */
.game-icon-area {
    display: flex;
    padding: 6px 6px 0;
    gap: 6px;
    align-items: center; /* 改为center对齐 */
    min-height: 64px; /* 确保区域高度至少等于图标高度 */
}

.game-icon-wrapper {
    flex-shrink: 0;
    display: flex;
    align-items: center; /* 确保图标垂直居中 */
}

.game-icon-wrapper-xg {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom:8px;
}

.game-icon-wrapper-xg img {
    width:64px;
    height:64px;
}

.game-title-xg {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.25;
    text-align: center;
    
    /* 最多显示2行，超出显示省略号 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 游戏图标尺寸 */
.game-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 游戏标题和基本信息区域 */
.game-basic-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直居中 */
    align-items: flex-start;
    height: 64px; /* 与图标高度相同 */
}

/* 游戏标题 - 增加与第二行的间距 */
.game-title {
    font-size: 1rem; /* 从0.9rem增大到1rem */
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 5px; /* 增加标题与第二行的间距 */
    width: 100%;
}

/* 游戏标签 - 调整行高和间距 */
.game-tag {
    color: var(--gray-color);
    font-size: 0.65rem; /* 从0.7rem减小到0.65rem */
    font-weight: 400; /* 从300增加到400，增加可读性 */
    white-space: nowrap;
    flex-shrink: 0;
    margin-right: 6px; /* 标签之间的水平间隔 */
    margin-bottom: 1px; /* 减少垂直间隔 */
    letter-spacing: -0.2px; /* 轻微字距调整 */
    line-height: 1.4; /* 增加行高 */
}

/* 游戏元数据区域 - 减少与第二行的间隔 */
.game-meta {
    display: flex;
    flex-wrap: wrap;
    margin-top: 2px; /* 减少第二行与第三行的间隔 */
    align-items: center; /* 确保标签垂直对齐 */
}

/* 游戏描述区域 */
.game-description-area {
    padding: 8px 8px 8px;
    border-top: 1px solid var(--light-gray);
    flex: 1;
}

.game-description {
    color: var(--gray-color);
    font-size: 0.8rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* 游戏详情页样式 */
.game-detail {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.game-media {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.game-video {
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--dark-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
}

/* 宣传图展示区域 */
.game-screenshots-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: var(--border-radius);
    background: var(--dark-color);
}

.game-screenshots-title {
    font-size: 1.2rem;
    color: white;
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.3);
    margin: 0;
    text-align: center;
}

.game-screenshots-grid {
    display: grid;
    overflow-y: hidden;
    grid-auto-flow: column;
    grid-auto-columns: 250px;
    gap: 3px;
    padding: 15px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
    height: 400px;
    align-items: center;
}

.game-screenshots-grid::-webkit-scrollbar {
    height: 6px;
}

.game-screenshots-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.game-screenshots-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.game-screenshots-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.screenshot {
    width: 250px;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    background: #000;
    cursor: pointer;
    transition: var(--transition);
}

.screenshot:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.screenshot-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.screenshot-nav:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.screenshot-nav.prev {
    left: 10px;
}

.screenshot-nav.next {
    right: 10px;
}

/* 详情页图标区域 */
.detail-header {
    display: flex;
    gap: 20px;
    align-items: center;
    border-bottom: 2px solid var(--light-gray);
}

.detail-icon-wrapper {
    flex-shrink: 0;
}

.detail-game-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.detail-title-area {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.game-name {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 0.6rem;
    line-height: 1.2;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.detail-type {
    color: var(--gray-color);
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.game-content {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.game-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-label {
    font-size: 1rem;
    font-weight: 1000;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--dark-color);
    font-weight: 350;
}

.game-description-long {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

pre {
    white-space: pre-wrap;
}

.game-description-long h3 {
    margin: 1.2rem 0 0.6rem;
    color: var(--dark-color);
    font-size: 1.2rem;
}

.game-description-long ul, .game-description-long ol {
    margin-left: 1.2rem;
    margin-bottom: 1rem;
    list-style-type: none;
}

.game-description-long li {
    margin-bottom: 0.4rem;
    font-size: 0.95rem;
}

.game-links {
    gap: 12px;
    margin-top: 0.5rem;
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    position: relative;
}

/* 单选框选项卡样式 */
.tab-radio {
    display: none;
}

.tab-panel {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#tab-activity:checked ~ .game-links-content .tab-panel-activity,
#tab-guide:checked ~ .game-links-content .tab-panel-guide {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.game-links-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 1.2rem;
    border-bottom: 2px solid var(--light-gray);
    padding-bottom: 10px;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-wrap: nowrap; /* 只添加这一行 */
}


.game-links-tab {
    flex:1; /* 修改：不伸缩，宽度自适应 */
    padding: 12px 16px;
    background: var(--light-gray);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--dark-color);
    white-space: nowrap; /* 只添加这一行 */
}

.game-links-tab:hover {
    background: #d1d9e6;
    transform: translateY(-2px);
}

#tab-activity:checked ~ .game-links-tabs label[for="tab-activity"],
#tab-guide:checked ~ .game-links-tabs label[for="tab-guide"] {
    background: var(--secondary-color);
    color: white;
}

.game-links-content {
    min-height: 200px;
}

.game-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.game-links-list li {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray);
    transition: var(--transition);
}

.game-links-list li:hover {
    background-color: rgba(67, 97, 238, 0.05);
    padding-left: 8px;
    border-radius: 4px;
}

.game-links-list li:last-child {
    border-bottom: none;
}

.link-date {
    font-size: 0.7rem;
    color: var(--gray-color);
    min-width: 60px;
    font-weight: 500;
    flex-shrink: 0;
}

.game-links-list a {
    color: var(--dark-color);
    text-decoration: none;
    font-size: 0.85rem;
    flex: 1;
    display: block;
    padding-left: 10px;
    transition: var(--transition);
    line-height: 1.4;
}

.game-links-list a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* 自定义文本区域样式 */
.custom-text-area {
    margin-top: 1rem;
    text-align: left;
}

.custom-text-content {
    font-size: 0.85rem;
    line-height: 1.6;
    color: red;
}

.custom-text-content p {
    margin-bottom: 0.8rem;
    padding-left: 0;
    position: relative;
}

/* 下载区域 */
.download-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-top: 0.5rem;
    border: 1px solid rgba(76, 205, 153, 0.2);
}

.download-section p {
    color:red;
    margin-top: 0.8rem;
}

.download-title {
    font-size: 1.2rem;
    color: var(--dark-color);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-title i {
    color: #3ddc84;
}

.download-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: white;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(60, 220, 132, 0.3);
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* 修改：确保按钮内的链接可点击 */
.btn-download a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.android-btn {
    background: linear-gradient(135deg, #4ccd99, #3ddc84);
}

.ios-btn {
    background: linear-gradient(135deg, #007aff, #0056d6);
}

.box-btn {
    background: linear-gradient(135deg, #F75485, #F72585);
}

/* 文章详情页样式 */
.article-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--box-shadow);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
}

.article-meta span {
    font-size: 0.85rem;
    color: var(--gray-color);
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-text {
    font-size: 0.95rem;
    line-height: 1.7;
}

.btn-return-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 6px 16px rgba(58, 12, 163, 0.3);
    min-width: 200px;
}

.btn-return-bottom:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(58, 12, 163, 0.4);
    background: linear-gradient(135deg, #2d0a7f, #3654d4);
}

.btn-return-bottom:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(58, 12, 163, 0.3);
}

.btn-return-bottom i {
    font-size: 1.2rem;
}

/* 搜索页面样式 */
.search-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 1rem;
}

.search-actions {
    display: flex;
    gap: 8px;
}

.btn-clear {
    background-color: #4361ee;
    color: white;
    border: 1px solid #ddd;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.btn-search {
    background: var(--accent-color);
    color: white;
    border: 1px solid #2980b9;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.search-input-container form {
    width: 70%;
}

.search-input-container input {
    width: 100%;
    padding: 14px 18px;
    font-size: 1rem;
    border: 2px solid var(--light-gray);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.search-input-container input:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.filter-btn {
    padding: 8px 15px;
    background: var(--light-gray);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    transition: var(--transition);
    margin-right:4px;
    margin-bottom:10px;
}

.filter-btn:hover {
    background: #d1d9e6;
}

.filter-btn.active {
    background: var(--secondary-color);
    color: white;
}

/* 统一推荐游戏网格 */
.recommended-section {
    margin: 1rem 0;
}

.recommended-grid-xg {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
}

/* 无数据提示 */
.no-data-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--gray-color);
}

.no-data-message p {
    font-size: 1rem;
    font-style: italic;
}

/* 底部样式 */
footer {
    background: var(--dark-color);
    color: white;
    padding: 1rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.footer-section h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: white;
    position: relative;
}

.footer-section h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 35px;
    height: 3px;
    background: var(--accent-color);
}

.footer-links {
    display: flex;
    list-style: none;
    gap:15px;
}

.footer-links li {
    margin-bottom: 20px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.copyright {
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 0.8rem;
}

/* 响应式调整 */
@media (max-width: 480px) {
    .btn-return-bottom {
        width: 100%;
        min-width: auto;
    }
    
    .game-title {
        font-size: 0.95rem;
    }

}

@media (max-width: 400px) {
    .search-input-container {
        flex-direction: column;
    }
    
    .search-input-container form {
        width: 100%;
    }
    
    .search-actions {
        width: 100%;
        justify-content: center;
    }
}

