/* ==========================================
   游山猪 · 全域生活平台 - 样式表
   ========================================== */

/* ---- Reset & Base ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #FFB800;
    --primary-dark: #e6a600;
    --bg: #f5f5f5;
    --card-bg: #fff;
    --text: #333;
    --text-light: #666;
    --text-muted: #999;
    --orange: #ff6b35;
    --orange-dark: #f7931e;
    --red: #e74c3c;
    --red-dark: #c0392b;
    --blue: #3498db;
    --blue-dark: #2980b9;
    --gold: #f1c40f;
    --gold-dark: #f39c12;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-lg: 20px;
}

body {
    font-size: 19px;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 70px;
    -webkit-font-smoothing: antialiased;
}

/* ---- 顶部品牌栏 ---- */
.top-bar { display: flex; 
    background: var(--primary);
    padding: 6px 16px;
    min-height: 44px;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}
.top-bar-inner { display: flex; 
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand-icon { font-size: 24px; }
.brand-name { font-size: 18px; font-weight: bold; color: #333; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.store-tag {
    background: rgba(255,255,255,0.8);
    padding: 4px 12px;
    border-radius: 14px;
    font-size: 14px;
    color: #333;
}
.login-link { font-size: 18px; font-weight: bold; color: #fff; cursor: pointer; text-decoration: none; background: var(--orange); padding: 6px 14px; border-radius: 6px; display: inline-block; }

/* ---- 页面切换 ---- */
.page { display: none; padding: 16px; max-width: 600px; margin: 0 auto; flex-wrap: nowrap; }
.page.active { display: block; }


/* ---- AI Banner ---- */
.ai-banner {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 14px 16px;
    border-radius: var(--radius);
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}
.ai-tag {
    background: rgba(255,255,255,0.2);
    padding: 3px 10px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    white-space: nowrap;
}

/* ---- 统计卡片 ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}
.stat-label { color: var(--text-light); font-size: 14px; margin-bottom: 6px; }
.stat-value { font-size: 24px; font-weight: bold; color: var(--text); }
.stat-trend { font-size: 14px; padding: 2px 8px; border-radius: 10px; font-weight: 500; display: inline-block; margin-top: 4px; }
.stat-trend.up { background: #FFEBEB; color: #E74C3C; }
.stat-trend.flat { background: #f0f0f0; color: #999; }
.stat-icon { font-size: 32px; }

/* ---- 入口按钮 ---- */
.entry-grid {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}
.entry-btn {
    align-items: center;
    padding: 22px 20px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    color: #fff;
}
.entry-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.entry-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent);
}
.entry-icon { font-size: 36px; margin-right: 16px; z-index: 1; }
.entry-title { font-size: 22px; font-weight: bold; z-index: 1; }
.entry-desc {
    font-size: 14px;
    color: rgba(255,255,255,0.8);
    position: absolute;
    right: 20px;
    bottom: 18px;
    z-index: 1;
}
.entry-mall { background: linear-gradient(135deg, var(--orange), var(--orange-dark)); box-shadow: 0 6px 20px rgba(255,107,53,0.3); }
.entry-food { background: linear-gradient(135deg, var(--red), var(--red-dark)); box-shadow: 0 6px 20px rgba(231,76,60,0.3); }
.entry-travel { background: linear-gradient(135deg, var(--blue), var(--blue-dark)); box-shadow: 0 6px 20px rgba(52,152,219,0.3); }
.entry-vip { background: linear-gradient(135deg, var(--gold), var(--gold-dark)); box-shadow: 0 6px 20px rgba(241,196,15,0.3); }
.entry-vip .entry-title, .entry-vip .entry-desc { color: #333; }

/* ---- 底部吉祥物 ---- */
.footer-mascot { text-align: center; padding: 30px; color: var(--text-muted); font-size: 14px; }
.mascot-icon { font-size: 40px; margin-bottom: 4px; }

/* ---- 搜索栏 ---- */
.search-bar {
    align-items: center;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 0 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow);
}
.search-icon { font-size: 16px; margin-right: 8px; }
.search-input {
    flex: 2;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 14px;
    background: transparent;
}

