/*
  网站完整样式表 · 黄色四肖八码弹窗修复版
  原网站主色调：#405c70（深蓝灰）
  修改范围：保留原有全站样式；追加黄色通知弹窗的布局、号码排列及复制按钮样式。
*/

html, body {
    padding: 0;
    margin: 0;
    width: 100%;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    background: #f5f5f5;
}

html { scroll-padding-top: 160px; }
a { text-decoration: none; }
.container { width: 100%; max-width: 720px; margin: 0 auto; box-sizing: border-box; }
.box { box-sizing: border-box; background: #fff; }
.box.ad p { margin: 0; padding: 0; }
.box img { width: 100%; display: block; }

/* 顶部选单 */
.menuicon {
    background: rgba(64, 92, 112, 0.05);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px 6px;
    box-sizing: border-box;
    border-bottom: 1px solid rgba(64, 92, 112, 0.2);
}
.menuicon img { width: 84px; height: auto; }

/* 日期背景 */
.riqi {
    height: 24px;
    line-height: 24px;
    text-align: center;
    font-weight: 700;
    background: #405c70;
    color: #ffffff;
    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, #405c70, #405c70 12.5%, transparent 0, transparent 25%, #333 0, #333 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 rgba(0,0,0,0.15);
    border-radius: 5px;
}
@-webkit-keyframes ants {
    from { background-position: 0 0; }
    to { background-position: 1.5em 1.5em; }
}
@keyframes ants {
    from { background-position: 0 0; }
    to { background-position: 1.5em 1.5em; }
}
.rememberdomain table { width: 100%; }
.rememberdomain td { border: 1px solid #ededed; padding: 6px; }
.box table { border-collapse: collapse; width: 100%; 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: #405c70; color: #fff; }

/* 标题栏 */
.tit {
    font-size: 18px !important;
    color: #fff !important;
    line-height: 42px !important;
    box-shadow: 0 10px 14px -7px rgba(64, 92, 112, 0.4);
    text-shadow: 0 1px 0 #20303b;
    background: linear-gradient(#5a7b94, #405c70) !important;
    font-weight: bold;
    text-align: center;
}

/* 各类边框 */
.border1 td { border: 1px solid #405c70; padding: 7px 0; }
.border2 td { border: 1px solid #718da0; padding: 7px 0; }
.border3 td { border: 1px solid #e1e7ec; padding: 7px 0; }
.border4 td { border: 1px solid #ddd7d7; padding: 7px 0; }
.border1 td p, .border2 td p, .border3 td p, .border4 td p { margin: 0; }
.titsle { font-size: 15px; font-weight: bold; }

/* 底部网格按钮 */
.zhzl {
    display: flex;
    justify-content: space-between;
    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;
    transition: all 0.3s;
}
.zhzl a:hover, .zhzl a:active {
    border-color: #405c70;
    color: #405c70;
    background: rgba(64, 92, 112, 0.02);
}

/* 手机适配 */
@media screen and (max-width: 710px) {
    .menuicon img { width: 66px; }
    .menuicon { padding: 10px 0; }
    .swiper-nav .swiper-slide { width: 90px !important; }
}
@media screen and (max-width: 500px) {
    .menuicon img { width: 62px; }
    .swiper-nav .swiper-slide { width: 90px !important; }
    .zhzl .item { width: 50%; }
}
@media screen and (max-width: 400px) {
    .menuicon img { width: 58px; }
    .swiper-nav .swiper-slide { width: 90px !important; }
}

/* =========================================================
   黄色「澳门下半场·四肖八码」弹窗补丁
   作用于 #popad，不改变其他业务页面。
   必须保留前台的弹窗 HTML 和 JS；CSS 自身不能生成按钮或定时关闭。
   ========================================================= */

#popad {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 999999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: rgba(0, 0, 0, .65) !important;
}

/* 若 JS 添加关闭样式，保持可关闭；避免旧样式永久强制 display:flex */
#popad[hidden],
#popad.is-closed { display: none !important; }

#popad .ad {
    position: relative !important;
    width: 100% !important;
    max-width: 420px !important;
    max-height: 94vh !important;
    max-height: 94dvh !important;
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

#popad .tongzhidic {
    display: block !important;
    width: 100% !important;
    max-height: 90vh !important;
    max-height: 90dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch;
}

/* 旧红框标题和关闭条：黄色版不显示 */
#popad .pop-header,
#popad .gb { display: none !important; }

/* 黄色卡片 */
#popad .am-final-card,
#popad .am-yellow-card {
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    background: #f6ca40 !important;
    border-radius: 10px !important;
}

/* 四肖、八码横向固定，不自动换行。
   对此前的 flex 版生效；如果内容为 table，则交给下方 table 规则。
*/
#popad .am-final-card .am-zodiac-row,
#popad .am-final-card .am-number-row,
#popad .am-yellow-zodiacs,
#popad .am-yellow-numbers {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
#popad .am-final-card .am-number-row,
#popad .am-yellow-numbers { gap: 3px !important; }
#popad .am-final-card .am-zodiac-row,
#popad .am-yellow-zodiacs { gap: 9px !important; }

/* 兼容早期使用 <table> 的通知内容：保持横向表格布局 */
#popad .am-final-card table,
#popad .am-yellow-card table {
    width: 100% !important;
    max-width: 320px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    table-layout: fixed !important;
}
#popad .am-final-card table td,
#popad .am-yellow-card table td {
    text-align: center !important;
    vertical-align: middle !important;
    padding: 2px !important;
}

/* 专用生肖圆圈：有对应 class 时覆盖旧样式 */
#popad .am-yellow-zodiac,
#popad .am-zodiac-ball {
    display: inline-flex !important;
    flex: 0 0 40px !important;
    width: 40px !important;
    height: 40px !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    border: 2px solid #eab84c !important;
    border-radius: 50% !important;
    background: #ffe3a0 !important;
    color: #704600 !important;
    font-size: 19px !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

/* 专用号码圆圈：有对应 class 时覆盖旧样式 */
#popad .am-yellow-ball,
#popad .am-number-ball {
    display: inline-flex !important;
    flex: 0 0 32px !important;
    width: 32px !important;
    height: 32px !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    border-width: 3px !important;
    border-style: solid !important;
    border-radius: 50% !important;
    background: #fff !important;
    color: #222 !important;
    font-size: 13px !important;
    font-weight: bold !important;
    line-height: 1 !important;
}
#popad .am-number-ball.red,
#popad .am-yellow-ball.red { border-color: #ff4242 !important; }
#popad .am-number-ball.blue,
#popad .am-yellow-ball.blue { border-color: #368cff !important; }
#popad .am-number-ball.green,
#popad .am-yellow-ball.green { border-color: #24bd4e !important; }

/* 复制按钮：兼容 class=am-copy-btn 与 onclick=copyBamaText() 两种写法 */
#popad .am-copy-btn,
#popad button[onclick*="copyBamaText"] {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    width: auto !important;
    height: auto !important;
    min-width: 96px !important;
    min-height: 40px !important;
    margin: 8px auto 6px !important;
    padding: 9px 26px !important;
    box-sizing: border-box !important;
    border: 0 !important;
    border-radius: 6px !important;
    background: #368cff !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: bold !important;
    line-height: 22px !important;
    cursor: pointer !important;
    text-align: center !important;
}

/* 黄色卡片右上角的关闭按钮 */
#popad .pop-close {
    position: absolute !important;
    right: 10px !important;
    top: 10px !important;
    z-index: 100 !important;
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 50% !important;
    background: #fff1c5 !important;
    color: #805200 !important;
    font-size: 25px !important;
    line-height: 32px !important;
    text-align: center !important;
    cursor: pointer !important;
}

@media screen and (max-width: 360px) {
    #popad { padding: 4px !important; }
    #popad .am-yellow-zodiac,
    #popad .am-zodiac-ball {
        flex-basis: 36px !important;
        width: 36px !important;
        height: 36px !important;
        font-size: 17px !important;
    }
    #popad .am-yellow-ball,
    #popad .am-number-ball {
        flex-basis: 28px !important;
        width: 28px !important;
        height: 28px !important;
        border-width: 2px !important;
        font-size: 12px !important;
    }
    #popad .am-final-card .am-number-row,
    #popad .am-yellow-numbers { gap: 2px !important; }
}
