/* 全局设计 token + Toast/对话框 + 统一底栏 */
:root {
    --primary-color: #00529B;
    --primary-dark: #003d75;
    --secondary-color: #00AEEF;
    --accent-color: #FFC107;
    --diet-primary: #00529B;
    --diet-primary-dark: #003d75;
    --diet-bg: #f0f7ff;
    --diet-surface: #ffffff;
    --diet-border: #d1e3ff;
    --diet-text: #1e293b;
    --diet-text-muted: #64748b;
    --diet-bottom-nav-h: 64px;
    --diet-safe-bottom: env(safe-area-inset-bottom, 0px);
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-soft: 0 8px 24px rgba(0, 82, 155, 0.12);
}

/* ---------- Toast（顶部弹出，避免遮挡底部保存栏/导航） ---------- */
.diet-toast-host {
    position: fixed;
    left: 50%;
    top: calc(12px + env(safe-area-inset-top, 0px));
    transform: translateX(-50%);
    z-index: 10050;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: min(92vw, 420px);
    pointer-events: none;
}

.diet-toast {
    pointer-events: auto;
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.4;
    box-shadow: var(--shadow-soft);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    cursor: pointer;
    text-align: center;
}

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

.diet-toast--info { background: #334155; }
.diet-toast--success { background: #15803d; }
.diet-toast--warning { background: #b45309; }
.diet-toast--error { background: #b91c1c; }

/* ---------- Dialog ---------- */
.diet-ui-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10060;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.16s ease;
}

.diet-ui-backdrop--open {
    opacity: 1;
}

.diet-ui-dialog {
    width: min(100%, 400px);
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 20px 20px 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(8px) scale(0.98);
    transition: transform 0.16s ease;
}

.diet-ui-backdrop--open .diet-ui-dialog {
    transform: none;
}

.diet-ui-dialog-title {
    margin: 0 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--diet-text);
}

.diet-ui-dialog-body {
    font-size: 0.92rem;
    color: #475569;
    line-height: 1.55;
    margin-bottom: 16px;
    max-height: 50vh;
    overflow-y: auto;
}

.diet-ui-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.diet-ui-btn {
    min-height: 44px;
    min-width: 72px;
    padding: 0 16px;
    border-radius: 10px;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.diet-ui-btn--ghost {
    background: #f1f5f9;
    color: #334155;
}

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

.diet-ui-btn--danger {
    background: #dc2626;
}

/* ---------- App bottom nav ---------- */
.app-bottom-nav {
    display: none;
}

body.has-app-bottom-nav {
    padding-bottom: calc(var(--diet-bottom-nav-h) + var(--diet-safe-bottom) + 8px);
}

@media (max-width: 900px) {
    .app-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 90;
        height: calc(var(--diet-bottom-nav-h) + var(--diet-safe-bottom));
        padding-bottom: var(--diet-safe-bottom);
        background: #fff;
        border-top: 1px solid var(--diet-border);
        box-shadow: 0 -4px 20px rgba(0, 82, 155, 0.08);
    }

    .app-bottom-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: var(--diet-bottom-nav-h);
        color: var(--diet-text-muted);
        text-decoration: none;
        font-size: 0.65rem;
        font-weight: 500;
        -webkit-tap-highlight-color: transparent;
        padding: 0 2px;
    }

    .app-bottom-nav-btn i,
    .app-bottom-nav-btn svg {
        width: 22px;
        height: 22px;
    }

    .app-bottom-nav-btn.active {
        color: var(--diet-primary);
        font-weight: 700;
    }

    /* 指南页也保留全局底栏（打卡/收藏/我的入口）；指南内用顶栏步骤 + 工具按钮 */
    body.diet-page {
        padding-bottom: calc(var(--diet-bottom-nav-h) + var(--diet-safe-bottom) + 8px);
    }

    /* 有统一底栏时隐藏悬浮加号 */
    body.has-app-bottom-nav #floating-menu,
    body.diet-page #floating-menu,
    body:has(#diet-app) #floating-menu {
        display: none !important;
    }
}

@media (min-width: 901px) {
    body.has-app-bottom-nav {
        padding-bottom: 0;
    }

    body.has-app-bottom-nav #floating-menu,
    body.diet-page #floating-menu,
    body:has(#diet-app) #floating-menu {
        display: none !important;
    }
}

/* ---------- Checkin meal tabs ---------- */
.checkin-meal-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 12px;
    padding-bottom: 2px;
}

