/* ========================================================================
   TENER COFFEE - 用户端样式
   美学：意式咖啡馆（深木 / 拿铁 / 奶白）— 稳重克制，无糖
   ======================================================================== */

:root {
    /* —— 色板：咖啡主题 —— */
    /* 主色 espresso 系（深咖啡）：用于强调按钮、链接、品牌色 */
    --coral:        #6F4E37;     /* espresso 主色（变量名保留兼容性，语义已变） */
    --coral-light:  #B08968;     /* 拿铁色 */
    --coral-deep:   #4A2C1A;     /* 浓缩咖啡，hover/active */

    /* 中性背景：奶白 / 米色 */
    --cream:        #F5EDE0;     /* 主背景，淡米色 */
    --cream-deep:   #EBDDC8;     /* 深米，分层用 */
    --cream-card:   #FBF5EC;     /* 卡片白 */

    /* 文字：深棕 → 浅棕 */
    --cocoa:        #2D1810;     /* 主文字，咖啡豆黑 */
    --cocoa-soft:   #5C4438;     /* 副文字，烘焙棕 */
    --cocoa-mute:   #8B7569;     /* 辅助文字，奶咖灰 */

    /* 强调点缀（取代粉色系）*/
    --blush:        #E0CDB6;     /* 替代 blush，米黄装饰 */
    --mint:         #8FA889;     /* 抹茶绿（环保提示用） */
    --gold:         #C8956A;     /* 焦糖金 */
    --line:         #E5D5BD;     /* 分割线，浅米 */

    /* —— 字体 —— */
    --font-display: 'Fraunces', 'Noto Serif SC', 'Songti SC', Georgia, serif;
    --font-body:    'Plus Jakarta Sans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    --font-script:  'Caveat', cursive;

    /* —— 间距 —— */
    --sp-1: 0.25rem;
    --sp-2: 0.5rem;
    --sp-3: 0.75rem;
    --sp-4: 1rem;
    --sp-5: 1.5rem;
    --sp-6: 2rem;
    --sp-8: 3rem;

    /* —— 圆角（保持温润感，不再像甜品店那么糖果） —— */
    --r-sm:  8px;
    --r-md:  14px;
    --r-lg:  18px;
    --r-xl:  24px;
    --r-pill: 999px;

    /* —— 阴影：偏咖啡棕 —— */
    --sh-sm:    0 2px 6px rgba(45,24,16,0.06);
    --sh-md:    0 6px 20px rgba(45,24,16,0.10);
    --sh-lg:    0 14px 40px rgba(45,24,16,0.14);
    --sh-coral: 0 8px 22px rgba(111,78,55,0.28);
    --sh-card:  0 3px 12px rgba(111,78,55,0.10);
}

/* —— Reset —— */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: transparent; cursor: pointer; }
input, textarea { border: 0; background: transparent; }
ul, ol { list-style: none; padding: 0; margin: 0; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

body {
    font-family: var(--font-body);
    background: var(--cream);
    color: var(--cocoa);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    /* 微妙的网点纹理增加暖意 */
    background-image:
        radial-gradient(circle at 25% 15%, rgba(232,184,106,0.06) 0%, transparent 40%),
        radial-gradient(circle at 75% 85%, rgba(176,137,104,0.10) 0%, transparent 40%);
}

/* —— 装饰元素 —— */
.decor {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    transition: transform 0.6s ease;
}
.decor--bean-1 {
    width: 120px; height: 120px;
    top: 8%; left: -30px;
    animation: drift 12s ease-in-out infinite;
}
.decor--bean-2 {
    width: 90px; height: 90px;
    bottom: 12%; right: -20px;
    animation: drift 15s ease-in-out infinite reverse;
}
.decor--steam {
    width: 110px; height: 130px;
    top: 30%; right: 5%;
    opacity: 0.6;
    animation: rise 4s ease-in-out infinite;
}

@keyframes drift {
    0%, 100% { transform: translate(0,0) rotate(0deg); }
    50% { transform: translate(15px, -10px) rotate(8deg); }
}
@keyframes rise {
    0%, 100% { transform: translateY(0); opacity: 0.4; }
    50% { transform: translateY(-12px); opacity: 0.7; }
}

/* 移动端隐藏部分装饰 */
@media (max-width: 720px) {
    .decor--steam { display: none; }
}

/* —— 视图通用 —— */
.view {
    position: relative;
    z-index: 1;
    animation: fade-up 0.4s ease both;
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ========================================================================
   登录页
   ======================================================================== */

.view--login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--cream-card);
    border-radius: var(--r-xl);
    padding: var(--sp-8) var(--sp-6) var(--sp-6);
    box-shadow: var(--sh-lg);
    position: relative;
    /* 边角装饰 */
    border: 1px solid rgba(232,184,106,0.2);
}
.login-card::before {
    content: "since 2026";
    position: absolute;
    top: 18px; right: 22px;
    font-family: var(--font-script);
    font-size: 1.05rem;
    color: var(--gold);
    transform: rotate(-4deg);
}

