/* ===== 七洋食堂 - 移动端样式 ===== */

:root {
    --primary: #FF6B35;
    --primary-dark: #E55A2B;
    --primary-light: #FFF0E8;
    --secondary: #FF8C5A;
    --bg: #F7F8FC;
    --card: #FFFFFF;
    --text: #1A1A2E;
    --text2: #6B7280;
    --text3: #9CA3AF;
    --border: #F0F0F5;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --shadow: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 14px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 70px;
}

/* ========== 通用组件 ========== */

.page-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}
.page-header .back {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
    color: #fff;
}
.page-header h1 {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
}

.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin: 12px 16px;
    overflow: hidden;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 15px rgba(255,107,53,0.3);
}
.btn-primary:active { transform: scale(0.96); opacity: 0.9; }
.btn-block { width: 100%; }
.btn-outline {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}
.btn-sm { padding: 6px 16px; font-size: 12px; }
.btn-gray { background: #F3F4F6; color: var(--text2); }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text3);
}
.empty-state .icon { font-size: 56px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ========== 底部导航 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--card);
    display: flex;
    padding-bottom: var(--safe-bottom);
    box-shadow: 0 -2px 20px rgba(0,0,0,0.06);
}
.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 0 4px;
    text-decoration: none;
    color: var(--text3);
    font-size: 10px;
    transition: color 0.2s;
    position: relative;
}
.bottom-nav a .nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1px;
}
.bottom-nav a .nav-svg {
    width: 24px;
    height: 24px;
    display: block;
}
.bottom-nav a.active .nav-svg {
    filter: drop-shadow(0 1px 3px rgba(255, 107, 53, 0.25));
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a .cart-badge {
    position: absolute;
    top: 2px;
    right: 50%;
    transform: translateX(18px);
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}

/* ========== 首页 ========== */
.store-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 20px 16px 30px;
    color: #fff;
    position: relative;
}
.store-header .store-name {
    font-size: 22px; font-weight: 700;
    margin-bottom: 4px;
}
.store-header .store-info {
    display: flex; gap: 16px; align-items: center;
    font-size: 13px; opacity: 0.9;
}
.store-header .store-notice {
    margin-top: 10px;
    background: rgba(255,255,255,0.15);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-bar {
    margin: -18px 16px 12px;
    background: var(--card);
    border-radius: 25px;
    box-shadow: var(--shadow-lg);
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 10;
}
.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 14px;
    background: transparent;
}
.search-bar .search-icon { color: var(--text3); font-size: 18px; }

/* 分类导航 */
.cat-nav {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding: 0 16px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav .cat-item {
    flex-shrink: 0;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    background: var(--card);
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    box-shadow: var(--shadow);
}
.cat-nav .cat-item.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    box-shadow: 0 4px 12px rgba(255,107,53,0.3);
}

/* 推荐菜品 */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px 8px;
    font-size: 16px;
    font-weight: 600;
}
.section-title .more { font-size: 13px; color: var(--text3); font-weight: 400; }

.recommend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px;
    margin-bottom: 12px;
}

