@charset "utf-8";
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* 移动端防缩放 */
html { -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; -ms-text-size-adjust: 100%; text-size-adjust: 100%; }
body { touch-action: manipulation; }

/* 页面整体弹性布局，锁定整体高度为屏幕可视区，网页本体禁止滚动 */
html, body {
    width: 100%;
    height: 100vh;    /* fallback */
    height: 100dvh;   /* 动态视口高度，自动适配移动端地址栏 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: none;  /* 禁止 iOS 橡皮筋下拉效果 */
    background-color: #222222;  /* 背景与 header 一致，防止下拉时露出白底 */
}

/* 顶部标题栏：覆盖 common.css 的 position:fixed 和 height:47px */
header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background-color: #1a1a1a;
    background-image: none;     /* 清除 common.css 遗留的背景图 */
    color: #fff;
    position: relative;         /* 覆盖 common.css 的 position:fixed */
    height: auto;               /* 覆盖 common.css 的 height:47px */
    z-index: 10;
    border-bottom: 1px solid #000;    /* 深色底边线，干净利落 */
    box-shadow: 0 1px 3px rgba(0,0,0,0.8);  /*  subtle 底部投影 */
    overflow: hidden;           /* 防止 iframe 内容穿透 header */
}
header .title {
    font-size: 17px;
    text-align: center;
    flex: 1;
    line-height: normal;       /* 覆盖 common.css 的 line-height:47px */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
header .controls {
    flex: 0 0 auto;            /* 覆盖 common.css 的 position:absolute */
    position: static;
    box-shadow: none;
    padding: 0;
    margin-left: 10px;
}
header .back {
    flex: 0 0 auto;            /* 覆盖 common.css 的 position:absolute */
    position: static;
    width: 24px;
    height: 24px;
    background-size: contain;
    background-position: center;
    cursor: pointer;
    margin-right: 10px;
}
header .controls a {
    background: none;          /* 覆盖 common.css 的背景图 */
    border: none;
    padding: 0;
    display: block;
    line-height: 1;            /* 覆盖 common.css 的 line-height:47px/44px */
}
header .controls a:active {
    opacity: 0.65;
}
header .controls a img {
    width: 26px;
    height: 26px;
    display: block;
}

/* iframe容器：自动填充header与广告栏中间所有剩余高度 */
#mainIframeWrap {
    flex: 1;
    width: 100%;
    /* 裁切UC页面自带上下乱码导航条 */
    overflow: hidden;
    margin-top: -2px;
    margin-bottom: -2px;
    position: relative;
    z-index: 1;
    background-color: #fff;  /* 白色背景防止边缘透出底色 */
}
#mainIframeWrap iframe {
    width: 100%;
    height: calc(100% + 4px);
    border: none;
    display: block;
}

/* 底部广告栏：覆盖 common.css 的 position:fixed，改为 flex 子元素 */
.ad-box {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    z-index: auto !important;
    box-shadow: none !important;
    flex: 0 0 auto;
    width: 100%;
    padding: 10px 6px;
    background: #f5f7fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    overflow: hidden;
    display: block;
}
.ad-box a {
    display: block;
    width: 100%;
}
.ad-box img {
    width: 100%;
    max-width: 100%;
    max-height: 82px;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

footer {
    width: 100%;
    padding: 8px 0;
    text-align: center;
    font-size: 13px;
    color: #666;
    background: #f0f2f5;
    float: none;
    border: none;
}

/* 返回顶部悬浮按钮，避开底部广告 */
#backTop {
    position: fixed;
    right: 20px;
    bottom: 145px;
    width: 50px;
    height: 50px;
    background-color: #007aff;
    color: #ffffff;
    border-radius: 50%;
    text-align: center;
    line-height: 50px;
    font-size: 22px;
    z-index: 999999;
    cursor: pointer;
    box-shadow: 0 3px 12px rgba(0,0,0,0.3);
    display: block !important;
}
#backTop:active{
    background:#005fcc;
}

@media (max-width: 768px) {
    header {
        padding: 8px 12px;
    }
    header .title {
        font-size: 15px;
    }
    .ad-box {
        padding: 6px 4px;
    }
    .ad-box img {
        max-width: 100%;
        max-height: 60px;
    }
    footer {
        font-size: 12px;
    }
    #backTop {
        right: 15px;
        bottom: 110px;
        width: 44px;
        height: 44px;
        line-height: 44px;
    }
}
@media (max-width: 480px) {
    header {
        padding: 6px 10px;
    }
    header .title {
        font-size: 14px;
    }
    .ad-box {
        padding: 4px 3px;
    }
    .ad-box img {
        max-width: 100%;
        max-height: 50px;
    }
    #backTop {
        right: 12px;
        bottom: 85px;
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 18px;
    }
}
/* 超小屏幕（320px及以下）确保广告不溢出 */
@media (max-width: 360px) {
    .ad-box {
        padding: 3px 2px;
    }
    .ad-box img {
        max-height: 44px;
    }
    header .title {
        font-size: 13px;
    }
}

/* PC端宽屏优化：消除顶部烂边，优化整体视觉 */
@media (min-width: 769px) {
    header {
        padding: 12px 24px;
        border-bottom: 1px solid #000;
        box-shadow: 0 2px 8px rgba(0,0,0,0.6);
    }
    header .title {
        font-size: 18px;
        font-weight: 500;
    }
    header .controls a img {
        width: 28px;
        height: 28px;
    }
    #mainIframeWrap {
        margin-top: 0;
        margin-bottom: 0;
    }
    #mainIframeWrap iframe {
        height: 100%;
    }
    .ad-box {
        padding: 12px 8px;
    }
    .ad-box img {
        max-height: 90px;
        max-width: 720px;  /* PC端限制广告最大宽度，避免过度拉伸 */
    }
    #backTop {
        bottom: 160px;
    }
}