/* ========================================
   食品热量识别与饮食建议系统 - 专业UI
   Modern Professional Design
   ======================================== */

:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-bg: #eef2ff;
    --success: #10b981;
    --success-bg: #ecfdf5;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --info: #3b82f6;
    --info-bg: #eff6ff;

    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);

    --sidebar-w: 260px;
    --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ========== 布局 ========== */
.app-layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.sidebar-brand {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand .brand-icon {
    width: 40px; height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}

.sidebar-brand h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.sidebar-brand p {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all 0.15s;
}

.nav-item:hover { background: var(--bg); color: var(--text); }

.nav-item.active {
    background: var(--primary-bg);
    color: var(--primary);
    font-weight: 600;
}

.nav-item .nav-icon { width: 20px; text-align: center; font-size: 16px; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.8;
}

/* 主内容区 */
.main-content { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; }

/* 顶栏 */
.top-header {
    height: var(--header-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.top-header h1 { font-size: 18px; font-weight: 700; }

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

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--primary-bg);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 600;
    color: var(--primary);
    cursor: pointer;
}

.page-body { padding: 28px; }

/* ========== 卡片 ========== */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 24px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
}

.card-title .icon { color: var(--primary); }

/* ========== 统计卡片 ========== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: box-shadow 0.2s;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

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

.stat-icon.green { background: var(--success-bg); }
.stat-icon.blue { background: var(--info-bg); }
.stat-icon.orange { background: var(--warning-bg); }
.stat-icon.purple { background: #f5f3ff; }

.stat-info h3 { font-size: 24px; font-weight: 700; line-height: 1.2; color: var(--text); }
.stat-info p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ========== 图表 ========== */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 24px; }
.chart-container { height: 350px; }

/* ========== 上传区域 ========== */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--bg);
}

.upload-zone:hover, .upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.upload-zone .upload-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.6; }
.upload-zone h3 { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.upload-zone p { font-size: 13px; color: var(--text-muted); }

.image-preview {
    position: relative;
    max-width: 100%;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 16px 0;
    box-shadow: var(--shadow);
}

.image-preview img { width: 100%; display: block; }

/* ========== 结果展示 ========== */
.result-panel { display: none; animation: slideUp 0.4s ease; }
.result-panel.show { display: block; }

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

.food-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 13px;
    font-weight: 500;
    margin: 4px;
}

.food-tag .confidence { font-size: 11px; opacity: 0.7; }

.nutrition-table { width: 100%; border-collapse: collapse; }

.nutrition-table th, .nutrition-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.nutrition-table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nutrition-table tr:hover td { background: var(--bg); }

.calorie-highlight {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.calorie-unit { font-size: 14px; color: var(--text-muted); font-weight: 400; }

/* ========== 聊天界面 ========== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--header-h) - 56px);
}

.chat-messages { flex: 1; overflow-y: auto; padding: 16px 0; }

.chat-bubble {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: slideUp 0.3s ease;
}

.chat-bubble.user { flex-direction: row-reverse; }

.chat-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-bubble.assistant .chat-avatar { background: var(--primary-bg); }
.chat-bubble.user .chat-avatar { background: var(--primary); color: white; }

.chat-content {
    max-width: 70%;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    line-height: 1.7;
}

.chat-bubble.assistant .chat-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top-left-radius: 4px;
}

.chat-bubble.user .chat-content {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
}

.chat-input-bar {
    display: flex;
    gap: 10px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
}

.chat-input-bar input {
    flex: 1;
    padding: 12px 18px;
    border: 1px solid var(--border);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    background: var(--bg);
}

.chat-input-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #4338ca; box-shadow: var(--shadow-md); }

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

.btn-accent { background: var(--success); color: white; }
.btn-accent:hover { background: #059669; }

.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg); }

.btn-lg { padding: 12px 28px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ========== 表单 ========== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    background: var(--surface);
}

.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ========== 进度条 ========== */
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; transition: width 0.6s ease; }
.progress-fill.green { background: var(--success); }
.progress-fill.orange { background: var(--warning); }
.progress-fill.red { background: var(--danger); }

/* ========== 登录页 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 420px;
    max-width: 90vw;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
}

.login-card h2 { text-align: center; margin-bottom: 6px; }
.login-card .subtitle { text-align: center; color: var(--text-muted); font-size: 14px; margin-bottom: 32px; }

.login-tabs { display: flex; margin-bottom: 24px; border-bottom: 2px solid var(--border); }

.login-tab {
    flex: 1;
    text-align: center;
    padding: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.login-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ========== 加载状态 ========== */
.loading-spinner {
    display: inline-block;
    width: 20px; height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== 通知 ========== */
.toast {
    position: fixed;
    top: 20px; right: 20px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 14px;
    z-index: 1000;
    animation: slideIn 0.3s;
    box-shadow: var(--shadow-lg);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--info); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ========== 历史记录 ========== */
.history-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover { border-color: var(--primary); box-shadow: var(--shadow-md); }

.history-thumb { width: 80px; height: 80px; border-radius: var(--radius-sm); object-fit: cover; background: var(--bg); }
.history-info { flex: 1; }
.history-info h4 { font-size: 14px; margin-bottom: 4px; }
.history-info .meta { font-size: 12px; color: var(--text-muted); }
.history-info .calories { font-size: 18px; font-weight: 700; color: var(--primary); margin-top: 8px; }

/* ========== 空状态 ========== */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 64px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }

