/* 黑桃短剧站内推广广告（开屏 + 悬浮 + 底部横幅）：无外部字体/图片/CDN 依赖 */

.heitao-promo-root {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* ---------- 开屏广告（原生 dialog） ---------- */

dialog.heitao-promo-splash {
    padding: 0;
    border: 1px solid rgba(224, 196, 144, 0.28);
    border-radius: 20px;
    background: #171314;
    color: #faf4e9;
    width: min(560px, calc(100vw - 40px));
    max-width: calc(100vw - 32px);
    max-height: min(680px, calc(100dvh - 48px));
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
    box-sizing: border-box;
    margin: auto;
}

dialog.heitao-promo-splash[open] {
    display: flex;
    flex-direction: column;
}

dialog.heitao-promo-splash:modal {
    overscroll-behavior: contain;
}

dialog.heitao-promo-splash::backdrop {
    overflow: hidden;
    overscroll-behavior: contain;
    background: rgba(11, 9, 10, 0.82);
    backdrop-filter: blur(8px);
}

dialog.heitao-promo-splash.is-fallback-open {
    position: fixed;
    inset: 0;
    z-index: 2147482000;
    margin: auto;
}

.heitao-promo-splash__frame {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 360px;
    background:
        radial-gradient(circle at 18% 12%, rgba(224, 196, 144, 0.22), transparent 52%),
        radial-gradient(circle at 86% 88%, rgba(232, 134, 68, 0.2), transparent 50%),
        linear-gradient(155deg, #211818 0%, #161112 58%, #100d0e 100%);
}

.heitao-promo-splash__topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    pointer-events: none;
}

.heitao-promo-splash__badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(20, 16, 16, 0.68);
    border: 1px solid rgba(224, 196, 144, 0.28);
    color: #e7cfa0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.heitao-promo-splash__skip {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(16, 13, 14, 0.74);
    color: #faf4e9;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.heitao-promo-splash__skip:hover {
    background: rgba(34, 28, 29, 0.92);
    border-color: rgba(224, 196, 144, 0.6);
}

.heitao-promo-splash__skip:focus-visible {
    outline: 2px solid #f0d7a3;
    outline-offset: 2px;
}

.heitao-promo-splash__link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1 1 auto;
    color: inherit;
    text-decoration: none;
    box-sizing: border-box;
}

.heitao-promo-splash__link:focus-visible {
    outline: 2px solid #f0d7a3;
    outline-offset: -4px;
}

/* 纯 CSS 兜底卡片（未配置本地图时显示） */
.heitao-promo-splash__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 84px 36px 48px;
    flex: 1 1 auto;
}

.heitao-promo-splash__eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(224, 196, 144, 0.14);
    border: 1px solid rgba(224, 196, 144, 0.34);
    color: #f0d7a3;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.heitao-promo-splash__title {
    margin: 0;
    max-width: 18em;
    color: #fff8ec;
    font-size: 28px;
    line-height: 1.38;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.heitao-promo-splash__desc {
    margin: 16px 0 0;
    max-width: 28em;
    color: #cfc4b4;
    font-size: 15px;
    line-height: 1.7;
}

.heitao-promo-splash__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 184px;
    min-height: 46px;
    margin-top: 28px;
    padding: 0 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f3dca7 0%, #dca857 100%);
    color: #1c1308;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 10px 26px rgba(220, 168, 87, 0.32);
    transition: transform 0.16s ease, filter 0.16s ease;
}

.heitao-promo-splash__link:hover .heitao-promo-splash__cta {
    transform: translateY(-1px);
    filter: brightness(1.06);
}

/* 有本地图片时的展示模式 */
.heitao-promo-splash__media {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0e0b0c;
}

.heitao-promo-splash__img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 540px;
    object-fit: cover;
}

.heitao-promo-splash__caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 20px;
    background: linear-gradient(180deg, rgba(22, 17, 18, 0.94) 0%, #141011 100%);
    border-top: 1px solid rgba(224, 196, 144, 0.18);
}

.heitao-promo-splash__caption-title {
    margin: 0;
    color: #faf4e9;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
}

.heitao-promo-splash__caption .heitao-promo-splash__cta {
    margin-top: 0;
    min-width: auto;
    min-height: 38px;
    padding: 0 18px;
    font-size: 14px;
    flex-shrink: 0;
}

/* ---------- 右下角悬浮广告 ---------- */