.product-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s;
}
.product-card:active { transform: scale(0.97); }
.product-card .img-wrap {
    width: 100%;
    aspect-ratio: 1/1;
    background: linear-gradient(135deg, #FFF5F0, #FFE8D6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--primary);
}
.product-card .info {
    padding: 8px 10px 10px;
}
.product-card .info .name {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.product-card .info .price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
}
.product-card .info .pd-price-area { display:flex; flex-direction:column; gap:1px; }
.product-card .info .pd-mp { font-size:15px; font-weight:700; color:var(--primary); }
.product-card .info .pd-mp::before { content:'¥'; font-size:11px; }
.product-card .info .pd-mp-tag { font-size:9px; background:var(--primary-light); color:var(--primary); padding:0 4px; border-radius:2px; }
.product-card .info .pd-np { font-size:11px; color:var(--text2); }
.product-card .info .add-btn {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}

/* ========== 菜单页 ========== */
.menu-page {
    display: flex;
    height: calc(100vh - 70px);
}
.menu-sidebar {
    width: 90px;
    flex-shrink: 0;
    background: var(--card);
    overflow-y: auto;
    padding: 8px 0;
}
.menu-sidebar .side-cat {
    padding: 12px 10px;
    font-size: 13px;
    text-align: center;
    color: var(--text2);
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.menu-sidebar .side-cat.active {
    color: var(--primary);
    font-weight: 600;
    border-left-color: var(--primary);
    background: var(--primary-light);
}
.menu-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    -webkit-overflow-scrolling: touch;
}
.menu-group { margin-bottom: 16px; }
.menu-group .group-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.menu-group .group-title::before {
    content: '';
    width: 3px; height: 14px;
    background: var(--primary);
    border-radius: 2px;
}

.menu-item {
    display: flex;
    gap: 12px;
    background: var(--card);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
    box-shadow: var(--shadow);
    position: relative;
}
.menu-item { flex-direction: column; }
.menu-item .menu-item-top { display: flex; gap: 12px; width: 100%; }
.menu-item .item-img {
    width: 72px; height: 72px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #FFF5F0, #FFE8D6);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: var(--primary);
}
.menu-item .item-info { flex: 1; min-width: 0; }
.menu-item .item-info .item-name {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.menu-item .item-info .item-desc {
    font-size: 12px;
    color: var(--text3);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.menu-item .item-info .item-sales {
    font-size: 11px;
    color: var(--text3);
    margin-top: 2px;
}
.menu-item .item-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    width: 100%;
}
.menu-item .price-area {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.menu-item .mp-tag {
    display: inline-block;
    padding: 0 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
}
.menu-item .mp-tag.vip { background: var(--primary-light); color: var(--primary); }
.menu-item .mp-price {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
}
.menu-item .mp-price::before { content: '¥'; font-size: 12px; }
.menu-item .np-price {
    font-size: 12px;
    color: #8B8FA3;
}
.menu-item .qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.menu-item .qty-btn {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.menu-item .qty-btn.minus {
    background: #F3F4F6;
    color: var(--text2);
}
.menu-item .qty-btn.plus {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 2px 8px rgba(255,107,53,0.3);
}
.menu-item .qty-num {
    font-size: 14px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
}

/* 购物车浮条 */
.cart-float {
    position: fixed;
    bottom: 70px;
    left: 16px;
    right: 16px;
    background: var(--card);
    border-radius: 30px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.15);
    padding: 8px 8px 8px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 150;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}
.cart-float.show { transform: translateY(0); opacity: 1; }
.cart-float .cart-icon-wrap {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: #fff;
    position: relative;
    flex-shrink: 0;
}
.cart-float .cart-count {
    position: absolute;
    top: -4px; right: -4px;
    background: var(--danger);
    color: #fff;
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}
.cart-float .cart-total {
    flex: 1;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
}
.cart-float .cart-total::before { content: '¥'; font-size: 12px; }
.cart-float .cart-total-desc {
    font-size: 11px;
    color: var(--text3);
}
.cart-float .cart-btn {
    padding: 10px 24px;
    border-radius: 25px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255,107,53,0.3);
    white-space: nowrap;
}

/* ========== 购物车页 ========== */
.cart-page .cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
}
.cart-page .cart-item:last-child { border-bottom: none; }
.cart-page .cart-item .item-img {
    width: 60px; height: 60px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #FFF5F0, #FFE8D6);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: var(--primary);
}
.cart-page .cart-item .item-info { flex: 1; }
.cart-page .cart-item .item-name { font-size: 14px; font-weight: 600; }
.cart-page .cart-item .item-sku { font-size: 12px; color: var(--text3); margin-top: 2px; }
.cart-page .cart-item .item-price { font-size: 16px; font-weight: 700; color: var(--primary); }
.cart-page .cart-item .item-price::before { content: '¥'; font-size: 11px; }

/* 购物车结算栏 */
.checkout-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--card);
    padding: 10px 16px;
    padding-bottom: var(--safe-bottom);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.08);
}
.checkout-bar .total-info { flex: 1; }
.checkout-bar .total-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}
.checkout-bar .total-price::before { content: '¥'; font-size: 13px; }
.checkout-bar .total-desc { font-size: 11px; color: var(--text3); }

/* ========== 订单 ========== */
.order-card {
    background: var(--card);
    border-radius: var(--radius);
    margin: 10px 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.order-card .order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.order-card .order-number { color: var(--text3); }
.order-card .order-status { font-weight: 600; }
.order-card .order-body { padding: 12px 14px; }
.order-card .order-product {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}
.order-card .order-product:last-child { margin-bottom: 0; }
.order-card .order-product .op-img {
    width: 48px; height: 48px;
    border-radius: 6px;
    background: linear-gradient(135deg, #FFF5F0, #FFE8D6);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: var(--primary);
}
.order-card .order-product .op-info { flex: 1; }
.order-card .order-product .op-name { font-size: 13px; font-weight: 500; }
.order-card .order-product .op-sku { font-size: 11px; color: var(--text3); }
.order-card .order-product .op-right {
    text-align: right;
    flex-shrink: 0;
}
.order-card .order-product .op-price { font-size: 14px; font-weight: 600; }
.order-card .order-product .op-qty { font-size: 12px; color: var(--text3); }

.order-card .order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}
.order-card .order-total { color: var(--text2); }
.order-card .order-total .amount {
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
}
.order-card .order-actions { display: flex; gap: 8px; }

/* ========== 个人中心 ========== */
.profile-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 30px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: #fff;
}
.profile-header .avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    border: 3px solid rgba(255,255,255,0.4);
}
.profile-header .profile-info { flex: 1; }
.profile-header .profile-name { font-size: 18px; font-weight: 700; }
.profile-header .profile-level { font-size: 13px; opacity: 0.85; margin-top: 2px; }

.menu-list { background: var(--card); margin: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow); }
.menu-list .menu-item-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
}
.menu-list .menu-item-row:last-child { border-bottom: none; }
.menu-list .menu-item-row .mi-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    margin-right: 12px;
}
.menu-list .menu-item-row .mi-label { flex: 1; font-size: 14px; }
.menu-list .menu-item-row .mi-arrow { color: var(--text3); font-size: 16px; }

/* ========== Toast ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 24px;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    text-align: center;
    max-width: 80%;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ========== 规格选择弹窗 ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal-content {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 501;
    background: var(--card);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 70vh;
    overflow-y: auto;
}
.modal-overlay.show .modal-content { transform: translateY(0); }
.modal-content .modal-title { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.modal-content .sku-list { display: flex; gap: 8px; flex-wrap: wrap; }
.modal-content .sku-item {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}
.modal-content .sku-item.active {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
}
.modal-content .modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}
.modal-handle {
    width: 36px; height: 4px;
    background: #DDD;
    border-radius: 2px;
    margin: 0 auto 12px;
}

/* ========== 订单状态标签配色 ========== */
.status-0 { color: var(--warning); }
.status-1 { color: var(--primary); }
.status-2 { color: #3B82F6; }
.status-3 { color: #8B5CF6; }
.status-4 { color: var(--success); }
.status-5 { color: var(--text3); }