.login-card__brand {
    text-align: center;
    margin-bottom: var(--sp-6);
}

.brand-mark {
    width: 80px; height: 80px;
    margin: 0 auto var(--sp-4);
    filter: drop-shadow(0 6px 14px rgba(111,78,55,0.25));
}

.brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: 0.5px;
    margin: 0;
    color: var(--cocoa);
}
.brand-name span {
    display: inline-block;
    margin-left: 0.5em;
    font-style: italic;
    font-weight: 500;
    color: var(--coral);
}

.brand-tag {
    margin-top: var(--sp-2);
    color: var(--cocoa-soft);
    font-family: var(--font-script);
    font-size: 1.2rem;
}

/* —— 表单字段 —— */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--sp-4);
}

.field { display: block; }
.field__label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cocoa-soft);
    margin-bottom: var(--sp-2);
    letter-spacing: 0.6px;
}
.field input,
.field textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--r-md);
    background: var(--cream-deep);
    border: 1.5px solid transparent;
    color: var(--cocoa);
    transition: border-color 0.2s, background 0.2s;
}
.field input:focus,
.field textarea:focus {
    outline: 0;
    border-color: var(--coral);
    background: #fff;
}
.field input::placeholder {
    color: var(--cocoa-mute);
}

.form-error {
    color: var(--coral-deep);
    font-size: 0.85rem;
    background: rgba(111,78,55,0.08);
    border-radius: var(--r-sm);
    padding: var(--sp-2) var(--sp-3);
    border-left: 3px solid var(--coral);
}

.login-hint {
    text-align: center;
    margin-top: var(--sp-4);
    color: var(--cocoa-mute);
    font-size: 0.82rem;
}

/* ========================================================================
   按钮
   ======================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: 0.85rem 1.5rem;
    border-radius: var(--r-pill);
    font-weight: 600;
    font-size: 0.95rem;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
    background: var(--coral);
    color: #fff;
    box-shadow: var(--sh-coral);
}
.btn--primary:hover { background: var(--coral-deep); }

.btn--secondary {
    background: var(--cream-deep);
    color: var(--cocoa);
    border: 1.5px solid var(--line);
}
.btn--secondary:hover { background: var(--blush); }

.btn--ghost {
    background: transparent;
    color: var(--cocoa-soft);
}
.btn--ghost:hover { color: var(--coral); }

.btn--full { width: 100%; }
.btn--lg { padding: 1rem 1.75rem; font-size: 1rem; }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

/* 图标按钮（顶栏） */
.icon-btn {
    position: relative;
    width: 42px; height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-pill);
    color: var(--cocoa);
    transition: background 0.2s;
}
.icon-btn:hover { background: var(--cream-deep); }

.badge {
    position: absolute;
    top: 4px; right: 4px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    border-radius: var(--r-pill);
    background: var(--coral);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(111,78,55,0.4);
}

/* ========================================================================
   主应用容器
   ======================================================================== */
.app {
    max-width: 540px;
    margin: 0 auto;
    min-height: 100vh;
    padding-bottom: var(--sp-8);
    position: relative;
    z-index: 1;
}

.app-header {
    padding: var(--sp-5) var(--sp-5) var(--sp-3);
    position: sticky;
    top: 0;
    z-index: 10;
    background: linear-gradient(to bottom, var(--cream) 65%, transparent);
    backdrop-filter: blur(8px);
}

.app-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-4);
}

.brand-mini {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    color: var(--cocoa);
}
.brand-mini i {
    font-style: italic;
    font-weight: 500;
    color: var(--coral);
    margin-left: 4px;
}

.app-header__actions {
    display: inline-flex;
    gap: var(--sp-1);
}

/* —— 视图标题区（动态渲染）—— */
.view-header {
    padding: var(--sp-2) var(--sp-5) 0;
    margin: 0 calc(-1 * var(--sp-5));
}

.greeting {
    padding: 0 var(--sp-5);
}
.greeting__hi {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    color: var(--cocoa);
}
.greeting__hi i {
    color: var(--coral);
    font-style: italic;
}
.greeting__sub {
    font-family: var(--font-script);
    font-size: 1.15rem;
    color: var(--cocoa-soft);
    margin: var(--sp-1) 0 0;
}

/* 其它视图的标题（详情/购物车） */
.page-title-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 0 var(--sp-5);
}
.page-title-bar h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0;
}
.btn-back {
    width: 38px; height: 38px;
    border-radius: var(--r-pill);
    background: var(--cream-card);
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--sh-sm);
}

