/* =========================================================
   战谷官网 - 移动端响应式适配样式
   配合 <meta name="viewport" content="width=device-width,initial-scale=1">
   在小屏幕下覆盖原固定宽度布局
   ========================================================= */

/* 侧边栏操作按钮区（充值/礼包/领券/下载） */
.zg-side-actions {
    padding: 12px 14px;
    margin-bottom: 14px;
}
.zg-side-actions-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.zg-side-actions-row:last-child {
    margin-bottom: 0;
}
.zg-side-actions-row a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: linear-gradient(180deg, #f5a623 0%, #d4821a 100%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    text-decoration: none;
    gap: 6px;
    min-width: 80px;
    box-shadow: 0 2px 4px rgba(0,0,0,.3);
    transition: transform .15s, box-shadow .15s;
}
.zg-side-actions-row a:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,.4);
    color: #fff;
}
.zg-side-actions-row a .zico {
    font-size: 16px;
}

/* 下载按钮纵向排列区 */
.zg-side-downloads {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.zg-download-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(180deg, #6379f4 0%, #4a5fb8 100%);
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    border-radius: 6px;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(99, 121, 244, .4);
    transition: transform .15s, box-shadow .15s;
}
.zg-download-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 121, 244, .5);
    color: #fff;
}
.zg-download-btn .zg-dl-type {
    display: inline-block;
    padding: 2px 6px;
    background: rgba(255, 255, 255, .25);
    border-radius: 3px;
    font-size: 11px;
    font-style: normal;
    margin-left: auto;
}
.zg-download-btn .zg-dl-title {
    flex: 1;
    text-align: left;
}

