* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --theme-color: #fe8900;
    --theme-rgb: 254,137,0;
    --bg: #f5f5f5;
    --card-bg: #fff;
    --text: #000;
    --text-2: #666;
    --text-3: #999;
    --border: #eee;
    --header-h: 48px;
    --bottom-h: 55px;
    --shadow: 0 2px 8px rgba(0,0,0,.05);
    --radius: 10px;
}
body[data-theme="blue"] { --theme-color: #3b82f6; --theme-rgb: 59,130,246; }
body[data-theme="green"] { --theme-color: #10b981; --theme-rgb: 16,185,129; }
body[data-theme="purple"] { --theme-color: #8b5cf6; --theme-rgb: 139,92,246; }

html, body { -webkit-tap-highlight-color: transparent; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg); color: var(--text); line-height: 1.6;
    padding-bottom: calc(var(--bottom-h) + 20px);
    padding-top: var(--header-h);
    transition: background .3s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ===== 顶部搜索栏 ===== */
.top-search-bar {
    position: fixed; top: 0; left: 0; right: 0; z-index: 2000;
    max-width: 900px; margin: 0 auto;
    background: rgba(255,255,255,0); backdrop-filter: blur(2px);
    transition: background .3s;
}
.top-search-bar.scrolled { background: var(--theme-color); }
.top-search-bar .search-container {
    position: relative; padding: 5px 150px; display: flex; align-items: center; justify-content: center;
}
.search-logo-icon {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; border-radius: 5px; overflow: hidden;
}
.search-logo-icon img { width: 100%; height: 100%; object-fit: contain; }
.search-input {
    width: 100%; height: 30px; padding: 0 10px; border-radius: 10px;
    border: none; font-size: 14px; background: rgba(255,255,255,.3);
    transition: background .3s; color: var(--text);
}
.search-input:focus { outline: none; background: #fff; }
.top-search-bar.scrolled .search-input { background: rgba(255,255,255,.95); }
.search-logo-text {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%) skewX(-10deg);
    font-size: 20px; font-weight: bold; color: var(--theme-color);
    white-space: nowrap; font-style: italic; pointer-events: none;
}
.top-search-bar.scrolled .search-logo-text { color: #fff; }

/* ===== 背景图 + 悬浮卡 ===== */
.image-container { position: relative; width: 100%; height: 400px; overflow: visible; }
.image-container img { width: 100%; height: 100%; object-fit: cover; }
.junction-cards-section {
    position: absolute; bottom: 0; left: 0; right: 0; transform: translateY(50%);
    z-index: 100; padding: 0 1rem;
}
.junction-cards-container {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    max-width: 900px; margin: 0 auto;
}
.junction-card {
    background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(248,248,248,.9));
    border: 1px solid #ddd; border-radius: 8px; padding: .8rem;
    display: flex; align-items: center; gap: .8rem; height: 90px;
    transition: all .25s;
}
.junction-card:hover { transform: translateY(-3px); border-color: var(--theme-color); }
.junction-card-icon {
    width: 40px; height: 40px; border-radius: 8px;
    background: rgba(var(--theme-rgb),.1); display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.junction-card-name { font-size: .9rem; font-weight: 600; margin-bottom: .2rem; }
.junction-card-description { font-size: .75rem; color: var(--text-2); }

/* ===== 主体 ===== */
.main-content { max-width: 900px; margin: 0 auto; padding: 5rem 1rem 1rem; }
.section-desc { text-align: center; font-size: .85rem; color: var(--theme-color); margin-bottom: 1rem; }

/* ===== 频道 ===== */
.channel { display: none; animation: fadeIn .3s; }
.channel.active { display: block; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== 游戏卡片（横版） ===== */
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; }
.game-card {
    background: #fff; border: 1px solid #ddd; border-radius: var(--radius);
    padding: 1rem; display: flex; align-items: center; gap: 1rem; height: 110px;
    transition: all .25s; cursor: pointer;
}
.game-card:hover { transform: translateY(-3px); border-color: var(--theme-color); box-shadow: var(--shadow); }
.game-icon { width: 70px; height: 70px; border-radius: var(--radius); overflow: hidden; flex-shrink: 0; }
.game-icon img { width: 100%; height: 100%; object-fit: cover; }
.game-info { flex: 1; min-width: 0; }
.game-name { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; transition: color .25s; }
.game-card:hover .game-name { color: var(--theme-color); }
.game-name-tag {
    display: inline-block; font-size: .65rem; font-weight: bold; color: #fff;
    border-radius: 4px; padding: 1px 4px; margin-left: 4px; vertical-align: middle;
    animation: pulse 1s infinite ease-in-out;
}
@keyframes pulse {
    0%,100% { transform: scale(1); opacity: .8; }
    50% { transform: scale(1.15); opacity: 1; }
}
.game-tags { display: flex; gap: .5rem; flex-wrap: wrap; }
.game-tag {
    background: rgba(var(--theme-rgb),.1); color: var(--theme-color);
    padding: 0 .5rem; border-radius: 20px; font-size: .7rem;
    border: 1px solid rgba(var(--theme-rgb),.2);
}

/* ===== 平台 Tab + iframe ===== */
.platform-tabs {
    display: flex; gap: .5rem; margin-bottom: 1rem;
    justify-content: center; flex-wrap: wrap;
}
.platform-tab {
    padding: .5rem 1.2rem; border-radius: 20px; font-size: .9rem; font-weight: 600;
    background: #fff; border: 1px solid #ddd; color: var(--text-2);
    transition: all .2s;
}
.platform-tab.active { background: var(--theme-color); color: #fff; border-color: var(--theme-color); }
.ip-iframe-wrapper { width: 100%; height: 70vh; min-height: 500px; position: relative; background: #fff; border-radius: var(--radius); overflow: hidden; }
.ip-iframe-item { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.ip-iframe-item iframe { width: 100%; height: 100%; border: 0; }
.ip-loading {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,.9); display: flex; flex-direction: column;
    align-items: center; justify-content: center; z-index: 10;
}
.ip-loading .loader {
    width: 40px; height: 40px; border: 4px solid #e0e0e0; border-top-color: var(--theme-color);
    border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 10px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.ip-loading p { color: var(--theme-color); font-size: .9rem; }

/* ===== 盒子卡片 ===== */
.box-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.box-card {
    background: #fff; border: 1px solid #ddd; border-radius: var(--radius);
    padding: 1rem; display: flex; align-items: center; gap: 1rem;
    height: 90px; transition: all .25s;
}
.box-card:hover { transform: translateY(-3px); border-color: var(--theme-color); }
.box-icon { width: 55px; height: 55px; border-radius: 8px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--border); }
.box-icon img { width: 100%; height: 100%; object-fit: cover; }
.box-name { font-size: 1rem; font-weight: 700; margin-bottom: .3rem; }
.box-desc { font-size: .8rem; color: var(--text-2); }
.box-card:hover .box-name { color: var(--theme-color); }

/* ===== 客服卡片 ===== */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.contact-card {
    background: #fff; border: 1px solid #ddd; border-radius: var(--radius);
    padding: 1.2rem; display: flex; align-items: center; gap: 1.2rem;
    min-height: 110px; transition: all .25s;
}
.contact-card:hover { transform: translateY(-3px); border-color: var(--theme-color); }
.contact-qr { width: 90px; height: 90px; border-radius: 8px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--border); }
.contact-qr img { width: 100%; height: 100%; object-fit: cover; }
.contact-info { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.contact-text h3 { font-size: 1.1rem; margin-bottom: .3rem; }
.contact-text p { font-size: .8rem; color: var(--text-2); }
.contact-btn {
    padding: .4rem 1rem; border-radius: 20px; background: var(--theme-color); color: #fff;
    font-size: .8rem; font-weight: 600; white-space: nowrap;
}

/* ===== 加载 / 到底 ===== */
.loading-dots { display: inline-flex; gap: 6px; }
.loading-dots span {
    width: 10px; height: 10px; border-radius: 50%; background: var(--theme-color);
    animation: dotBounce 1.4s infinite; opacity: .6;
}
.loading-dots span:nth-child(2) { animation-delay: .2s; }
.loading-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes dotBounce { 0%,80%,100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.load-more-indicator, .list-end-tip { text-align: center; padding: 20px 0; color: var(--text-3); font-size: .85rem; }

/* ===== 底部导航 ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 2000;
    background: rgba(255,255,255,.95); backdrop-filter: blur(10px);
    border-top: 2px solid var(--theme-color); height: var(--bottom-h);
    max-width: 900px; margin: 0 auto;
}
.nav-container { display: grid; grid-template-columns: repeat(4, 1fr); height: 100%; }
.nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: rgba(0,0,0,.65); font-size: .7rem; font-weight: 600; transition: color .25s;
}
.nav-icon { font-size: 1.3rem; margin-bottom: 2px; }
.nav-item.active { color: var(--theme-color); }
.nav-item.active .nav-icon { transform: scale(1.1); }

/* ===== 弹窗 ===== */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.65);
    z-index: 3000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all .25s; padding: 15px;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content {
    background: #fff; border-radius: 12px; width: 95%; max-width: 500px;
    max-height: 80vh; display: flex; flex-direction: column;
    transform: translateY(20px); transition: transform .25s;
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-header {
    padding: .7rem 1.2rem; background: var(--theme-color); color: #fff;
    display: flex; justify-content: space-between; align-items: center;
    border-radius: 12px 12px 0 0;
}
.modal-header h3 { font-size: 1rem; }
.modal-close { color: #fff; font-size: 1.6rem; line-height: 1; }
.modal-body { padding: 1.2rem; overflow-y: auto; flex: 1; }
.modal-text { font-size: .9rem; color: var(--text-2); margin-bottom: .6rem; line-height: 1.6; }
.modal-img-wrap { margin: .6rem 0; border-radius: 8px; overflow: hidden; }
.modal-footer { padding: .7rem; text-align: center; border-top: 1px solid var(--border); }
.modal-confirm { padding: .4rem 2rem; background: var(--theme-color); color: #fff; border-radius: 8px; font-weight: 600; }

/* ===== 详情页 ===== */
.detail-main { padding: 1rem 1rem 3rem; }
.breadcrumb { padding: .5rem; font-size: .8rem; color: var(--text-2); list-style: none; display: flex; }
.breadcrumb li + li::before { content: '/'; margin: 0 6px; opacity: .5; }
.article-detail {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.5rem; margin-bottom: 1.5rem;
}
.game-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; position: relative; }
.game-header-icon { width: 75px; height: 75px; border-radius: 12px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--border); }
.game-header-icon img { width: 100%; height: 100%; object-fit: cover; }
.game-header-center { flex: 1; min-width: 0; }
.game-header-title { font-size: 1.5rem; margin-bottom: .4rem; }
.game-header-tags { display: flex; flex-wrap: wrap; gap: .3rem; }
.game-header-rating {
    width: 75px; height: 75px; background: rgba(var(--theme-rgb),.08);
    border: 1px solid rgba(var(--theme-rgb),.2); border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.rating-star { color: var(--theme-color); font-size: 1.1rem; }
.rating-score { color: var(--theme-color); font-weight: 600; font-size: 1rem; }
.rating-text { font-size: .6rem; color: var(--text-3); margin-top: 2px; }

/* ===== 按钮组 ===== */
.buttons-section { display: flex; flex-direction: column; gap: 1.2rem; margin-bottom: 1.5rem; }
.btn-group { display: flex; flex-direction: column; align-items: center; }
.btn-row { display: flex; justify-content: center; gap: .8rem; flex-wrap: wrap; width: 100%; }
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .7rem 1.5rem; border-radius: 10px; font-size: 1rem; font-weight: 600;
    color: #fff; text-shadow: 1px 1px 2px rgba(0,0,0,.15); transition: all .2s;
    min-height: 44px;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.btn-orange { background: linear-gradient(180deg, #fe8900, #e67800); }
.btn-purple { background: linear-gradient(135deg, #a55eea, #8854d0); }
.btn-desc {
    margin-top: .5rem; padding: .5rem; width: 100%; text-align: center;
    font-size: .85rem; color: var(--text); background: #f9f9f9;
    border: 1px solid var(--border); border-radius: 8px; line-height: 1.5;
}
.section-block { margin: 1.5rem 0; }
.section-block-title { font-size: 1rem; font-weight: 700; color: var(--theme-color); margin-bottom: .6rem; }
.section-block-body { font-size: .9rem; color: var(--text); line-height: 1.7; }
.section-block-body img { max-width: 100%; margin: .5rem 0; border-radius: 8px; }

/* ===== 福利区 ===== */
.welfare-section {
    margin-top: 2rem; padding-top: 1.5rem; border-top: 1px dashed var(--theme-color);
}
.welfare-title { font-size: 1.2rem; color: var(--theme-color); margin-bottom: 1rem; }
.welfare-meta { font-size: .8rem; color: var(--text-3); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.welfare-block { margin-bottom: 1rem; }
.welfare-label {
    display: inline-block; padding: .2rem .7rem; font-size: .85rem; font-weight: 600;
    color: #fff; background: var(--theme-color); border-radius: 4px; margin-bottom: .4rem;
}
.welfare-value {
    font-size: .9rem; color: var(--text); line-height: 1.7;
    background: #fafafa; padding: .7rem 1rem; border-radius: 8px; border: 1px solid var(--border);
}
.welfare-value a { color: var(--theme-color); text-decoration: underline; }
.welfare-cdk {
    display: inline-block; padding: .3rem .8rem; background: #fff5eb;
    border: 2px dashed var(--theme-color); color: var(--theme-color);
    font-weight: 700; border-radius: 6px; font-family: Consolas, monospace;
    font-size: 1.05rem; letter-spacing: 1px;
}
.welfare-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-top: 1rem; }
.welfare-images img { width: 100%; border-radius: 8px; cursor: zoom-in; }

.copyright-box {
    margin-top: 2rem; padding: 1.5rem; border: 1.5px dashed var(--theme-color);
    border-radius: 10px; background: #fafafa; font-size: .85rem; line-height: 2;
    color: var(--text-2); position: relative;
}
.copyright-title {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    padding: 2px 16px; background: linear-gradient(to right, #ffcc99, #ff99cc);
    border: 1.5px dashed var(--theme-color); border-radius: 999px;
    color: #333; font-size: .85rem; font-weight: 700;
}

/* ===== 灯箱 ===== */
.img-lightbox {
    position: fixed; inset: 0; background: rgba(0,0,0,.95); z-index: 9999;
    display: none; align-items: center; justify-content: center;
}
.img-lightbox.show { display: flex; }
.img-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-lightbox-close {
    position: absolute; top: 15px; right: 20px; width: 44px; height: 44px;
    background: rgba(255,255,255,.15); color: #fff; border-radius: 50%;
    font-size: 1.8rem; display: flex; align-items: center; justify-content: center;
}
body.lightbox-open { overflow: hidden; }

/* ===== footer ===== */
.footer { background: #fff; padding: 1.5rem; margin-bottom: var(--bottom-h); }
.footer-inner { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; padding-bottom: 1rem; }
.footer-col h4 { font-size: .95rem; margin-bottom: .8rem; color: var(--text); }
.footer-col p { font-size: .8rem; color: var(--text-2); line-height: 2; }
.footer-col a { color: var(--theme-color); }
.footer-bottom { max-width: 900px; margin: 0 auto; border-top: 1px solid var(--border); padding-top: 1rem; text-align: center; font-size: .8rem; color: var(--text-3); }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .game-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .image-container { height: 300px; }
    .junction-cards-container { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .junction-card { height: 75px; padding: .6rem; gap: .5rem; }
    .junction-card-icon { width: 35px; height: 35px; font-size: 1rem; }
    .junction-card-name { font-size: .8rem; }
    .junction-card-description { font-size: .65rem; }
    .main-content { padding: 6.5rem 10px 1rem; }
    .game-grid { grid-template-columns: 1fr; gap: .8rem; }
    .game-card { height: 95px; padding: .7rem; }
    .game-icon { width: 60px; height: 60px; }
    .game-name { font-size: 1rem; }
    .top-search-bar .search-container { padding: 5px 110px; }
    .search-logo-text { font-size: 16px; }
    .search-logo-icon { width: 30px; height: 30px; }
    .article-detail { padding: 1rem; }
    .game-header-title { font-size: 1.2rem; }
    .game-header-icon, .game-header-rating { width: 60px; height: 60px; }
    .btn { font-size: .9rem; padding: .6rem 1rem; }
    .footer-inner { grid-template-columns: 1fr; gap: 1rem; }
    .ip-iframe-wrapper { height: 60vh; min-height: 400px; }
}
