/**
 * AiCart OS v6.11
 * Copyright (c) AiCart OS team. All rights reserved.
 */

/* ==================== 首页欢迎弹窗 ==================== */

.ux-hp {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ux-hp[hidden] { display: none; }
.ux-hp-mask {
    position: absolute;
    inset: 0;
    background: rgba(8, 13, 26, .62);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    animation: uxFadeIn .2s ease;
}
.ux-hp-box {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 900px;
    max-width: 100%;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    background: var(--card, #fff);
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius-lg, 18px);
    box-shadow: var(--shadow-lg, 0 24px 64px rgba(15, 23, 42, .22));
    animation: uxModalIn .28s cubic-bezier(.34, 1.3, .64, 1);
}
.ux-hp-box--noimg { grid-template-columns: minmax(0, 1fr); width: 520px; }
.ux-hp-media { position: relative; min-height: 320px; background: var(--bg, #f7f8fa); }
.ux-hp-media img,
.ux-hp-media a {
    display: block;
    width: 100%;
    height: 100%;
}
.ux-hp-media img {
    object-fit: cover;
    max-height: calc(100vh - 40px);
}
.ux-hp-body {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 44px 44px 36px;
    overflow-y: auto;
}
.ux-hp-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 10px;
    background: var(--bg, #f5f6f8);
    color: var(--muted, #667085);
    font-size: 16px;
    cursor: pointer;
    transition: all .2s ease;
    z-index: 2;
}
.ux-hp-close:hover { background: var(--primary-soft, #eef2ff); color: var(--primary, #2563eb); }
.ux-hp-title {
    margin: 0 0 10px;
    font-family: var(--font, inherit);
    font-size: 27px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--ink, #101828);
}
.ux-hp-sub {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--muted, #667085);
}
.ux-hp-locale {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}
.ux-hp-field { display: flex; flex-direction: column; gap: 6px; }
.ux-hp-field > label {
    font-size: 13px;
    font-weight: 700;
    color: var(--ink, #101828);
}
.ux-hp-field select {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    background: var(--bg, #fff);
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    font-family: var(--font, inherit);
    font-size: 14px;
    color: var(--ink, #101828);
    outline: none;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.ux-hp-field select:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 37, 99, 235), .15);
}

/* 发货地：复用账号地址管理可搜索下拉组件 */
.ux-hp .sselect { position: relative; }
.ux-hp .sselect-input {
    width: 100%;
    height: 46px;
    padding: 0 36px 0 14px;
    background: var(--bg, #fff);
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    font-family: var(--font, inherit);
    font-size: 14px;
    color: var(--ink, #101828);
    box-sizing: border-box;
    cursor: pointer;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.ux-hp .sselect-input:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 37, 99, 235), .15);
    cursor: text;
}
.ux-hp .sselect::after {
    content: "▾";
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted, #98a2b3);
    font-size: 12px;
    pointer-events: none;
}
.ux-hp .sselect-list {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    background: var(--card, #fff);
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
}
.ux-hp .sselect-list.open { display: block; }
.ux-hp .sselect-item {
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--ink, #101828);
    cursor: pointer;
}
.ux-hp .sselect-item:hover,
.ux-hp .sselect-item.active {
    background: var(--primary-soft, #eef2ff);
    color: var(--primary, #2563eb);
}
.ux-hp .sselect-empty { padding: 12px; color: var(--muted, #98a2b3); font-size: 12px; text-align: center; }

.ux-hp-coupons { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.ux-hp-coupons .ux-hp-coupon { margin-bottom: 0; }

.ux-hp-coupon {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--bg, #f7f8fa);
    border: 1px dashed var(--primary, #2563eb);
    border-radius: var(--radius, 10px);
}
.ux-hp-coupon-info { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; min-width: 0; flex: 1; }
.ux-hp-coupon-value { font-size: 18px; font-weight: 800; color: var(--primary, #2563eb); }
.ux-hp-coupon-name { font-size: 13px; font-weight: 600; color: var(--ink, #101828); }
.ux-hp-coupon-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    letter-spacing: .04em;
    color: var(--muted, #667085);
    word-break: break-all;
}
.ux-hp-copy,
.ux-hp-claim {
    flex: none;
    height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm, 8px);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .2s ease;
}
.ux-hp-copy { border: 1px solid var(--line, #e5e7eb); background: var(--card, #fff); color: var(--ink, #101828); }
.ux-hp-copy:hover { border-color: var(--primary, #2563eb); color: var(--primary, #2563eb); }
.ux-hp-claim { background: var(--primary, #2563eb); color: #fff; border: 1px solid var(--primary, #2563eb); }
.ux-hp-claim:hover { opacity: .88; }

.ux-hp-nl {
    padding: 14px 16px;
    margin-bottom: 16px;
    background: var(--bg, #f7f8fa);
    border-radius: var(--radius, 10px);
}
.ux-hp-nl h3 { margin: 0 0 4px; font-size: 15px; font-weight: 800; color: var(--ink, #101828); }
.ux-hp-nl p { margin: 0 0 10px; font-size: 13px; color: var(--muted, #667085); }
.ux-hp-nl-form { display: flex; gap: 8px; }
.ux-hp-nl-form input[type="email"] {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 12px;
    background: var(--card, #fff);
    border: 1px solid var(--line, #e5e7eb);
    border-radius: var(--radius-sm, 8px);
    font-size: 14px;
    color: var(--ink, #101828);
    outline: none;
}
.ux-hp-nl-form input[type="email"]:focus { border-color: var(--primary, #2563eb); }
.ux-hp-nl-form button {
    flex: none;
    height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: var(--radius-sm, 8px);
    background: var(--primary, #2563eb);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s ease;
}
.ux-hp-nl-form button:hover { opacity: .88; }
.ux-hp-nl-form button:disabled { opacity: .55; cursor: default; }
.ux-hp-hp { display: none !important; }
.ux-hp-nl-msg {
    margin-top: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #16a34a;
}
.ux-hp-nl-msg.err { color: #ef4444; }
.ux-hp-nl-msg[hidden] { display: none; }

.ux-hp-consents {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-bottom: 16px;
}
.ux-hp-check {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--muted, #667085);
    cursor: pointer;
}
.ux-hp-check input {
    flex: none;
    width: 16px;
    height: 16px;
    margin: 1px 0 0;
    accent-color: var(--primary, #2563eb);
    cursor: pointer;
}
.ux-hp-check a { color: var(--primary, #2563eb); text-decoration: underline; }

.ux-hp-error {
    margin-bottom: 12px;
    padding: 9px 12px;
    border-radius: var(--radius-sm, 8px);
    background: rgba(239, 68, 68, .1);
    color: #ef4444;
    font-size: 12px;
    font-weight: 600;
}
.ux-hp-error[hidden] { display: none; }

.ux-hp-confirm {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: var(--radius-sm, 8px);
    background: var(--ink, #101828);
    color: #fff;
    font-family: var(--font, inherit);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .02em;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.ux-hp-confirm:hover { background: var(--primary, #2563eb); transform: translateY(-1px); }
.ux-hp-caption {
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted, #667085);
}

.ux-hp-close:focus-visible,
.ux-hp-confirm:focus-visible,
.ux-hp-copy:focus-visible,
.ux-hp-claim:focus-visible,
.ux-hp-field select:focus-visible,
.ux-hp-check input:focus-visible {
    outline: 2px solid var(--primary, #2563eb);
    outline-offset: 2px;
}

body.ux-hp-lock { overflow: hidden; }

html[data-theme="dark"] .ux-hp-box { background: #1b2432; border-color: #2c3a4d; }
html[data-theme="dark"] .ux-hp-title,
html[data-theme="dark"] .ux-hp-field > label,
html[data-theme="dark"] .ux-hp-confirm { color: #e6edf7; }
html[data-theme="dark"] .ux-hp-confirm { background: #2c3a4d; }
html[data-theme="dark"] .ux-hp-confirm:hover { background: var(--primary, #2563eb); }
html[data-theme="dark"] .ux-hp-field select,
html[data-theme="dark"] .ux-hp-nl,
html[data-theme="dark"] .ux-hp-coupon,
html[data-theme="dark"] .ux-hp-nl-form input[type="email"] { background: #222d3d; border-color: #36455a; color: #e6edf7; }
html[data-theme="dark"] .ux-hp-close { background: #222d3d; color: #9fb0c5; }
html[data-theme="dark"] .ux-hp .sselect-input,
html[data-theme="dark"] .ux-hp .sselect-list { background: #222d3d; border-color: #36455a; color: #e6edf7; }
html[data-theme="dark"] .ux-hp .sselect-item { color: #e6edf7; }
html[data-theme="dark"] .ux-hp .sselect-item:hover,
html[data-theme="dark"] .ux-hp .sselect-item.active { background: #2b3a4e; color: #fff; }

@media (max-width: 820px) {
    .ux-hp { align-items: flex-end; padding: 0; }
    .ux-hp-box,
    .ux-hp-box--noimg {
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        max-width: 100%;
        max-height: calc(100vh - 24px);
        border-radius: 20px 20px 0 0;
        animation: uxHpSheet .28s cubic-bezier(.32, .72, .24, 1);
    }
    .ux-hp-box::before {
        content: '';
        position: absolute;
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        border-radius: 4px;
        background: #e4e7ec;
        z-index: 3;
    }
    .ux-hp-media { min-height: 0; max-height: 200px; }
    .ux-hp-media img { height: 200px; max-height: 200px; }
    .ux-hp-body { padding: 30px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
    .ux-hp-title { font-size: 22px; }
    .ux-hp-close { top: 12px; right: 14px; }
}
@keyframes uxHpSheet { from { transform: translateY(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
    .ux-hp-box { animation: none; }
    .ux-hp-confirm { transition: none; }
}
