/* ==========================================================================
   1. 全域基礎樣式與版面重設
   ========================================================================== */
html, body {
    padding: 0;
    margin: 0;
    width: 100%;
    /* 【關鍵修正】全排列需要無限向下的高度，強制不鎖死高度與滾動 */
    height: auto !important;
    min-height: 100%;
    font-family: "PingFangSC-Regular", "Microsoft YaHei", Arial, Helvetica, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    background: #f5f5f5;
    overflow-x: hidden;
}

html {
    scroll-padding-top: 160px;
}

a {
    text-decoration: none;
}

/* 網頁主容器：限制最大寬度以達到手機端居中適配 */
.container, .KJ-TabContainer {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: 10px;
}

.box {
    box-sizing: border-box;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.box.ad p { margin: 0; padding: 0; }
.box img { width: 100%; display: block; }

/* ==========================================================================
   2. 全排列排版框架 (全新縱向排列樣式) - 彻底解決遮擋與不全問題
   ========================================================================== */

/* 每個彩種的獨立區塊盒 */
.lottery-card {
    background: #fff;
    border-radius: 12px;
    border: 2px solid #0ed800; /* 保留綠色框架 */
    margin-bottom: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    display: block !important; /* 強制區塊垂直排列顯示 */
    width: 100%;
}

/* 區塊頂部的彩種名稱標題欄 */
.lottery-header {
    background: #0ed800;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 手動重新整理按鈕 */
.refresh-btn {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: 1px solid #fff;
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 6px;
    cursor: pointer;
}
.refresh-btn:active {
    background: rgba(255, 255, 255, 0.4);
}

/* 下方內嵌網頁的容器 */
.content-box {
    display: block !important; /* 廢除分頁切換的 display:none */
    background: #fff;
    padding: 4px;
    box-sizing: border-box;
    /* 【關鍵修正】大幅提高固定高度到 900px，確保內容完全裝得下不被截斷 */
    height: 900px !important; 
    min-height: 900px !important;
    overflow: hidden !important; /* 徹底禁用此容器的滾動條 */
}

/* Iframe 內嵌框架自適應擴展 */
.KJ-IFRAME {
    width: 100% !important;
    display: block !important;
    border: none !important;
    background: #fff !important;
    /* 【關鍵修正】高度與外盒同步，100% 撐開填滿 */
    height: 100% !important;  
    /* 【關鍵修正】遵照要求，完全物理封殺內部滾動條 */
    overflow: hidden !important; 
}

/* ==========================================================================
   3. 原框架現有元件樣式與補修
   ========================================================================== */
/* 頂部 Logo 區 */
.menuicon {
    background: #e1fbe1;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px 6px;
    box-sizing: border-box;
}
.menuicon img { width: 84px; }

/* 日期橫條 */
.riqi {
    height: 24px;
    line-height: 24px;
    text-align: center;
    font-weight: 700;
    background: rgb(128, 0, 0);
    color: #fff;
    border-radius: 5px;
    margin: 2px 0;
    font-size: 11pt;
}

/* 記憶網域名稱的邊框 */
.rememberdomain {
    margin: 5px;
    display: block;
    border: .5em solid transparent;
    background: linear-gradient(#fff, #fff) padding-box, 
                repeating-linear-gradient(-45deg, #9a0001, red 12.5%, transparent 0, transparent 25%, #058d45 0, #014e1e 37.5%, transparent 0, transparent 50%) 0 / 1.5em 1.5em;
    -webkit-animation: ants 12s linear infinite;
    animation: ants 12s linear infinite;
    box-shadow: 0 0 5px #999;
    border-radius: 5px;
}
.rememberdomain table { width: 100%; }
.rememberdomain td { border: 1px solid #ededed; padding: 6px; }

/* 螞蟻行軍邊框動畫的核心程式碼 */
@keyframes ants {
    to {
        background-position: 100%;
    }
}

/* 表格公用設定 */
.box table { width: 100%; border-collapse: collapse; box-sizing: border-box; }
.box table td { border-collapse: collapse; }

/* 滑動導航 (如有使用 Swiper 插件) */
.swiper-nav { text-align: center; color: #fff; font-weight: bold;}
.swiper-nav .swiper-slide { width:110px!important; padding: 5px 0; color: #303133; font-size: 13px; font-weight: bold; border-radius: 2px; border-right: 1px solid #ededed}
.swiper-nav .active-nav { background: #3d7eff; color: #fff}

/* 紅色大標題區 */
.tit {
    font-size: 18px !important;
    color: #fff !important;
    line-height: 42px !important;
    box-shadow: 0 10px 14px -7px rgb(128, 0, 0);
    text-shadow: 0 1px 0 #750505;
    background: linear-gradient(#a00000, rgb(128, 0, 0)) !important;
    font-weight: bold;
    text-align: center;
}

/* 彩票資訊不同顏色的表格邊框 */
.border1 td { border:1px solid rgb(0, 112, 192); padding: 7px 0; }
.border2 td { border:1px solid #ddd7d7; padding: 7px 0; }
.border3 td { border:1px solid rgb(112, 48, 160); padding: 7px 0; }
.border4 td { border:1px solid rgb(255, 0, 0); padding: 7px 0; }
.border1 td p, .border2 td p, .border3 td p, .border4 td p { margin: 0; }
.titsle { font-size: 15px; font-weight: bold; }

/* 綜合字料/文字連結塊（4欄版面） */
.zhzl {
    display: flex;
    justify-content: flex-start; 
    flex-wrap: wrap;
    box-sizing: border-box;
    margin-top: 10px;
    margin-bottom: 20px;
}
.zhzl .item {
    width: 25%;
    box-sizing: border-box;
    padding: 2px 3px;
}
.zhzl a {
    line-height: 40px;
    text-align: center;
    border: 1px solid #ccc;
    background: #fff;
    border-radius: 5px;
    display: block;
    color: #333;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
}

/* ==========================================================================
   【全排列專用 - 終極解鎖代碼】強制擊穿原有 main.css 的高度與裁剪限制
   ========================================================================== */
html, body, .container, .KJ-TabContainer {
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    overflow-y: auto !important; /* 強制開啟瀏覽器整頁滾動條 */
    overflow-x: hidden !important;
    position: relative !important; /* 防止被 fixed 釘死 */
}

/* 徹底重設原有的 box 及分頁遮擋屬性 */
.box, .content-box {
    display: block !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}
