/**
 * 智慧食堂订餐系统 - 全局样式表
 * 移动端优先、卡片式设计、角色主题色
 */

/* ========== CSS 变量 ========== */
:root {
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --secondary: #0ea5e9;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --purple: #7c3aed;

    --bg-page: #f5f6fa;
    --bg-card: #ffffff;
    --bg-input: #f8fafc;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-white: #ffffff;

    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --header-height: 56px;
    --tabbar-height: 60px;
    --max-width: 480px;

    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    overflow-y: auto;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, li {
    list-style: none;
}

input, textarea, select, button {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
    background: none;
}

img {
    display: block;
    max-width: 100%;
}

/* ========== 页面容器 ========== */
#app {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.app-shell {
    width: 100%;
    max-width: var(--max-width);
    min-height: 100vh;
    background: var(--bg-page);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* 桌面端居中，两侧留白 */
@media (min-width: 481px) {
    body {
        background: #e8ecf1;
    }
    .app-shell {
        min-height: 100vh;
        height: 100vh;
    }
}

/* ========== 顶部Header ========== */
.app-header {
    height: var(--header-height);
    background: var(--primary);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-left {
    flex: 1;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 20px;
    transition: background 0.2s;
}

.header-user:active {
    background: rgba(255, 255, 255, 0.15);
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.header-username {
    font-size: 13px;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-logout {
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.header-logout:active {
    opacity: 1;
}

/* ========== 主内容区 ========== */
.app-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
    padding-bottom: calc(var(--tabbar-height) + 20px);
}

.page-transition {
    animation: pageFadeIn 0.3s ease;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 底部 TabBar ========== */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--max-width);
    height: var(--tabbar-height);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-tertiary);
    transition: color 0.2s;
    padding: 6px 0;
}

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

.tabbar-item.active .tabbar-icon {
    transform: scale(1.1);
}

.tabbar-icon {
    font-size: 22px;
    transition: transform 0.2s;
}

.tabbar-label {
    font-size: 10px;
    font-weight: 500;
}

/* ========== 登录页面 ========== */
.login-page {
    width: 100%;
    max-width: var(--max-width);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 100%);
}

.login-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.08) 0%, transparent 50%);
}

.login-card {
    position: relative;
    z-index: 1;
    width: 86%;
    max-width: 360px;
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
}

.login-logo {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo-icon {
    font-size: 52px;
    margin-bottom: 8px;
}

.login-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

.login-form {
    margin-bottom: 16px;
}

.login-error {
    color: var(--danger);
    font-size: 13px;
    min-height: 20px;
    margin-bottom: 8px;
    text-align: center;
}

.login-tips {
    text-align: center;
    font-size: 11px;
    color: var(--text-tertiary);
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
}

/* ========== 表单组件 ========== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: #fff;
}

.form-textarea {
    height: auto;
    min-height: 80px;
    padding: 10px 14px;
    resize: vertical;
    line-height: 1.5;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row > .form-group {
    flex: 1;
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 20px;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

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

.btn-default {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

.btn-lg {
    height: 52px;
    font-size: 16px;
}

/* ========== 卡片 ========== */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    margin-bottom: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========== 菜品卡片 ========== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.menu-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.menu-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    background: #f1f5f9;
}

.menu-img-placeholder {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.placeholder-emoji {
    font-size: 36px;
}

.placeholder-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    opacity: 0.6;
}

.menu-info {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-desc {
    font-size: 11px;
    color: var(--text-tertiary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.menu-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--danger);
}

.menu-calories {
    font-size: 10px;
    color: var(--text-tertiary);
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
}

.menu-add-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: transform 0.15s;
    flex-shrink: 0;
}

.menu-add-btn:active {
    transform: scale(1.2);
}

/* ========== 餐别切换Tab ========== */
.meal-tabs {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.meal-tab {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.meal-tab.active {
    background: var(--primary);
    color: #fff;
}

/* ========== 订单卡片 ========== */
.order-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 14px;
    margin-bottom: 10px;
}

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

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

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

.status-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-paid {
    background: #dbeafe;
    color: #2563eb;
}

.status-preparing {
    background: #fef3c7;
    color: #d97706;
}

.status-ready {
    background: #d1fae5;
    color: #059669;
}

.status-completed {
    background: #f1f5f9;
    color: #64748b;
}

.status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

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

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

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

.order-item-qty {
    color: var(--text-tertiary);
    margin: 0 12px;
}

.order-item-price {
    color: var(--text-primary);
    font-weight: 500;
}

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

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

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

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
}

.stat-trend {
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.stat-trend.up {
    color: var(--success);
}

.stat-trend.down {
    color: var(--danger);
}

/* ========== 图表容器 ========== */
.chart-container {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
}

.chart-box {
    width: 100%;
    height: 240px;
}

/* ========== 表格 ========== */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 500px;
}

.table th {
    background: #f8fafc;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

.table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.table tr:active {
    background: #f8fafc;
}

/* ========== 列表项 ========== */
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}

.list-item-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: #eff6ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-item-subtitle {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.list-item-action {
    font-size: 13px;
    color: var(--primary);
    font-weight: 500;
    flex-shrink: 0;
}

/* ========== 库存预警 ========== */
.stock-low {
    color: var(--danger) !important;
    font-weight: 600;
}

.stock-warning {
    color: var(--warning) !important;
}

.stock-bar {
    width: 100%;
    height: 6px;
    background: #f1f5f9;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.stock-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s;
}

/* ========== 窗口卡片 ========== */
.window-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
}

.window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.window-name {
    font-size: 15px;
    font-weight: 600;
}

.window-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
}

.window-queue {
    display: flex;
    align-items: center;
    gap: 8px;
}

.queue-bar {
    flex: 1;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
}

