:root {
    --paper: #f6f7f2;
    --surface: #ffffff;
    --ink: #111820;
    --muted: #68717e;
    --line: rgba(17, 24, 32, .1);
    --coral: #ff4f3f;
    --blue: #1d69d8;
    --mint: #1fbf8f;
    --lemon: #d9ff4a;
    --shadow: 0 18px 42px rgba(25, 31, 40, .12);
    --soft-shadow: 0 10px 28px rgba(25, 31, 40, .08);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body.shop-page,
body.checkout-page {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(255,255,255,.55) 0, rgba(255,255,255,0) 240px),
        var(--paper);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}
button,
input,
select,
textarea { font: inherit; }
button { letter-spacing: 0; }
a,
a:hover,
a:focus { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.shop-shell {
    width: min(100%, 440px);
    margin: 0 auto;
    padding: 16px 14px 98px;
}

.shop-hero {
    position: relative;
    z-index: 30;
    padding: 4px 0 14px;
}
.brand-block { min-width: 0; }
.shop-kicker,
.section-head span,
.section-title span {
    color: var(--blue);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .12em;
}
.shop-hero h1 {
    margin: 4px 0 0;
    font-size: 32px;
    line-height: 1.05;
    font-weight: 950;
}
.shop-hero p {
    max-width: 270px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.featured-swiper {
    position: relative;
    z-index: 1;
    aspect-ratio: 1920 / 900;
    height: auto;
    overflow: hidden;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(25, 31, 40, .08);
}
.hero-product {
    position: relative;
    display: grid;
    place-items: center;
    height: 100%;
    overflow: hidden;
    background: #fff;
}
.hero-product img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.featured-swiper .swiper-pagination {
    bottom: 8px;
}
.swiper-pagination-bullet {
    width: 6px;
    height: 6px;
    background: rgba(17,24,32,.28);
    opacity: 1;
}
.swiper-pagination-bullet-active {
    width: 18px;
    border-radius: 99px;
    background: var(--ink);
}

.section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 2px 12px;
}
.section-head h2,
.section-title h2 {
    margin: 3px 0 0;
    font-size: 22px;
    line-height: 1.15;
    font-weight: 950;
}
.section-head em {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
}

.product-waterfall {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.product-card {
    display: block;
    overflow: hidden;
    border: 1px solid rgba(17,24,32,.06);
    border-radius: 18px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 12px 30px rgba(25,31,40,.08);
}
.product-card:nth-child(3n + 2) { transform: translateY(10px); }
.product-cover {
    position: relative;
    aspect-ratio: 1 / 1.16;
    overflow: hidden;
    background: #e9edf0;
}
.product-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.product-card:hover .product-cover img { transform: scale(1.035); }
.product-cover span {
    position: absolute;
    top: 9px;
    left: 9px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    max-width: calc(100% - 18px);
    min-height: 24px;
    padding: 0 8px;
    border-radius: 99px;
    background: rgba(255,255,255,.92);
    color: var(--coral);
    font-size: 11px;
    font-weight: 950;
    white-space: nowrap;
}
.product-info { padding: 11px 11px 12px; }
.product-info h3 {
    display: -webkit-box;
    min-height: 40px;
    margin: 0;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 15px;
    line-height: 1.34;
    font-weight: 950;
}
.product-info p {
    display: -webkit-box;
    min-height: 34px;
    margin: 6px 0 10px;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.42;
}
.price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}
.price-row strong,
.detail-price strong {
    color: var(--coral);
    font-size: 21px;
    line-height: 1;
    font-weight: 950;
}
.price-row del,
.detail-price del {
    color: #a5adba;
    font-size: 12px;
}
.product-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 12px;
}
.product-foot span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-foot i {
    display: grid;
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 15px;
}
.empty-state {
    padding: 46px 18px;
    border: 1px dashed rgba(17,24,32,.16);
    border-radius: 18px;
    background: rgba(255,255,255,.75);
    color: var(--muted);
    text-align: center;
}