/* ========================================================================
   主体内容
   ======================================================================== */
.app-main {
    padding: var(--sp-4) var(--sp-5) var(--sp-5);
}

/* —— 分类 chips —— */
.categories {
    display: flex;
    gap: var(--sp-2);
    overflow-x: auto;
    margin: var(--sp-5) calc(-1 * var(--sp-5)) var(--sp-5);
    padding: 0 var(--sp-5) var(--sp-2);
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}
.categories::-webkit-scrollbar { display: none; }

.chip {
    flex: 0 0 auto;
    padding: 0.55rem 1.05rem;
    border-radius: var(--r-pill);
    background: var(--cream-card);
    color: var(--cocoa-soft);
    font-weight: 500;
    font-size: 0.9rem;
    border: 1.5px solid var(--line);
    transition: all 0.2s;
    scroll-snap-align: start;
}
.chip:hover { color: var(--cocoa); }
.chip.is-active {
    background: var(--cocoa);
    color: var(--cream);
    border-color: var(--cocoa);
    box-shadow: 0 4px 14px rgba(59,38,32,0.18);
}

/* —— 商品网格 —— */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-4);
}

/* —— 商品卡片 —— */
.product-card {
    background: var(--cream-card);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--sh-card);
    border: 1px solid rgba(240,225,206,0.6);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}
.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sh-md);
}
.product-card:active { transform: translateY(-1px); }

.product-card__img {
    aspect-ratio: 1 / 1;
    background: var(--cream-deep);
    background-size: cover;
    background-position: center;
    position: relative;
}
.product-card__img--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cream-deep) 0%, var(--cream-card) 100%);
}
.product-card__img--placeholder span {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.5rem;
    color: var(--coral-deep);
    opacity: 0.55;
    text-align: center;
    padding: var(--sp-3);
    line-height: 1.2;
}

.product-card__body {
    padding: var(--sp-3) var(--sp-4) var(--sp-4);
}

.product-card__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
    margin: 0 0 var(--sp-2);
    color: var(--cocoa);
    /* 单行省略 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-card__price {
    display: inline-flex;
    align-items: baseline;
    gap: 2px;
    color: var(--coral);
    font-weight: 700;
}
.product-card__price-prefix {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--cocoa-mute);
    margin-right: 2px;
}
.product-card__price-currency {
    font-size: 0.85rem;
}
.product-card__price-num {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
}

/* ========================================================================
   商品详情
   ======================================================================== */
.product-detail {
    padding-bottom: 100px; /* 给底部 sticky 让位 */
}

.product-detail__hero {
    aspect-ratio: 4 / 3;
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--cream-deep);
    background-size: cover;
    background-position: center;
    box-shadow: var(--sh-md);
    margin: 0 0 var(--sp-5);
    position: relative;
}
.product-detail__hero--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--cream-deep) 0%, var(--coral-light) 100%);
}
.product-detail__hero--placeholder span {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 2.2rem;
    color: var(--coral-deep);
    text-align: center;
    padding: var(--sp-5);
    opacity: 0.85;
}

.product-detail__name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.8rem;
    line-height: 1.2;
    margin: 0 0 var(--sp-2);
    color: var(--cocoa);
}
.product-detail__desc {
    color: var(--cocoa-soft);
    line-height: 1.6;
    margin: 0 0 var(--sp-5);
}

.spec-section {
    margin-bottom: var(--sp-5);
}
.spec-section__title {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--cocoa-soft);
    margin: 0 0 var(--sp-3);
    letter-spacing: 0.6px;
}

/* 规格选项 */
.options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
}

.option-card {
    flex: 1 1 calc(50% - var(--sp-2));
    min-width: 130px;
    padding: 0.8rem 1rem;
    background: var(--cream-card);
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    position: relative;
    color: var(--cocoa);
}
.option-card:hover {
    border-color: var(--coral-light);
    background: rgba(111, 78, 55, 0.04);
}
.option-card.is-active {
    border-color: var(--coral);
    /* 半透明 espresso 叠加在卡片白底上，明确"咖啡奶泡"质感 */
    background:
        linear-gradient(180deg, rgba(111, 78, 55, 0.14) 0%, rgba(111, 78, 55, 0.04) 100%),
        var(--cream-card);
    box-shadow: 0 4px 16px rgba(74, 44, 26, 0.18);
}
.option-card.is-active::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 2px solid var(--coral);
    pointer-events: none;
}
.option-card__label {
    display: block;
    font-size: 0.92rem;
    font-weight: 600;
}
.option-card__hint {
    display: block;
    font-size: 0.78rem;
    color: var(--cocoa-mute);
    margin-top: 2px;
}
.option-card__price {
    display: block;
    margin-top: var(--sp-1);
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--coral);
    font-size: 1rem;
}
.option-card__check {
    position: absolute;
    top: 8px; right: 8px;
    width: 18px; height: 18px;
    color: var(--coral);
    opacity: 0;
    transition: opacity 0.2s;
}
.option-card.is-active .option-card__check { opacity: 1; }

