:root {
    --h5-green: #0dbf82;
    --h5-green-deep: #09a86f;
    --h5-green-dark: #0b8f60;
    --h5-green-ink: #0a7a54;
    --h5-mint: #d9f4e7;
    --h5-text: #17281f;
    --h5-text-sub: #6b7f74;
    --h5-line: #dcefe5;
    --h5-bg: #eefaf4;
    --h5-card: #ffffff;
    --h5-danger: #e5484d;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--h5-bg);
    color: var(--h5-text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.h5-page {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: 40px;
    background: var(--h5-bg);
}

.h5-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ===== 顶部品牌区 ===== */
.h5-hero {
    position: relative;
    overflow: hidden;
    padding: 18px 16px 24px;
    background:
        radial-gradient(120% 90% at 85% 0%, rgba(13, 191, 130, 0.32) 0%, rgba(13, 191, 130, 0) 55%),
        radial-gradient(90% 70% at 0% 100%, rgba(13, 191, 130, 0.18) 0%, rgba(13, 191, 130, 0) 60%),
        linear-gradient(165deg, #c9f2df 0%, #e6f9f0 58%, #eefaf4 100%);
    border-radius: 0 0 24px 24px;
}

.h5-channel-image {
    flex: 0 0 118px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.h5-channel-image img {
    display: block;
    width: 122px;
    height: 198px;
    object-fit: cover;
    object-position: center top;
    border: 4px solid rgba(255, 255, 255, 0.88);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 26px rgba(10, 60, 40, 0.2);
    transform: rotate(2deg);
}

.h5-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.h5-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.h5-brand-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(150deg, #123527 0%, #1f5c40 100%);
    color: #4ef0ae;
    flex-shrink: 0;
}

.h5-brand-logo svg {
    width: 19px;
    height: 19px;
}

.h5-brand-logo.has-image {
    overflow: hidden;
    background: #fff;
    box-shadow: 0 5px 14px rgba(20, 40, 90, 0.16);
}

.h5-brand-logo.has-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.h5-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.h5-brand-text strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--h5-text);
}

.h5-brand-text small {
    font-size: 10px;
    color: var(--h5-text-sub);
    letter-spacing: 1px;
}

.h5-hero-pill {
    padding: 5px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(13, 191, 130, 0.35);
    color: var(--h5-green-dark);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(13, 191, 130, 0.12);
}

.h5-hero-main {
    display: flex;
    align-items: stretch;
    gap: 8px;
    margin-top: 16px;
}

.h5-hero-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.h5-hero-title {
    margin: 0 0 8px;
    font-size: 21px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--h5-text);
}

.h5-hero-title em {
    font-style: normal;
    color: var(--h5-green-dark);
}

.h5-hero-sub {
    margin: 0 0 14px;
    font-size: 12.5px;
    color: var(--h5-ink);
    font-weight: 600;
}

.h5-hero-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.h5-hero-features li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 2px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(13, 191, 130, 0.16);
}

.h5-feat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(150deg, #0ecf8d 0%, #09a86f 100%);
    color: #fff;
}

.h5-feat-icon svg {
    width: 15px;
    height: 15px;
}

.h5-feat-label {
    font-size: 11px;
    color: var(--h5-text);
    font-weight: 600;
}