.detail-topbar {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -2px -4px 12px;
    padding: 6px 0;
}
.detail-topbar a,
.detail-topbar > em {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    box-shadow: var(--soft-shadow);
    color: #253044;
    font-size: 21px;
}
.detail-topbar > em {
    visibility: hidden;
}
.detail-topbar span {
    font-size: 15px;
    font-weight: 950;
}
.detail-gallery {
    height: 386px;
    overflow: hidden;
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow);
}
.detail-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-card,
.detail-content {
    margin-top: 14px;
    padding: 17px;
    border: 1px solid rgba(17,24,32,.06);
    border-radius: 20px;
    background: rgba(255,255,255,.95);
    box-shadow: 0 12px 30px rgba(25,31,40,.07);
}
.detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}
.detail-meta span:first-child {
    color: var(--coral);
    font-weight: 900;
}
.detail-card h1 {
    margin: 12px 0 8px;
    font-size: 24px;
    line-height: 1.18;
    font-weight: 950;
}
.subtitle {
    margin: 0 0 13px;
    color: #5f6a78;
    line-height: 1.62;
}
.detail-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.service-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}
.service-row span {
    display: grid;
    min-height: 64px;
    gap: 4px;
    place-items: center;
    padding: 9px 5px;
    border-radius: 14px;
    background: #f4f6f8;
    color: #5f6a78;
    font-size: 11px;
    line-height: 1.25;
    text-align: center;
}
.service-row i { color: var(--mint); font-size: 18px; }
.content-body {
    color: #26313f;
    font-size: 14px;
    line-height: 1.8;
}
.content-body img {
    width: 100%;
    height: auto;
    border-radius: 14px;
}
.buy-bar {
    position: fixed;
    left: 50%;
    bottom: 14px;
    z-index: 20;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 10px;
    width: min(410px, calc(100% - 28px));
    transform: translateX(-50%);
    padding: 9px;
    border: 1px solid rgba(255,255,255,.62);
    border-radius: 20px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 18px 42px rgba(25,31,40,.18);
    backdrop-filter: blur(18px);
}
.buy-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 14px;
    background: #f1f3f5;
    color: #566274;
    font-size: 12px;
    font-weight: 900;
}
.buy-button {
    display: grid;
    min-width: 0;
    height: 48px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--coral), #f02462);
    box-shadow: 0 12px 24px rgba(255,79,63,.28);
    font-size: 16px;
    font-weight: 950;
}