/* —— 数量步进器 —— */
.stepper {
    display: inline-flex;
    align-items: center;
    background: var(--cream-card);
    border: 1.5px solid var(--line);
    border-radius: var(--r-pill);
    overflow: hidden;
}
.stepper__btn {
    width: 40px; height: 40px;
    color: var(--cocoa);
    transition: background 0.2s;
}
.stepper__btn:hover { background: var(--blush); }
.stepper__btn:disabled {
    color: var(--cocoa-mute);
    cursor: not-allowed;
}
.stepper__value {
    min-width: 38px;
    text-align: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.05rem;
}

/* —— 备注 textarea —— */
.remark-field textarea {
    width: 100%;
    min-height: 70px;
    padding: 0.8rem 1rem;
    border-radius: var(--r-md);
    background: var(--cream-deep);
    border: 1.5px solid transparent;
    resize: vertical;
    transition: border-color 0.2s, background 0.2s;
}
.remark-field textarea:focus {
    outline: 0;
    border-color: var(--coral);
    background: #fff;
}
.remark-field__count {
    text-align: right;
    font-size: 0.78rem;
    color: var(--cocoa-mute);
    margin-top: var(--sp-1);
}

/* —— 底部 sticky 操作条 —— */
.detail-actionbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 540px;
    padding: var(--sp-3) var(--sp-5) calc(var(--sp-4) + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--cream) 70%, transparent);
    backdrop-filter: blur(8px);
    z-index: 20;
}
.detail-actionbar__inner {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    background: var(--cream-card);
    padding: var(--sp-3);
    padding-left: var(--sp-5);
    border-radius: var(--r-pill);
    box-shadow: var(--sh-md);
    border: 1px solid var(--line);
}
.detail-actionbar__price {
    display: flex;
    flex-direction: column;
    line-height: 1;
    flex-shrink: 0;
}
.detail-actionbar__price-label {
    font-size: 0.7rem;
    color: var(--cocoa-mute);
    margin-bottom: 2px;
}
.detail-actionbar__price-num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--coral);
}
/* 单按钮（兼容旧布局）*/
.detail-actionbar > .detail-actionbar__inner > .btn:not(.detail-actionbar__btn) {
    margin-left: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}
/* 双按钮（加入购物车 + 去结算）*/
.detail-actionbar__btn {
    flex: 1;
    min-width: 0;
    padding-left: var(--sp-3);
    padding-right: var(--sp-3);
    white-space: nowrap;
}
.detail-actionbar__btn:first-of-type {
    margin-left: auto;
}
/* 双按钮布局下，"加入购物车"里的图标更紧凑 */
.detail-actionbar__btn svg {
    margin-right: 4px;
}
/* 极窄屏适配（<360px）：图标隐藏，仅显示文字 */
@media (max-width: 360px) {
    .detail-actionbar__btn svg { display: none; }
    .detail-actionbar__inner { padding-left: var(--sp-3); }
    .detail-actionbar__price-num { font-size: 1.2rem; }
}

/* ========================================================================
   购物车
   ======================================================================== */
.cart {
    padding-bottom: 110px;
}

.cart-list {
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    margin-top: var(--sp-5);
}

.cart-item {
    display: flex;
    gap: var(--sp-3);
    background: var(--cream-card);
    border-radius: var(--r-lg);
    padding: var(--sp-3);
    border: 1px solid var(--line);
    transition: opacity 0.2s;
}
.cart-item.is-removing { opacity: 0; transform: scale(0.96); }

.cart-item__img {
    flex: 0 0 86px;
    width: 86px; height: 86px;
    border-radius: var(--r-md);
    background: var(--cream-deep);
    background-size: cover;
    background-position: center;
}
.cart-item__img--placeholder {
    background: linear-gradient(135deg, var(--blush), var(--cream-deep));
    display: flex;
    align-items: center;
    justify-content: center;
}
.cart-item__img--placeholder span {
    font-family: var(--font-display);
    font-style: italic;
    color: var(--coral);
    font-size: 0.85rem;
    text-align: center;
    padding: var(--sp-1);
}

