* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    height: 100%;
    height: -webkit-fill-available;
}

:root {
    --primary-color: #c41e3a;
    --primary-light: #e63946;
    --primary-dark: #a01830;
    --secondary-color: #fff;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --border-color: #eee;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --vh: 1vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-color);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-text-size-adjust: 100%;
    height: 100%;
    height: -webkit-fill-available;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== 移动端默认样式 (Mobile First - 默认生效) ===== */
.phone-frame-wrapper {
    display: block;
    padding: 0;
    background: var(--bg-color);
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    height: 100%;
    width: 100%;
}
.phone-frame {
    width: 100%;
    height: auto;
    background: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    overflow: visible;
    position: relative;
}
.phone-notch { display: none; }
.phone-screen {
    width: 100%;
    height: auto;
    background: var(--bg-color);
    border-radius: 0;
    overflow: visible;
    position: relative;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
}
.phone-screen::-webkit-scrollbar { display: none; }
.phone-screen .app-container {
    max-width: 100%;
    padding-bottom: 130px;
}
.phone-screen .category-sidebar {
    position: sticky;
    top: 153px;
    align-self: flex-start;
    height: auto;
    max-height: calc(100vh - 200px);
    max-height: calc(var(--vh, 1vh) * 60);
    overflow-y: auto;
    z-index: 50;
}
.phone-frame > .cart-bar,
.phone-frame > .bottom-nav,
.phone-frame > .cart-footer-bar,
.phone-frame > .co-submit-bar,
.phone-frame > .pay-bar {
    position: fixed;
    left: 0;
    right: 0;
    transform: none;
    max-width: none;
    width: 100%;
    z-index: 100;
    border-radius: 0;
}
.phone-frame > .cart-bar {
    bottom: 50px;
}
.phone-frame > .bottom-nav {
    bottom: 0;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.phone-frame > .cart-footer-bar,
.phone-frame > .co-submit-bar,
.phone-frame > .pay-bar {
    bottom: 50px;
}
.phone-frame > .cart-popup,
.phone-frame > .cart-mask {
    position: fixed;
}
.phone-frame > .cart-popup {
    bottom: 115px;
    left: 10px;
    right: 10px;
    max-width: none;
    width: auto;
    z-index: 101;
}
.phone-screen .toast {
    position: fixed;
}
.phone-frame > .dish-detail-modal,
.phone-frame > .order-detail-modal,
.phone-frame > .pay-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    z-index: 99999;
    border-radius: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
}
.phone-frame > .dish-detail-modal .dish-detail-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 88vh;
    max-height: calc(var(--vh, 1vh) * 88);
}
/* 安全独立样式 - 即使JS把元素移动到body下也能正确显示 (移动端) */
.cart-footer-bar, .co-submit-bar, .pay-bar {
    position: fixed;
    left: 0; right: 0; bottom: 50px;
    width: 100%;
    max-width: none;
    z-index: 100;
    border-radius: 0;
    transform: none;
}
.cart-popup {
    position: fixed;
    bottom: 115px;
    left: 10px; right: 10px;
    width: auto;
    max-width: none;
    z-index: 101;
}
.cart-mask, .cart-popup-mask {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99;
}
.dish-detail-modal, .order-detail-modal, .pay-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100vw;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    z-index: 99999;
    border-radius: 0;
    overflow: hidden;
    margin: 0; padding: 0;
}