/* 手机样机 */
.h5-phone {
    flex: 0 0 108px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.h5-phone-body {
    position: relative;
    width: 96px;
    height: 172px;
    padding: 7px;
    border-radius: 18px;
    background: linear-gradient(160deg, #17281f 0%, #2b4a39 100%);
    box-shadow: 0 14px 26px rgba(10, 60, 40, 0.22);
    transform: rotate(6deg);
}

.h5-phone-screen {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: linear-gradient(170deg, #f4fdf9 0%, #dff5ea 100%);
    padding: 16px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.h5-phone-line {
    display: block;
    height: 6px;
    border-radius: 3px;
    background: #bfe8d4;
}

.h5-phone-line.is-w45 { width: 45%; }
.h5-phone-line.is-w60 { width: 60%; }
.h5-phone-line.is-w70 { width: 70%; }
.h5-phone-line.is-w80 { width: 80%; }

.h5-phone-corner {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid var(--h5-green);
}

.h5-phone-corner.is-tl { top: 7px; left: 6px; border-right: 0; border-bottom: 0; border-radius: 4px 0 0 0; }
.h5-phone-corner.is-tr { top: 7px; right: 6px; border-left: 0; border-bottom: 0; border-radius: 0 4px 0 0; }
.h5-phone-corner.is-bl { bottom: 7px; left: 6px; border-right: 0; border-top: 0; border-radius: 0 0 0 4px; }
.h5-phone-corner.is-br { bottom: 7px; right: 6px; border-left: 0; border-top: 0; border-radius: 0 0 4px 0; }

.h5-phone-float {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    box-shadow: 0 6px 14px rgba(10, 60, 40, 0.2);
}

.h5-phone-float.is-doc {
    width: 30px;
    height: 30px;
    top: 14px;
    left: -12px;
    background: linear-gradient(150deg, #3b8cff 0%, #2b6fe0 100%);
    transform: rotate(-10deg);
}

.h5-phone-float.is-pdf {
    width: 34px;
    height: 34px;
    bottom: 16px;
    right: -14px;
    background: linear-gradient(150deg, #ff6a5f 0%, #e5484d 100%);
    transform: rotate(10deg);
}

/* ===== 卡片 ===== */
.h5-card {
    position: relative;
    margin: 14px 16px 0;
    background: var(--h5-card);
    border-radius: 16px;
    padding: 18px 16px;
    box-shadow: 0 8px 24px rgba(10, 70, 45, 0.07);
}

.h5-card + .h5-card {
    margin-top: 14px;
}

/* 分栏标题：— 会员权益 — */
.h5-section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--h5-text);
}

.h5-section-title i {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--h5-line));
}

.h5-section-title i:last-child {
    background: linear-gradient(90deg, var(--h5-line), transparent);
}

.h5-section-title span {
    color: var(--h5-green-dark);
    letter-spacing: 2px;
}

/* 会员权益宫格 */
.h5-benefits {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.h5-benefits li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.h5-benefit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(155deg, #e3fbf0 0%, #c8f2e1 100%);
    color: var(--h5-green-dark);
}

.h5-benefit-icon svg {
    width: 22px;
    height: 22px;
}

.h5-benefit-label {
    font-size: 10.5px;
    color: var(--h5-text);
    font-weight: 600;
    white-space: nowrap;
}

/* ===== 购买卡 ===== */
.h5-buy-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.h5-plan-name {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 15.5px;
    font-weight: 700;
}

.h5-crown {
    display: flex;
    color: var(--h5-green);
}

.h5-crown svg {
    width: 18px;
    height: 18px;
}

.h5-cycle-pill {
    flex-shrink: 0;
    padding: 3px 10px;
    border-radius: 999px;
    background: #e6faf1;
    border: 1px solid rgba(13, 191, 130, 0.35);
    color: var(--h5-green-dark);
    font-size: 11px;
    font-weight: 700;
}

.h5-plan-batch {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--h5-text-sub);
}

/* 价格 */
.h5-price-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 10px;
}

.h5-price-symbol {
    font-size: 19px;
    font-weight: 800;
    color: var(--h5-green-ink);
}

.h5-price-value {
    font-size: 42px;
    font-weight: 800;
    color: var(--h5-green-ink);
    line-height: 1;
    letter-spacing: -1px;
}

.h5-price-unit {
    font-size: 14px;
    color: var(--h5-text-sub);
}

.h5-price-note {
    margin: 8px 0 0;
    font-size: 12.5px;
    color: var(--h5-text-sub);
}

.h5-price-note strong {
    color: var(--h5-green-dark);
    font-weight: 700;
}

/* 表单 */
.h5-field {
    position: relative;
    margin-top: 20px;
}

.h5-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    display: flex;
    color: #9db8ab;
    pointer-events: none;
}

.h5-input-icon svg {
    width: 18px;
    height: 18px;
}

.h5-input {
    width: 100%;
    height: 50px;
    padding: 0 14px 0 42px;
    border: 1px solid var(--h5-line);
    border-radius: 12px;
    background: #f7fcf9;
    font-size: 17px;
    letter-spacing: 1px;
    color: var(--h5-text);
    outline: none;
    transition: border-color 0.16s, background 0.16s;
}