/* ---- 分类标签 ---- */
.category-tabs {
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 12px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    background: var(--card-bg);
    color: var(--text-light);
    border: 1px solid #e0e0e0;
    transition: all 0.2s;
    flex-shrink: 0;
}
.cat-tab.active {
    background: var(--orange);
    color: #fff;
    border-color: var(--orange);
}

/* ---- 商品/菜品/旅游列表 ---- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.product-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.15s;
}
.product-card:hover { transform: translateY(-2px); }
.product-card-img {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden;
}
.product-card-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-emoji {
    font-size: 48px;
    z-index: 1;
    position: relative;
}
.product-card-body { padding: 12px; }
.product-card-name { font-size: 14px; font-weight: 600; line-height: 1.5; height: 42px; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-price { display: flex; align-items: center; gap: 0; }
.product-card-price .price-left { flex: 3; display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.price-member { color: var(--red); font-size: 18px; font-weight: bold; white-space: nowrap; }
.price-original { color: var(--text-muted); font-size: 14px; text-decoration: line-through; white-space: nowrap; }
.product-card-btn {
    flex: 2;
    min-width: 0;
    padding: 6px 4px;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
    text-align: center;
}
.product-card-btn:hover { background: #e55a2b; }

/* ---- Loading ---- */
.loading-hint {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ---- 会员页 ---- */
.member-card {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: var(--radius-lg);
    padding: 24px;
    align-items: center;
    gap: 16px;
    color: #fff;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(102,126,234,0.3);
}
.member-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}
.member-info { flex: 1; }
.member-name { font-size: 18px; font-weight: bold; }
.member-level { font-size: 14px; opacity: 0.85; margin-top: 2px; }
.btn-recharge {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
}

.member-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.member-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.15s;
}
.member-item:hover { transform: translateY(-2px); }
.member-item-icon { font-size: 28px; display: block; margin-bottom: 6px; }
.member-item-label { font-size: 14px; color: var(--text-light); }

.order-list { margin-top: 12px; }
.order-item {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow);
}
.order-item-header {
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}
.order-item-no { color: var(--text-light); }
.order-item-status { color: var(--orange); font-weight: 600; }
.order-item-items { font-size: 14px; color: var(--text-light); margin-bottom: 4px; }
.order-item-total { font-size: 16px; font-weight: bold; }

/* ---- 底部导航 ---- */
.tab-bar { display: none; 
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    justify-content: space-around;
    padding: 6px 0 env(safe-area-inset-bottom, 6px);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
    z-index: 100;
    max-width: 600px;
    margin: 0 auto; flex-wrap: nowrap;
}
.tab-item {
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
    flex: 2;
    font-size: 14px;
}
.tab-item.active { color: var(--orange); }
.tab-icon { font-size: 20px; }
.tab-label { font-size: 14px; }

/* ---- 购物车底部栏 ---- */
.cart-bar {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    background: var(--card-bg);
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 99;
    max-width: 600px;
    margin: 0 auto; flex-wrap: nowrap;
}
.cart-info { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.cart-icon { font-size: 24px; }
.cart-count {
    background: var(--red);
    color: #fff;
    font-size: 14px;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}
.cart-total { font-weight: bold; font-size: 16px; color: var(--red); }
.btn-settle {
    background: var(--orange);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-settle:hover { background: #e55a2b; }

/* ---- 购物车面板 ---- */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 198;
}
.cart-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto; flex-wrap: nowrap;
    background: var(--card-bg);
    border-radius: 16px 16px 0 0;
    z-index: 199;
    max-height: 50vh;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.cart-panel.open { transform: translateY(0); }
.cart-panel-header {
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-weight: bold;
}
.btn-clear {
    background: none;
    border: none;
    color: var(--red);
    font-size: 14px;
    cursor: pointer;
}
.cart-panel-list { overflow-y: auto; padding: 12px 16px; flex: 1; }
.cart-item {
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f5f5f5;
    gap: 8px;
}
.cart-item-name { flex: 1; font-size: 14px; }
.cart-item-price { color: var(--red); font-weight: 600; font-size: 14px; min-width: 60px; text-align: right; }
.cart-item-ctrl { display: flex; align-items: center; gap: 8px; }
.ctrl-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #ddd;
    background: var(--card-bg);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: var(--text);
}
.cart-empty { text-align: center; padding: 30px; color: var(--text-muted); font-size: 14px; }

/* ---- Modal ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 300;
}
.modal-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    width: 90%;
    max-width: 380px;
    text-align: center;
}
.modal-box h3 { margin-bottom: 16px; font-size: 18px; }
.modal-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 14px;
    outline: none;
    text-align: center;
}
.modal-input:focus { border-color: var(--orange); }

.btn-primary {
    background: var(--orange);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-primary:hover { background: #e55a2b; }
.btn-full { width: 100%; }
.btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    margin-top: 10px;
    cursor: pointer;
    font-size: 14px;
}

/* ---- Toast ---- */
.toast {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.78);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 400;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.toast.show { opacity: 1; }

/* ---- 响应式 ---- */
@media (max-width: 480px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .product-card-img .card-emoji { font-size: 36px; }
    .stats-grid { gap: 8px; }
    .stat-card { padding: 14px; }
    .stat-value { font-size: 20px; }
    .entry-btn { padding: 16px 14px; }
    .entry-icon { font-size: 28px; }
    .entry-title { font-size: 18px; }
    .member-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
@media (min-width: 768px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); }
    .stat-card { padding: 24px; }
}