/* ===== PC端样式 - 大屏幕+鼠标设备才显示手机外框 ===== */
@media screen and (min-width: 769px) and (pointer: fine) {
.phone-frame-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 20px;
    height: 100vh;
    width: auto;
}
.phone-frame {
    position: relative;
    width: 420px;
    height: 800px;
    background: #1a1a1a;
    border-radius: 50px;
    padding: 12px;
    overflow: hidden;
    box-shadow: 
        0 0 0 2px #333,
        0 20px 60px rgba(0,0,0,0.5),
        inset 0 0 10px rgba(255,255,255,0.05);
    border: none;
}
.phone-notch {
    display: block;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 28px;
    background: #000;
    border-radius: 0 0 18px 18px;
    z-index: 1000;
}
.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    border-radius: 40px;
    overflow: hidden;
    overflow-y: auto;
    position: relative;
    min-height: auto;
}
.phone-screen .app-container {
    max-width: 100%;
    padding-bottom: 175px;
}
.phone-screen .category-sidebar {
    position: sticky;
    top: 153px;
    align-self: flex-start;
    height: auto;
    max-height: 440px;
    overflow-y: auto;
    z-index: 50;
}
.phone-screen .category-title {
    top: 153px;
    z-index: 10;
}
.phone-frame > .cart-bar {
    position: absolute;
    bottom: 92px;
    left: 27px;
    right: 27px;
    transform: none;
    max-width: none;
    width: auto;
    z-index: 102;
    overflow: visible;
}
.phone-frame > .bottom-nav {
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
    width: auto;
    z-index: 100;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
    padding-bottom: 8px;
}
.phone-frame > .cart-footer-bar,
.phone-frame > .co-submit-bar,
.phone-frame > .pay-bar {
    position: absolute;
    bottom: 72px;
    left: 12px;
    right: 12px;
    transform: none;
    max-width: none;
    width: auto;
    z-index: 102;
    border-radius: 0;
}
.phone-frame > .cart-popup {
    position: absolute;
    bottom: 148px;
    left: 22px;
    right: 22px;
    z-index: 101;
}
.phone-frame > .cart-mask {
    position: absolute;
    top: 0; left: 12px; right: 12px; bottom: 0;
    z-index: 99;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
}
.phone-screen .toast {
    position: absolute;
}
.phone-frame > .dish-detail-modal,
.phone-frame > .order-detail-modal,
.phone-frame > .pay-modal {
    position: absolute;
    top: 12px; left: 12px; right: 12px; bottom: 12px;
    width: auto;
    height: auto;
    z-index: 200;
    border-radius: 40px;
    overflow: hidden;
}
.phone-frame > .dish-detail-modal .dish-detail-content {
    max-height: 80%;
    border-bottom-left-radius: 40px;
    border-bottom-right-radius: 40px;
}
} /* ===== END PC media query ===== */

.app-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    background: var(--bg-color);
    position: relative;
    padding-bottom: 130px;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #fff;
    padding: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 15px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-icon {
    font-size: 24px;
}

.logo-text {
    font-size: 18px;
    font-weight: 600;
}

.table-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
}