/* ========== 打字效果 ========== */
.typing-indicator { display: flex; gap: 4px; padding: 4px 0; }
.typing-indicator span {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typing 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* ========== 摄像头页面 ========== */
.camera-wrapper {
    position: relative;
    width: 100%;
    max-width: 720px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-lg);
}

.camera-wrapper video { width: 100%; display: block; }

.camera-canvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
}

.camera-controls { display: flex; align-items: center; gap: 12px; margin-top: 16px; }

.camera-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.camera-status.live { background: var(--danger-bg); color: var(--danger); }
.camera-status.live::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse 1.5s infinite;
}

.camera-status.off { background: var(--bg); color: var(--text-muted); }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

.detected-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    margin-bottom: 8px;
    animation: slideUp 0.3s ease;
}

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

.detected-item .item-info { flex: 1; }
.detected-item .item-info h4 { font-size: 14px; margin-bottom: 2px; }
.detected-item .item-info .meta { font-size: 12px; color: var(--text-muted); }
.detected-item .item-cal { font-size: 16px; font-weight: 700; color: var(--primary); }

.realtime-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary-bg), var(--success-bg));
    border-radius: var(--radius);
    margin-top: 12px;
}

.realtime-total h3 { font-size: 14px; color: var(--text); }
.realtime-total .total-cal { font-size: 28px; font-weight: 800; color: var(--primary); }

.capture-flash {
    position: absolute;
    inset: 0;
    background: white;
    opacity: 0;
    pointer-events: none;
    border-radius: var(--radius);
    transition: opacity 0.1s;
}

.capture-flash.flash { opacity: 0.3; }

.freeze-overlay {
    position: absolute;
    top: 8px; right: 8px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.6);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    display: none;
}