/* layer 弹窗自定义样式 */
.zg-layer .layui-layer-title {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    color: #ffe9a7;
    font-weight: bold;
    font-size: 15px;
    padding: 0 16px;
    height: 44px;
    line-height: 44px;
    border-bottom: 2px solid #f5a623;
}
.zg-layer .layui-layer-content {
    padding: 0;
    overflow: visible;
}
.zg-layer .layui-layer-setwin .layui-layer-close {
    top: 13px;
}
.zg-modal-body {
    padding: 16px;
    max-height: 500px;
    overflow-y: auto;
}
.zg-gift-item,
.zg-yhq-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    margin-bottom: 10px;
    background: #f8f8f8;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    transition: box-shadow .15s;
}
.zg-gift-item:hover,
.zg-yhq-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}
.zg-gift-item.zg-new {
    border-color: #f5a623;
    background: linear-gradient(135deg, #fff9ed 0%, #fff 60%);
}
.zg-gift-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(180deg, #f5a623, #d4821a);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.zg-gift-icon .zico {
    color: #fff;
    font-size: 22px;
}
.zg-gift-info,
.zg-yhq-info {
    flex: 1;
    min-width: 0;
}
.zg-gift-info h4,
.zg-yhq-info h4 {
    margin: 0 0 4px;
    font-size: 15px;
    color: #333;
}
.zg-gift-desc {
    margin: 0 0 6px;
    color: #666;
    font-size: 13px;
    line-height: 1.5;
}
.zg-gift-meta {
    display: inline-block;
    margin-right: 10px;
    font-size: 12px;
    color: #999;
}
.zg-yhq-info p {
    margin: 4px 0 0;
    color: #555;
    font-size: 13px;
    line-height: 1.6;
}
.zg-yhq-info p strong {
    color: #d70023;
}
.zg-yhq-yxq {
    color: #999;
    font-size: 12px;
    font-style: normal;
    margin-left: 8px;
}
.zg-btn-get {
    flex-shrink: 0;
    padding: 8px 18px;
    background: linear-gradient(180deg, #f5a623, #d4821a);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: transform .1s;
}
.zg-btn-get:hover {
    transform: translateY(-1px);
}
.zg-btn-get:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}
.zg-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* 消除顶部白色间隙：让 banner 紧贴顶部 */
body.tbbg {
    background: #131313;
    margin: 0;
    padding: 0;
}
body {
    margin: 0 !important;
    padding: 0 !important;
}
.g-wrapper > header {
    display: none !important;
    height: 0 !important;
}
.tbbg-site {
    top: 0 !important;
    height: 480px !important;
}
.g-main {
    padding-top: 360px !important;
}
.g-inner {
    margin-top: 0 !important;
}

/* 小屏覆盖 */
@media screen and (max-width: 1100px) {
    .g-inner,
    .m-w {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding-left: 12px;
        padding-right: 12px;
    }
    .tbbg-site {
        height: 360px !important;
    }
    .g-main {
        padding-top: 280px !important;
    }
    /* 让左侧操作区与主内容区在窄屏堆叠 */
    .g-wrapper > .g-main > .g-inner > .g-parse {
        display: block !important;
    }
    .g-parse > aside,
    .g-parse > .mcm {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        display: block !important;
    }
    .zg-side-actions {
        display: flex;
        flex-direction: column;
    }
    .zg-side-actions-row {
        justify-content: center;
    }
    .zg-side-actions-row a {
        flex: 1 1 30%;
        min-width: 0;
    }
    .zg-side-downloads {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .zg-download-btn {
        flex: 1 1 calc(50% - 4px);
        font-size: 13px;
    }
    .m-pane {
        margin-bottom: 14px;
    }
}

@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }
    .tbbg-site {
        height: 260px !important;
    }
    .g-main {
        padding-top: 210px !important;
    }
    /* 游戏特色 - 田字格 2x2 */
    .m-gamelist ul.index_focus {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        padding: 0 !important;
        list-style: none !important;
    }
    /* 清除 clearfix 伪元素对 grid 的干扰 */
    .m-gamelist ul.index_focus::before,
    .m-gamelist ul.index_focus::after {
        display: none !important;
        content: none !important;
    }
    .m-gamelist ul.index_focus li {
        float: none !important;
        width: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        text-align: center;
        overflow: visible !important;
        list-style: none !important;
    }
    .m-gamelist ul.index_focus li img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        display: block !important;
        float: none !important;
    }
    .m-gamelist ul.index_focus li span {
        display: block !important;
        font-size: 12px;
        line-height: 1.3;
        margin: 0 !important;
        padding: 4px 2px !important;
        background: transparent !important;
        position: static !important;
        color: #fff !important;
        white-space: normal !important;
    }
    .m-gamelist ul.index_focus li span em {
        color: #ffe9a7 !important;
    }
    /* 游戏截图 - 手机端单图铺满 */
    #swiper1 .swiper-slide {
        width: 100% !important;
    }
    #swiper1 .swiper-slide img {
        width: 100% !important;
        height: auto !important;
        display: block;
    }
    /* 侧边栏按钮自适应 */
    .zg-side-actions-row {
        gap: 6px;
        margin-bottom: 8px;
    }
    .zg-side-actions-row a {
        padding: 8px 12px;
        font-size: 13px;
        flex: 1 1 30%;
    }
    .zg-download-btn {
        padding: 10px 14px;
        font-size: 13px;
    }
    .zg-download-btn .zg-dl-type {
        font-size: 10px;
        padding: 1px 5px;
    }
    /* 文章块 */
    .m-art-block {
        padding: 12px !important;
    }
    .m-art-block .block-hd {
        font-size: 15px;
    }
    .g-i {
        font-size: 16px;
    }
    /* 游戏截图 swiper */
    .swiper-slide img {
        max-width: 100%;
        height: auto;
    }
    /* 新闻列表 */
    .m-art-list li {
        line-height: 1.7;
        font-size: 13px;
    }
    .m-art-list li em {
        display: block;
        color: #999;
        font-size: 12px;
    }
    /* 礼包/优惠券 列表 */
    .lbcard li,
    #yhm-list li {
        margin-bottom: 10px !important;
    }
    .yhq {
        padding: 10px !important;
    }
    /* 底部 */
    footer .ft-info {
        font-size: 13px;
        line-height: 1.8;
        text-align: center;
    }
    footer p {
        font-size: 12px;
        line-height: 1.8;
    }
    /* 弹出层（礼包/优惠券/下载）自适应 */
    .f-serverwrap .g-inner {
        width: 94% !important;
        margin: 0 auto !important;
    }
    .m-game-server,
    .yhm-list,
    #app-down {
        padding: 12px !important;
    }
    .app-tc-app ul li {
        font-size: 13px;
    }
    .app-tc-b a {
        font-size: 14px;
        padding: 8px 12px;
    }
    .layui-layer {
        width: 90% !important;
        left: 5% !important;
        margin-left: 0 !important;
    }
    .layui-layer-content {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .tbbg-site {
        height: 200px !important;
    }
    .g-main {
        padding-top: 170px !important;
    }
    /* 小屏按钮更紧凑 */
    .zg-side-actions-row {
        gap: 5px;
    }
    .zg-side-actions-row a {
        padding: 7px 8px;
        font-size: 12px;
        flex: 1 1 30%;
    }
    .zg-side-downloads {
        gap: 6px;
    }
    .zg-download-btn {
        padding: 9px 10px;
        font-size: 12px;
        flex: 1 1 100%;
    }
    .zg-download-btn .zg-dl-type {
        font-size: 10px;
    }
}