.cart-item__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.cart-item__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    margin: 0 0 var(--sp-1);
    color: var(--cocoa);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-item__specs {
    font-size: 0.8rem;
    color: var(--cocoa-soft);
    margin-bottom: var(--sp-1);
}
.cart-item__remark {
    font-size: 0.78rem;
    color: var(--cocoa-mute);
    font-style: italic;
    margin-bottom: var(--sp-2);
    /* 单行省略 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}
.cart-item__price {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--coral);
    font-size: 1.1rem;
}
.cart-item__price small {
    font-size: 0.7rem;
    color: var(--cocoa-mute);
    font-weight: 500;
    margin-left: 4px;
    font-family: var(--font-body);
}

/* —— 小步进器（购物车内）—— */
.stepper--sm .stepper__btn { width: 30px; height: 30px; }
.stepper--sm .stepper__value { min-width: 28px; font-size: 0.95rem; }

.cart-item__delete {
    color: var(--cocoa-mute);
    font-size: 0.8rem;
    margin-top: var(--sp-2);
    align-self: flex-start;
    transition: color 0.2s;
}
.cart-item__delete:hover { color: var(--coral-deep); }

.cart-item__unavailable {
    background: rgba(0,0,0,0.04);
    color: var(--cocoa-mute);
    font-size: 0.78rem;
    padding: 2px 8px;
    border-radius: var(--r-sm);
    align-self: flex-start;
    margin-top: var(--sp-1);
}

/* —— 购物车汇总 sticky —— */
.cart-summary {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 540px;
    padding: var(--sp-3) var(--sp-5) calc(var(--sp-4) + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--cream) 70%, transparent);
    backdrop-filter: blur(8px);
    z-index: 20;
}
.cart-summary__inner {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    background: var(--cocoa);
    color: var(--cream);
    padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-5);
    border-radius: var(--r-pill);
    box-shadow: 0 12px 32px rgba(59,38,32,0.25);
}
.cart-summary__total {
    flex: 1;
}
.cart-summary__label {
    font-size: 0.72rem;
    opacity: 0.7;
    display: block;
    margin-bottom: 2px;
}
.cart-summary__num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--gold);
}
.cart-summary__num small {
    font-size: 0.85rem;
    margin-right: 2px;
    color: var(--gold);
    opacity: 0.85;
}
.cart-summary .btn--primary {
    background: var(--coral);
    box-shadow: 0 0 0 transparent;
}

/* ========================================================================
   空状态 / Toast / Loader
   ======================================================================== */
.empty-state {
    text-align: center;
    padding: var(--sp-8) var(--sp-5);
    color: var(--cocoa-soft);
}
.empty-state__icon {
    font-size: 3rem;
    margin: 0 0 var(--sp-3);
}

.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--cocoa);
    color: var(--cream);
    padding: 0.85rem 1.4rem;
    border-radius: var(--r-pill);
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: var(--sh-lg);
    z-index: 100;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast--error {
    background: var(--coral-deep);
}

.loader {
    position: fixed;
    inset: 0;
    background: rgba(245, 237, 224, 0.88);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
}
.loader__cup {
    width: 88px; height: 88px;
    animation: bounce 1.4s ease-in-out infinite;
    filter: drop-shadow(0 6px 12px rgba(74, 44, 26, 0.18));
}
@keyframes bounce {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-6px) rotate(2deg); }
}
.loader__steam {
    transform-origin: center bottom;
    animation: steam-rise 1.8s ease-in-out infinite;
    opacity: 0;
}
.loader__steam--1 { animation-delay: 0s;   }
.loader__steam--2 { animation-delay: 0.25s; }
.loader__steam--3 { animation-delay: 0.5s; }
@keyframes steam-rise {
    0%   { opacity: 0; transform: translateY(8px) scaleY(0.85); }
    35%  { opacity: 0.85; }
    100% { opacity: 0; transform: translateY(-8px) scaleY(1.15); }
}
/* 咖啡液面微微"咕嘟" */
.loader__liquid {
    transform-origin: center;
    animation: liquid-bob 2s ease-in-out infinite;
}
@keyframes liquid-bob {
    0%, 100% { transform: translateY(0)   scaleX(1);    }
    50%      { transform: translateY(0.4px) scaleX(0.985); }
}

/* ========================================================================
   响应式
   ======================================================================== */
@media (min-width: 720px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .greeting__hi { font-size: 2rem; }
    .product-detail__name { font-size: 2rem; }
}

@media (min-width: 1024px) {
    .app {
        max-width: 600px;
    }
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--sp-5);
    }
    .decor--bean-1 { width: 180px; height: 180px; left: 5%; }
    .decor--bean-2 { width: 140px; height: 140px; right: 5%; }
}

/* ========================================================================
   结算 / 支付 / 订单详情
   ======================================================================== */

/* —— 结算页 —— */
.checkout {
    padding-bottom: 110px;
}
.checkout-section {
    background: var(--cream-card);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    border: 1px solid var(--line);
}
.checkout-section__title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--cocoa-soft);
    margin: 0 0 var(--sp-3);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}
.checkout-section__title::before {
    content: "";
    width: 3px;
    height: 14px;
    background: var(--coral);
    border-radius: 2px;
}

