/* 遮罩：仅首页注入本文件；display:none 时不参与布局 */
.hp-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
        max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
}

.hp-overlay .hp-dialog {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    max-width: 760px;
    width: 100%;
    min-height: 320px;
    max-height: min(92vh, 100dvh);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.28);
    background: #fff;
}

/* 左侧图片区（PC） */
.hp-overlay .hp-media {
    flex: 0 0 42%;
    max-width: 320px;
    min-height: 320px;
    background: #e8e4df;
    aspect-ratio: 4 / 5;
}

.hp-overlay .hp-media--empty {
    display: none !important;
}

.hp-overlay .hp-media img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    display: block;
}

/* 右侧内容区 */
.hp-overlay .hp-panel {
    flex: 1;
    min-width: 0;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 44px 28px 32px;
    background: #947b63;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.hp-close {
    position: absolute;
    top: max(8px, env(safe-area-inset-top, 0px));
    right: max(8px, env(safe-area-inset-right, 0px));
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    color: #374151;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hp-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.hp-logo {
    margin-bottom: 16px;
}

.hp-logo img {
    max-height: 40px;
    width: auto;
    height: auto;
    display: inline-block;
}

.hp-title {
    font-size: clamp(1.125rem, 2.8vw, 1.5rem);
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0 0 12px;
    max-width: 100%;
}

.hp-subtitle {
    font-size: clamp(0.875rem, 2.2vw, 0.9375rem);
    color: #1f2937;
    line-height: 1.5;
    margin: 0 0 20px;
    max-width: 100%;
}

.hp-form {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.hp-email-group {
    width: 100%;
}

.hp-email-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    padding: 12px 14px;
    font-size: 16px; /* 避免 iOS 聚焦时自动放大 */
    background: #fff;
}

.hp-email-input:focus {
    outline: none;
    border-color: rgba(29, 78, 216, 0.5);
    box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}

.hp-cta-btn {
    width: 100%;
    min-height: 44px;
    border: none;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: #000000;
    cursor: pointer;
}

.hp-cta-btn:hover {
    background: #152a45;
}

.hp-cta-btn--busy {
    opacity: 0.75;
    pointer-events: none;
}

.hp-form-error {
    width: 100%;
    max-width: 320px;
    margin: 4px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: #b91c1c;
    text-align: center;
}

.hp-step--success {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.hp-success-title {
    font-size: clamp(1.125rem, 2.8vw, 1.4rem);
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0;
    max-width: 100%;
}

.hp-success-subtitle {
    font-size: clamp(0.9rem, 2.2vw, 1rem);
    color: #374151;
    line-height: 1.45;
    margin: 0;
    max-width: 100%;
}

.hp-success-body {
    font-size: 0.9375rem;
    color: #1f2937;
    line-height: 1.55;
    margin: 0;
    max-width: 100%;
}

.hp-code-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    margin-top: 4px;
    box-sizing: border-box;
}

.hp-code {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.06em;
    color: #000000;
    text-align: center;
    box-sizing: border-box;
}

.hp-copy-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-height: 48px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #000000;
    background: #fff;
    color: #000000;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    box-sizing: border-box;
}

.hp-copy-btn:hover {
    background: rgba(30, 58, 95, 0.06);
}

/* 与上一页「提交 / 发券」主按钮 .hp-cta-btn 同色 */
.hp-success-cta {
    width: 100%;
    max-width: 320px;
    min-height: 44px;
    margin-top: 4px;
    padding: 12px 16px;
    border-radius: 8px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    color: #fff;
    background: #000000;
    cursor: pointer;
    box-sizing: border-box;
}

.hp-success-cta:hover {
    background: #152a45;
    color: #fff;
}

.hp-cancel {
    margin-top: 14px;
    padding: 10px 8px;
    min-height: 44px;
    border: none;
    background: none;
    font-size: 13px;
    color: #000000;
    text-decoration: underline;
    cursor: pointer;
}

.hp-no-scroll {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .hp-overlay .hp-dialog {
        transition: none;
    }
}

/* 无表单：仅文案/图 — Blade 已不输出表单，此处仅收紧右栏留白 */
.hp-overlay.hp--no-form .hp-panel.hp-panel--no-form {
    justify-content: center;
    padding-top: 48px;
    padding-bottom: 40px;
}

.hp-overlay.hp--no-form .hp-panel.hp-panel--no-form .hp-title:last-child,
.hp-overlay.hp--no-form .hp-panel.hp-panel--no-form .hp-subtitle:last-child {
    margin-bottom: 0;
}

/* 无左侧图 */
.hp-dialog--no-media .hp-panel {
    border-radius: 12px;
}

/* 移动端：不展示左侧大图，仅右侧内容区（与 PC 左侧图二选一，省流量与屏高） */
@media (max-width: 768px) {
    .hp-overlay .hp-dialog {
        flex-direction: column;
        max-width: 100%;
        min-height: 0;
        max-height: min(94dvh, 100vh);
    }

    .hp-overlay .hp-media {
        display: none !important;
    }

    .hp-overlay .hp-panel {
        flex: 1 1 auto;
        width: 100%;
        border-radius: 12px;
        padding: max(36px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
        min-height: min(280px, 60dvh);
    }

    .hp-close {
        top: max(4px, env(safe-area-inset-top, 0px));
        right: max(4px, env(safe-area-inset-right, 0px));
    }
}
