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

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;
}

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));
}

/* —— 顶栏 —— */
.hf-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 8px;
    padding-top: env(safe-area-inset-top, 0);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.hf-nav__title {
    flex: 1;
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    text-align: center;
    letter-spacing: 0.02em;
}

.hf-nav__btn {
    width: 44px;
    height: 44px;
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hf-nav__chev {
    display: block;
    width: 10px;
    height: 10px;
    border-left: 2px solid #111;
    border-bottom: 2px solid #111;
    transform: rotate(45deg);
    margin-left: 4px;
}

.hf-nav__dots {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #111;
    box-shadow: -7px 0 0 #111, 7px 0 0 #111;
}

/* —— 绿色头图区 —— */
.hf-hero {
    padding: 14px 16px 28px;
    text-align: center;
    color: #fff;
}

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

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

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

.hf-hero__slogan {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1.35;
    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 16px;
    font-size: 13px;
    opacity: 0.95;
    letter-spacing: 0.04em;
}

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

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

.hf-countdown__box {
    min-width: 36px;
    padding: 6px 8px;
    background: #facc15;
    color: #111827;
    font-size: 17px;
    font-weight: 800;
    border-radius: 8px;
    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: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.hf-ticker {
    display: inline-block;
    max-width: 100%;
    margin: 0 auto;
    padding: 8px 16px;
    font-size: 12px;
    line-height: 1.4;
    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: -12px 12px 0;
    position: relative;
    z-index: 2;
}

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

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

/* 悬浮客服 */
.hf-service {
    position: absolute;
    top: -100px;
    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: 8px;
    margin-bottom: 18px;
}

.hf-tier {
    flex: 1;
    min-width: 0;
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 22px 6px 12px;
    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: 18px;
    font-weight: 800;
    color: #6b7280;
    margin-bottom: 6px;
}

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

.hf-tier--hot .hf-tier__ribbon {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(90deg, #ef4444, #dc2626);
    padding: 3px 8px;
    border-radius: 0 0 8px 8px;
    line-height: 1.2;
    box-shadow: 0 2px 4px rgba(220, 38, 38, 0.35);
}

.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;
    background: linear-gradient(90deg, #a16207, #d97706);
    box-shadow: 0 2px 4px rgba(161, 98, 7, 0.35);
}

.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 {
    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--hot.is-active .hf-tier__btm {
    color: #fef08a;
    font-weight: 800;
}

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

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

.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: 4px 4px 4px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #fff;
    margin-bottom: 14px;
}

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

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

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

.hf-paybox {
    background: #eff6ff;
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 16px;
    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: 10px;
    padding-top: 10px;
    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: 15px;
    font-size: 18px;
    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: 12px;
}

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

.hf-btn-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.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: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.02em;
}

/* 弹窗 */
.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;
}

/* 微信 / 支付宝（金付通 wxpay / alipay） */
.hf-pay-methods {
    margin-bottom: 14px;
}

.hf-pay-methods__title {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 10px;
    font-weight: 600;
}

.hf-pay-methods__row {
    display: flex;
    gap: 12px;
}

.hf-pay-method {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: 52px;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.hf-pay-method input[type="radio"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    align-self: center;
    accent-color: #22c55e;
}

/* 与摘要区 .hf-paybox__zfb 一致，保持 24×24。
   flex 子项 img 默认 min-width:auto 会按图片固有宽度（如 100px）卡住，须显式放开 */
.hf-pay-method__icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
    min-width: 0;
    object-fit: contain;
    object-position: center;
    display: block;
    align-self: center;
    overflow: hidden;
}

.hf-pay-method__label {
    flex: 1;
    min-width: 0;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: 0.02em;
    color: #374151;
    align-self: center;
}

.hf-pay-method.is-selected {
    border-color: #22c55e;
    background: #f0fdf4;
}

.hf-pay-method.is-selected .hf-pay-method__label {
    color: #166534;
}

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

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

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

    .hf-pay-method {
        padding: 10px 10px;
        gap: 8px;
    }

    .hf-pay-method__label {
        font-size: 14px;
    }
}