.checkin-meal-tab {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--diet-border);
    background: #fff;
    color: var(--diet-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

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

.checkin-meal-panel {
    display: none;
}

.checkin-meal-panel.active {
    display: block;
}

.checkin-notice {
    margin-bottom: 12px;
}

.checkin-notice-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #92400e;
    font-weight: 600;
}

.checkin-notice-summary::-webkit-details-marker {
    display: none;
}

.checkin-progress-bar {
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}

.checkin-progress-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--diet-primary);
}

.checkin-progress-bar.is-warn > span {
    background: #d97706;
}

.checkin-progress-bar.is-over > span {
    background: #dc2626;
}

.timeline-expand-btn {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--diet-primary);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    min-height: 32px;
}

.timeline-detail {
    display: none;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #475569;
}

.timeline-detail.open {
    display: block;
}

.monthly-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    margin: 12px 0 4px;
    padding: 8px 4px 0;
    border-bottom: 1px solid #e2e8f0;
}

.monthly-chart-bar {
    flex: 1;
    min-width: 0;
    background: rgba(0, 82, 155, 0.2);
    border-radius: 4px 4px 0 0;
    position: relative;
}

.monthly-chart-bar.is-ok {
    background: rgba(21, 128, 61, 0.55);
}

.monthly-chart-bar.is-warn {
    background: rgba(217, 119, 6, 0.55);
}

.header-user-menu {
    position: relative;
}

.header-user-menu summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.85rem;
}

.header-user-menu summary::-webkit-details-marker {
    display: none;
}

.header-user-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 160px;
    background: #fff;
    color: #334155;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    padding: 6px;
    z-index: 80;
}

.header-user-menu-panel a,
.header-user-menu-panel button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: none;
    background: none;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #334155;
    cursor: pointer;
    text-decoration: none;
}

.header-user-menu-panel a:hover,
.header-user-menu-panel button:hover {
    background: #f1f5f9;
}

.checkin-quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.saved-switch-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.saved-switch-tab {
    flex: 1;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--diet-border);
    background: #fff;
    color: var(--diet-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.saved-switch-tab.active {
    background: var(--diet-primary);
    border-color: var(--diet-primary);
    color: #fff;
}

.account-quick-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.account-quick-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 82, 155, 0.06);
    text-decoration: none;
    color: #334155;
    min-height: 56px;
    font-size: 0.875rem;
    font-weight: 600;
}

.account-quick-link span {
    color: var(--diet-text-muted);
    font-weight: 400;
    font-size: 0.75rem;
    display: block;
}