/* ---- 商品详情弹窗 ---- */
.modal-wide { max-width: 420px; }
.detail-img {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    color: #fff;
    margin-bottom: 16px;
    overflow: hidden;
}
.detail-img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.detail-prices {
    align-items: baseline;
    gap: 8px;
    margin-bottom: 16px;
}
.detail-prices span:first-child { color: #e74c3c; font-size: 28px; font-weight: bold; }
.detail-prices span:last-child { color: #999; font-size: 14px; text-decoration: line-through; }
.detail-actions { display: flex; justify-content: space-between; }
.btn-buy { background: #e74c3c !important; }
.btn-buy:hover { background: #c0392b !important; }

/* ---- 结算弹窗 ---- */
.checkout-section {
    text-align: left;
    margin: 10px 0;
}
.checkout-section label {
    font-size: 14px;
    color: #999;
    display: block;
    margin-bottom: 4px;
}
.checkout-section select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 6px;
    background: #fff;
}
.btn-sm { font-size: 14px !important; padding: 4px 0 !important; }
#checkoutItems { text-align: left; max-height: 200px; overflow-y: auto; margin: 10px 0; }
.checkout-item {
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 14px;
}
.checkout-item-name { flex: 1; }
.checkout-item-qty { color: #999; margin: 0 8px; }
.checkout-item-price { color: #e74c3c; font-weight: 600; }
.checkout-summary {
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid #f0f0f0;
    font-size: 16px;
    font-weight: bold;
}
.checkout-summary span:last-child { color: #e74c3c; }

/* ---- 角色徽章 ---- */
.role-badge {
    font-size: 14px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}
.role-badge.employee { background: #667eea; color: #fff; }
.role-badge.customer { background: #e8f8ef; color: #27ae60; }

/* ---- 角色切换 ---- */
.role-toggle {
    gap: 8px;
    margin-bottom: 14px;
}
.role-option {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    background: #fafafa;
    transition: all 0.2s;
}
.role-option.active {
    border-color: var(--orange);
    background: #fff7f0;
    font-weight: 600;
}

/* ---- 员工工作台 ---- */
.emp-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: var(--radius-lg);
    padding: 20px;
    align-items: center;
    gap: 14px;
    color: #fff;
    margin-bottom: 16px;
}
.emp-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; flex-shrink: 0;
}
.emp-name { font-size: 18px; font-weight: bold; }
.emp-role { font-size: 14px; opacity: 0.85; }

.emp-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    justify-content: space-between;
    margin-bottom: 16px;
}
.emp-action-btn {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    font-size: 14px;
    color: var(--text);
    transition: transform 0.15s;
}
.emp-action-btn:hover { transform: translateY(-2px); }
.emp-action-btn span { font-size: 26px; display: block; margin-bottom: 6px; }

/* ==========================================
   POS 收银台（桌面端专用）
   ========================================== */

