:root {
    --bg-start: #f7fbff;
    --bg-end: #eef7ff;
    --text: #1f3651;
    --muted: #6c87a5;
    --line: #d7ebfb;
    --primary-a: #5aa8e8;
    --primary-b: #2a7abf;
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100%;
    background: linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
    color: var(--text);
    font-size: 15px;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button,
input,
textarea,
select {
    font: inherit;
}

.page-shell {
    min-height: 100vh;
    width: min(1080px, calc(100vw - 24px));
    margin: 0 auto;
    padding: 12px 0 110px;
}

.card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 8px 22px rgba(90, 145, 196, 0.12);
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-title__main {
    font-size: 18px;
    font-weight: 700;
}

.section-title__sub {
    font-size: 13px;
    color: var(--muted);
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-a), var(--primary-b));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 11px;
    background: #f4fafe;
    color: #2a7abf;
    border: 1px solid #cfe5f8;
    font-size: 13px;
    cursor: pointer;
}

.muted {
    color: var(--muted);
}

.price {
    color: #1d6fb0;
    font-size: 19px;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 6px 10px;
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
}

.status-pending { background: #7aaad5; }
.status-accepted { background: #3f98d6; }
.status-preparing { background: #5f88d8; }
.status-completed { background: #31a36b; }
.status-cancelled { background: #d96a6a; }

.alert {
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.alert-success {
    background: rgba(49, 163, 107, 0.12);
    border: 1px solid rgba(49, 163, 107, 0.26);
    color: #1f8554;
}

.alert-error {
    background: rgba(217, 106, 106, 0.12);
    border: 1px solid rgba(217, 106, 106, 0.26);
    color: #af4545;
}

.home-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}

.home-topbar__label {
    color: #6c87a5;
    font-size: 13px;
}

.home-topbar__balance {
    margin-top: 6px;
    font-size: 24px;
    font-weight: 700;
}

.home-topbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.home-menu {
    display: grid;
    grid-template-columns: 146px 1fr;
    min-height: 72vh;
    overflow: hidden;
}

.home-menu__sidebar {
    padding: 10px;
    background: rgba(240, 248, 255, 0.76);
    border-right: 1px solid #d7ebfb;
}

.home-category {
    display: block;
    padding: 12px 10px;
    border-radius: 12px;
    color: #5c7897;
    font-size: 14px;
    margin-bottom: 6px;
}

.home-category.is-active {
    background: linear-gradient(135deg, #dff0ff, #edf7ff);
    color: #1d6fb0;
    font-weight: 700;
}

.home-menu__content {
    height: 72vh;
    overflow-y: auto;
    padding: 12px;
}

.dish-group + .dish-group {
    margin-top: 12px;
}

.dish-group__title {
    margin-bottom: 10px;
    font-size: 17px;
    font-weight: 700;
}

.dish-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #edf4fb;
}

.dish-item__image,
.dish-item__image img,
.dish-item__placeholder {
    width: 96px;
    height: 96px;
    border-radius: 12px;
}

.dish-item__image img {
    object-fit: cover;
}

.dish-item__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e7f4ff;
    color: #6c87a5;
    font-size: 12px;
}

.dish-item__body {
    flex: 1;
    min-width: 0;
}

.dish-item__name {
    font-size: 16px;
    font-weight: 700;
}

.dish-item__desc {
    margin-top: 6px;
    color: #6c87a5;
    line-height: 1.45;
    font-size: 13px;
}

.dish-item__meta {
    margin-top: 6px;
    color: #7f97b0;
    font-size: 12px;
}

.dish-item__footer {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.qty-stepper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qty-stepper__button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef7ff;
    color: #3f78aa;
    font-size: 19px;
    font-weight: 700;
    border: 0;
    cursor: pointer;
}

.qty-stepper__button--add {
    background: linear-gradient(135deg, #5aa8e8, #2a7abf);
    color: #fff;
}

.qty-stepper__count {
    min-width: 20px;
    text-align: center;
    font-size: 15px;
}

.home-loading {
    padding: 70px 0;
    text-align: center;
}

.home-cartbar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 999px;
    background: rgba(20, 46, 75, 0.92);
    color: #fff;
    box-shadow: 0 10px 24px rgba(11, 31, 56, 0.22);
    z-index: 20;
}

.home-cartbar__count { font-size: 13px; }
.home-cartbar__amount { margin-top: 4px; font-size: 20px; font-weight: 700; }
.home-cartbar__button { min-width: 120px; }

.checkout-loading,
.orders-loading,
.detail-loading {
    padding: 80px 0;
    text-align: center;
}

.checkout-card,
.order-card,
.detail-card {
    padding: 14px;
}

.checkout-card + .checkout-card,
.order-card + .order-card,
.detail-card + .detail-card {
    margin-top: 10px;
}

.checkout-item {
    display: grid;
    grid-template-columns: 86px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #edf4fb;
}

.checkout-item__image,
.checkout-item__image img,
.checkout-item__placeholder {
    width: 86px;
    height: 86px;
    border-radius: 12px;
}

.checkout-item__image img,
.order-card__image img,
.detail-item__image img {
    object-fit: cover;
}

.checkout-item__placeholder,
.order-card__placeholder,
.detail-item__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e7f4ff;
    color: #6c87a5;
    font-size: 12px;
}

.checkout-item__name { font-size: 15px; font-weight: 700; }
.checkout-item__desc { margin-top: 5px; color: #6c87a5; font-size: 13px; }
.checkout-item__amount { font-size: 15px; font-weight: 700; }

.form-item + .form-item { margin-top: 10px; }
.form-item__label { margin-bottom: 6px; color: #4d6e90; font-size: 13px; }
.form-input,
.form-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #d7ebfb;
    background: #fbfeff;
}

.form-textarea { min-height: 88px; resize: vertical; }

.coupon-list { display: flex; flex-direction: column; gap: 8px; }

.coupon-item {
    padding: 10px 12px;
    border: 1px solid #d7ebfb;
    border-radius: 10px;
    color: #4d6e90;
    background: #f7fbff;
    cursor: pointer;
}

.coupon-item.is-active {
    background: linear-gradient(135deg, #dff0ff, #edf7ff);
    border-color: #96c4ef;
    color: #1d6fb0;
    font-weight: 700;
}

.checkout-summary,
.detail-summary {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #f8fcff;
    border: 1px solid #d7ebfb;
}

.checkout-summary__row,
.detail-summary__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
}

.checkout-summary__row--total {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed #aacced;
    font-weight: 700;
}

.checkout-balance-tip { margin-top: 10px; font-size: 13px; }
.checkout-balance-tip.is-ok { color: #2a8e60; }
.checkout-balance-tip.is-error { color: #c55858; }
.checkout-submit { width: 100%; margin-top: 12px; }

.empty-state {
    padding: 24px 18px;
    text-align: center;
}

.empty-state__title { font-size: 22px; font-weight: 700; }
.empty-state__desc { margin-top: 8px; color: #6c87a5; line-height: 1.5; }
.empty-state__button { width: 100%; margin-top: 14px; }

.order-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.order-card__no { font-size: 15px; font-weight: 700; }
.order-card__time { margin-top: 4px; color: #6c87a5; font-size: 13px; }

.order-card__body {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.order-card__image,
.order-card__image img,
.order-card__placeholder {
    width: 78px;
    height: 78px;
    border-radius: 10px;
}

.order-card__meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #4d6e90;
    font-size: 13px;
}

.detail-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.detail-card__no { font-size: 16px; font-weight: 700; }
.detail-card__meta { margin-top: 5px; color: #6c87a5; font-size: 13px; }

.detail-item {
    display: grid;
    grid-template-columns: 78px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid #edf4fb;
}

.detail-item__image,
.detail-item__image img,
.detail-item__placeholder {
    width: 78px;
    height: 78px;
    border-radius: 10px;
}

.detail-item__name { font-size: 15px; font-weight: 700; }
.detail-item__desc { margin-top: 5px; color: #6c87a5; font-size: 13px; }
.detail-item__amount { font-size: 15px; font-weight: 700; }

.detail-log + .detail-log { margin-top: 8px; }

.detail-log {
    padding: 10px 12px;
    border-left: 4px solid #96c4ef;
    border-radius: 0 10px 10px 0;
    background: #f8fcff;
}

.detail-log__title { font-size: 15px; font-weight: 700; }
.detail-log__note { margin-top: 5px; color: #4d6e90; line-height: 1.5; font-size: 13px; }
.detail-log__time { margin-top: 4px; color: #7f97b0; font-size: 12px; }

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    width: 100%;
    padding: 24px 18px;
}

.auth-card__eyebrow {
    display: inline-flex;
    padding: 5px 10px;
    border-radius: 999px;
    background: #e6f4ff;
    color: #2a7abf;
    font-size: 12px;
    font-weight: 700;
}

.auth-card__title { margin-top: 10px; font-size: 26px; font-weight: 700; }
.auth-card__desc { margin-top: 8px; line-height: 1.6; color: #6c87a5; font-size: 14px; }

.auth-project {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f7fbff;
    border: 1px solid #d7ebfb;
}

.auth-project__row + .auth-project__row { margin-top: 8px; }
.auth-project__label { display: block; color: #6c87a5; font-size: 12px; }
.auth-project__value { display: block; margin-top: 3px; color: #1f3651; font-size: 13px; word-break: break-all; }

.auth-profile {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    margin-top: 12px;
}

.auth-avatar {
    width: 92px;
    height: 92px;
    border: 0;
    border-radius: 50%;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
}

.auth-avatar__image {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
}

.auth-nickname {
    width: 100%;
    height: 42px;
    align-self: center;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid #d7ebfb;
    background: #fbfeff;
}

.auth-card__ghost,
.auth-card__button {
    width: 100%;
    margin-top: 12px;
}

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

@media (max-width: 860px) {
    .home-menu {
        grid-template-columns: 118px 1fr;
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100vw - 12px, 1080px);
        padding-bottom: 100px;
    }

    .home-menu {
        grid-template-columns: 92px 1fr;
    }

    .home-category {
        font-size: 12px;
        padding: 10px 8px;
    }

    .home-menu__content {
        padding: 10px;
    }

    .dish-item__image,
    .dish-item__image img,
    .dish-item__placeholder {
        width: 78px;
        height: 78px;
    }

    .home-cartbar {
        border-radius: 14px;
    }
}