/* 商品紧凑行 */
.checkout-item {
    display: flex;
    gap: var(--sp-3);
    padding: var(--sp-3) 0;
    border-bottom: 1px dashed var(--line);
}
.checkout-item:first-child { padding-top: 0; }
.checkout-item:last-child { border-bottom: 0; padding-bottom: 0; }
.checkout-item__img {
    flex: 0 0 56px;
    width: 56px; height: 56px;
    border-radius: var(--r-md);
    background: var(--cream-deep);
    background-size: cover;
    background-position: center;
}
.checkout-item__img--placeholder {
    background: linear-gradient(135deg, var(--blush), var(--cream-deep));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 0.7rem;
    color: var(--coral);
    text-align: center;
    padding: var(--sp-1);
    line-height: 1.1;
}
.checkout-item__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.checkout-item__name {
    font-weight: 600;
    margin: 0 0 2px;
    font-size: 0.95rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.checkout-item__specs {
    font-size: 0.78rem;
    color: var(--cocoa-mute);
}
.checkout-item__price-col {
    text-align: right;
    flex-shrink: 0;
    align-self: center;
}
.checkout-item__price {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--coral);
}
.checkout-item__qty {
    font-size: 0.78rem;
    color: var(--cocoa-mute);
}

/* 兑换券行（结算页） */
.coupon-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-2) 0;
    color: var(--cocoa-mute);
    font-size: 0.9rem;
}
.coupon-row--clickable {
    width: 100%;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--cocoa);
    text-align: left;
    padding: var(--sp-3) 0;
    font: inherit;
    transition: opacity 0.15s;
}
.coupon-row--clickable:hover {
    opacity: 0.7;
}
.coupon-row--empty {
    font-style: italic;
}

/* 兑换券选择弹层（底部弹起） */
.coupon-picker {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
}
.coupon-picker--visible {
    pointer-events: auto;
}
.coupon-picker__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(59, 38, 32, 0.5);
    opacity: 0;
    transition: opacity 0.25s;
    cursor: pointer;
}
.coupon-picker--visible .coupon-picker__backdrop {
    opacity: 1;
}
.coupon-picker__panel {
    position: relative;
    background: var(--cream);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 75vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(.2,.8,.2,1);
    display: flex;
    flex-direction: column;
}
.coupon-picker--visible .coupon-picker__panel {
    transform: translateY(0);
}
.coupon-picker__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-4) var(--sp-5);
    border-bottom: 1px solid var(--line);
}
.coupon-picker__head h3 {
    font-family: var(--font-display);
    font-weight: 600;
    margin: 0;
    font-size: 1.1rem;
}
.coupon-picker__close {
    width: 32px; height: 32px;
    border: 0;
    background: transparent;
    color: var(--cocoa-mute);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.coupon-picker__close:hover {
    background: var(--cream-deep);
    color: var(--cocoa);
}
.coupon-picker__body {
    overflow-y: auto;
    padding: var(--sp-4) var(--sp-5) var(--sp-6);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

/* 单张券卡片 */
.coupon-item {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding: var(--sp-4);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    cursor: pointer;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    position: relative;
    transition: border-color 0.15s, background 0.15s;
}
.coupon-item:hover {
    border-color: var(--coral-soft);
}
.coupon-item--selected {
    border-color: var(--coral);
    background: linear-gradient(180deg, var(--coral-soft) 0%, var(--surface) 60%);
}
.coupon-item__left {
    background: var(--coral);
    color: #fff;
    border-radius: var(--r-md);
    padding: var(--sp-3) var(--sp-4);
    text-align: center;
    flex-shrink: 0;
    min-width: 80px;
}
.coupon-item__value {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.4rem;
    line-height: 1;
}
.coupon-item__valuesub {
    font-size: 0.72rem;
    margin-top: 2px;
    opacity: 0.85;
}
.coupon-item__body {
    flex: 1;
    min-width: 0;
}
.coupon-item__name {
    font-weight: 600;
    color: var(--cocoa);
    margin-bottom: 4px;
    font-size: 0.95rem;
}
.coupon-item__desc {
    color: var(--cocoa-soft);
    font-size: 0.8rem;
    margin-bottom: 2px;
}
.coupon-item__expire {
    color: var(--cocoa-mute);
    font-size: 0.74rem;
}
.coupon-item__check {
    color: var(--coral);
    font-weight: 700;
    font-size: 1.4rem;
    margin-left: auto;
    flex-shrink: 0;
}
.coupon-item--no {
    background: var(--cream-deep);
    border-style: dashed;
}

/* 我的券页 */
.coupons-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border-radius: var(--r-md);
    padding: 4px;
    margin: var(--sp-4) var(--sp-4) var(--sp-3);
    border: 1px solid var(--line);
}
.coupons-tab {
    flex: 1;
    padding: 0.5rem 0.6rem;
    border: 0;
    background: transparent;
    border-radius: var(--r-sm);
    color: var(--cocoa-soft);
    font-weight: 500;
    font-size: 0.86rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.coupons-tab:hover { background: var(--cream-deep); }
.coupons-tab.is-active {
    background: var(--coral);
    color: #fff;
}

#coupons-list {
    padding: 0 var(--sp-4) var(--sp-6);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
}

.coupon-card {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: var(--r-md);
    padding: var(--sp-4);
    box-shadow: var(--sh-sm);
    position: relative;
}
.coupon-card--dim {
    opacity: 0.6;
}
.coupon-card__left {
    background: linear-gradient(135deg, var(--coral) 0%, var(--coral-deep) 100%);
    color: #fff;
    border-radius: var(--r-md);
    padding: var(--sp-3) var(--sp-4);
    text-align: center;
    flex-shrink: 0;
    min-width: 92px;
    position: relative;
}
.coupon-card--dim .coupon-card__left {
    background: var(--cocoa-mute);
}
.coupon-card__value {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.6rem;
    line-height: 1;
}
.coupon-card__valuesub {
    font-size: 0.74rem;
    margin-top: 4px;
    opacity: 0.9;
}
.coupon-card__body {
    flex: 1;
    min-width: 0;
}
.coupon-card__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    color: var(--cocoa);
    margin-bottom: 4px;
}
.coupon-card__desc {
    color: var(--cocoa-soft);
    font-size: 0.84rem;
    margin-bottom: 4px;
}
.coupon-card__expire {
    color: var(--cocoa-mute);
    font-size: 0.78rem;
}
.coupon-card__expire--urgent {
    color: var(--coral-deep);
    font-weight: 600;
}
.coupon-card__hint {
    color: var(--cocoa-mute);
    font-size: 0.74rem;
    margin-top: 4px;
    line-height: 1.4;
    font-style: italic;
}

