:root {
    --red: #e4002b;
    --red-2: #ff3352;
    --ink: #16161a;
    --sub: #8b8b96;
    --line: #ececf1;
    --bg: #f5f6f9;
    --card: #fff;
    --r: 18px;
    --sh: 0 8px 26px rgba(22, 22, 40, .06);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 12px 16px 40px;
}

a { color: inherit; text-decoration: none; }
.muted { color: var(--sub); }
.small { font-size: 13px; }

/* 顶栏：跟下面的卡片同宽、四角圆角，不贴屏顶也不吸附 */
.topbar {
    margin: 0 0 14px;
    padding: 16px 16px 18px;
    color: #fff;
    background: linear-gradient(135deg, var(--red) 0%, #c90026 100%);
    border-radius: 22px;
    box-shadow: 0 10px 24px rgba(228, 0, 43, .22);
}

.topbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; letter-spacing: .3px; }
.brand-dot { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .22); }

.brand-badge {
    font-size: 11px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .26);
}

.topbar-title { margin-top: 12px; font-size: 22px; font-weight: 700; letter-spacing: .5px; }

/* 顶栏里的门店营业状态与地址 */
.topbar-store { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ts-state {
    font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 999px;
    background: rgba(255, 255, 255, .2); border: 1px solid rgba(255, 255, 255, .36); color: #fff;
}
.ts-state.off { background: rgba(20, 20, 24, .22); border-color: rgba(255, 255, 255, .22); color: #ffdfe4; }
.ts-hours { font-size: 11.5px; opacity: .85; }
.ts-addr { margin-top: 6px; font-size: 12px; line-height: 1.45; opacity: .9; }

.back, .switch {
    width: 32px; height: 32px; line-height: 30px; text-align: center;
    border-radius: 10px; background: rgba(255, 255, 255, .16); font-size: 15px;
}
.switch { width: auto; padding: 0 10px; font-size: 12px; line-height: 30px; }

/* 卡片 */
.card {
    background: var(--card);
    border-radius: var(--r);
    box-shadow: var(--sh);
    padding: 16px;
    margin-bottom: 14px;
}

.card-title { font-weight: 600; font-size: 15px; margin-bottom: 12px; }

.search-row { display: flex; gap: 8px; }

.input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafafc;
    font-size: 14px;
    color: var(--ink);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.input:focus { border-color: #ffb3c1; box-shadow: 0 0 0 3px rgba(228, 0, 43, .08); background: #fff; }

#geo-tip { margin-top: 10px; }

/* 定位条 */
.loc-row { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.loc-pin { font-size: 14px; flex: none; }
.loc-btn {
    display: flex; align-items: center; gap: 8px;
    flex: 1; min-width: 0;
    border: 0; background: #fff5f6; color: var(--red);
    border-radius: 12px; padding: 9px 12px;
    font-size: 13.5px; font-family: inherit; text-align: left; cursor: pointer;
    transition: background .2s;
}
.loc-btn:active { background: #ffe9ec; }
.loc-btn #loc-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.loc-refresh { flex: none; font-size: 12px; color: #b3404f; opacity: .85; border-left: 1px solid #ffd4dc; padding-left: 8px; }

/* 地点候选 */
.poi-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.poi-head { font-size: 12px; color: var(--sub); margin-bottom: 2px; }
.poi {
    display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    width: 100%; text-align: left; cursor: pointer;
    border: 1px solid var(--line); background: #fafafc;
    border-radius: 12px; padding: 9px 12px; font-family: inherit;
    transition: background .18s, border-color .18s, transform .12s;
    animation: poi-in .22s ease both;
}
.poi:active { transform: scale(.99); background: #fff5f6; border-color: #ffd4dc; }
.poi-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.poi-addr { font-size: 11.5px; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
@keyframes poi-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.store-hours { font-size: 11px; font-weight: 500; color: var(--sub); margin-left: 6px; }

/* 按钮 */
.btn {
    border: 0;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    padding: 0 16px;
    height: 44px;
    cursor: pointer;
    transition: transform .12s ease, opacity .2s, box-shadow .2s;
    font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn.primary {
    color: #fff;
    background: linear-gradient(135deg, var(--red-2), var(--red));
    box-shadow: 0 8px 18px rgba(228, 0, 43, .26);
}
.btn.primary:disabled { opacity: .45; box-shadow: none; cursor: not-allowed; }
.btn.ghost { background: #fff5f6; color: var(--red); border: 1px solid #ffd4dc; }
.btn.block { width: 100%; margin-top: 16px; }

/* 门店列表 */
.store-list { display: flex; flex-direction: column; gap: 10px; }

.store {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    background: var(--card);
    border-radius: var(--r);
    padding: 14px 16px;
    box-shadow: var(--sh);
    transition: transform .15s ease, box-shadow .2s;
}
.store:active { transform: scale(.985); box-shadow: 0 4px 14px rgba(22, 22, 40, .08); }

.store-main { min-width: 0; flex: 1 1 auto; }
.store-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.store-addr { color: var(--sub); font-size: 12.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.store-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; color: var(--sub); font-size: 11.5px; }
.store-side { text-align: right; flex: none; }
.dist { color: var(--sub); font-size: 12px; }
.go { color: var(--red); font-size: 12.5px; font-weight: 600; margin-top: 4px; }
.go.off { color: #a7abb4; }
.store-state {
    font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
    border: 1px solid #c8ecd4; background: #eefaf1; color: #14803e;
}
.store-state.rest, .store-state.closed { border-color: #e6e7ee; background: #f4f5f8; color: #8b8b96; }
.store.closed { background: #f7f8fa; box-shadow: none; border: 1px dashed #e6e7ee; cursor: not-allowed; }
.store.closed .store-name { color: #6b6f78; }
/* 打烊的店在套餐链接里照样能点（约明天），只做轻提示，不灰掉 */
.store.rest { border: 1px solid #f0e3d8; }
.store-tip { margin-top: 6px; font-size: 11.5px; color: #c2410c; }

/* 骨架屏 */
.skeleton {
    height: 74px;
    border-radius: var(--r);
    background: linear-gradient(100deg, #eef0f4 30%, #f7f8fa 50%, #eef0f4 70%);
    background-size: 200% 100%;
    animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { from { background-position: 140% 0; } to { background-position: -40% 0; } }

@keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: none; }
}
.reveal { animation: rise .38s ease both; }

/* 空状态 */
.empty { text-align: center; padding: 40px 20px; }
.empty-ico { font-size: 34px; margin-bottom: 10px; }
.empty-title { font-weight: 600; margin: 0 0 6px; }

/* 分类胶囊 */
.chips {
    display: flex; gap: 8px; overflow-x: auto;
    padding: 2px 0 12px;
    scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
    flex: none;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 999px;
    padding: 8px 15px;
    font-size: 13.5px;
    cursor: pointer;
    transition: all .18s;
    font-family: inherit;
}
.chip.on { background: var(--red); color: #fff; border-color: var(--red); box-shadow: 0 6px 14px rgba(228, 0, 43, .2); }

/* 只有一个规格时（官方这杯只有去冰），不做选择器，只标出来 */
.ice-fixed {
    flex: none; font-size: 12px; font-weight: 600;
    color: var(--red); background: #fff5f6;
    border: 1px solid #ffd4dc; border-radius: 8px;
    padding: 3px 9px;
}

/* 菜单 */
.sections { display: flex; flex-direction: column; gap: 14px; }
.cat h3 { margin: 6px 4px 10px; font-size: 14px; color: var(--sub); font-weight: 600; letter-spacing: .5px; }

.item {
    display: flex; gap: 12px;
    background: var(--card);
    border-radius: var(--r);
    padding: 12px;
    box-shadow: var(--sh);
    margin-bottom: 10px;
}
.item.off { opacity: .62; }

.thumb {
    flex: none;
    width: 62px; height: 62px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 17px; color: #fff;
    background: linear-gradient(135deg, #ffb3c1, #ff6f83);
}

.meta { flex: 1; min-width: 0; }
.name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag {
    font-size: 10.5px; font-weight: 600; color: var(--red);
    background: #fff1f3; border: 1px solid #ffd9e0;
    border-radius: 6px; padding: 1px 5px;
}
.desc { color: var(--sub); font-size: 12.5px; margin-top: 2px; }
.price { margin-top: 6px; display: flex; align-items: baseline; gap: 8px; }
.now { color: var(--red); font-weight: 700; font-size: 15px; }
.orig { color: var(--sub); font-size: 12px; text-decoration: line-through; }
.tip { color: #b98900; font-size: 12px; }

.qty { display: flex; align-items: center; gap: 10px; align-self: center; }
.qty button {
    width: 28px; height: 28px; border-radius: 50%;
    border: 0; cursor: pointer; font-size: 15px; line-height: 1;
    font-family: inherit;
    transition: transform .12s;
}
.qty button:active { transform: scale(.9); }
.plus { background: var(--red); color: #fff; box-shadow: 0 4px 10px rgba(228, 0, 43, .25); }
.minus { background: #f3f4f7; color: #6b6b76; }
.qty button:disabled { opacity: .35; box-shadow: none; cursor: default; }
.qty .n { min-width: 16px; text-align: center; font-weight: 600; font-size: 14px; }

.lock { align-self: center; font-size: 16px; opacity: .5; }

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

.cartbar {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    margin: 0 auto;
    width: min(448px, calc(100% - 32px));
    box-sizing: border-box;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 12px 10px 18px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 12px 34px rgba(22, 22, 40, .13);
    animation: rise .35s ease both;
    z-index: 20;
}
.cart-info { flex: 1 1 auto; min-width: 0; }
.cart-count { font-size: 12.5px; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-total { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.cart-total .now { font-size: 18px; }
.cartbar .btn { flex: 0 0 auto; height: 44px; padding: 0 20px; white-space: nowrap; }

/* 结果浮层 */
.sheet-mask {
    position: fixed; inset: 0;
    background: rgba(16, 16, 24, .42);
    backdrop-filter: blur(3px);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 30;
    animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet-mask[hidden] { display: none; }

.sheet {
    width: 100%; max-width: 480px;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 26px 22px 30px;
    text-align: center;
    animation: up .32s cubic-bezier(.22, .61, .36, 1);
}
@keyframes up { from { transform: translateY(30px); } to { transform: none; } }

.sheet-ico { font-size: 40px; }
.sheet h3 { margin: 8px 0 6px; font-size: 19px; }

/* 取餐号 */
.pickup { margin: 16px 0 4px; text-align: center; }
.pickup-label { font-size: 11.5px; color: var(--sub); letter-spacing: 3px; }
.pickup-no {
    margin-top: 2px;
    font-size: 42px; font-weight: 800; line-height: 1.15;
    letter-spacing: 3px; color: var(--red);
    font-variant-numeric: tabular-nums;
}
.pickup-tail {
    margin-top: 6px; display: inline-block;
    font-size: 12.5px; color: var(--sub);
    background: #f6f7f9; border-radius: 999px; padding: 3px 12px;
}
.sheet-kv {
    margin: 16px 0 4px;
    background: #f7f8fa;
    border-radius: 14px;
    padding: 12px 14px;
    display: none;
    text-align: left;
}
.sheet-kv.on { display: block; }
.kv-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13.5px; gap: 10px; }
.kv-row span:first-child { color: var(--sub); flex: 0 1 auto; min-width: 0; }
.kv-row strong { font-weight: 700; letter-spacing: .5px; flex: 0 1 auto; min-width: 0; text-align: right; word-break: break-all; }

/* 城市选择 */
.city-chip {
    flex: none; height: 34px; padding: 0 10px;
    border: 1px solid #ffd4dc; background: #fff; color: var(--red);
    border-radius: 10px; font-size: 12.5px; font-family: inherit; cursor: pointer;
    transition: background .2s;
}
.city-chip:active { background: #fff5f6; }

.mask {
    position: fixed; inset: 0; z-index: 40;
    background: rgba(16, 16, 24, .42);
    backdrop-filter: blur(3px);
    display: flex; align-items: flex-end; justify-content: center;
    animation: fade .2s ease both;
}
.mask[hidden] { display: none; }
#city-mask .sheet { text-align: left; padding: 18px 18px 26px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 15px; margin-bottom: 12px; }
.sheet-x { border: 0; background: transparent; font-size: 20px; line-height: 1; color: var(--sub); cursor: pointer; padding: 0 4px; }
#city-kw { width: 100%; margin-bottom: 10px; }
.city-list {
    display: flex; flex-wrap: wrap; gap: 8px;
    max-height: 46vh; overflow-y: auto; padding-bottom: 4px;
}
.city-item {
    height: 34px; padding: 0 12px;
    border: 1px solid var(--line); background: #fafafc;
    border-radius: 10px; font-size: 13px; color: var(--ink);
    font-family: inherit; cursor: pointer;
    transition: background .18s, border-color .18s;
}
.city-item:active { background: #fff5f6; border-color: #ffd4dc; color: var(--red); }

/* 套餐卡 */
.combo {
    background: var(--card);
    border-radius: 22px;
    box-shadow: 0 10px 30px rgba(22, 22, 40, .07);
    padding: 16px 16px 12px;
    margin-bottom: 14px;
}

.combo-head { display: flex; align-items: center; gap: 12px; }

.combo-ico {
    flex: none;
    width: 62px; height: 62px;
    border-radius: 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px;
    background: linear-gradient(135deg, #fff1d6, #ffd9a8);
    box-shadow: inset 0 0 0 1px rgba(255, 178, 72, .25);
}

.combo-meta { flex: 1; min-width: 0; }
.combo-title { font-weight: 700; font-size: 16px; letter-spacing: .2px; }
.combo-sub { color: var(--sub); font-size: 12.5px; margin-top: 2px; }
.combo-price { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; }
.combo-price .orig { text-decoration: none; }

.combo-lines { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }

.combo-line { padding: 8px 0; }
.combo-line + .combo-line { border-top: 1px solid #f4f4f8; }

.line-main { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.line-name { font-weight: 600; font-size: 14.5px; }
.line-note { color: var(--sub); font-size: 12px; flex: none; }

.ice { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ice .chip { padding: 6px 13px; font-size: 12.5px; }

/* 打烊门店：明天的取餐时段 */
.book { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.book .chip { padding: 7px 13px; font-size: 12.5px; }
.book .chip.on { background: var(--red); border-color: var(--red); color: #fff; }

.combo-foot {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 12px; padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.card.warn { background: #fff8f1; box-shadow: none; border: 1px solid #ffe2c2; }

/* toast */
.toast {
    position: fixed; left: 50%; top: 22%;
    transform: translate(-50%, -8px);
    background: rgba(20, 20, 28, .88);
    color: #fff;
    font-size: 13.5px;
    padding: 10px 16px;
    border-radius: 12px;
    z-index: 60;
    opacity: 0;
    transition: opacity .22s, transform .22s;
    pointer-events: none;
    max-width: 78%;
    text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.foot-note { text-align: center; color: var(--sub); font-size: 12px; margin: 18px 0 0; }

/* 极验滑块弹层（官方要求人机验证时才出） */
.cap-sheet { text-align: center; }
.cap-box { margin: 14px 0 8px; min-height: 46px; }
.cap-box > div { width: 100% !important; }
#cap .btn.ghost.block { margin-top: 10px; }
.cap-loading {
    height: 46px; display: flex; align-items: center; justify-content: center;
    border-radius: 12px; background: #f6f7f9; color: var(--sub); font-size: 13px;
}

/* 失败浮层里的整宽按钮（<a> 也要居中） */
#err .btn { display: flex; align-items: center; justify-content: center; }
#err .btn.ghost.block { margin-top: 10px; }