.h5-input::placeholder {
    color: #a9c2b6;
    letter-spacing: 0;
}

.h5-input:focus {
    border-color: var(--h5-green);
    background: #fff;
}

.h5-input.is-error {
    border-color: var(--h5-danger);
}

.h5-error {
    min-height: 20px;
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--h5-danger);
}

.h5-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    height: 50px;
    margin-top: 6px;
    border: none;
    border-radius: 999px;
    background: var(--h5-green);
    background: linear-gradient(135deg, color-mix(in srgb, var(--h5-green) 78%, white) 0%, var(--h5-green) 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(13, 191, 130, 0.28);
    transition: opacity 0.16s, transform 0.16s;
}

.h5-button-arrow {
    font-weight: 400;
}

.h5-button:active {
    transform: scale(0.99);
    opacity: 0.92;
}

.h5-button[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
}

.h5-button.is-ghost {
    background: #fff;
    color: var(--h5-green-dark);
    border: 1px solid var(--h5-green);
    box-shadow: none;
}

/* 协议勾选 */
.h5-agreement {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 14px 0 0;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--h5-text-sub);
    cursor: pointer;
}

.h5-agreement input {
    flex-shrink: 0;
    width: 15px;
    height: 15px;
    margin-top: 3px;
    accent-color: var(--h5-green);
}

.h5-agreement b {
    font-weight: 600;
    color: var(--h5-green-dark);
}

/* 协议链接（勾选行 + 确认弹窗内） */
.h5-agreement-link {
    color: var(--h5-green-dark);
    font-weight: 600;
    text-decoration: none;
}

.h5-confirm-terms {
    text-align: left;
}

.h5-button.is-ghost.is-plain {
    border-color: transparent;
    color: #9aa4b2;
    font-weight: 500;
}

/* 提示块 */
.h5-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 14px 0 0;
    padding: 11px 13px;
    border-radius: 12px;
    background: #ecfaf3;
    border: 1px solid #c9edda;
    color: var(--h5-green-ink);
    font-size: 12.5px;
    line-height: 1.65;
}

.h5-notice.is-blocked {
    margin: 0 0 16px;
    background: #fef1f1;
    border-color: #fbd5d5;
    color: #a5323a;
}

.h5-notice-icon {
    display: flex;
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--h5-green);
}

.h5-notice-icon svg {
    width: 16px;
    height: 16px;
}

/* 兑换步骤 */
.h5-steps {
    display: flex;
    align-items: stretch;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: none;
}

.h5-steps li {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2px;
    min-width: 0;
}

.h5-step-no {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    border-radius: 50%;
    background: linear-gradient(150deg, #12d894 0%, #09a86f 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    font-style: normal;
}

.h5-steps strong {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--h5-text);
    white-space: nowrap;
}

.h5-steps small {
    font-size: 10.5px;
    line-height: 1.5;
    color: var(--h5-text-sub);
}

.h5-step-arrow {
    flex: 0 0 auto !important;
    justify-content: center !important;
    padding-top: 26px;
    font-size: 18px;
    color: #9fd8bf;
}

/* 客服入口 */
.h5-service {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 16px 0;
    padding: 13px 16px;
    border-radius: 14px;
    background: #fff;
    color: var(--h5-text);
    text-decoration: none;
    font-size: 14px;
    box-shadow: 0 4px 14px rgba(10, 70, 45, 0.05);
}

.h5-service-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e6faf1;
    color: var(--h5-green-dark);
    flex-shrink: 0;
}

.h5-service-icon svg {
    width: 17px;
    height: 17px;
}

.h5-service-text strong {
    display: block;
    font-size: 13.5px;
}

.h5-service-text span {
    font-size: 11.5px;
    color: var(--h5-text-sub);
}

.h5-service-arrow {
    margin-left: auto;
    color: #b5cfc2;
    font-size: 18px;
}

/* 页脚 */
.h5-footer {
    padding: 22px 24px 12px;
    text-align: center;
    font-size: 12px;
    color: #8aa397;
    line-height: 1.8;
}

