@font-face {
    font-family: 'princess-cute';
    src: url('fonts/princess-cute.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg: #fff7da;
    --topbar: #fff1bd;
    --card: #ffffff;
    --text: #1f2329;
    --muted: #7a828c;
    --line: #e8ebee;
    --primary: #1769e0;
    --primary-soft: #eaf2ff;
    --danger: #d94438;
    --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: #fdf1c8;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.phone {
    position: relative;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--bg);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--topbar);
}

.brand {
    font-family: 'princess-cute', '幼圆', 'YouYuan', '华文琥珀', 'STHupo', 'Comic Sans MS', cursive;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #d2691e;
    text-shadow: 1px 1px 0 #fff, 2px 2px 0 rgba(210, 105, 30, 0.18);
}
.topbar-sub { font-size: 13px; color: var(--muted); }

.content { padding: 20px 20px 150px; }

.view { display: none; }
.view.active { display: block; }

.hero { margin: 4px 4px 22px; }
.hero-img { display: block; width: 100%; border-radius: 18px; background: #fff8e1; }

/* 点单页大图满宽贴边，取消上下留白，并在底部加渐变过渡 */
#view-menu .hero {
    position: relative;
    margin: -20px -20px 0;
}
#view-menu .hero-img { border-radius: 0; }
#view-menu .hero::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 32px;
    background: linear-gradient(to bottom, rgba(255, 247, 218, 0), var(--bg));
    pointer-events: none;
}

.search {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    font-size: 14px;
    outline: none;
}
.search:focus { border-color: var(--primary); }

.chips {
    display: flex;
    gap: 5px;
    margin: 18px 0;
    overflow-x: auto;
    padding-bottom: 4px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
    flex: none;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: #555e68;
    font-size: 12px;
    cursor: pointer;
}
.chip.active { border-color: var(--primary); background: var(--primary); color: #fff; }

.card {
    margin-bottom: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
}

/* 点单页：左侧分类侧边栏 + 右侧水果列表 */
.menu-body {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.category-sidebar {
    position: sticky;
    top: 70px;
    flex: 0 0 78px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    padding-right: 2px;
}
.category-sidebar::-webkit-scrollbar { display: none; }
.category-sidebar::before {
    content: '分类';
    flex: none;
    padding: 2px 0;
    color: var(--muted);
    font-size: 11px;
    text-align: center;
}
.category-sidebar .chip {
    width: 100%;
    padding: 8px 6px;
    border-radius: 10px;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.menu-main {
    flex: 1;
    min-width: 0;
}
.menu-main .search { margin-bottom: 12px; }
#menu-list { display: block; }
#menu-list .card {
    width: 100%;
    margin: 0 0 8px;
    padding: 9px 10px;
    border-radius: 12px;
}
#menu-list .dish { align-items: center; gap: 8px; }
#menu-list .dish-img,
#menu-list .dish-thumb {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 16px;
}
#menu-list .dish-info { min-width: 0; }
#menu-list .dish-head { gap: 3px; }
#menu-list .dish-name { font-size: 14px; }
#menu-list .dish-en { font-size: 10px; }
#menu-list .desc { margin-top: 2px; font-size: 10px; }
#menu-list .add-btn { width: 28px; height: 28px; font-size: 17px; }

.dish { display: flex; align-items: center; gap: 14px; }
.dish-thumb {
    display: flex;
    width: 52px;
    height: 52px;
    flex: none;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 22px;
}
.dish-info { flex: 1; min-width: 0; }
.dish-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dish-img { width: 52px; height: 52px; flex: none; border-radius: 14px; background: var(--primary-soft); object-fit: cover; }
.dish-en { color: var(--muted); font-size: 12px; }
.dish-name { font-size: 16px; font-weight: 600; }
.desc { margin-top: 4px; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
    padding: 9px 16px;
    border: 0;
    border-radius: 12px;
    background: #eef3fb;
    color: var(--primary);
    font-size: 13px;
    cursor: pointer;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.danger { background: #fdeceb; color: var(--danger); }
.btn.block { display: block; width: 100%; margin-top: 18px; padding: 13px; font-size: 15px; }
.btn.small { padding: 6px 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.add-btn {
    width: 38px;
    height: 38px;
    flex: none;
    border: 0;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.empty { padding: 60px 16px; color: #8a9099; font-size: 14px; text-align: center; }

.line { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f2f3f5; font-size: 14px; }

.section-title { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.field {
    width: 100%;
    margin-top: 12px;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafbfc;
    font-size: 14px;
    outline: none;
}
.field:focus { border-color: var(--primary); }
.error { margin-top: 12px; color: var(--danger); font-size: 13px; }

.order-head { display: flex; align-items: center; justify-content: space-between; }
.muted { color: var(--muted); font-size: 12px; }
.status { padding: 3px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 11px; }
.order-id { margin-top: 8px; color: #a0a6ad; font-size: 11px; }
.order-row { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; font-size: 14px; }
.summary { display: block; margin-top: 8px; color: #555e68; font-size: 13px; line-height: 1.6; }
.actions { display: flex; gap: 10px; margin-top: 12px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; padding: 5px; border-radius: 14px; background: #fff; }
.tab { flex: 1; padding: 10px 0; border: 0; border-radius: 10px; background: transparent; color: #555e68; font-size: 14px; cursor: pointer; }
.tab.active { background: var(--primary); color: #fff; }
.link { color: var(--primary); font-size: 13px; cursor: pointer; }

.cart-bar {
    position: fixed;
    bottom: 62px;
    left: 50%;
    z-index: 40;
    display: flex;
    width: calc(100% - 32px);
    max-width: 448px;
    align-items: center;
    transform: translateX(-50%);
    padding: 10px 12px;
    border-radius: 18px;
    background: #1f2329;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.cart-info { display: flex; flex: 1; align-items: center; cursor: pointer; }
.cart-icon { display: flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: var(--primary); color: #fff; font-size: 15px; }
.cart-text { display: flex; flex-direction: column; margin-left: 12px; }
.cart-count { color: #d6dae0; font-size: 12px; }
.checkout-btn { padding: 10px 20px; }

.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    z-index: 45;
    display: flex;
    width: 100%;
    max-width: 480px;
    transform: translateX(-50%);
    border-top: 1px solid var(--line);
    background: #fff;
}
.tabbar-item { flex: 1; padding: 14px 0; border: 0; background: transparent; color: #8a9099; font-size: 13px; cursor: pointer; }
.tabbar-item.active { color: var(--primary); font-weight: 600; }

.mask { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.38); }
.sheet {
    position: fixed;
    bottom: 0;
    left: 50%;
    z-index: 51;
    width: 100%;
    max-width: 480px;
    transform: translateX(-50%);
    padding: 22px 20px 32px;
    border-radius: 22px 22px 0 0;
    background: #fff;
    max-height: 78vh;
    overflow-y: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cart-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #f0f1f2; }
.qty { display: flex; align-items: center; gap: 10px; }
.qty button { width: 30px; height: 30px; border: 0; border-radius: 8px; background: var(--primary-soft); color: var(--primary); font-size: 16px; cursor: pointer; }

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 80;
    transform: translate(-50%, -50%);
    padding: 12px 20px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 14px;
}

.result-title { margin: 0 0 14px; font-size: 24px; font-weight: 600; }
.result-row { display: flex; justify-content: space-between; padding: 11px 0; border-bottom: 1px solid #f2f3f5; font-size: 14px; }
