body {
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    overflow: hidden;
}
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg);
}

/* 头部 */
.header {
    background: var(--primary);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(255,107,53,0.3);
    flex-shrink: 0;
}
.brand { font-size: 1.3rem; font-weight: 700; }
.table-badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.95rem;
}

/* 主内容左右布局 */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}
.sidebar {
    width: 90px;
    background: #fff;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    flex-shrink: 0;
}
.category-list {
    list-style: none;
    padding: 8px 0;
}
.category-list li {
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    color: var(--text-light);
}
.category-list li.active {
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 700;
    background: #fff8f5;
}
.content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    position: relative;
}
/* 加载动画 */
.loading-overlay {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.6);
    z-index: 10;
    justify-content: center;
    align-items: center;
}
.loading-overlay.show {
    display: flex;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.menu-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.menu-card {
    background: var(--card);
    border-radius: 12px;
    display: flex;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.15s;
}
.menu-card.sold-out { opacity: 0.5; pointer-events: none; }
.menu-card .card-img {
    width: 100px;
    height: 100px;
    background: #f0f0f0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ccc;
    position: relative;
    overflow: hidden;
}
.menu-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0; left: 0;
    opacity: 0;
    filter: blur(10px);
    transition: opacity 0.4s ease, filter 0.4s ease;
}
.menu-card .card-img img.loaded {
    opacity: 1;
    filter: blur(0);
}
.menu-card .card-info {
    flex: 1;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.menu-card .card-name {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
}
.menu-card .card-desc {
    font-size: 0.75rem;
    color: var(--text-light);
    flex: 1;
}
.menu-card .card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.menu-card .price {
    color: var(--primary);
    font-weight: 700;
    font-size: 1.1rem;
}
.menu-card .add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.menu-card .add-btn:hover { background: #e55a2b; }

/* 购物车栏 */
.cart-bar {
    background: #1e1e2d;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
    flex-shrink: 0;
}
.cart-info { display: flex; align-items: center; gap: 8px; }
.cart-count {
    background: var(--primary);
    width: 20px; height: 20px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 700;
}
.btn-checkout {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 8px 24px;
    border-radius: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-checkout:hover { background: #e55a2b; }

/* 购物车弹窗 — visibility 实现进出动画 */
.cart-popup {
    visibility: hidden;
    position: fixed; top:0; left:0; right:0; bottom:0;
    z-index: 300;
    transition: visibility 0s 0.35s;
}
.cart-popup.open {
    visibility: visible;
    transition: visibility 0s 0s;
}
.cart-mask {
    position: absolute; top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    transition: opacity 0.35s ease;
}
.cart-popup.open .cart-mask { opacity: 1; }
.cart-dialog {
    position: absolute; bottom: -100%; left:0; right:0;
    max-height: 70vh;
    background: #fff; border-radius: 20px 20px 0 0; padding: 20px;
    display: flex; flex-direction: column;
    transition: bottom 0.35s ease;
}
.cart-popup.open .cart-dialog { bottom: 0; }
.cart-dialog-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.cart-dialog-header .clear-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 16px;
    padding: 4px 14px;
    font-size: 0.8rem;
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cart-dialog-header .clear-btn:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: #fff5f5;
}
.cart-dialog-list { list-style: none; overflow-y: auto; flex:1; max-height: 40vh; }
.cart-dialog-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.cart-dialog-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.btn-submit {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 12px 28px;
    border-radius: 24px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-submit:hover { background: #e55a2b; }
.btn-submit:disabled { background: #ccc; cursor: not-allowed; }

.pay-btn {
    width: 70px; height: 70px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: #fff;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    gap: 4px;
}
.pay-btn.selected { border-color: var(--primary); background: #fff5f0; }

/* 成功页面 */
.success-overlay { display: none; position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(255,255,255,0.95); z-index: 400; justify-content: center; align-items: center; }
.success-overlay.show { display: flex; }
.success-card { text-align: center; padding: 40px; background: #fff; border-radius: 20px; box-shadow: 0 8px 30px rgba(0,0,0,0.1); }
.success-card i { font-size: 4rem; color: #27ae60; }
.success-card h2 { margin: 16px 0; }
.btn-back { margin-top: 20px; }