.h5-footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.h5-footer-brand .h5-brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

.h5-footer-brand .h5-brand-logo svg {
    width: 15px;
    height: 15px;
}

.h5-footer-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--h5-text);
}

.h5-footer-tags {
    margin: 6px 0 0;
    font-size: 11px;
    letter-spacing: 2px;
}

.h5-footer-tip {
    margin: 4px 0 0;
    font-size: 11.5px;
    color: var(--h5-text-sub);
}

.h5-footer-hint {
    margin: 10px 0 0;
    font-size: 11px;
    color: #9db8ab;
}

/* 拉起支付宝遮罩 */
.h5-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(13, 34, 24, 0.55);
}

.h5-overlay.is-open {
    display: flex;
}

.h5-dialog {
    position: relative;
    width: 100%;
    max-width: 340px;
    padding: 24px 20px;
    border-radius: 18px;
    background: #fff;
    text-align: center;
}

.h5-dialog-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f3f6f4;
    color: #65756d;
    font-size: 24px;
    line-height: 32px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.h5-dialog-close:active {
    background: #e7eeea;
}

.h5-dialog-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px;
    border-radius: 50%;
    background: #e6faf1;
    color: var(--h5-green-dark);
    font-size: 24px;
    line-height: 52px;
}

.h5-dialog-title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 600;
}

.h5-dialog-desc {
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--h5-text-sub);
    line-height: 1.7;
}

.h5-dialog .h5-button {
    margin-top: 10px;
}

.h5-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    vertical-align: -3px;
    animation: h5-spin 0.7s linear infinite;
}

@keyframes h5-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 窄屏微调 */
@media (max-width: 374px) {
    .h5-hero-title {
        font-size: 19px;
    }

    .h5-phone {
        flex-basis: 92px;
    }

    .h5-phone-body {
        width: 82px;
        height: 150px;
    }

    .h5-price-value {
        font-size: 38px;
    }

    .h5-benefits {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 12px 6px;
    }
}

/* 渠道主题色覆盖：旧 WebView 不支持 color-mix 时继续使用上面的默认静态色。 */
@supports (color: color-mix(in srgb, red 50%, white)) {
    body,
    .h5-page {
        background: color-mix(in srgb, var(--h5-green) 8%, white);
    }

    .h5-hero {
        background:
            radial-gradient(120% 90% at 85% 0%, color-mix(in srgb, var(--h5-green) 28%, transparent) 0%, transparent 55%),
            radial-gradient(90% 70% at 0% 100%, color-mix(in srgb, var(--h5-green) 16%, transparent) 0%, transparent 60%),
            linear-gradient(165deg, color-mix(in srgb, var(--h5-green) 24%, white) 0%, color-mix(in srgb, var(--h5-green) 10%, white) 58%, color-mix(in srgb, var(--h5-green) 6%, white) 100%);
    }

    .h5-brand-logo {
        background: linear-gradient(150deg, color-mix(in srgb, var(--h5-green) 42%, #111827) 0%, color-mix(in srgb, var(--h5-green) 68%, #111827) 100%);
        color: #fff;
    }

    .h5-feat-icon {
        background: linear-gradient(150deg, color-mix(in srgb, var(--h5-green) 76%, white) 0%, var(--h5-green) 100%);
    }

    .h5-benefit-icon,
    .h5-cycle-pill,
    .h5-notice,
    .h5-dialog-icon {
        background: color-mix(in srgb, var(--h5-green) 11%, white);
        border-color: color-mix(in srgb, var(--h5-green) 26%, white);
    }

    .h5-card {
        box-shadow: 0 8px 24px color-mix(in srgb, var(--h5-green) 10%, transparent);
    }

    .h5-input {
        background: color-mix(in srgb, var(--h5-green) 4%, white);
        border-color: color-mix(in srgb, var(--h5-green) 20%, white);
    }

    .h5-input-icon,
    .h5-input::placeholder {
        color: color-mix(in srgb, var(--h5-green) 42%, #9aa4b2);
    }

    .h5-step-no {
        background: var(--h5-green);
    }

    .h5-step-arrow {
        color: color-mix(in srgb, var(--h5-green) 55%, white);
    }
}
