:root {
    --brand: #ff5a3c;
    --brand-dark: #e0432a;
    --brand-soft: #fff2ee;
    --text: #22262e;
    --muted: #7c8593;
    --line: #eceff3;
    --bg: #f4f5f7;
    --card: #ffffff;
    --radius: 16px;
    --shadow: 0 8px 24px rgba(24, 32, 48, .06);
    --shadow-sm: 0 2px 8px rgba(24, 32, 48, .05);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

body.no-scroll {
    overflow: hidden;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

input,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    outline: none;
}

.wrap {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 14px;
}

.is-hidden {
    display: none !important;
}

/* ============ 顶部 ============ */
.site-header {
    background: linear-gradient(118deg, #ff7d5c 0%, #ff5137 55%, #f53a29 100%);
    color: #fff;
    padding: 18px 0 26px;
    box-shadow: 0 6px 18px rgba(245, 58, 41, .18);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.logo-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 13px;
    background: rgba(255, 255, 255, .22);
    border: 1px solid rgba(255, 255, 255, .32);
    display: grid;
    place-items: center;
    font-size: 20px;
    font-weight: 700;
}

.logo-text {
    display: flex;
    flex-direction: column;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.25;
    min-width: 0;
}

.logo-text em {
    font-style: normal;
    font-size: 11px;
    font-weight: 400;
    opacity: .88;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-badge {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .38);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
}

/* ============ 主区域 ============ */
.main {
    padding-bottom: 30px;
}

.panel {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 16px 6px;
    margin-top: -14px;
    position: relative;
}

.panel-head,
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.panel-head h2,
.section-head h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.panel-sub,
.section-sub {
    font-size: 12px;
    color: var(--muted);
}

.notice-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.notice-list li {
    padding: 12px 0;
    border-top: 1px dashed var(--line);
}

.notice-list li:first-child {
    border-top: 0;
    padding-top: 2px;
}

.notice-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.notice-date {
    flex: 0 0 auto;
    font-size: 11px;
    color: var(--brand);
    background: var(--brand-soft);
    border-radius: 6px;
    padding: 2px 7px;
    font-variant-numeric: tabular-nums;
}

.notice-title {
    font-size: 14px;
    font-weight: 600;
}

.notice-text {
    margin: 0;
    color: #58606d;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}

.notice-empty {
    margin: 4px 0 14px;
    color: var(--muted);
    font-size: 13px;
}

/* ============ 分类 ============ */
.cat-section {
    margin: 14px 0 8px;
}

.cat-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.cat-scroll::-webkit-scrollbar {
    display: none;
}

.cat-btn {
    flex: 0 0 auto;
    padding: 8px 16px;
    border-radius: 999px;
    background: #fff;
    color: #4b5462;
    font-size: 13px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: all .16s;
    white-space: nowrap;
}

.cat-btn.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 6px 14px rgba(255, 90, 60, .26);
}

/* ============ 商品 ============ */
.product-section {
    margin-top: 12px;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: transform .16s, box-shadow .16s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(24, 32, 48, .1);
}

.card-img {
    position: relative;
    aspect-ratio: 1 / 1;
    background: #f7f8fa;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-ph {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #fff0eb, #ffe3d9 70%, #ffd8ca);
}

.img-ph span {
    font-size: 34px;
    font-weight: 700;
    color: #ff8f78;
}

.card-tag {
    position: absolute;
    left: 8px;
    top: 8px;
    font-size: 11px;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: #5a6270;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}

.soldout {
    position: absolute;
    right: 8px;
    top: 8px;
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 6px;
    background: rgba(34, 38, 46, .78);
    color: #fff;
}

.card-body {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.card-name {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 18px;
}

.card-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    margin-top: auto;
}

.price {
    color: var(--brand);
    font-weight: 700;
    display: inline-flex;
    align-items: baseline;
    gap: 1px;
}

.price i {
    font-style: normal;
    font-size: 12px;
}

.price em {
    font-style: normal;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
}

.stock {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

.btn-buy {
    margin-top: 4px;
    height: 36px;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    transition: background .16s;
}

.btn-buy:hover {
    background: var(--brand-dark);
}

.btn-buy.is-disabled,
.btn-buy[disabled] {
    background: #dfe3e9;
    color: #97a0ae;
    cursor: not-allowed;
}

.empty-block {
    background: var(--card);
    border-radius: var(--radius);
    padding: 44px 16px;
    text-align: center;
    color: var(--muted);
    box-shadow: var(--shadow);
}

.empty-block p {
    margin: 0;
}

.load-more {
    display: flex;
    justify-content: center;
    padding: 18px 0 6px;
}

.btn-load {
    min-width: 150px;
    height: 40px;
    padding: 0 22px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: #4b5462;
    font-size: 13px;
    box-shadow: var(--shadow-sm);
}

.btn-load:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.btn-load:disabled {
    color: var(--muted);
    cursor: default;
    border-color: var(--line);
}

/* ============ 弹窗 ============ */
.modal-mask {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(16, 20, 28, .52);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    backdrop-filter: blur(2px);
}

.modal-mask[hidden] {
    display: none;
}

.modal {
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -8px 40px rgba(16, 24, 40, .22);
    animation: slideUp .2s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(18px);
        opacity: .6;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 10px;
    border-bottom: 1px solid var(--line);
}

.modal-head h3 {
    margin: 0;
    font-size: 16px;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: var(--muted);
    background: #f4f5f7;
}

.modal-body {
    padding: 14px 18px 20px;
}

.order-product {
    display: flex;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    background: #fafbfc;
    border: 1px solid var(--line);
}

.op-img {
    width: 62px;
    height: 62px;
    flex: 0 0 62px;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #fff0eb, #ffd8ca);
    display: grid;
    place-items: center;
    color: #ff8f78;
    font-size: 22px;
    font-weight: 700;
}

.op-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.op-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    justify-content: center;
}

.op-info strong {
    font-size: 14px;
    line-height: 1.4;
}

.op-price {
    font-size: 12px;
    color: var(--brand);
}

.op-stock {
    font-size: 12px;
    color: var(--muted);
}

.qty-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 2px 10px;
    font-size: 13px;
    color: #4b5462;
}

.qty-box {
    display: flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.qty-box button {
    width: 34px;
    height: 32px;
    font-size: 16px;
    color: #4b5462;
    background: #fafbfc;
}

.qty-box button:active {
    background: #f0f2f5;
}

.qty-box input {
    width: 46px;
    height: 32px;
    text-align: center;
    border: 0;
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: #fff;
    font-variant-numeric: tabular-nums;
}

.field {
    display: block;
    margin-bottom: 12px;
}

.field > span {
    display: block;
    font-size: 12px;
    color: #5a6270;
    margin-bottom: 5px;
}

.field > span i {
    color: var(--brand);
    font-style: normal;
}

.field input,
.field textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fafbfc;
    padding: 9px 11px;
    font-size: 14px;
    transition: border-color .16s, background .16s;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    border-color: var(--brand);
    background: #fff;
}

.modal-sum {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 12px 2px;
    font-size: 13px;
    color: #4b5462;
}

.modal-sum b {
    color: var(--brand);
    font-size: 20px;
    font-variant-numeric: tabular-nums;
}

.modal-sum b em {
    font-style: normal;
}

.btn-submit {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(120deg, #ff7554, #ff4c30);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(255, 76, 48, .28);
}

.btn-submit:disabled {
    opacity: .7;
    cursor: default;
}

/* ============ 扫码支付弹窗 ============ */
.qr-modal {
    max-width: 360px;
}

.qr-body {
    text-align: center;
    padding: 16px 18px 20px;
}

.qr-product {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qr-amount {
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--muted);
}

.qr-amount em {
    font-style: normal;
    font-size: 16px;
    font-weight: 700;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
}

.qr-img {
    display: flex;
    justify-content: center;
    padding: 10px;
    border-radius: 14px;
    background: #fafbfc;
    border: 1px solid var(--line);
}

.qr-img img {
    width: 100%;
    max-width: 240px;
    height: auto;
    border-radius: 6px;
}

.qr-tip {
    margin: 12px 0 14px;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

.btn-qr-close {
    width: 100%;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #fff;
    color: #4b5462;
    font-size: 14px;
}

.btn-qr-close:hover {
    border-color: var(--brand);
    color: var(--brand);
}

/* ============ toast ============ */
.toast {
    position: fixed;
    left: 50%;
    bottom: 84px;
    transform: translate(-50%, 8px);
    z-index: 90;
    max-width: 80vw;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(28, 32, 40, .92);
    color: #fff;
    font-size: 13px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* ============ 收银台 ============ */
.pay-body {
    background: var(--bg);
}

.pay-main {
    padding-top: 16px;
    padding-bottom: 40px;
    max-width: 560px;
}

.pay-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 20px 18px 22px;
}

.pay-card-head h1 {
    margin: 0 0 4px;
    font-size: 18px;
}

.pay-no {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    word-break: break-all;
}

.pay-amount {
    margin: 16px 0 8px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 16px;
    border-radius: 14px;
    background: linear-gradient(120deg, #fff5f1, #ffece5);
    border: 1px solid #ffe1d6;
}

.pay-amount span {
    font-size: 13px;
    color: #8a6270;
}

.pay-amount strong {
    color: var(--brand);
    font-size: 30px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.pay-amount strong i {
    font-style: normal;
    font-size: 16px;
    margin-right: 2px;
}

.pay-amount strong em {
    font-style: normal;
}

.pay-status {
    display: inline-block;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.pay-status.wait {
    background: #fff7e6;
    color: #b7791f;
}

.pay-status.done {
    background: #e8f7ee;
    color: #1f8a4c;
}

.pay-status.cancel {
    background: #f2f3f5;
    color: #828b99;
}

.pay-items {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 4px 12px;
    margin-bottom: 14px;
}

.pay-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 0;
    border-top: 1px dashed var(--line);
    font-size: 13px;
}

.pay-item:first-child {
    border-top: 0;
}

.pi-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pi-qty {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
}

.pi-sub {
    font-weight: 600;
    color: var(--brand);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pay-info {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
}

.pay-info li {
    display: flex;
    gap: 10px;
    padding: 7px 0;
    font-size: 13px;
    border-bottom: 1px dashed var(--line);
}

.pay-info li:last-child {
    border-bottom: 0;
}

.pay-info span {
    flex: 0 0 66px;
    color: var(--muted);
    font-size: 12px;
}

.pay-info b {
    font-weight: 500;
    word-break: break-word;
}

.pay-actions {
    margin-bottom: 4px;
}

.btn-pay {
    width: 100%;
    height: 46px;
    border-radius: 13px;
    background: linear-gradient(120deg, #ff7554, #ff4c30);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(255, 76, 48, .26);
}

.btn-pay:disabled {
    opacity: .72;
    cursor: default;
}

.pay-btns {
    display: grid;
    gap: 10px;
    margin-bottom: 4px;
}

.pay-btns form {
    margin: 0;
}

.btn-pay.wx {
    background: linear-gradient(120deg, #3ecf6b, #1faa4e);
    box-shadow: 0 10px 20px rgba(31, 170, 78, .26);
}

.jump-card {
    text-align: center;
}

.pay-jumping {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 0 10px;
    font-size: 15px;
    color: #4b5462;
}

.jump-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--brand);
    animation: jumpPulse 1s ease-in-out infinite;
}

@keyframes jumpPulse {
    0%, 100% {
        opacity: .3;
        transform: scale(.8);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.pay-tip {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
    text-align: center;
}

.btn-back {
    display: block;
    text-align: center;
    margin-top: 16px;
    height: 42px;
    line-height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    color: #4b5462;
    font-size: 13px;
}

/* ============ 桌面端 ============ */
@media (min-width: 640px) {
    .wrap {
        padding: 0 20px;
    }

    .site-header {
        padding: 22px 0 34px;
    }

    .logo-mark {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        font-size: 22px;
    }

    .logo-text {
        font-size: 21px;
    }

    .panel {
        padding: 20px 22px 8px;
        margin-top: -18px;
    }

    .cat-section {
        margin-top: 18px;
    }

    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }

    .modal-mask {
        align-items: center;
        padding: 24px;
    }

    .modal {
        border-radius: 18px;
        box-shadow: 0 24px 60px rgba(16, 24, 40, .3);
    }

    .pay-main {
        padding-top: 26px;
    }

    .pay-card {
        padding: 26px 26px 28px;
    }
}

@media (min-width: 960px) {
    .product-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
    }

    .card-body {
        padding: 12px 14px 14px;
    }

    .cat-btn {
        font-size: 14px;
        padding: 9px 20px;
    }
}