.heitao-promo-float {
    position: fixed;
    right: 22px;
    bottom: 84px;
    z-index: 95;
    max-width: 220px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.heitao-promo-float[hidden] {
    display: none;
}

.heitao-promo-float.is-avoiding-player {
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.heitao-promo-float__close {
    position: absolute;
    top: -10px;
    right: -8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid rgba(224, 196, 144, 0.4);
    border-radius: 50%;
    background: #1b1516;
    color: #e9decb;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
    transition: background-color 0.15s ease, color 0.15s ease;
}

.heitao-promo-float__close:hover {
    background: #332628;
    color: #ffffff;
}

.heitao-promo-float__close:focus-visible {
    outline: 2px solid #f0d7a3;
    outline-offset: 2px;
}

.heitao-promo-float__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 11px;
    border-radius: 14px;
    border: 1px solid rgba(224, 196, 144, 0.42);
    background: linear-gradient(135deg, #271d1d 0%, #171213 100%);
    color: #faf4e9;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.heitao-promo-float__link:hover {
    transform: translateY(-2px);
    border-color: #f0d7a3;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.heitao-promo-float__link:focus-visible {
    outline: 2px solid #f0d7a3;
    outline-offset: 2px;
}

.heitao-promo-float__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #f3dca7 0%, #d89f48 100%);
    color: #1c1308;
    font-size: 14px;
    font-weight: 700;
}

.heitao-promo-float__img {
    display: block;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 9px;
    object-fit: cover;
    background: #0f0c0d;
}

.heitao-promo-float__meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.heitao-promo-float__title {
    color: #fff6e5;
    font-size: 13px;
    line-height: 1.3;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.heitao-promo-float__sub {
    margin-top: 2px;
    color: #e3c894;
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 手机端适配：整屏开屏 + 避开底部导航/安全区/回到顶部 ---------- */

/* ---------- 底部通栏横幅（左右占满屏幕） ---------- */

.heitao-promo-bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 96;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(23, 19, 20, 0.97);
    border-top: 1px solid rgba(224, 196, 144, 0.32);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.38);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

.heitao-promo-bottom[hidden] {
    display: none;
}

.heitao-promo-bottom__link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    max-width: 1200px;
    min-height: 64px;
    margin: 0 auto;
    padding: 10px 56px 10px 16px;
    color: #faf4e9;
    text-decoration: none;
}

.heitao-promo-bottom__link:focus-visible {
    outline: 2px solid #f3dca7;
    outline-offset: -2px;
}

.heitao-promo-bottom__icon,
.heitao-promo-bottom__img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 11px;
    object-fit: cover;
}

.heitao-promo-bottom__icon {
    background: linear-gradient(135deg, #f3dca7 0%, #d89f48 100%);
    color: #1c1308;
    font-size: 16px;
    font-weight: 700;
}

.heitao-promo-bottom__meta {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.heitao-promo-bottom__title,
.heitao-promo-bottom__sub {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.heitao-promo-bottom__title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.heitao-promo-bottom__sub {
    color: rgba(250, 244, 233, 0.72);
    font-size: 13px;
    line-height: 1.3;
}

.heitao-promo-bottom__cta {
    flex-shrink: 0;
    padding: 9px 20px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f3dca7 0%, #d89f48 100%);
    color: #1c1308;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.heitao-promo-bottom__close {
    position: absolute;
    top: 20px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(250, 244, 233, 0.28);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(250, 244, 233, 0.82);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.heitao-promo-bottom__close:focus-visible {
    outline: 2px solid #f3dca7;
    outline-offset: 2px;
}

/* 横幅出现时：页面底部留白，右下角浮标与回顶按钮整体上移，互不遮挡 */
html.heitao-promo-bottom-on body {
    padding-bottom: var(--heitao-promo-bottom-h, 64px);
}

html.heitao-promo-bottom-on .heitao-promo-float,
html.heitao-promo-bottom-on .back-to-top,
html.heitao-promo-bottom-on .scroll-to-top {
    margin-bottom: var(--heitao-promo-bottom-h, 64px);
}

/* 网页全屏播放时不显示横幅 */
html.heitao-web-fullscreen-open .heitao-promo-bottom,
body.heitao-web-fullscreen-open .heitao-promo-bottom {
    display: none;
}

@media (max-width: 640px) {
    .heitao-promo-bottom__link {
        gap: 10px;
        min-height: 58px;
        padding: 8px 46px 8px 12px;
    }

    .heitao-promo-bottom__icon,
    .heitao-promo-bottom__img {
        width: 38px;
        height: 38px;
        border-radius: 10px;
    }

    .heitao-promo-bottom__title {
        font-size: 15px;
    }

    .heitao-promo-bottom__sub {
        font-size: 12px;
    }

    .heitao-promo-bottom__cta {
        padding: 8px 14px;
        font-size: 13px;
    }

    .heitao-promo-bottom__close {
        top: 17px;
        right: 10px;
        width: 24px;
        height: 24px;
        font-size: 15px;
    }

    dialog.heitao-promo-splash {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        max-width: 100vw;
        max-height: 100vh;
        max-height: 100dvh;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .heitao-promo-splash__frame {
        min-height: 100%;
    }

    .heitao-promo-splash__topbar {
        padding-top: calc(16px + env(safe-area-inset-top));
        padding-left: calc(16px + env(safe-area-inset-left));
        padding-right: calc(16px + env(safe-area-inset-right));
    }

    .heitao-promo-splash__card {
        padding: calc(88px + env(safe-area-inset-top)) 24px calc(44px + env(safe-area-inset-bottom));
    }

    .heitao-promo-splash__title {
        font-size: 24px;
    }

    .heitao-promo-splash__img {
        max-height: none;
    }

    .heitao-promo-splash__caption {
        padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
    }

    .heitao-promo-float {
        right: calc(12px + env(safe-area-inset-right));
        bottom: calc(68px + env(safe-area-inset-bottom));
        z-index: 80;
        max-width: 168px;
    }

    .heitao-promo-float__link {
        padding: 8px 11px 8px 9px;
        gap: 8px;
        border-radius: 12px;
    }

    .heitao-promo-float__icon,
    .heitao-promo-float__img {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .heitao-promo-float__title {
        font-size: 12px;
    }

    .heitao-promo-float__sub {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .heitao-promo-splash__skip,
    .heitao-promo-splash__cta,
    .heitao-promo-float,
    .heitao-promo-float__close,
    .heitao-promo-float__link {
        transition: none;
    }
}