@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
    .table-badge {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
    .search-input-wrap {
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

.search-bar {
    padding: 0 15px 15px;
}

.search-input-wrap {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 25px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-input-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 14px;
}

.search-input-wrap input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-icon {
    font-size: 16px;
}

.main-content {
    padding: 0;
}

.menu-layout {
    display: flex;
    min-height: calc(100vh - 180px);
    overflow: visible;
}

.category-sidebar {
    width: 90px;
    background: #f8f8f8;
    flex-shrink: 0;
    position: sticky;
    top: 120px;
    height: calc(100vh - 190px);
    overflow-y: auto;
}

.category-item {
    padding: 15px 10px;
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.category-item.active {
    background: #fff;
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

.category-item:hover {
    background: #fff;
}

.dish-content {
    flex: 1;
    min-width: 0;
    background: #fff;
    padding: 10px 0;
    overflow: visible;
}

.category-title {
    padding: 10px 15px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dish-list {
    padding: 0 20px 0 5px;
    overflow: visible;
}

.dish-item {
    display: flex;
    padding: 12px 3px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    overflow: visible;
}

.dish-item:last-child {
    border-bottom: none;
}

.dish-image {
    width: 82px;
    height: 82px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.dish-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dish-badges {
    position: absolute;
    top: 5px;
    left: 5px;
    display: flex;
    gap: 3px;
}

.badge {
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    font-weight: 500;
}

.badge-hot {
    background: var(--primary-color);
    color: #fff;
}

.badge-recommend {
    background: var(--warning-color);
    color: #fff;
}

.dish-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.dish-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dish-desc {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.dish-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.dish-price-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0;
}

.dish-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.dish-price::before {
    content: '¥';
    font-size: 13px;
}

.dish-original-price,
.dish-sales {
    display: none;
}

.dish-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 15;
    flex-shrink: 0;
    overflow: visible;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-quantity {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.1s;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.btn-quantity:active {
    transform: scale(0.9);
}

.btn-minus {
    background: #f0f0f0;
    color: #666;
}

.btn-plus {
    background: #c41e3a;
    color: #fff;
}

.quantity-num {
    font-size: 14px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

.btn-add {
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 50%;
    background: #c41e3a;
    color: #fff;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
    transition: transform 0.1s, background 0.2s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    position: relative;
    z-index: 10;
}

.btn-add:active {
    transform: scale(0.9);
    background: #a01830;
}

.cart-bar {
    position: fixed;
    bottom: 65px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 30px);
    max-width: 450px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 8px 8px 8px 12px;
    z-index: 99;
    box-sizing: border-box;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    height: 50px;
}

.cart-bar.d-none {
    display: none !important;
}

.cart-icon-wrap {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-radius: 50%;
    margin-top: -18px;
    margin-bottom: -18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.4);
    flex-shrink: 0;
    cursor: pointer;
}

.cart-dish-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: none;
}

.cart-icon {
    font-size: 22px;
    display: flex;
}

.cart-icon.hidden {
    display: none;
}

.cart-dish-preview.show {
    display: block;
}

.cart-count {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--danger-color);
    color: #fff;
    font-size: 11px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    font-weight: 600;
    border: 2px solid #fff;
}

.cart-info {
    flex: 1;
    padding: 0 12px;
    cursor: pointer;
    min-width: 0;
}

.cart-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1.2;
}

.cart-total::before {
    content: '¥';
    font-size: 13px;
}

.cart-tip {
    font-size: 11px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-checkout {
    padding: 0 20px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-checkout:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff;
    display: flex;
    border-top: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
    text-decoration: none;
    color: var(--text-light);
    position: relative;
    transition: color 0.2s;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.nav-text {
    font-size: 11px;
}

.cart-badge {
    position: absolute;
    top: 3px;
    right: 50%;
    transform: translateX(20px);
    background: var(--primary-color);
    color: #fff;
    font-size: 10px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.page-header {
    background: #fff;
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    margin-right: 10px;
}

.page-title {
    font-size: 17px;
    font-weight: 600;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-text {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 20px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.cart-list {
    background: #fff;
    padding: 0 15px;
}

.cart-item {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    align-items: center;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
}

.cart-item-price {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
}

.cart-item-price::before {
    content: '¥';
    font-size: 12px;
}

.cart-item-actions {
    display: flex;
    align-items: center;
}

.checkout-section {
    background: #fff;
    margin-top: 10px;
    padding: 15px;
}

.checkout-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
}

.checkout-row:last-child {
    border-bottom: none;
}

.checkout-label {
    color: var(--text-secondary);
}

.checkout-value {
    font-weight: 600;
}

.total-amount {
    font-size: 22px;
    color: var(--primary-color);
    font-weight: 700;
}

.total-amount::before {
    content: '¥';
    font-size: 14px;
}

.btn-submit-order {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 15px;
    cursor: pointer;
}

.table-input-wrap {
    padding: 15px;
    background: #fff;
    margin-bottom: 10px;
}

.input-group {
    margin-bottom: 15px;
}

.input-label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.input-field:focus {
    border-color: var(--primary-color);
}

textarea.input-field {
    resize: none;
    height: 80px;
    width: 100%;
    box-sizing: border-box;
}

.order-list {
    padding: 10px;
}

.order-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.order-no {
    font-size: 13px;
    color: var(--text-secondary);
}

.order-status {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 15px;
}

.status-pending {
    background: #fff7e6;
    color: #fa8c16;
}

.status-paid {
    background: #e6f7ff;
    color: #1890ff;
}

.status-cooking {
    background: #f6ffed;
    color: #52c41a;
}

.status-completed {
    background: #f0f0f0;
    color: #666;
}

.status-cancelled {
    background: #fff1f0;
    color: #ff4d4f;
}

.order-items {
    margin-bottom: 12px;
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 13px;
}

.order-item-name {
    color: var(--text-primary);
}

.order-item-qty {
    color: var(--text-light);
    margin-left: 10px;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.order-total {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
}

.order-total::before {
    content: '共';
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: normal;
    margin-right: 5px;
}

.order-time {
    font-size: 12px;
    color: var(--text-light);
}

.order-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.order-detail-modal.show {
    display: flex;
}
body.is-mobile .order-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    background: rgba(0,0,0,0.5);
    z-index: 99998;
    margin: 0;
    padding: 0;
    border-radius: 0;
    transform: none;
}
body.is-mobile .order-detail-modal .modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    max-height: calc(var(--vh, 1vh) * 80);
}

.modal-content {
    background: #fff;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 20px 20px 0 0;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    padding: 20px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 10;
}

.modal-title {
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-light);
}

.modal-body {
    padding: 15px;
}

.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 999;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.admin-container {
    max-width: 100%;
    min-height: 100vh;
    background: #f0f2f5;
}

.admin-login {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
}

.admin-login-box {
    background: #fff;
    border-radius: 15px;
    padding: 40px 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.admin-login-title {
    text-align: center;
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 30px;
    font-weight: 700;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: linear-gradient(180deg, #001529 0%, #000c17 100%);
    color: #fff;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.admin-sidebar-header {
    padding: 22px 20px;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    letter-spacing: 1px;
}

.admin-nav {
    list-style: none;
    padding: 12px 0;
}

.admin-nav li a {
    display: flex;
    align-items: center;
    padding: 13px 22px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.25s ease;
    margin: 2px 8px;
    border-radius: 8px;
    position: relative;
}

.admin-nav li a:hover {
    background: rgba(196, 30, 58, 0.15);
    color: #fff;
    transform: translateX(3px);
}

.admin-nav li a.active {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.35);
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 220px;
    min-width: 0;
}

.admin-topbar {
    background: #fff;
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.admin-topbar-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.admin-topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-view-frontend {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s;
    border: 1px solid rgba(196, 30, 58, 0.2);
}

.admin-view-frontend:hover {
    background: var(--primary-color);
    color: #fff;
}

.admin-welcome {
    color: #666;
    font-size: 14px;
}

.admin-logout {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: 6px;
    transition: all 0.2s;
}

.admin-logout:hover {
    background: #fff1f0;
}

.admin-content {
    padding: 25px 30px;
    flex: 1;
}

.admin-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin-bottom: 20px;
    transition: box-shadow 0.3s;
}

.admin-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 8px;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid #f5f5f5;
}

.admin-table th {
    background: linear-gradient(180deg, #fafbfc 0%, #f5f7fa 100%);
    font-weight: 600;
    color: #555;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-table tr:hover {
    background: #fafcff;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-btn {
    padding: 8px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    margin-right: 6px;
    transition: all 0.2s ease;
}

.admin-btn:hover {
    transform: translateY(-1px);
}

.admin-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.25);
}

.admin-btn-primary:hover {
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.35);
}

.admin-btn-danger {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.25);
}

.admin-btn-default {
    background: #fff;
    color: var(--text-primary);
    border: 1px solid #d9d9d9;
}

.admin-btn-default:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fffafa;
}

.admin-btn-success {
    background: linear-gradient(135deg, #52c41a 0%, #73d13d 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(82, 196, 26, 0.25);
}

.admin-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.admin-form-row {
    display: flex;
    margin-bottom: 18px;
    align-items: center;
}

.admin-form-label {
    width: 120px;
    text-align: right;
    padding-right: 18px;
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.admin-form-input {
    flex: 1;
    max-width: 480px;
}

.admin-form-input input,
.admin-form-input select,
.admin-form-input textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.admin-form-input input:focus,
.admin-form-input select:focus,
.admin-form-input textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.1);
}

.admin-form-input textarea {
    resize: vertical;
    min-height: 80px;
}

.admin-form-actions {
    padding-left: 138px;
    padding-top: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: linear-gradient(135deg, #fff 0%, #fafbfc 100%);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-value {
    font-size: 34px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: #888;
    font-weight: 500;
}

.admin-nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 10px 16px;
}

.admin-card-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-card-desc {
    font-size: 13px;
    color: #888;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.admin-alert {
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.admin-alert-success {
    background: linear-gradient(135deg, #f6ffed 0%, #f0fff4 100%);
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

.admin-alert-error {
    background: linear-gradient(135deg, #fff2f0 0%, #fff7f6 100%);
    border: 1px solid #ffccc7;
    color: #cf1322;
}

.admin-tip {
    background: linear-gradient(135deg, #f0f5ff 0%, #f5f8ff 100%);
    border-radius: 10px;
    padding: 14px 18px;
    font-size: 13px;
    color: #2f54eb;
    margin-top: 18px;
    line-height: 1.7;
    border-left: 3px solid #597ef7;
}

.admin-tip-warn {
    background: linear-gradient(135deg, #fffbe6 0%, #fffdf0 100%);
    color: #d48806;
    border-left-color: #faad14;
}

.admin-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px dashed transparent;
    transition: border-color 0.2s;
}

.admin-link:hover {
    border-bottom-color: var(--primary-color);
}

.pay-channel {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    margin-bottom: 18px;
    overflow: hidden;
    transition: all 0.3s;
}

.pay-channel:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.pay-channel-wechat {
    border-color: #b7eb8f;
    background: linear-gradient(135deg, #f6ffed 0%, #fff 30%);
}

.pay-channel-alipay {
    border-color: #91d5ff;
    background: linear-gradient(135deg, #e6f7ff 0%, #fff 30%);
}

.pay-channel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px;
    background: rgba(255,255,255,0.85);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.pay-channel-icon {
    font-size: 26px;
}

.pay-channel-name {
    font-weight: 600;
    font-size: 16px;
    flex: 1;
    color: #333;
}

.pay-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    user-select: none;
}

.pay-toggle input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    -webkit-appearance: none;
    background: #ccc;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.pay-toggle input[type="checkbox"]::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.pay-toggle input[type="checkbox"]:checked {
    background: #52c41a;
}

.pay-toggle input[type="checkbox"]:checked::after {
    transform: translateX(20px);
}

.mode-selector {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.mode-option {
    cursor: pointer;
    display: block;
}

.mode-option input[type="radio"] {
    display: none;
}

.mode-card {
    border: 2px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px 18px;
    min-width: 180px;
    background: #fafafa;
    transition: all 0.25s ease;
    text-align: left;
}

.mode-option:hover .mode-card {
    border-color: #c41e3a;
    background: #fff5f5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196,30,58,0.15);
}

.mode-option input[type="radio"]:checked ~ .mode-card {
    border-color: #c41e3a;
    background: #fff5f5;
    box-shadow: 0 4px 16px rgba(196,30,58,0.2);
}

.mode-option input[type="radio"]:checked ~ .mode-card::after {
    content: '✓';
    position: absolute;
    top: -1px;
    right: -1px;
    width: 26px;
    height: 26px;
    background: #c41e3a;
    color: #fff;
    border-radius: 0 8px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.mode-card {
    position: relative;
    overflow: hidden;
}

.mode-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.mode-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.mode-option input[type="radio"]:checked ~ .mode-card .mode-name {
    color: #c41e3a;
}

.mode-desc {
    font-size: 12px;
    color: #999;
    line-height: 1.5;
}

.pay-channel-body {
    padding: 20px 22px;
    background: #fff;
}

.printer-section {
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.printer-section:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.printer-section-header {
    padding: 16px 22px;
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%);
    border-bottom: 1px solid #f0f0f0;
}

.printer-section-body {
    padding: 20px 22px;
}

.miniapp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.miniapp-card {
    background: linear-gradient(145deg, #fff 0%, #fff9f9 100%);
    border: 2px solid #ffe0e0;
    border-radius: 16px;
    padding: 30px 25px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.miniapp-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(196,30,58,0.05) 0%, transparent 70%);
    transition: all 0.5s;
}

.miniapp-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 24px rgba(196,30,58,0.15);
    transform: translateY(-4px);
}

.miniapp-card:hover::before {
    top: -30%;
    right: -30%;
}

.miniapp-card-icon {
    font-size: 56px;
    margin-bottom: 14px;
    position: relative;
    z-index: 1;
}

.miniapp-card-title {
    font-weight: 600;
    font-size: 17px;
    color: #222;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.miniapp-card-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.7;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.miniapp-features {
    list-style: none;
    padding: 0;
    margin: 0 0 22px 0;
    text-align: left;
    font-size: 13px;
    color: #666;
    line-height: 2.2;
    background: #fafafa;
    border-radius: 8px;
    padding: 12px 16px;
    position: relative;
    z-index: 1;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 14px;
}

.quick-link-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 12px;
    background: linear-gradient(145deg, #fafbfc 0%, #f5f7fa 100%);
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    text-decoration: none;
    color: #444;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 10px;
}

.quick-link-item:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: linear-gradient(145deg, #fff5f5 0%, #fff 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(196,30,58,0.12);
}

.quick-link-icon {
    font-size: 32px;
    transition: transform 0.2s;
}

.quick-link-item:hover .quick-link-icon {
    transform: scale(1.1);
}

.quick-link-text {
    font-size: 13px;
    font-weight: 500;
}

.order-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.order-status.status-pending { background: linear-gradient(135deg, #fff7e6, #fff1d6); color: #d46b08; }
.order-status.status-paid { background: linear-gradient(135deg, #e6f7ff, #d6efff); color: #096dd9; }
.order-status.status-cooking { background: linear-gradient(135deg, #f6ffed, #e6ffe6); color: #389e0d; }
.order-status.status-completed { background: linear-gradient(135deg, #f5f5f5, #ebebeb); color: #8c8c8c; }
.order-status.status-cancelled { background: linear-gradient(135deg, #fff2f0, #ffe6e6); color: #cf1322; }

.pay-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 99997;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.pay-modal.show {
    display: flex;
}
body.is-mobile .pay-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    background: rgba(0,0,0,0.6);
    z-index: 99997;
    margin: 0;
    padding: 20px;
    border-radius: 0;
    transform: none;
}

.qrcode-box {
    background: #fff;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    width: 100%;
    max-width: 300px;
}

.qrcode-placeholder {
    width: 200px;
    height: 200px;
    background: #f5f5f5;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-light);
    border: 2px dashed var(--border-color);
}

.pay-tip {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 15px;
}

.btn-cancel-pay {
    padding: 10px 30px;
    background: #f5f5f5;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-secondary);
}

.dish-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.55);
    background: #000\9;
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    display: none;
    align-items: flex-end;
    justify-content: center;
}
.dish-detail-modal.show {
    display: flex;
}
.dish-detail-content {
    background: #fff;
    width: 100%;
    max-width: 480px;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 88%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: slideUp 0.3s ease;
    position: relative;
    z-index: 100000;
}
body.is-mobile .dish-detail-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    background: rgba(0,0,0,0.55);
    z-index: 99999;
    margin: 0;
    padding: 0;
    border-radius: 0;
    transform: none;
}
body.is-mobile .dish-detail-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 16px 16px 0 0;
    max-height: 88vh;
    max-height: calc(var(--vh, 1vh) * 88);
}
body.is-ios .dish-detail-modal {
    height: calc(var(--vh, 1vh) * 100);
}
body.is-ios .dish-detail-content {
    max-height: calc(var(--vh, 1vh) * 88);
}
.dish-detail-img {
    width: 100%;
    height: 220px;
    background: linear-gradient(135deg,var(--primary-color),var(--primary-light));
    display: flex; align-items: center; justify-content: center;
    font-size: 80px; color: #fff;
    position: relative; overflow: hidden;
}
.dish-detail-img img { width:100%;height:100%;object-fit:cover; }
.dish-detail-close {
    position: absolute; top: 12px; right: 12px;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0,0,0,0.5); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; cursor: pointer;
}
.dish-detail-body { padding: 15px; }
.dish-detail-name { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.dish-detail-desc { font-size: 13px; color: var(--text-light); margin-bottom: 12px; line-height: 1.5; }
.dish-detail-price { font-size: 26px; font-weight: 700; color: var(--primary-color); margin-bottom: 15px; }
.dish-detail-price::before { content:'¥'; font-size:16px; }
.spec-section { margin-bottom: 15px; }
.spec-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; display: flex; align-items: center; }
.spec-required { color: var(--danger-color); margin-right: 3px; }
.spec-options { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-option {
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    background: #fafafa;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.spec-option.active {
    background: #fff1f0;
    border-color: var(--primary-color);
    color: var(--primary-color);
}
.spec-option .plus { color: var(--text-light); font-size: 11px; }
.spec-option.active .plus { color: var(--primary-color); }
.detail-qty-bar {
    position: sticky; bottom: 0; background: #fff;
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 15px; border-top: 1px solid var(--border-color);
}
.btn-add-cart-detail {
    padding: 12px 30px;
    background: linear-gradient(135deg,var(--primary-color),var(--primary-light));
    color: #fff; border: none; border-radius: 25px;
    font-size: 15px; font-weight: 600; cursor: pointer;
}
.business-banner {
    background: linear-gradient(135deg,#fff7e6,#fff1f0);
    color: var(--primary-color);
    padding: 8px 15px; font-size: 12px;
    display: flex; align-items: center; gap: 6px;
    border-bottom: 1px solid #ffe7cc;
}
.closed-banner {
    background: var(--primary-color);
    color: #fff;
    padding: 30px 20px;
    text-align: center;
}
.closed-banner .closed-icon { font-size: 50px; margin-bottom: 10px; }
.closed-banner .closed-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.closed-banner .closed-reason { font-size: 14px; opacity: 0.9; margin-bottom: 15px; }
.header-info {
    padding: 0 15px 10px; display: flex; justify-content: space-between; align-items: center;
    color: rgba(255,255,255,0.9); font-size: 12px;
}
.header-status { display: flex; align-items: center; gap: 5px; }
.status-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #52c41a; display: inline-block;
}
.status-dot.off { background: #ff4d4f; }
.dish-clickable { cursor: pointer; }
.dish-clickable:active { background: #fafafa; }
.spec-text { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.pay-mode-option {
    display: flex; align-items: flex-start; gap: 10px; padding: 12px;
    border: 1px solid var(--border-color); border-radius: 10px; margin-bottom: 10px; cursor: pointer;
}
.pay-mode-option.active { border-color: var(--primary-color); background: #fff1f0; }
.pay-mode-option input { margin-top: 3px; }

.admin-nav .nav-badge {
    display: inline-block;
    background: #ff4d4f;
    color: #fff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 6px;
    font-weight: bold;
    animation: badgePulse 1.5s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.order-notify-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.order-notify-modal {
    background: #fff;
    border-radius: 16px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: notifyBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
}

@keyframes notifyBounce {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.order-notify-header {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: #fff;
    padding: 20px;
    text-align: center;
    position: relative;
}

.order-notify-header.alerting {
    animation: headerFlash 0.8s ease-in-out infinite;
}

@keyframes headerFlash {
    0%, 100% { background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%); }
    50% { background: linear-gradient(135deg, #cf1322 0%, #ff4d4f 100%); }
}

.order-notify-icon {
    font-size: 48px;
    margin-bottom: 8px;
    animation: bellRing 0.5s ease-in-out infinite;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

.order-notify-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 4px;
}

.order-notify-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

.order-notify-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.order-notify-close:hover {
    background: rgba(255,255,255,0.4);
}

.order-notify-body {
    padding: 24px;
}

.order-notify-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.order-notify-info-item {
    text-align: center;
}

.order-notify-info-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 4px;
}

.order-notify-info-value {
    font-size: 24px;
    font-weight: bold;
    color: #ff4d4f;
}

.order-notify-info-value.table {
    font-size: 32px;
}

.order-notify-detail {
    background: #f8f8f8;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: #666;
}

.order-notify-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
}

.order-notify-detail-row .label {
    color: #999;
}

.order-notify-detail-row .value {
    color: #333;
    font-weight: 500;
}

.order-notify-actions {
    display: flex;
    gap: 12px;
}

.order-notify-btn {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.order-notify-btn-primary {
    background: linear-gradient(135deg, #ff4d4f 0%, #ff7875 100%);
    color: #fff;
}

.order-notify-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,77,79,0.4);
}

.order-notify-btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.order-notify-btn-secondary:hover {
    background: #eee;
}

.order-notify-btn-print {
    background: linear-gradient(135deg, #1890ff 0%, #40a9ff 100%);
    color: #fff;
}

.order-notify-btn-print:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24,144,255,0.4);
}

.print-queue-bar {
    position: fixed;
    top: 56px;
    left: 220px;
    right: 0;
    height: 44px;
    background: linear-gradient(90deg, #ff7a00, #ff4d4f);
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 9998;
    box-shadow: 0 2px 8px rgba(255,77,79,0.4);
    animation: printBarPulse 2s ease-in-out infinite;
    gap: 12px;
}

@keyframes printBarPulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(255,77,79,0.4); }
    50% { box-shadow: 0 2px 20px rgba(255,77,79,0.7); }
}

.print-queue-icon {
    font-size: 22px;
    animation: printIconShake 1s ease-in-out infinite;
}

@keyframes printIconShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

.print-queue-text {
    flex: 1;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.print-queue-btn {
    padding: 6px 20px;
    background: #fff;
    color: #ff4d4f;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.print-queue-btn:hover {
    background: #fff1f0;
    transform: scale(1.05);
}

.print-queue-close {
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.print-queue-close:hover {
    background: rgba(255,255,255,0.4);
}

.ws-status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.ws-status-dot.online {
    background: #52c41a;
    box-shadow: 0 0 6px rgba(82,196,26,0.6);
}

.ws-status-dot.offline {
    background: #ff4d4f;
}

.ws-status-dot.connecting {
    background: #faad14;
    animation: statusBlink 1s ease-in-out infinite;
}

@keyframes statusBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.admin-ws-status {
    font-size: 12px;
    color: #999;
    margin-right: 12px;
    display: flex;
    align-items: center;
}

.order-notify-sound-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4d4f, #ff7875);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    z-index: 99998;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255,77,79,0.5);
    animation: soundPulse 1s ease-in-out infinite;
}

@keyframes soundPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(255,77,79,0.5); transform: scale(1); }
    50% { box-shadow: 0 4px 28px rgba(255,77,79,0.8); transform: scale(1.08); }
}

/* ===== 微信小程序webview适配 - 所有底部栏在导航上方不重叠 ===== */
body.is-miniapp .app-container {
    padding-bottom: calc(160px + env(safe-area-inset-bottom, 0px)) !important;
}
/* 首页购物车栏 */
body.is-miniapp .cart-bar {
    position: fixed !important;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    transform: none !important;
    -webkit-transform: none !important;
    z-index: 101 !important;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08) !important;
    margin: 0 !important;
}
/* 购物车弹层和遮罩 - 打开时覆盖导航 */
body.is-miniapp .cart-popup {
    position: fixed !important;
    bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 16px 16px 0 0 !important;
    transform: none !important;
    -webkit-transform: none !important;
    z-index: 201 !important;
    margin: 0 !important;
}
body.is-miniapp .cart-popup-mask {
    position: fixed !important;
    z-index: 200 !important;
}
/* 底部导航 */
body.is-miniapp .bottom-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    -webkit-transform: none !important;
    z-index: 100 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    box-sizing: content-box !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05) !important;
}
body.is-miniapp .bottom-nav .nav-item {
    box-sizing: border-box !important;
}
/* 购物车页/结算页/支付页底部提交栏 */
body.is-miniapp .cart-footer-bar,
body.is-miniapp .co-submit-bar,
body.is-miniapp .pay-bar {
    position: fixed !important;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px)) !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    transform: none !important;
    -webkit-transform: none !important;
    z-index: 101 !important;
    padding-bottom: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.08) !important;
}
body.is-miniapp .menu-layout {
    min-height: auto;
}
body.is-miniapp .category-sidebar {
    height: auto;
}