/* 金额明细 */
.amount-row {
    display: flex;
    justify-content: space-between;
    padding: var(--sp-2) 0;
    font-size: 0.92rem;
    color: var(--cocoa-soft);
}
.amount-row--total {
    border-top: 1px dashed var(--line);
    padding-top: var(--sp-3);
    margin-top: var(--sp-2);
    font-size: 1.05rem;
    color: var(--cocoa);
}
.amount-row--total .amount-row__num {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--coral);
    font-size: 1.4rem;
}

/* —— 支付二维码页 —— */
.pay-screen {
    text-align: center;
    padding: var(--sp-5) 0 var(--sp-8);
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.pay-card {
    background: var(--cream-card);
    border-radius: var(--r-xl);
    padding: var(--sp-6) var(--sp-5);
    box-shadow: var(--sh-md);
    border: 1px solid var(--line);
    width: 100%;
    max-width: 360px;
}
.pay-card__amount {
    margin: 0 0 var(--sp-2);
}
.pay-card__amount-label {
    display: block;
    font-size: 0.82rem;
    color: var(--cocoa-mute);
    margin-bottom: var(--sp-1);
}
.pay-card__amount-num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2.4rem;
    color: var(--coral);
    line-height: 1;
}
.pay-card__amount-num small {
    font-size: 1.2rem;
    margin-right: 4px;
}

.qrcode-wrap {
    display: inline-block;
    background: #fff;
    padding: var(--sp-3);
    border-radius: var(--r-md);
    margin: var(--sp-5) 0 var(--sp-4);
    border: 1.5px solid var(--blush);
    position: relative;
}
.qrcode-wrap img,
.qrcode-wrap canvas {
    display: block;
    margin: 0 auto;
}
.qrcode-wrap.is-loading::after {
    content: "生成二维码中...";
    position: absolute;
    inset: 0;
    background: var(--cream-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cocoa-mute);
    font-size: 0.85rem;
    border-radius: var(--r-md);
}
.qrcode-wrap.is-expired::before {
    content: "已超时";
    position: absolute;
    inset: 0;
    background: rgba(232,93,77,0.92);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.4rem;
    border-radius: var(--r-md);
    z-index: 2;
}

.pay-card__hint {
    font-size: 0.92rem;
    color: var(--cocoa-soft);
    margin: 0;
}
.pay-card__hint i {
    color: var(--coral);
    font-style: normal;
    font-weight: 600;
}

.pay-status {
    margin-top: var(--sp-4);
    font-size: 0.88rem;
    color: var(--cocoa-mute);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
}
.pay-status__dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.7); }
}

.pay-countdown {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--coral);
    margin-left: 4px;
}

.pay-actions {
    margin-top: var(--sp-6);
    display: flex;
    flex-direction: column;
    gap: var(--sp-3);
    align-items: center;
}

