/* 首页通知公告式广告弹窗（红签 + 倒计时 + 富内容 + 不再显示） */

.home-ad-overlay {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.home-ad-overlay.home-ad-open {
    opacity: 1;
    visibility: visible;
}

.home-ad-overlay.home-ad-open .home-ad-dialog {
    transform: translate3d(0, 0, 0) scale(1);
}

/* 在上一版基础上整体 ×1.17（放大 17%） */
.home-ad-dialog {
    position: relative;
    width: 100%;
    max-width: min(90vw, 328px);
    max-height: min(68vh, 498px);
    display: flex;
    flex-direction: column;
    margin: 0;
    background: #fff;
    border: none;
    border-radius: 14px;
    box-shadow:
        0 9px 33px rgba(0, 0, 0, 0.28),
        0 1px 0 rgba(255, 255, 255, 0.8) inset;
    transform: translate3d(0, 14px, 0) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34, 1.12, 0.64, 1);
    overflow: hidden;
}

/* 顶栏：左倒计时、中「通知公告」、右关闭 */
.home-ad-top {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    min-height: 47px;
    padding: 9px 12px 9px;
    background: #fff;
}

.home-ad-top-side {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-width: 35px;
}

.home-ad-top-side--left {
    justify-content: flex-start;
}

.home-ad-top-side--right {
    justify-content: flex-end;
}

.home-ad-top-center {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    padding: 0 2px;
}

.home-ad-close {
    flex-shrink: 0;
    width: 33px;
    height: 33px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: #bdbdbd;
    color: #fff;
    font-size: 21px;
    line-height: 1;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: background 0.2s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.home-ad-close:hover {
    background: #9e9e9e;
}

.home-ad-close:active {
    transform: scale(0.94);
}

.home-ad-ribbon {
    display: inline-block;
    padding: 6px 21px 7px;
    background: linear-gradient(180deg, #ff5252 0%, #e53935 45%, #c62828 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.1em;
    border-radius: 7px;
    box-shadow: 0 4px 9px rgba(198, 40, 40, 0.28);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
    white-space: nowrap;
}

.home-ad-countdown {
    font-size: 14px;
    font-weight: 700;
    color: #e53935;
    line-height: 33px;
}

/* 可滚动正文 */
.home-ad-rich {
    flex: 1;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 9px 12px 9px;
    font-size: 14px;
    line-height: 1.55;
    color: #222;
    text-align: center;
}

.home-ad-rich p {
    margin: 0 0 12px;
    text-align: center;
}

.home-ad-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 7px auto 9px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 2px solid #c9a227;
    background: linear-gradient(180deg, #fff8e1, #ffe082 55%, #ffb300);
    font-size: 12px;
    font-weight: 800;
    color: #5d4037;
    line-height: 1.35;
    box-sizing: border-box;
    box-shadow: 0 2px 9px rgba(201, 162, 39, 0.32);
    max-width: 96%;
    text-align: center;
}

.home-ad-brand {
    margin: 5px 0 9px;
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    font-family: Georgia, 'Times New Roman', 'Microsoft YaHei', serif;
}

.home-ad-brand small {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    font-weight: 600;
    color: #1565c0;
}

/* 三列表格 */
.home-ad-table-wrap {
    margin: 7px 0 12px;
    border: 1px solid #bdbdbd;
    border-radius: 2px;
    overflow: hidden;
}

.home-ad-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.home-ad-table thead td {
    background: #616161;
    color: #fff;
    font-weight: 700;
    padding: 6px 2px;
    text-align: center;
    border: 1px solid #757575;
}

.home-ad-table tbody td {
    padding: 7px 5px;
    text-align: center;
    border: 1px solid #e0e0e0;
    background: #fff;
    vertical-align: middle;
}

.home-ad-table tbody td strong {
    color: #c62828;
    font-size: 14px;
}

/* 主按钮 */
.home-ad-cta {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px;
    padding: 9px 12px;
    border: none;
    border-radius: 7px;
    background: linear-gradient(180deg, #a1887f 0%, #6d4c41 100%);
    color: #ffeb3b;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 0 #4e342e, 0 5px 14px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.home-ad-cta:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #4e342e, 0 3px 10px rgba(0, 0, 0, 0.15);
}

/* 链接宫格 */
.home-ad-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 7px;
}

.home-ad-grid td {
    border: 1px solid #ccc;
    padding: 7px 5px;
    text-align: center;
    background: #fff;
    vertical-align: middle;
}

.home-ad-grid td a {
    color: #1565c0;
    text-decoration: none;
    font-weight: 600;
}

.home-ad-grid td.is-hot {
    background: #ffeb3b;
}

.home-ad-grid td.is-hot a {
    color: #c62828;
}

.home-ad-slogan {
    font-size: 13px;
    font-weight: 700;
    color: #111;
    margin: 2px 0 0;
}

/* 底部「不再显示」居中 */
.home-ad-foot {
    flex-shrink: 0;
    padding: 9px 12px 14px;
    border-top: 1px solid #eee;
    background: #fafafa;
    text-align: center;
}

.home-ad-never {
    display: inline-block;
    min-width: 117px;
    padding: 8px 21px;
    border: 2px solid #e53935;
    border-radius: 7px;
    background: #fff;
    color: #e53935;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.home-ad-never:hover {
    background: #ffebee;
}

.home-ad-never:active {
    transform: scale(0.98);
}

body.home-ad-scroll-lock {
    overflow: hidden;
    touch-action: none;
}

@media screen and (min-width: 800px) {
    .home-ad-dialog {
        max-width: 351px;
        max-height: min(68vh, 515px);
    }
}