/* ========== 响应式 - 移动端优化 ========== */
@media (max-width: 768px) {
    /* --- 基础布局 --- */
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding-bottom: 72px; }
    .app-layout { flex-direction: column; }

    /* --- 顶栏：更紧凑更现代 --- */
    .top-header {
        height: 52px;
        padding: 0 16px;
        background: linear-gradient(135deg, var(--primary), #6366f1);
        border-bottom: none;
    }
    .top-header h1 {
        font-size: 17px;
        font-weight: 600;
        color: #fff;
    }
    .header-right { gap: 10px; }
    .user-avatar {
        width: 32px; height: 32px;
        background: rgba(255,255,255,0.2);
        color: #fff;
        font-size: 13px;
        backdrop-filter: blur(4px);
    }
    #user-bmi { color: rgba(255,255,255,0.8) !important; font-size: 12px !important; }
    #llm-status {
        background: rgba(255,255,255,0.15) !important;
        color: #fff !important;
        font-size: 11px !important;
        padding: 3px 8px !important;
    }

    /* --- 内容区域 --- */
    .page-body { padding: 12px; }

    /* --- 统计卡片：水平滚动 --- */
    .stat-grid {
        display: flex;
        overflow-x: auto;
        gap: 10px;
        padding-bottom: 4px;
        margin-bottom: 16px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .stat-grid::-webkit-scrollbar { display: none; }
    .stat-card {
        flex: 0 0 auto;
        min-width: 140px;
        scroll-snap-align: start;
        padding: 14px;
        border-radius: 14px;
        border: none;
        background: var(--surface);
        box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    }
    .stat-icon {
        width: 40px; height: 40px;
        border-radius: 10px;
        font-size: 18px;
    }
    .stat-info h3 { font-size: 18px; }
    .stat-info p { font-size: 11px; margin-top: 1px; }

    /* --- 卡片 --- */
    .card {
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 14px;
        border: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    .card-title {
        font-size: 14px;
        margin-bottom: 14px;
    }

    /* --- 图表 --- */
    .chart-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 16px;
    }
    .chart-container { height: 220px; }

    /* --- 按钮 --- */
    .btn { font-size: 13px; padding: 9px 16px; border-radius: 10px; }
    .btn-lg { padding: 11px 18px; font-size: 14px; border-radius: 12px; }
    .btn-sm { padding: 6px 12px; font-size: 11px; }

    /* --- 热量数字 --- */
    .calorie-highlight { font-size: 30px; }

    /* --- 表单 --- */
    .form-row { grid-template-columns: 1fr; }
    .form-control { font-size: 16px; padding: 12px 14px; /* 16px防iOS缩放 */ }

    /* --- 上传区 --- */
    .upload-zone { padding: 32px 16px; }
    .upload-zone .upload-icon { font-size: 36px; }
    .upload-zone h3 { font-size: 15px; }

    /* --- 营养表格：移动端横向滚动 --- */
    .nutrition-table { font-size: 13px; }
    .nutrition-table th, .nutrition-table td { padding: 10px 8px; }
    .nutrition-table th { font-size: 10px; }

    /* --- 食品标签 --- */
    .food-tag { padding: 5px 10px; font-size: 12px; border-radius: 16px; }

    /* --- 聊天界面 --- */
    .chat-container {
        height: calc(100vh - 52px - 72px - 24px);
    }
    .chat-bubble { margin-bottom: 14px; gap: 8px; }
    .chat-avatar { width: 32px; height: 32px; font-size: 14px; }
    .chat-content {
        max-width: 82%;
        padding: 10px 14px;
        font-size: 14px;
        line-height: 1.6;
        border-radius: 16px;
    }
    .chat-bubble.assistant .chat-content { border-top-left-radius: 4px; }
    .chat-bubble.user .chat-content { border-top-right-radius: 4px; }
    .chat-input-bar {
        gap: 8px;
        padding: 10px 0;
    }
    .chat-input-bar input {
        padding: 10px 16px;
        font-size: 16px;
        border-radius: 22px;
    }
    .chat-input-bar .btn { border-radius: 22px; padding: 10px 18px; }

    /* --- 历史记录 --- */
    .history-item {
        padding: 12px;
        gap: 10px;
        border-radius: 12px;
    }
    .history-thumb { width: 64px; height: 64px; }
    .history-info h4 { font-size: 13px; }
    .history-info .calories { font-size: 16px; }

    /* --- 摄像头页面 --- */
    .camera-layout { grid-template-columns: 1fr !important; gap: 12px !important; }
    .camera-controls {
        flex-wrap: wrap;
        gap: 8px;
    }
    .camera-controls .btn { flex: 1; min-width: 80px; font-size: 12px; padding: 8px 10px; }
    .camera-wrapper { border-radius: 12px; }

    /* --- 检测到的食品项 --- */
    .detected-item { padding: 10px 12px; gap: 8px; }
    .detected-item .item-icon { width: 34px; height: 34px; font-size: 16px; }
    .detected-item .item-info h4 { font-size: 13px; }
    .detected-item .item-cal { font-size: 14px; }

    .realtime-total { padding: 12px; border-radius: 12px; }
    .realtime-total h3 { font-size: 13px; }
    .realtime-total .total-cal { font-size: 22px; }

    /* --- 进度条 --- */
    .progress-bar { height: 6px; }

    /* --- 登录页 --- */
    .login-card { padding: 28px 20px; border-radius: 20px; }
    .login-card h2 { font-size: 22px; }

    /* --- 空状态 --- */
    .empty-state { padding: 40px 16px; }
    .empty-state .empty-icon { font-size: 48px; }
    .empty-state h3 { font-size: 16px; }

    /* --- Toast通知 --- */
    .toast {
        top: auto;
        bottom: 80px;
        left: 16px;
        right: 16px;
        text-align: center;
        border-radius: 12px;
        padding: 12px 16px;
        font-size: 13px;
    }

    /* --- 底部导航栏（核心交互） --- */
    .bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 60px;
        background: var(--surface);
        border-top: none;
        z-index: 200;
        justify-content: space-around;
        align-items: flex-start;
        padding: 6px 0 0 0;
        box-shadow: 0 -1px 12px rgba(0,0,0,0.08);
        border-top-left-radius: 16px;
        border-top-right-radius: 16px;
    }
    .bottom-nav a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        text-decoration: none;
        color: var(--text-muted);
        font-size: 10px;
        font-weight: 500;
        padding: 4px 0;
        flex: 1;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }
    .bottom-nav a .bnav-icon {
        font-size: 22px;
        line-height: 1;
        transition: transform 0.2s ease;
    }
    .bottom-nav a span:last-child {
        transition: color 0.2s ease;
    }
    .bottom-nav a.active {
        color: var(--primary);
    }
    .bottom-nav a.active .bnav-icon {
        transform: scale(1.15);
    }
    .bottom-nav a.active::after {
        content: '';
        width: 4px; height: 4px;
        border-radius: 50%;
        background: var(--primary);
        margin-top: 1px;
    }
    .bottom-nav a:active {
        transform: scale(0.92);
    }

    /* --- 系统状态小卡片 --- */
    .system-status-grid {
        gap: 8px !important;
    }
    .system-status-grid > div {
        padding: 10px !important;
        border-radius: 10px !important;
    }
    .system-status-grid > div > div:first-child {
        font-size: 11px !important;
    }
    .system-status-grid > div > div:last-child {
        font-size: 12px !important;
    }

    /* --- 分析页双栏变单栏 --- */
    .analysis-layout {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .analysis-layout .result-charts-grid {
        grid-template-columns: 1fr !important;
    }

    /* --- 快速操作按钮全宽 --- */
    .quick-actions {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .quick-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

/* 底部导航默认隐藏，仅移动端显示 */
.bottom-nav { display: none; }