/* PC 图标 */
.m-pc {
    background: #fff url("data:image/svg+xml,%3Csvg viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M879.77 789.165H144.23c-15.66 0-28.34-12.68-28.34-28.34V241.19c0-15.66 12.68-28.34 28.34-28.34h735.54c15.66 0 28.34 12.68 28.34 28.34v519.635c0 15.66-12.68 28.34-28.34 28.34zM851.43 269.53H172.57v462.95h678.86V269.53zM481.22 851.76h61.56c4.97 0 8.97 4 8.97 8.97v49.47c0 4.97-4 8.97-8.97 8.97h-61.56c-4.97 0-8.97-4-8.97-8.97v-49.47c0-4.97 4-8.97 8.97-8.97zM317.93 918.16h388.14c4.97 0 8.97 4 8.97 8.97v3.93c0 24.78-20.11 44.88-44.88 44.88H353.84c-24.77 0-44.88-20.1-44.88-44.88v-3.93c0-4.97 4-8.97 8.97-8.97zM332.86 326.12h358.28v28.34H332.86v-28.34zm0 64.79h240v28.34h-240v-28.34zm0 64.79h240v28.34h-240v-28.34zm0 64.79h358.28v165.1H332.86V520.44z' fill='%23333'/%3E%3C/svg%3E") no-repeat 50% 50%;
    background-size: 70% auto;
}

/* 自实现弹窗样式 */
.zg-modal-box {
    width: 640px;
    font-family: 'Microsoft YaHei', sans-serif;
    overflow: hidden;
}
.zg-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    color: #ffe9a7;
    border-bottom: 2px solid #f5a623;
}
.zg-modal-title {
    font-size: 15px;
    font-weight: bold;
}
.zg-modal-close {
    cursor: pointer;
    font-size: 24px;
    color: #999;
    line-height: 1;
    padding: 0 4px;
}
.zg-modal-close:hover {
    color: #fff;
}
.zg-modal-body-wrap {
    background: #fff;
}
.zg-modal-inner {
    padding: 0;
}
.zg-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: zg-spin 0.8s linear infinite;
}
@keyframes zg-spin {
    to { transform: rotate(360deg); }
}

/* 公告列表区 */
.zg-ann-box {
    margin-top: 14px;
}
.zg-ann-box .zg-ann-item {
    padding: 10px 12px;
    border-bottom: 1px dashed rgba(255, 255, 255, .15);
}
.zg-ann-box .zg-ann-item h4 {
    margin: 0 0 4px;
    font-size: 15px;
    color: #ffe9a7;
}
.zg-ann-box .zg-ann-item p {
    margin: 0;
    color: #ddd;
    font-size: 13px;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
}
.zg-ann-box .zg-ann-item .zg-ann-date {
    color: #999;
    font-size: 12px;
}

/* 下载/充值快捷列表（移动端友好） */
.zg-link-list {
    margin-top: 14px;
}
.zg-link-list a {
    display: inline-block;
    margin: 4px 6px 4px 0;
    padding: 7px 14px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 4px;
    color: #ffe9a7;
    font-size: 13px;
    text-decoration: none;
}
.zg-link-list a:hover {
    background: rgba(255, 255, 255, .16);
}
