/* 话费充值活动首页 — 绿色四网联合参考稿 */

html {
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

body.hf-page {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #1f2937;
    background: linear-gradient(180deg, #22c55e 0%, #16a34a 42%, #15803d 100%);
    -webkit-tap-highlight-color: transparent;
    /* 抑制部分浏览器双击缩放，且无需对 touchstart 调 preventDefault（避免阻断按钮跳转） */
    touch-action: manipulation;
    --hf-foot-tip: rgba(255, 255, 255, 0.75);
    --hf-foot-rules: rgba(255, 255, 255, 0.38);
}

body.hf-modal-open {
    overflow: hidden;
}

.hf-shell {
    max-width: 430px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}

/* 底部支付条展开时为页面留白，避免规则区被遮挡 */
body.hf-sticky-pay .hf-shell {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0));
}

body.hf-modal-open .hf-pay-sticky {
    display: none;
}

body.hf-modal-open.hf-sticky-pay .hf-shell {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}

/* —— 绿色头图区（紧凑排版，首屏尽量露出充值区） —— */
.hf-hero {
    padding: 8px 12px 12px;
    text-align: center;
    color: #fff;
}

.hf-carriers {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 0 2px;
}

.hf-carriers__item {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hf-carriers__logo {
    width: 52px;
    height: 52px;
    max-width: 100%;
    object-fit: contain;
    display: block;
    background: transparent;
}

.hf-hero__slogan {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.hf-hero__slogan em {
    font-style: normal;
    color: #fef08a;
}

.hf-hero__sub {
    margin: 0 0 8px;
    font-size: 12px;
    opacity: 0.95;
    letter-spacing: 0.03em;
}

.hf-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-bottom: 8px;
}

.hf-countdown__boxes {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hf-countdown__box {
    min-width: 30px;
    padding: 4px 6px;
    background: #facc15;
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    border-radius: 6px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.08);
}

.hf-countdown__sep {
    font-weight: 700;
    color: #fff;
    opacity: 0.9;
}

.hf-countdown__hint {
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.hf-ticker {
    display: inline-block;
    max-width: 100%;
    margin: 0 auto;
    padding: 5px 12px;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.95);
    background: rgba(21, 128, 61, 0.55);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* —— 白卡片 —— */
.hf-card-outer {
    margin: -18px 12px 0;
    position: relative;
    z-index: 2;
}

.hf-card {
    position: relative;
    background: #fff;
    border-radius: 20px;
    padding: 16px 14px 16px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.hf-card__title {
    margin: 0 0 12px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #16a34a;
    letter-spacing: 0.06em;
}

/* 悬浮客服 */
.hf-service {
    position: absolute;
    top: -132px;
    right: -6px;
    width: 52px;
    padding: 8px 6px 10px;
    background: #fff;
    border-radius: 12px 0 0 12px;
    box-shadow: -2px 2px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
    text-decoration: none;
    color: #374151;
    z-index: 5;
}

.hf-service__avatar {
    display: block;
    width: 34px;
    height: 34px;
    margin: 0 auto 4px;
    border-radius: 50%;
    background: linear-gradient(145deg, #fce7f3, #fbcfe8 40%, #f9a8d4);
    position: relative;
}

.hf-service__avatar::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 5px;
    transform: translateX(-50%);
    width: 18px;
    height: 10px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: 0 0 10px 10px;
}

.hf-service__txt {
    font-size: 12px;
    font-weight: 600;
    color: #4b5563;
}

/* 三档 */
.hf-tier-row {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.hf-tier {
    flex: 1;
    min-width: 0;
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px 4px 8px;
    background: #f9fafb;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.hf-tier:not(:disabled):active {
    transform: scale(0.98);
}

.hf-tier__top {
    display: block;
    font-size: 16px;
    font-weight: 800;
    color: #6b7280;
    margin-bottom: 4px;
}

.hf-tier__btm {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.hf-tier--hot .hf-tier__ribbon,
.hf-tier--vip .hf-tier__ribbon {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    padding: 3px 8px;
    border-radius: 0 0 8px 8px;
    line-height: 1.2;
}

.hf-tier--hot .hf-tier__ribbon {
    background: linear-gradient(90deg, #ef4444, #dc2626);
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.35);
}

.hf-tier--vip .hf-tier__ribbon {
    background: linear-gradient(90deg, #a16207, #d97706);
    box-shadow: 0 2px 4px rgba(161, 98, 7, 0.35);
}

/* 尊享档面值（如 ¥500）未选中时用红色突出 */
.hf-tier--vip:not(.is-active) .hf-tier__top {
    color: #dc2626;
    font-weight: 900;
    letter-spacing: -0.02em;
}

.hf-tier--soldout:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    filter: grayscale(0.35);
    border-style: dashed;
    border-color: #d1d5db;
    background: #f3f4f6;
}

.hf-tier--soldout:disabled .hf-tier__top,
.hf-tier--soldout:disabled .hf-tier__btm {
    color: #9ca3af;
}

.hf-tier__soldout-badge {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #6b7280;
    padding: 3px 10px;
    border-radius: 0 0 8px 8px;
    line-height: 1.2;
}

.hf-tier.is-active {
    border-color: #22c55e;
    border-width: 2px;
}

/* 非主推、非尊享的普通档位选中（浅绿）；尊享与热卖由下方单独样式 */
.hf-tier:not(.hf-tier--hot):not(.hf-tier--vip).is-active {
    background: #f0fdf4;
    box-shadow: 0 2px 10px rgba(34, 197, 94, 0.2);
}

.hf-tier:not(.hf-tier--hot):not(.hf-tier--vip).is-active .hf-tier__top {
    color: #166534;
}

.hf-tier:not(.hf-tier--hot):not(.hf-tier--vip).is-active .hf-tier__btm {
    color: #15803d;
    font-weight: 600;
}

/* 热卖档与尊享档选中同款实心绿底 */
.hf-tier--hot.is-active,
.hf-tier--vip.is-active {
    background: #22c55e;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.35);
}

.hf-tier--hot.is-active .hf-tier__top {
    color: #fff;
}

.hf-tier--vip.is-active .hf-tier__top {
    color: #fef08a;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.hf-tier--hot.is-active .hf-tier__btm,
.hf-tier--vip.is-active .hf-tier__btm {
    color: #fef08a;
    font-weight: 800;
}

/* 表单 */
.hf-form {
    margin: 0;
    padding: 0;
}

.hf-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 4px 2px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    margin-bottom: 10px;
}

.hf-phone__icon {
    flex-shrink: 0;
    color: #9ca3af;
    display: flex;
}

.hf-phone__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 11px 12px 11px 0;
    min-width: 0;
    background: transparent;
}

.hf-phone__input::placeholder {
    color: #c4c4c4;
}

.hf-paybox {
    background: #eff6ff;
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;
    border: 1px solid #dbeafe;
}

.hf-paybox__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 14px;
    color: #374151;
}

.hf-paybox__row--second {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #bfdbfe;
}

.hf-paybox__left {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.hf-paybox__zfb {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    min-width: 0;
    object-fit: contain;
    flex-shrink: 0;
    overflow: hidden;
}

.hf-paybox__amt b {
    font-weight: 700;
    color: #111827;
}

.hf-paybox__credit {
    font-size: 14px;
    color: #15803d;
}

.hf-paybox__credit strong {
    font-size: 17px;
    font-weight: 800;
}

.hf-paybox__tag {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #ef4444;
    padding: 3px 8px;
    border-radius: 6px;
}

.hf-btn {
    display: block;
    width: 100%;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    border-radius: 999px;
    -webkit-tap-highlight-color: transparent;
}

.hf-btn--primary {
    padding: 13px;
    font-size: 17px;
    color: #fff;
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 45%, #16a34a 100%);
    box-shadow: 0 6px 18px rgba(34, 197, 94, 0.45);
    margin-bottom: 10px;
}

.hf-btn--primary:active {
    opacity: 0.92;
    transform: scale(0.99);
}

.hf-btn-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.hf-btn--sub {
    flex: 1;
    padding: 11px 8px;
    font-size: 14px;
    color: #fff;
    background: #22c55e;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.hf-btn--sub:active {
    opacity: 0.9;
}

/* 协议 */
.hf-agree {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.55;
    color: #6b7280;
    margin: 0;
}

.hf-agree__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hf-agree__ui {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 4px;
    border: 2px solid #3b82f6;
    background: #fff;
    position: relative;
}

.hf-agree__input:checked+.hf-agree__ui {
    background: #3b82f6;
    border-color: #2563eb;
}

.hf-agree__input:checked+.hf-agree__ui::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.hf-agree__text a {
    color: #16a34a;
    text-decoration: none;
    font-weight: 600;
}

.hf-agree__text a:active {
    opacity: 0.8;
}

.hf-bottom-tip {
    margin: 18px 16px 8px;
    text-align: center;
    font-size: 13px;
    color: var(--hf-foot-tip);
    letter-spacing: 0.02em;
}

/* 头图内弱提示（与绿色背景融合，避免单独色块抢眼） */
.hf-hero__hint {
    margin: 6px auto 0;
    padding: 0;
    max-width: 28em;
    font-size: 11px;
    line-height: 3.45;
    color: rgba(255, 255, 255, 0.68);
    text-align: center;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* 第一行、第二行由 <br> 控制；第二行整句不换行，避免「（共20期）」等尾部孤行 */
.hf-hero__hint__line2 {
    white-space: nowrap;
}

@media (max-width: 320px) {
    .hf-hero__hint {
        font-size: 10px;
    }
}

/* 首屏主栏：至少占满一屏高度，使下方「活动规则」需滑动后才进入视口 */
.hf-main-column {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.hf-main-column > .hf-card-outer {
    flex: 1 0 auto;
}

/* 底部固定支付条：主按钮滚出视口时出现 */
.hf-pay-sticky {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1500;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0));
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.1);
    transform: translateY(110%);
    transition: transform 0.22s ease;
    pointer-events: none;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.hf-pay-sticky.is-visible {
    transform: translateY(0);
    pointer-events: auto;
}

.hf-pay-sticky__bar {
    max-width: 430px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hf-pay-sticky__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.hf-pay-sticky__label {
    font-size: 11px;
    color: #6b7280;
}

.hf-pay-sticky__price {
    font-size: 15px;
    color: #111827;
    font-weight: 700;
}

.hf-pay-sticky__price b {
    font-size: 20px;
    font-weight: 800;
    color: #dc2626;
}

.hf-pay-sticky__btn {
    flex-shrink: 0;
    margin: 0;
    padding: 12px 22px;
    border: none;
    border-radius: 999px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(180deg, #4ade80 0%, #22c55e 45%, #16a34a 100%);
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4);
    -webkit-tap-highlight-color: transparent;
}

.hf-pay-sticky__btn:active {
    opacity: 0.92;
    transform: scale(0.98);
}

/* 页内活动规则（完整展示） */
.hf-page-rules {
    margin: 14px 16px 0;
    padding: 16px 14px 18px;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.9);
}

.hf-page-rules__title {
    margin: 0 0 12px;
    font-size: 17px;
    color: #16a34a;
    text-align: center;
    font-weight: 700;
}

.hf-page-rules__body {
    font-size: 13px;
    line-height: 1.55;
    color: #4b5563;
    text-align: left;
}

.hf-page-rules__h {
    margin: 14px 0 8px;
    font-size: 14px;
    color: #111827;
    font-weight: 700;
}

.hf-page-rules__h:first-of-type {
    margin-top: 0;
}

.hf-page-rules__body p {
    margin: 0 0 10px;
}

.hf-page-rules__body p:last-child {
    margin-bottom: 0;
}

.hf-page-rules__body a {
    color: #2563eb;
    word-break: break-all;
}

/* 首页底部活动规则（弱化展示） */
.hf-rules-foot {
    margin-top: 14px;
    padding: 0 16px 4px;
}

.hf-rules-foot__inner {
    font-size: 11px;
    line-height: 1.55;
    color: var(--hf-foot-rules);
    text-align: center;
    letter-spacing: 0.01em;
}

.hf-rules-foot__inner p {
    margin: 0 0 8px;
}

.hf-rules-foot__inner p:last-child {
    margin-bottom: 0;
}

.hf-rules-foot__more {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    font-size: inherit;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    opacity: 0.92;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.hf-rules-foot__more:active {
    opacity: 0.65;
}

/* 弹窗 */
.hf-modal[hidden] {
    display: none !important;
}

.hf-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 2000;
    padding: 24px;
    background: rgba(0, 0, 0, 0.45);
}

.hf-modal__panel {
    position: relative;
    width: 100%;
    max-width: 360px;
    max-height: 78vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.hf-modal__panel--menu {
    max-height: none;
    padding: 28px 20px 20px;
}

.hf-modal__x {
    position: absolute;
    right: 12px;
    top: 8px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 4px 8px;
    z-index: 2;
}

.hf-modal__h {
    margin: 0;
    padding: 20px 44px 12px 20px;
    font-size: 18px;
    color: #16a34a;
    text-align: center;
    flex-shrink: 0;
}

.hf-modal__body {
    padding: 0 20px 20px;
    overflow-y: auto;
    text-align: left;
    font-size: 14px;
    color: #4b5563;
    line-height: 1.55;
}

.hf-modal__h4 {
    margin: 16px 0 8px;
    color: #111827;
    font-size: 15px;
}

.hf-modal__body p {
    margin: 0 0 10px;
}

.hf-modal__body a {
    color: #2563eb;
    word-break: break-all;
}

.hf-menu__item {
    margin: 0;
    padding: 14px 12px;
    font-size: 16px;
    color: #111827;
    border-radius: 10px;
    background: #f3f4f6;
    cursor: pointer;
    text-align: center;
}

.hf-menu__item+.hf-menu__item {
    margin-top: 10px;
}

@media (max-width: 360px) {
    .hf-hero__slogan {
        font-size: 20px;
    }

    .hf-tier__top {
        font-size: 15px;
    }

    .hf-service {
        right: -4px;
        width: 48px;
    }
}