.checkout-page {
    background:
        linear-gradient(180deg, #f7f8fb 0, #eef1f4 100%);
    color: var(--ink);
}
.ecpay-shell {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 24px 12px 54px;
}
.ecpay-card {
    min-height: 760px;
    padding: 18px 22px 32px;
    border: 1px solid rgba(17,24,32,.08);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--soft-shadow);
}
.ecpay-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    align-items: center;
    gap: 10px;
}
.ecpay-head a {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: #4c5563;
    font-size: 20px;
}
.ecpay-head em {
    display: block;
    width: 42px;
    height: 38px;
}
.ecpay-head h1 {
    margin: 0;
    text-align: center;
    font-size: 18px;
    font-weight: 950;
}
.checkout-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    margin: 18px 0 16px;
    padding: 14px;
    border-radius: 16px;
    background:
        linear-gradient(135deg, #121922 0%, #263141 62%, #1d69d8 100%);
    color: #fff;
}
.checkout-product-mini {
    display: flex;
    gap: 11px;
    min-width: 0;
    align-items: center;
}
.checkout-product-mini img {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 12px;
    object-fit: cover;
}
.checkout-product-mini strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 14px;
    line-height: 1.3;
}
.checkout-product-mini em,
.checkout-total span {
    display: block;
    margin-top: 4px;
    color: rgba(255,255,255,.72);
    font-style: normal;
    font-size: 12px;
}
.checkout-total { text-align: right; }
.checkout-total strong {
    display: block;
    margin-top: 3px;
    font-size: 24px;
    line-height: 1;
    font-weight: 950;
}
.method-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}
.method-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid #d9dee5;
    border-radius: 10px;
    background: #fff;
    color: #303741;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    white-space: nowrap;
}
.method-tabs button.active {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}
.ecpay-rule {
    height: 3px;
    margin: 14px 0;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--ink), var(--blue), var(--mint));
}
.ecpay-notice {
    margin-bottom: 14px;
    padding: 9px 11px;
    border: 1px solid #dcebf7;
    border-radius: 10px;
    background: #f5fbff;
    color: #276f9e;
    font-size: 12px;
    line-height: 1.5;
}
.ecpay-notice b {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border-radius: 6px;
    background: #e6f3ff;
    color: #1f72aa;
}
.ecpay-layout {
    display: block;
}
.ecpay-form {
    padding-right: 0;
    border-right: 0;
}
.ecpay-form section { margin-bottom: 18px; }
.ecpay-form h2,
.ecpay-side h2 {
    margin: 12px 0 14px;
    color: #176b9e;
    font-size: 16px;
    font-weight: 950;
}
.brand-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}
.brand-row strong {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border: 1px solid #d8e3f4;
    border-radius: 8px;
    background: #f8fbff;
    color: #1554b7;
    font-size: 12px;
    font-weight: 950;
}
.pay-field {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.pay-field.compact {
    grid-template-columns: 132px 76px 76px minmax(0, 1fr);
}
.pay-field label {
    margin: 0;
    color: #323b47;
    font-size: 14px;
    font-weight: 700;
}
.pay-field em {
    color: var(--coral);
    font-style: normal;
}
.pay-field input,
.pay-field select,
.pay-field textarea {
    width: 100%;
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid #dce2e8;
    border-radius: 9px;
    background: #fff;
    color: #222b36;
    outline: none;
    font-size: 13px;
}
.pay-field textarea { resize: vertical; }
.pay-field input:focus,
.pay-field select:focus,
.pay-field textarea:focus {
    border-color: #75a9d7;
    box-shadow: 0 0 0 3px rgba(29,105,216,.1);
}
.pay-field small {
    display: block;
    margin-top: 6px;
    color: #2a86b4;
    font-size: 12px;
    line-height: 1.45;
}
.card-split {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}
.cvv-input { max-width: 150px; }
.method-panel { display: none; }
.method-panel.active { display: block; }
.bank-step { display: none; }
.bank-step.active { display: block; }
.bank-card-preview,
.bank-confirm-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid #dfe8f2;
    border-radius: 14px;
    background: linear-gradient(135deg, #fbfdff, #f2f8fb);
}
.bank-card-preview i,
.bank-confirm-box i {
    display: grid;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 15px;
    background: var(--ink);
    color: #fff;
    font-size: 25px;
}
.bank-card-preview strong,
.bank-confirm-box strong {
    display: block;
    color: #1f2b3a;
    font-size: 15px;
    font-weight: 950;
}
.bank-card-preview p,
.bank-confirm-box p {
    margin: 4px 0 0;
    color: #687684;
    font-size: 12px;
    line-height: 1.55;
}
.bank-confirm-box {
    display: grid;
    justify-items: center;
    min-height: 220px;
    text-align: center;
}
.bank-confirm-box i {
    background: linear-gradient(135deg, var(--mint), #45d9aa);
}
.bank-confirm-box p {
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}
.bank-confirm-field {
    width: min(100%, 360px);
    margin: 6px auto 0;
    text-align: left;
}
.bank-confirm-field label {
    width: auto;
    margin: 0 0 8px;
}
.bank-confirm-field input {
    width: 100%;
}
.bank-next,
.bank-back {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-weight: 950;
}
.bank-next {
    width: 180px;
    margin-left: 132px;
    background: var(--ink);
    color: #fff;
}
.bank-back {
    margin-top: 10px;
    padding: 0 18px;
    background: #e9eef4;
    color: #304052;
}
.pay-field input.is-invalid,
.pay-field textarea.is-invalid,
.pay-field select.is-invalid {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(255,79,63,.12);
}
.wallet-box {
    display: grid;
    place-items: center;
    min-height: 190px;
    padding: 24px;
    border: 1px solid #e4e8ef;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfcfe, #f2f6f9);
    text-align: center;
}
.wallet-box i,
.wallet-box span {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    border-radius: 18px;
    background: #111;
    color: #fff;
    font-size: 34px;
}
.wallet-box.green span {
    background: var(--mint);
    font-weight: 950;
}
.wallet-box strong {
    margin-top: 12px;
    font-size: 18px;
}
.wallet-box p {
    max-width: 380px;
    margin: 8px auto 0;
    color: #6c7888;
    line-height: 1.6;
}
.remember-line {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 14px 132px;
    color: #424d5b;
    font-weight: 600;
}
.ecpay-submit {
    display: block;
    width: 270px;
    min-height: 44px;
    margin: 20px 0 0 132px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--ink), #334255);
    color: #fff;
    box-shadow: 0 12px 22px rgba(17,24,32,.18);
    font-size: 15px;
    font-weight: 950;
    cursor: pointer;
}
.ecpay-side { text-align: center; }
.qr-box {
    position: relative;
    width: 174px;
    height: 174px;
    margin: 18px auto;
    border: 10px solid #fff;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(25,31,40,.1);
    background:
        repeating-linear-gradient(90deg, #111 0 5px, #fff 5px 10px),
        repeating-linear-gradient(0deg, rgba(0,0,0,.68) 0 5px, transparent 5px 10px);
    background-blend-mode: multiply;
}
.qr-box span {
    position: absolute;
    left: 50%;
    top: 50%;
    display: grid;
    width: 52px;
    height: 52px;
    transform: translate(-50%, -50%);
    place-items: center;
    border-radius: 12px;
    background: var(--mint);
    color: #fff;
    font-size: 28px;
    font-weight: 950;
}
.ecpay-side p {
    color: #3c9d67;
    line-height: 1.6;
}
.checkout-product {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    padding: 12px;
    border: 1px solid #e4e8ef;
    border-radius: 12px;
    background: #fff;
    text-align: left;
}
.checkout-product img {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 10px;
}
.checkout-product strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 13px;
    line-height: 1.35;
}
.checkout-product em {
    display: block;
    margin-top: 5px;
    color: var(--coral);
    font-style: normal;
    font-weight: 950;
}

.success-card {
    width: min(420px, calc(100% - 32px));
    margin: 86px auto 0;
    padding: 38px 24px;
    border: 1px solid rgba(17,24,32,.06);
    border-radius: 24px;
    background: rgba(255,255,255,.94);
    box-shadow: var(--shadow);
    text-align: center;
}
.success-mark {
    display: grid;
    width: 74px;
    height: 74px;
    margin: 0 auto 18px;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, var(--mint), #45d9aa);
    box-shadow: 0 14px 28px rgba(31,191,143,.28);
    font-size: 42px;
}
.success-card h1 {
    margin: 0 0 10px;
    font-size: 25px;
    font-weight: 950;
}
.success-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}
.success-card a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding: 0 30px;
    border-radius: 14px;
    color: #fff;
    background: var(--ink);
    font-weight: 950;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *:before,
    *:after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 720px) {
    .ecpay-shell { padding: 0; }
    .ecpay-card {
        min-height: 100vh;
        padding: 14px 12px 28px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
    .ecpay-head { grid-template-columns: 40px minmax(0, 1fr) 40px; }
    .ecpay-head h1 { font-size: 17px; }
    .checkout-hero {
        grid-template-columns: 1fr;
    }
    .checkout-total {
        text-align: left;
        padding-top: 2px;
    }
    .method-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
        gap: 6px;
    }
    .method-tabs button {
        min-height: 42px;
        padding: 0 5px;
        font-size: 12px;
    }
    .ecpay-layout { grid-template-columns: 1fr; }
    .ecpay-form {
        padding-right: 0;
        border-right: 0;
    }
    .ecpay-side { display: none; }
    .pay-field,
    .pay-field.compact {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .remember-line,
    .ecpay-submit,
    .bank-next {
        width: 100%;
        margin-left: 0;
    }
    .bank-card-preview {
        align-items: flex-start;
    }
}

@media (max-width: 420px) {
    .shop-shell { padding-left: 12px; padding-right: 12px; }
    .shop-hero h1 { font-size: 29px; }
    .shop-hero p { max-width: 235px; }
    .product-waterfall { gap: 10px; }
    .product-card:nth-child(3n + 2) { transform: translateY(8px); }
    .detail-gallery { height: 360px; }
    .service-row { gap: 6px; }
    .service-row span { font-size: 10px; }
}

@media (max-width: 360px) {
    .product-info h3 { font-size: 14px; }
    .price-row strong { font-size: 18px; }
    .method-tabs { grid-template-columns: 1fr; }
}