.queue-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s;
}

/* ========== 购物车浮动按钮 ========== */
.cart-fab {
    position: fixed;
    bottom: calc(var(--tabbar-height) + 16px);
    left: 50%;
    transform: translateX(150px);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4);
    z-index: 99;
    transition: transform 0.2s;
}

.cart-fab:active {
    transform: translateX(150px) scale(0.9);
}

.cart-fab-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

/* ========== Loading 动画 ========== */
.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.spin {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    gap: 12px;
    color: var(--text-tertiary);
    font-size: 14px;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-box {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-lg);
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ========== 空状态 ========== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-icon {
    font-size: 56px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-title {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 4px;
}

.empty-desc {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ========== Toast ========== */
.toast-container {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
    width: 100%;
    max-width: var(--max-width);
}

.toast {
    background: rgba(30, 41, 59, 0.92);
    color: #fff;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s;
    pointer-events: auto;
    box-shadow: var(--shadow-md);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

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

.toast-success {
    background: rgba(16, 185, 129, 0.92);
}

.toast-error {
    background: rgba(239, 68, 68, 0.92);
}

.toast-warning {
    background: rgba(245, 158, 11, 0.92);
}

/* ========== Modal 弹窗 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s;
    padding: 20px;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    background: #fff;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 400px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s;
    overflow: hidden;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

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

.modal-close {
    font-size: 20px;
    color: var(--text-tertiary);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:active {
    background: var(--bg-input);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    display: flex;
    gap: 10px;
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn {
    flex: 1;
}

/* ========== 用户菜单弹窗 ========== */
.user-menu-header {
    margin: -20px -20px 0 -20px;
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.user-menu-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-menu-name {
    font-size: 17px;
    font-weight: 600;
}

.user-menu-role {
    font-size: 13px;
    opacity: 0.8;
}

.user-menu-body {
    margin-top: 8px;
}

.user-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-primary);
}

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

.user-menu-balance {
    font-weight: 700;
    color: var(--danger);
    font-size: 16px;
}

.logout-item {
    color: var(--danger) !important;
}

/* ========== 购物车页面 ========== */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}

.cart-item-img {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cart-item-name {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: all 0.15s;
}

.qty-btn:active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.qty-num {
    font-size: 15px;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
}

/* ========== 支付方式 ========== */
.pay-options {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.pay-option {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.pay-option.active {
    border-color: var(--primary);
    background: #eff6ff;
}

.pay-option-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.pay-option-label {
    font-size: 13px;
    font-weight: 500;
}

/* ========== 段落标题 ========== */
.section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.section-title::before {
    content: '';
    width: 3px;
    height: 16px;
    background: var(--primary);
    border-radius: 2px;
}

/* ========== 下拉刷新 ========== */
.pull-refresh {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
    transition: height 0.1s;
}

.pull-refresh .spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ========== 加载更多 ========== */
.load-more {
    text-align: center;
    padding: 16px;
    color: var(--text-tertiary);
    font-size: 13px;
}

.load-more.loading::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e2e8f0;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* ========== 搜索栏 ========== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.search-bar input {
    flex: 1;
    height: 40px;
    border: none;
    background: none;
    font-size: 14px;
}

.search-bar .search-icon {
    font-size: 18px;
    color: var(--text-tertiary);
}

/* ========== 筛选条 ========== */
.filter-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    padding: 6px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ========== 图标按钮 ========== */
.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    background: var(--bg-input);
    color: var(--text-secondary);
    border: none;
    transition: all 0.2s;
}

.icon-btn:active {
    transform: scale(0.92);
}

.icon-btn.danger {
    color: var(--danger);
}

.icon-btn.success {
    color: var(--success);
}

/* ========== 徽章 ========== */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.badge-primary {
    background: #dbeafe;
    color: #2563eb;
}

.badge-danger {
    background: #fee2e2;
    color: #dc2626;
}

.badge-success {
    background: #d1fae5;
    color: #059669;
}

.badge-warning {
    background: #fef3c7;
    color: #d97706;
}

/* ========== 汇总卡片 ========== */
.summary-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
}

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

.summary-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    border-radius: var(--radius-md);
    color: #fff;
    margin-top: 8px;
}

.summary-total-label {
    font-size: 14px;
    opacity: 0.9;
}

.summary-total-value {
    font-size: 22px;
    font-weight: 700;
}

/* ========== 日期选择器 ========== */
.date-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 0 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}

.date-picker input {
    flex: 1;
    height: 40px;
    border: none;
    background: none;
    font-size: 14px;
}

/* ========== 排队指引 ========== */
.queue-recommend {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.queue-recommend-icon {
    font-size: 32px;
}

.queue-recommend-info {
    flex: 1;
}

.queue-recommend-title {
    font-size: 14px;
    font-weight: 600;
    color: #065f46;
}

.queue-recommend-desc {
    font-size: 12px;
    color: #047857;
}

/* ========== 文件上传 ========== */
.upload-area {
    width: 100%;
    height: 120px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg-input);
}

.upload-area:active {
    border-color: var(--primary);
    background: #eff6ff;
}

.upload-icon {
    font-size: 32px;
}

.upload-text {
    font-size: 13px;
    color: var(--text-tertiary);
}

.upload-preview {
    width: 100%;
    height: 120px;
    border-radius: var(--radius-md);
    object-fit: cover;
    margin-bottom: 8px;
}

/* ========== 工具样式 ========== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.p-12 { padding: 12px; }
.p-16 { padding: 16px; }
.hidden { display: none; }

/* ========== 响应式微调 ========== */
@media (max-width: 360px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 滚动条隐藏 ========== */
.app-main::-webkit-scrollbar {
    width: 0;
    display: none;
}