/* 支付成功 */
.pay-success {
    text-align: center;
    padding: var(--sp-8) var(--sp-5);
}
.pay-success__icon {
    width: 80px; height: 80px;
    margin: 0 auto var(--sp-4);
    border-radius: 50%;
    background: var(--mint);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cream-card);
    animation: pop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.pay-success__title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 var(--sp-2);
}
.pay-success__sub {
    color: var(--cocoa-soft);
    margin: 0 0 var(--sp-6);
}

/* —— 订单详情 —— */
.order-detail {
    padding-bottom: var(--sp-5);
}
.order-status-card {
    background: var(--cream-card);
    border-radius: var(--r-lg);
    padding: var(--sp-5) var(--sp-4);
    margin-bottom: var(--sp-3);
    border: 1px solid var(--line);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.order-status-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(176,137,104,0.18));
    pointer-events: none;
}
.order-status-card__badge {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: var(--r-pill);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--sp-2);
}
.order-status-card__badge--paid {
    background: var(--mint);
    color: #1f4d3f;
}
.order-status-card__badge--pending {
    background: var(--gold);
    color: #5c4115;
}
.order-status-card__badge--cancelled {
    background: var(--cream-deep);
    color: var(--cocoa-mute);
}
.order-status-card__title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    margin: 0 0 var(--sp-1);
}
.order-status-card__sub {
    font-size: 0.88rem;
    color: var(--cocoa-soft);
    margin: 0;
}
.order-status-card__no {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.78rem;
    color: var(--cocoa-mute);
    margin-top: var(--sp-3);
    letter-spacing: 0.5px;
}

/* —— 取餐号大字（订单详情/支付成功）—— */
.order-status-card__pickup {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: var(--sp-3) 0 var(--sp-2);
    padding: var(--sp-2) var(--sp-5);
    background: var(--cream-deep);
    border-radius: var(--r-md);
    border: 1.5px dashed var(--gold);
}
.order-status-card__pickup-label {
    font-size: 0.72rem;
    color: var(--cocoa-soft);
    letter-spacing: 1px;
}
.order-status-card__pickup-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 2rem;
    color: var(--coral);
    line-height: 1;
}

.pickup-no-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin: var(--sp-5) 0 var(--sp-6);
    padding: var(--sp-4) var(--sp-6);
    background: var(--cream-deep);
    border-radius: var(--r-lg);
    border: 2px dashed var(--gold);
    box-shadow: var(--sh-sm);
}
.pickup-no-card__label {
    font-size: 0.78rem;
    color: var(--cocoa-soft);
    letter-spacing: 2px;
}
.pickup-no-card__num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 3rem;
    color: var(--coral);
    line-height: 1;
}

.order-section {
    background: var(--cream-card);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-3);
    border: 1px solid var(--line);
}

.order-meta {
    font-size: 0.88rem;
}
.order-meta__row {
    display: flex;
    justify-content: space-between;
    padding: var(--sp-2) 0;
    color: var(--cocoa-soft);
}
.order-meta__row + .order-meta__row {
    border-top: 1px dashed var(--line);
}
.order-meta__row strong {
    font-weight: 500;
    color: var(--cocoa);
}

.order-actions {
    display: flex;
    gap: var(--sp-3);
    margin-top: var(--sp-4);
}
.order-actions .btn { flex: 1; }

/* —— 我的订单（列表，留作未来阶段使用） —— */
.order-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.order-list-item {
    background: var(--cream-card);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    border: 1px solid var(--line);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.order-list-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh-sm);
}

/* ========================================================================
   阶段 11：温度选项视觉
   ======================================================================== */

/* —— 商品卡上的"仅冰/仅热"角标 —— */
.product-card { position: relative; }
.product-card__temp {
    position: absolute;
    top: var(--sp-3);
    left: var(--sp-3);
    padding: 2px 10px;
    border-radius: var(--r-pill);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    backdrop-filter: blur(4px);
    z-index: 1;
}
.product-card__temp--cold {
    background: rgba(143, 168, 137, 0.92);  /* 抹茶绿 */
    color: #fff;
}
.product-card__temp--hot {
    background: rgba(200, 149, 106, 0.95);  /* 焦糖金 */
    color: #fff;
}

/* —— 商品详情页锁定的温度卡（只能冰 / 只能热）—— */
.option-card--locked {
    cursor: default;
    background: var(--cream-card);
    border-color: var(--cream-deep);
    opacity: 0.92;
    pointer-events: none;
}
.option-card--locked.is-active {
    border-color: var(--coral);
    background:
        linear-gradient(180deg, rgba(111, 78, 55, 0.14) 0%, rgba(111, 78, 55, 0.04) 100%),
        var(--cream-card);
}