/* Checkin quick foods */
.checkin-quick-food:active {
    background: #e8f4fd;
    border-color: var(--diet-primary, #00529b);
    color: var(--diet-primary, #00529b);
}

/* ---------- Desktop primary nav (pairs with bottom nav) ---------- */
.app-desktop-primary-nav {
    display: none;
}

@media (min-width: 901px) {
    .app-desktop-primary-nav {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        background: #fff;
        border-bottom: 1px solid var(--diet-border, #e2e8f0);
        padding: 0 16px;
        position: sticky;
        top: 0;
        z-index: 40;
        box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
    }
    .app-desktop-nav-link {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        min-height: 48px;
        color: var(--diet-text-muted, #64748b);
        text-decoration: none;
        font-size: 0.95rem;
        font-weight: 500;
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
    }
    .app-desktop-nav-link i,
    .app-desktop-nav-link svg {
        width: 18px;
        height: 18px;
    }
    .app-desktop-nav-link.active,
    .app-desktop-nav-link:hover {
        color: var(--diet-primary, #00529b);
    }
    .app-desktop-nav-link.active {
        border-bottom-color: var(--diet-primary, #00529b);
        font-weight: 700;
    }
}

/* ---------- Unified page header ---------- */
.app-page-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    min-height: 44px;
}
.app-page-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-color, #00529b);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 40px;
    padding: 4px 8px 4px 0;
    flex-shrink: 0;
}
.app-page-back:hover { opacity: 0.85; }
.app-page-title {
    flex: 1;
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary-color, #00529b);
    text-align: center;
    line-height: 1.3;
}
.app-page-title-spacer { flex: 1; }
.app-page-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 4.5rem;
    justify-content: flex-end;
}
.app-page-header-link {
    color: var(--primary-color, #00529b);
    text-decoration: none;
    font-size: 0.875rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}
@media (max-width: 480px) {
    .app-page-back-text { display: none; }
}

/* ---------- Query page polish ---------- */
.query-page {
    max-width: 960px;
}
.query-search-card {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 82, 155, 0.06);
    margin-bottom: 16px;
}
.query-search-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.query-search-input-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}
.query-hint {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: #475569;
}
.query-section {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 82, 155, 0.06);
    margin-bottom: 16px;
}
.query-section-title {
    margin: 0 0 12px;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}
.query-empty {
    text-align: center;
    padding: 28px 16px;
    color: #64748b;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 82, 155, 0.06);
}
.food-card-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.food-result-item {
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
    text-align: left;
    width: 100%;
}
.food-result-item:hover,
.food-result-item:focus {
    border-color: #93c5fd;
    box-shadow: 0 4px 14px rgba(0, 82, 155, 0.08);
    outline: none;
}
.food-result-item-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 8px;
}
.food-result-item-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 1rem;
    margin: 0;
}
.food-result-item-cat {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 2px;
}
.food-result-item-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}
.food-result-metric {
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px 6px;
    text-align: center;
}
.food-result-metric span {
    display: block;
    font-size: 0.68rem;
    color: #94a3b8;
}
.food-result-metric strong {
    display: block;
    font-size: 0.9rem;
    color: #0f172a;
    margin-top: 2px;
}
.food-result-metric.is-warn strong { color: #dc2626; }
.food-list-count {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 10px;
}
.query-jump-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.query-jump-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    min-height: 40px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
    font-size: 0.82rem;
}
.query-jump-chip:hover {
    background: #e8f4fd;
    color: var(--primary-color, #00529b);
}


/* 四栏主导航已覆盖入口，隐藏悬浮加号减少层级干扰 */
#floating-menu { display: none !important; }

/* ============================================================
   统一设计系统（参考薄荷健康 / 华为运动健康）
   ============================================================ */
:root {
    --app-radius-card: 16px;
    --app-radius-btn: 12px;
    --app-shadow-card: 0 2px 12px rgba(0, 82, 155, 0.06);
    --app-bg: #f4f6f9;
    --app-text: #0f172a;
    --app-text-2: #64748b;
    --app-text-3: #94a3b8;
    --app-line: #eef2f7;
}

.app-card {
    background: #fff;
    border-radius: var(--app-radius-card);
    box-shadow: var(--app-shadow-card);
}

/* 一级 Tab 页标题（无返回键） */
.app-tab-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}
.app-tab-title h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--app-text);
}
.app-tab-title .app-tab-links {
    display: flex;
    gap: 12px;
}
.app-tab-title .app-tab-links a {
    color: var(--primary-color, #00529b);
    font-size: 0.85rem;
    text-decoration: none;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
}

/* ---------- 今日页（日记式） ---------- */
.today-page { max-width: 760px; }

.today-date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}
.today-date-row h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--app-text);
}
.today-date-row .today-week {
    color: var(--app-text-2);
    font-size: 0.85rem;
    margin-top: 2px;
}
.today-streak-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* 今日营养概览 */
.today-summary-card {
    padding: 16px;
    margin-bottom: 16px;
}
.today-summary-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 12px;
}
.today-summary-head h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-text);
}
.today-summary-head span {
    font-size: 0.75rem;
    color: var(--app-text-3);
}
.today-nutri-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.today-nutri-row {
    display: grid;
    grid-template-columns: 3.2rem 1fr auto;
    align-items: center;
    gap: 10px;
}
.today-nutri-name {
    font-size: 0.82rem;
    color: var(--app-text-2);
}
.today-nutri-bar {
    height: 8px;
    background: #f1f5f9;
    border-radius: 999px;
    overflow: hidden;
}
.today-nutri-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: var(--primary-color, #00529b);
    transition: width .3s;
}
.today-nutri-bar.is-warn > span { background: #f59e0b; }
.today-nutri-bar.is-over > span { background: #ef4444; }
.today-nutri-val {
    font-size: 0.78rem;
    color: var(--app-text-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.today-nutri-val strong { color: var(--app-text); }
.today-summary-empty {
    color: var(--app-text-2);
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 0;
}

/* 餐次卡片 */
.meal-card {
    padding: 16px;
    margin-bottom: 12px;
}
.meal-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.meal-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1rem;
    color: var(--app-text);
}
.meal-card-title .meal-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e8f4fd;
    color: var(--primary-color, #00529b);
    flex-shrink: 0;
}
.meal-card-title .meal-icon svg { width: 18px; height: 18px; }

.meal-food-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}
.meal-food-list:empty { display: none; }
.meal-food-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 10px;
}
.meal-food-item .meal-food-name {
    flex: 1;
    min-width: 0;
    font-size: 0.9rem;
    color: var(--app-text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.meal-food-item .meal-food-qty {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.meal-food-item .meal-food-qty input {
    width: 64px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    min-height: 36px;
    text-align: center;
}
.meal-food-item .meal-food-qty span {
    font-size: 0.78rem;
    color: var(--app-text-3);
}
.meal-food-item .meal-food-remove {
    border: none;
    background: none;
    color: #cbd5e1;
    cursor: pointer;
    padding: 6px;
    min-height: 36px;
    min-width: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.meal-food-item .meal-food-remove:hover { color: #ef4444; }
.meal-food-item .meal-food-remove svg { width: 16px; height: 16px; }

.meal-add-btn {
    width: 100%;
    border: 1.5px dashed #cbd5e1;
    background: #fbfdff;
    color: var(--primary-color, #00529b);
    border-radius: var(--app-radius-btn);
    padding: 12px;
    min-height: 48px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.meal-add-btn:active { background: #e8f4fd; }
.meal-add-btn svg { width: 18px; height: 18px; }

.meal-extra-toggle {
    margin-top: 8px;
    border: none;
    background: none;
    color: var(--app-text-3);
    font-size: 0.78rem;
    cursor: pointer;
    padding: 4px 0;
    min-height: 32px;
}
.meal-extra-textarea {
    margin-top: 6px;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.85rem;
    box-sizing: border-box;
}

/* 底部固定保存栏 */
.today-save-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--diet-bottom-nav-h, 64px) + var(--diet-safe-bottom, 0px));
    z-index: 80;
    padding: 10px 16px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--app-line);
}
.today-save-bar .today-save-inner {
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    align-items: center;
}
.today-save-btn {
    flex: 1;
    background: var(--primary-color, #00529b);
    color: #fff;
    border: none;
    border-radius: var(--app-radius-btn);
    padding: 14px;
    min-height: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
.today-copy-link {
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: var(--app-text-2);
    border-radius: var(--app-radius-btn);
    padding: 0 14px;
    min-height: 50px;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}
@media (min-width: 901px) {
    .today-save-bar { bottom: 0; }
}
.today-page { padding-bottom: 90px; }

/* 添加食物弹层（全屏） */
.food-picker {
    position: fixed;
    inset: 0;
    z-index: 120;
    background: var(--app-bg);
    display: flex;
    flex-direction: column;
}
.food-picker[hidden] { display: none !important; }
.food-picker-head {
    background: #fff;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    border-bottom: 1px solid var(--app-line);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.food-picker-close {
    border: none;
    background: #f1f5f9;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--app-text-2);
    flex-shrink: 0;
}
.food-picker-title {
    flex: 1;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--app-text);
}
.food-picker-title small {
    display: block;
    font-size: 0.72rem;
    color: var(--app-text-3);
    font-weight: 400;
}
.food-picker-search {
    background: #fff;
    padding: 10px 16px;
    border-bottom: 1px solid var(--app-line);
    flex-shrink: 0;
}
.food-picker-search input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    min-height: 48px;
    box-sizing: border-box;
    background: #f8fafc;
}
.food-picker-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
}
.food-picker-section-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--app-text-3);
    margin: 6px 0 10px;
}
.food-picker-common {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.food-picker-common button {
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 999px;
    padding: 8px 14px;
    min-height: 40px;
    font-size: 0.85rem;
    color: var(--app-text);
    cursor: pointer;
}
.food-picker-common button:active { background: #e8f4fd; border-color: var(--primary-color); }
.food-picker-row {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.food-picker-row-info { flex: 1; min-width: 0; }
.food-picker-row-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--app-text);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.food-picker-row-meta {
    font-size: 0.75rem;
    color: var(--app-text-3);
    margin-top: 2px;
}
.food-picker-row-qty {
    width: 60px;
    flex-shrink: 0;
}
.food-picker-row-qty input {
    width: 100%;
    padding: 8px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    min-height: 40px;
    box-sizing: border-box;
}
.food-picker-row-add {
    flex-shrink: 0;
    border: none;
    background: var(--primary-color, #00529b);
    color: #fff;
    border-radius: 10px;
    padding: 0 14px;
    min-height: 40px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.food-picker-row-add.is-added { background: #10b981; }
.food-picker-empty {
    text-align: center;
    color: var(--app-text-3);
    padding: 30px 0;
    font-size: 0.88rem;
}
.food-picker-camera {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 10px;
    padding: 0 12px;
    min-height: 40px;
    font-size: 0.82rem;
    color: var(--app-text-2);
    cursor: pointer;
    flex-shrink: 0;
}

/* 营养反馈卡 */
.today-feedback-card { padding: 16px; margin-bottom: 16px; }
.today-feedback-msg {
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.9rem;
    line-height: 1.6;
}
.today-feedback-msg.is-good { background: #ecfdf5; color: #065f46; }
.today-feedback-msg.is-warn { background: #fffbeb; color: #92400e; }
.today-feedback-msg ul { margin: 8px 0 0; padding-left: 18px; }

/* ================= 查询页：食物详情卡片 ================= */
.food-detail-card {
    background: #fff;
    border: 1px solid #e1eeff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--app-shadow-card, 0 2px 12px rgba(0,82,155,.06));
}
.food-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}
.food-detail-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}
.food-detail-meta {
    margin-top: 4px;
    font-size: 0.82rem;
    color: #94a3b8;
}
.food-detail-card .add-to-today-btn {
    background: var(--primary-color, #00529b);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0 18px;
    min-height: 42px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.food-detail-card .add-to-today-btn:hover { opacity: .92; }

/* 营养格子 */
.food-detail-card .nutrient-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-top: 16px;
}
.food-detail-card .nutrient-item {
    background: #f0f7ff;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 8px 10px;
    text-align: center;
}
.food-detail-card .nutrient-item .nutrient-label {
    font-size: 0.78rem;
    color: #64748b;
}
.food-detail-card .nutrient-item .nutrient-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color, #00529b);
    margin: 4px 0;
}
/* 高危营养素格子：红底 + 顶部徽章 */
.food-detail-card .nutrient-item.nutrient-item-danger {
    background: #fff5f5;
    border-color: #fecaca;
}
.food-detail-card .nutrient-item .nutrient-badge {
    display: inline-block;
    background: #dc2626;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
    padding: 4px 10px;
    border-radius: 999px;
    margin: -2px 0 6px;
    letter-spacing: 0.03em;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

/* 提示框 */
.food-tip-box {
    margin-top: 12px;
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.86rem;
    line-height: 1.6;
    background: #f0f7ff;
    border-left: 4px solid var(--primary-color, #00529b);
    color: #334155;
}
.food-tip-box.food-tip-ok {
    background: #ecfdf5;
    border-left-color: #16a34a;
    color: #065f46;
}
.food-tip-box.food-tip-danger {
    background: #fef2f2;
    border-left-color: #dc2626;
    color: #991b1b;
}
.food-back-list-btn {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    padding: 0 16px;
    min-height: 38px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
}
.food-back-list-btn:hover { background: #f8fafc; }

/* 列表卡片：钾/磷格子上方小徽章 */
.food-result-metric { position: relative; }
.food-result-metric .food-metric-badge {
    display: inline-block;
    font-style: normal;
    background: #dc2626;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    padding: 2px 7px;
    border-radius: 999px;
    margin-bottom: 3px;
}
.food-result-metric.is-warn {
    background: #fff5f5;
    border: 1px solid #fecaca;
}

/* ================= 我的页：桌面左侧栏 + 右侧内容 ================= */
.mine-page { max-width: 1080px; }

.mine-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 用户卡 */
.mine-profile-card {
    background: linear-gradient(135deg, #00529b 0%, #1a6dcc 60%, #3b8dd9 100%);
    border-radius: 16px;
    padding: 20px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 82, 155, 0.18);
}
.mine-profile-top {
    display: flex;
    align-items: center;
    gap: 14px;
}
.mine-avatar {
    width: 56px; height: 56px; border-radius: 16px;
    background: rgba(255,255,255,0.16);
    color: #fff;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mine-name { margin: 0; font-weight: 700; font-size: 1.15rem; color: #fff; }
.mine-email { margin: 2px 0 0; font-size: 0.82rem; color: rgba(255,255,255,0.8); overflow: hidden; text-overflow: ellipsis; }
.mine-profile-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.mine-profile-chips span {
    font-size: 0.75rem; background: rgba(255,255,255,0.16); color: #fff;
    padding: 5px 12px; border-radius: 999px;
}
.mine-no-profile { margin: 12px 0 0; font-size: 0.85rem; color: #ffe9a8; }

/* 功能菜单 */
.mine-menu {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--app-shadow-card, 0 2px 12px rgba(0,82,155,.06));
    padding: 8px;
    margin-top: 16px;
}
.mine-menu-label {
    font-size: 0.75rem; font-weight: 700; color: #94a3b8;
    margin: 12px 10px 6px; letter-spacing: 0.02em;
}
.mine-menu-label:first-child { margin-top: 6px; }
.mine-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 10px;
    border-radius: 12px;
    text-decoration: none;
    color: #0f172a;
    min-height: 56px;
    transition: background .15s;
}
.mine-menu-item:hover { background: #f8fafc; }
.mine-menu-item.is-active {
    background: #e8f4fd;
}
.mine-menu-item.is-active .mine-menu-text { color: var(--primary-color, #00529b); }
.mine-menu-item.is-active .mine-menu-arrow { color: var(--primary-color, #00529b); }
.mine-menu-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: #e8f4fd; color: var(--primary-color, #00529b);
    display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.mine-menu-item.is-active .mine-menu-icon {
    background: var(--primary-color, #00529b);
    color: #fff;
}
.mine-menu-icon svg { width: 19px; height: 19px; }
.mine-menu-text { flex: 1; min-width: 0; font-size: 0.92rem; font-weight: 600; }
.mine-menu-text small { display: block; font-size: 0.75rem; color: #94a3b8; font-weight: 400; margin-top: 1px; }
.mine-menu-arrow { width: 18px; height: 18px; color: #cbd5e1; flex-shrink: 0; }

.mine-logout-btn {
    width: 100%;
    margin-top: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    border-radius: 12px;
    padding: 12px;
    min-height: 48px;
    font-size: 0.9rem;
    cursor: pointer;
}
.mine-logout-btn:hover { color: #dc2626; border-color: #fecaca; }

/* 右侧内容面板 */
.mine-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}
.mine-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: var(--app-shadow-card, 0 2px 12px rgba(0,82,155,.06));
    padding: 20px;
}
.mine-panel-title {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mine-panel-title svg { width: 18px; height: 18px; color: var(--primary-color, #00529b); }
.mine-field-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #475569;
    margin-bottom: 6px;
}
.mine-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    min-height: 46px;
    box-sizing: border-box;
    background: #fbfdff;
}
.mine-input:focus {
    outline: none;
    border-color: var(--primary-color, #00529b);
    box-shadow: 0 0 0 3px rgba(0, 82, 155, 0.12);
    background: #fff;
}
.mine-field-hint { margin: 8px 0 0; font-size: 0.8rem; color: #94a3b8; }
.mine-field-group { display: flex; flex-direction: column; gap: 14px; }

/* 健康档案表单 */
.mine-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}
.mine-checkbox-row { display: flex; flex-wrap: wrap; gap: 10px; }
.mine-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
    min-height: 40px;
    background: #fbfdff;
    transition: all .15s;
    user-select: none;
}
.mine-checkbox:has(input:checked) {
    border-color: var(--primary-color, #00529b);
    background: #e8f4fd;
    color: var(--primary-color, #00529b);
    font-weight: 600;
}
.mine-checkbox input { accent-color: var(--primary-color, #00529b); width: 15px; height: 15px; margin: 0; }

.mine-btn {
    margin-top: 16px;
    background: var(--primary-color, #00529b);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0 22px;
    min-height: 46px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
}
.mine-btn:hover { opacity: 0.92; }

/* 二级页桌面端标题（侧栏布局时显示） */
.mine-subpage-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #0f172a;
}

/* 桌面端：左 320px 侧栏 + 右自适应 */
@media (min-width: 901px) {
    .mine-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
    }
    .mine-sidebar {
        width: 320px;
        flex-shrink: 0;
        position: sticky;
        top: 76px;
    }
    .mine-content { flex: 1; }
    .mine-form-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ================= 今日页：桌面端优化 ================= */
/* 提高优先级覆盖 layout 内联的 .container-main max-width:1200px */
.container-main.today-page { max-width: 760px; }

@media (min-width: 901px) {
    .container-main.today-page { max-width: 1020px; }
    /* 固定保存栏高度约 72px，桌面无底栏，底部留足滚动空间 */
    .today-page { padding-bottom: 120px; }

    /* 四餐卡 2x2 网格，减少滚动 */
    .today-page #checkin-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        align-items: start;
        padding-bottom: 8px;
    }
    .today-page #checkin-form .meal-card { margin-bottom: 0; }
    /* 备注卡占满整行 */
    .today-page #checkin-form > .app-card:not(.meal-card) {
        grid-column: 1 / -1;
        margin-bottom: 0 !important;
    }
    .today-save-bar {
        bottom: 0;
        padding: 12px 24px;
    }
    .today-save-bar .today-save-inner { max-width: 1020px; }

    /* 营养概览行桌面端更舒展 */
    .today-nutri-row { padding: 7px 0; }
    .today-nutri-name { font-size: 0.92rem; }
    .today-nutri-val { font-size: 0.92rem; }
}
/* today-page 桌面保存栏留白 */


/* ================= 查询页：中老年友好（大字深色） ================= */
.food-result-item-cat {
    font-size: 0.85rem;
    color: #475569;
}
.food-result-metric span {
    font-size: 0.75rem;
    color: #64748b;
}
.food-result-metric strong {
    font-size: 1rem;
}
.food-list-count {
    font-size: 0.95rem;
    color: #334155;
}
.food-detail-card .nutrient-item .nutrient-label {
    font-size: 0.85rem;
    color: #475569;
}
.food-detail-meta { color: #64748b; font-size: 0.9rem; }
.food-tip-box { font-size: 0.95rem; }

/* 添加食物弹层：底部完成栏 */
.food-picker-foot {
    background: #fff;
    border-top: 1px solid var(--app-line);
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.food-picker-count {
    font-size: 0.95rem;
    color: var(--app-text-2);
    font-weight: 600;
    white-space: nowrap;
}
.food-picker-done {
    flex: 1;
    background: var(--primary-color, #00529b);
    color: #fff;
    border: none;
    border-radius: var(--app-radius-btn);
    min-height: 50px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
}
.food-picker-done:active { opacity: 0.9; }

/* 营养卡实时估算说明 */
.today-nutri-note {
    margin: 12px 0 0;
    font-size: 0.75rem;
    color: var(--app-text-3);
    line-height: 1.5;
}

/* ================= 弹层内已选清单（可改克数/删除） ================= */
.food-picker-selected-wrap {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 14px;
    border: 1.5px solid #bfdbfe;
}
.food-picker-selected-wrap .food-picker-section-label {
    margin: 0 0 10px;
    color: var(--primary-color, #00529b);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.food-picker-selected-hint {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--app-text-3);
}
.food-picker-selected {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.picker-sel-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 10px;
}
.picker-sel-name {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--app-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.picker-sel-qty {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
.picker-sel-qty input {
    width: 68px;
    padding: 8px 6px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.95rem;
    min-height: 42px;
    text-align: center;
    box-sizing: border-box;
    background: #fff;
}
.picker-sel-qty input:focus {
    outline: none;
    border-color: var(--primary-color, #00529b);
    box-shadow: 0 0 0 3px rgba(0, 82, 155, 0.12);
}
.picker-sel-qty span {
    font-size: 0.8rem;
    color: var(--app-text-3);
}
.picker-sel-del {
    border: none;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 8px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}
.picker-sel-del:active { background: #fecaca; }
.picker-sel-del svg { width: 18px; height: 18px; }

/* ================= 站点页脚：桌面显示，移动端隐藏（避免被底栏遮挡） ================= */
.site-footer {
    background: #1e293b;
    color: #fff;
    padding: 16px 12px;
}
.site-footer-line {
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.5;
    color: #e2e8f0;
}
.site-footer-sub {
    margin: 6px 0 0;
    font-size: 0.75rem;
    line-height: 1.45;
    color: #94a3b8;
}
@media (max-width: 900px) {
    .site-footer--desktop-only {
        display: none !important;
    }
}
/* 今日页有固定保存栏，页脚会被挡住，直接隐藏 */
body:has(.today-save-bar) .site-footer {
    display: none !important;
}

/* ================= 全站视觉统一补丁 ================= */
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
    color: var(--app-text, #0f172a);
    background: var(--app-bg, #f4f6f9);
}

/* 统一主按钮：打卡页 / 我的 / 方案页 */
.diet-app .btn,
.mine-btn,
.today-save-btn,
.app-primary-btn {
    border-radius: 12px !important;
    min-height: 48px;
    font-weight: 600;
    font-family: inherit;
}
.diet-app .btn-secondary {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border: 1px solid #e2e8f0 !important;
}

/* 方案页彩色内联按钮收敛为主色/次色 */
.diet-app .btn[style*="background-color: #3498db"],
.diet-app .btn[style*="background-color:#3498db"],
.diet-app .btn[style*="background-color: #9b59b6"],
.diet-app .btn[style*="background-color:#9b59b6"],
.diet-app .btn[style*="background-color: #27ae60"],
.diet-app .btn[style*="background-color:#27ae60"] {
    background-color: var(--primary-color, #00529B) !important;
    border-radius: 12px !important;
}

/* ================= 交换份单页简化 ================= */
.exchange-simple-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.exchange-step-card {
    background: #fff;
    border: 1px solid #e8eef5;
    border-radius: 16px;
    padding: 16px;
}
.exchange-step-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.exchange-step-num {
    width: 28px; height: 28px; border-radius: 999px;
    background: var(--primary-color, #00529b); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.85rem; font-weight: 700; flex-shrink: 0;
}
.exchange-step-head h3 {
    margin: 0; font-size: 1.05rem; font-weight: 700; color: #0f172a;
}
.exchange-step-head p {
    margin: 2px 0 0; font-size: 0.82rem; color: #64748b;
}
.exchange-lookup-toggle {
    width: 100%;
    margin-top: 10px;
    border: 1.5px dashed #cbd5e1;
    background: #fbfdff;
    color: var(--primary-color, #00529b);
    border-radius: 12px;
    min-height: 48px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.exchange-lookup-panel[hidden] { display: none !important; }
.exchange-lookup-panel { margin-top: 12px; }

/* ================= 我的食谱：分享/打印 ================= */
.recipe-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}
.recipe-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 48px;
    padding: 0 18px;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.recipe-action-btn--primary {
    background: var(--primary-color, #00529b);
    color: #fff;
}
.recipe-action-btn--ghost {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #e2e8f0;
}
.recipe-action-btn--danger {
    background: #fff;
    color: #dc2626;
    border: 1px solid #fecaca;
}
.recipe-share-box {
    display: none;
    margin-top: 12px;
    padding: 12px 14px;
    background: #f0f7ff;
    border: 1px solid #d1e3ff;
    border-radius: 12px;
}
.recipe-share-box.is-open { display: block; }
.recipe-share-box input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 0.9rem;
    box-sizing: border-box;
    margin: 8px 0;
}
.recipe-detail-panel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 82, 155, 0.06);
    padding: 20px;
}
.recipe-meal-block { margin-bottom: 16px; }
.recipe-meal-block h3 {
    margin: 0 0 6px;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}
.recipe-meal-block p {
    margin: 0;
    color: #475569;
    line-height: 1.6;
    font-size: 0.95rem;
}
.recipe-nutri-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
@media (min-width: 640px) {
    .recipe-nutri-grid { grid-template-columns: repeat(4, 1fr); }
}
.recipe-nutri-grid div {
    background: #f8fafc;
    border-radius: 10px;
    padding: 10px;
    font-size: 0.88rem;
    color: #334155;
}

@media print {
    body * { visibility: hidden; }
    #recipe-print-root, #recipe-print-root * { visibility: visible; }
    #recipe-print-root {
        position: absolute;
        left: 0; top: 0; width: 100%;
        padding: 16px;
        box-shadow: none !important;
    }
    .no-print { display: none !important; }
    header, footer, .app-bottom-nav, .app-desktop-primary-nav, .mine-sidebar { display: none !important; }
}


/* 今日页短提示 */
.today-tip-line {
    margin: 8px 0 20px;
    font-size: 0.82rem;
    color: #64748b;
    text-align: center;
}

/* 统一表单/页内错误条（toast 仍由 layout 负责 session flash） */
.diet-flash {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.45;
}
.diet-flash--error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.diet-flash--info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.diet-flash--success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}
.diet-field-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}
