/* ============================================================
   饮食记录 diet.s1.css
   橙色渐变主题 + 玻璃拟态，移动端自适应
   ============================================================ */

.diet-card {
    background: linear-gradient(160deg, rgba(255,255,255,0.96), rgba(255,247,237,0.92));
    border: 1px solid rgba(249, 115, 22, 0.35);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(249, 115, 22, 0.10);
    padding: 22px;
    position: relative;
    overflow: hidden;
}
.diet-card::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 200px; height: 200px;
    background: radial-gradient(circle, rgba(245,158,11,0.10), transparent 70%);
    pointer-events: none;
}
.diet-card::after {
    content: '';
    position: absolute;
    bottom: -40px; left: -40px;
    width: 180px; height: 180px;
    background: radial-gradient(circle, rgba(249,115,22,0.08), transparent 70%);
    pointer-events: none;
}
.diet-icon {
    background: linear-gradient(135deg, #f97316 0%, #f59e0b 100%) !important;
    box-shadow: 0 6px 18px rgba(249, 115, 22, 0.35);
    animation: diet-breath 3s ease-in-out infinite;
}
@keyframes diet-breath {
    0%, 100% { box-shadow: 0 6px 18px rgba(249,115,22,0.35); }
    50% { box-shadow: 0 6px 26px rgba(245,158,11,0.55); }
}

/* ---------- 登录引导 ---------- */
.diet-login-guide { text-align: center; padding: 34px 16px 26px; position: relative; z-index: 1; }
.diet-login-guide i { font-size: 40px; background: linear-gradient(135deg,#f97316,#f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.diet-login-guide h3 { margin: 12px 0 6px; font-size: 1.05rem; color: #1e293b; }
.diet-login-guide p { margin: 0 0 18px; font-size: 0.85rem; color: #64748b; }
.diet-login-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.diet-login-btns a {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 26px; border-radius: 999px; text-decoration: none;
    font-size: 0.9rem; font-weight: 600; transition: all .25s ease;
}
.diet-login-btns a.main { background: linear-gradient(135deg,#f97316,#f59e0b); color: #fff; box-shadow: 0 6px 16px rgba(249,115,22,0.35); }
.diet-login-btns a.main:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(245,158,11,0.45); }
.diet-login-btns a.ghost { border: 1.5px solid rgba(249,115,22,0.45); color: #ea580c; background: rgba(255,255,255,0.7); }
.diet-login-btns a.ghost:hover { background: rgba(249,115,22,0.08); }

/* ---------- Tabs ---------- */
.diet-tabs {
    display: flex; gap: 5px; margin: 6px 0 16px;
    background: rgba(255,237,213,0.55); border: 1px solid rgba(245,158,11,0.28);
    padding: 5px; border-radius: 14px;
    position: relative; z-index: 1;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.diet-tabs::-webkit-scrollbar { display: none; }
.diet-tab {
    flex: 1 0 auto; border: none; background: transparent; cursor: pointer;
    padding: 9px 12px; border-radius: 10px; font-size: 0.85rem; font-weight: 600;
    color: #94a3b8; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    transition: all .22s ease; white-space: nowrap;
}
.diet-tab i { font-size: 0.8rem; }
.diet-tab:hover { color: #ea580c; }
.diet-tab.active {
    background: linear-gradient(135deg,#f97316,#f59e0b); color: #fff;
    box-shadow: 0 4px 14px rgba(249,115,22,0.35);
}
.diet-pane { display: none; animation: diet-slide-in .3s ease; position: relative; z-index: 1; }
.diet-pane.active { display: block; }
@keyframes diet-slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 今日概览卡 ---------- */
.diet-overview-card {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    background: linear-gradient(135deg, #ffedd5 0%, #fef3c7 100%);
    border-radius: 16px; padding: 18px 20px;
    border: 1px solid rgba(245,158,11,0.4);
    box-shadow: 0 6px 20px rgba(249,115,22,0.10);
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.diet-overview-main { flex: 1; min-width: 0; }
.diet-overview-label { font-size: 0.78rem; color: #9a3412; font-weight: 600; letter-spacing: 0.5px; }
.diet-overview-cal { font-size: 1.7rem; font-weight: 700; color: #c2410c; margin: 4px 0 2px; }
.diet-overview-cal small { font-size: 0.8rem; font-weight: 500; color: #9a3412; }
.diet-overview-sub { font-size: 0.82rem; color: #9a3412; }
.diet-overview-side { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.diet-ov-meal { display: flex; align-items: center; gap: 5px; font-size: 0.85rem; color: #7c2d12; font-weight: 600; background: rgba(255,255,255,0.55); padding: 6px 10px; border-radius: 10px; }

/* ---------- 表单 ---------- */
.diet-form-card {
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(245,158,11,0.22);
    border-radius: 16px; padding: 18px;
    margin-bottom: 16px;
}
.diet-form-title { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 700; color: #9a3412; margin-bottom: 16px; }
.diet-form-title i { color: #f97316; }

.diet-field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.diet-field { flex: 1; min-width: 130px; margin-bottom: 14px; }
.diet-field label { display: block; font-size: 0.82rem; font-weight: 600; color: #475569; margin-bottom: 7px; }
.diet-field label i { color: #f97316; margin-right: 4px; }
.diet-field input[type="text"], .diet-field input[type="date"], .diet-field input[type="number"] {
    width: 100%; padding: 10px 12px; border: 1.5px solid rgba(245,158,11,0.25);
    border-radius: 10px; font-size: 0.88rem; color: #1e293b;
    background: #fff; box-sizing: border-box;
    transition: border-color .2s, box-shadow .2s;
}
.diet-field input:focus { outline: none; border-color: #f97316; box-shadow: 0 0 0 3px rgba(249,115,22,0.12); }

/* 餐次选择 */
.diet-meal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.diet-meal-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px; border: 1.5px solid rgba(245,158,11,0.25); border-radius: 12px;
    cursor: pointer; transition: all .2s; background: #fff; text-align: center;
}
.diet-meal-item i { font-size: 1.1rem; }
.diet-meal-item .diet-meal-name { font-size: 0.78rem; color: #64748b; }
.diet-meal-item.active { background: rgba(249,115,22,0.10); border-color: #f97316; transform: translateY(-2px); }
.diet-meal-item.active .diet-meal-name { color: #9a3412; font-weight: 600; }

/* 保存按钮 */
.diet-save-row { display: flex; gap: 10px; margin-top: 6px; }
.diet-save-btn {
    flex: 1; border: none; cursor: pointer;
    padding: 12px 20px; border-radius: 12px;
    font-size: 0.92rem; font-weight: 600; color: #fff;
    background: linear-gradient(135deg,#f97316,#f59e0b);
    box-shadow: 0 6px 16px rgba(249,115,22,0.35);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: all .25s ease;
}
.diet-save-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(245,158,11,0.45); }
.diet-cancel-btn {
    border: 1.5px solid rgba(249,115,22,0.4); cursor: pointer;
    padding: 12px 20px; border-radius: 12px;
    font-size: 0.92rem; font-weight: 600; color: #ea580c; background: rgba(255,255,255,0.7);
    transition: all .2s;
}
.diet-cancel-btn:hover { background: rgba(249,115,22,0.08); }

/* ---------- 今日餐次分组 ---------- */
.diet-today-groups { display: flex; flex-direction: column; gap: 12px; }
.diet-meal-group {
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 14px; padding: 14px;
}
.diet-meal-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.diet-meal-group-title { display: flex; align-items: center; gap: 7px; font-size: 0.88rem; font-weight: 700; color: #9a3412; }
.diet-meal-group-title i { color: #f97316; }
.diet-meal-group-cal { font-size: 0.8rem; color: #64748b; font-weight: 600; }
.diet-food-list { display: flex; flex-direction: column; gap: 8px; }
.diet-food-item {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,247,237,0.6); border-radius: 10px; padding: 10px 12px;
}
.diet-food-info { flex: 1; min-width: 0; }
.diet-food-name { font-size: 0.86rem; font-weight: 600; color: #1e293b; }
.diet-food-note { font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }
.diet-food-cal { font-size: 0.82rem; font-weight: 700; color: #ea580c; }
.diet-food-actions { display: flex; gap: 5px; }
.diet-food-btn { border: none; background: rgba(249,115,22,0.08); color: #ea580c; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 0.78rem; transition: all .2s; }
.diet-food-btn:hover { background: rgba(249,115,22,0.18); }
.diet-food-btn.del { color: #ef4444; background: rgba(239,68,68,0.08); }
.diet-food-btn.del:hover { background: rgba(239,68,68,0.18); }

/* ---------- 统计 ---------- */
.diet-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
.diet-stat-card {
    background: rgba(255,255,255,0.8); border-radius: 14px; padding: 14px;
    border: 1px solid rgba(245,158,11,0.18);
}
.diet-stat-card.c1 { background: linear-gradient(135deg, #ffedd5, #fff); }
.diet-stat-card.c2 { background: linear-gradient(135deg, #fef3c7, #fff); }
.diet-stat-card.c3 { background: linear-gradient(135deg, #fce7f3, #fff); }
.diet-stat-card.c4 { background: linear-gradient(135deg, #d1fae5, #fff); }
.diet-stat-label { font-size: 0.78rem; color: #64748b; margin-bottom: 6px; }
.diet-stat-label i { margin-right: 4px; }
.diet-stat-value { font-size: 1.5rem; font-weight: 800; color: #1e293b; }
.diet-stat-value small { font-size: 0.75rem; font-weight: 500; color: #64748b; }

.diet-top-title { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 700; color: #9a3412; margin: 18px 0 12px; }
.diet-top-title i { color: #f97316; }

/* 本周每日柱状图 */
.diet-week-chart {
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 14px; padding: 16px;
    display: flex; align-items: flex-end; justify-content: space-between; gap: 8px;
    height: 180px;
}
.diet-week-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.diet-week-bar-fill {
    width: 100%; max-width: 34px;
    background: linear-gradient(180deg, #fbbf24 0%, #f97316 100%);
    border-radius: 8px 8px 0 0;
    min-height: 4px;
    transition: height .5s ease;
    position: relative;
}
.diet-week-bar-fill.today { background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%); box-shadow: 0 0 0 2px rgba(249,115,22,0.3); }
.diet-week-bar-val { font-size: 0.68rem; color: #ea580c; font-weight: 600; }
.diet-week-bar-label { font-size: 0.7rem; color: #94a3b8; }

/* 餐次占比 */
.diet-meal-dist { display: flex; flex-direction: column; gap: 10px; }
.diet-meal-bar { display: flex; align-items: center; gap: 10px; }
.diet-meal-bar .diet-mb-ico { width: 32px; height: 32px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 0.85rem; flex-shrink: 0; }
.diet-meal-bar .diet-mb-info { flex: 1; min-width: 0; }
.diet-meal-bar .diet-mb-head { display: flex; justify-content: space-between; font-size: 0.8rem; margin-bottom: 4px; }
.diet-meal-bar .diet-mb-head .diet-mb-nm { color: #475569; font-weight: 500; }
.diet-meal-bar .diet-mb-head .diet-mb-pct { color: #94a3b8; }
.diet-meal-bar .diet-mb-track { height: 7px; background: rgba(245,158,11,0.12); border-radius: 999px; overflow: hidden; }
.diet-meal-bar .diet-mb-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }

/* ---------- 历史 ---------- */
.diet-history-filter { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.diet-history-filter input, .diet-history-filter select {
    padding: 9px 12px; border: 1.5px solid rgba(245,158,11,0.25);
    border-radius: 10px; font-size: 0.85rem; color: #1e293b; background: #fff;
}
.diet-history-filter input:focus, .diet-history-filter select:focus { outline: none; border-color: #f97316; }

.diet-history-list { display: flex; flex-direction: column; gap: 8px; }
.diet-hist-item {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.8); border: 1px solid rgba(245,158,11,0.18);
    border-radius: 12px; padding: 12px 14px;
}
.diet-hist-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; color: #fff; padding: 3px 8px; border-radius: 999px; flex-shrink: 0; }
.diet-hist-info { flex: 1; min-width: 0; }
.diet-hist-food { font-size: 0.86rem; font-weight: 600; color: #1e293b; }
.diet-hist-meta { font-size: 0.72rem; color: #94a3b8; margin-top: 2px; }
.diet-hist-cal { font-size: 0.85rem; font-weight: 700; color: #ea580c; }
.diet-hist-actions { display: flex; gap: 5px; }
.diet-hist-btn { border: none; background: rgba(249,115,22,0.08); color: #ea580c; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 0.78rem; transition: all .2s; }
.diet-hist-btn:hover { background: rgba(249,115,22,0.18); }
.diet-hist-btn.del { color: #ef4444; background: rgba(239,68,68,0.08); }
.diet-hist-btn.del:hover { background: rgba(239,68,68,0.18); }

.diet-pagination { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.diet-page-btn { border: 1.5px solid rgba(245,158,11,0.25); background: #fff; color: #ea580c; padding: 7px 13px; border-radius: 10px; cursor: pointer; font-size: 0.82rem; font-weight: 600; }
.diet-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.diet-page-btn.active { background: linear-gradient(135deg,#f97316,#f59e0b); color: #fff; border-color: transparent; }

.diet-empty { text-align: center; padding: 28px 16px; color: #94a3b8; }
.diet-empty i { font-size: 2rem; margin-bottom: 8px; opacity: 0.5; }
.diet-empty div { font-size: 0.85rem; }

/* ---------- Toast ---------- */
.diet-toast {
    position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
    background: #fff; padding: 12px 20px; border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex; align-items: center; gap: 10px;
    font-size: 0.88rem; font-weight: 500; z-index: 999999;
    border-left: 4px solid #f97316;
    animation: diet-toast-in .3s ease;
    max-width: 90vw;
}
.diet-toast.success { border-left-color: #10b981; }
.diet-toast.error { border-left-color: #ef4444; }
.diet-toast.warning { border-left-color: #f59e0b; }
.diet-toast.info { border-left-color: #3b82f6; }
.diet-toast i { font-size: 1rem; }
.diet-toast.success i { color: #10b981; }
.diet-toast.error i { color: #ef4444; }
.diet-toast.warning i { color: #f59e0b; }
.diet-toast.info i { color: #3b82f6; }
@keyframes diet-toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-15px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .diet-card { padding: 14px; border-radius: 16px; }
    .diet-tab { padding: 8px 10px; font-size: 0.78rem; }
    .diet-tab i { display: none; }
    .diet-overview-card { padding: 14px; }
    .diet-overview-cal { font-size: 1.4rem; }
    .diet-overview-side { grid-template-columns: repeat(4, 1fr); width: 100%; }
    .diet-form-card { padding: 14px; }
    .diet-field-row { gap: 8px; }
    .diet-meal-grid { gap: 6px; }
    .diet-stat-grid { gap: 8px; }
    .diet-stat-card { padding: 12px; }
    .diet-stat-value { font-size: 1.2rem; }
    .diet-week-chart { height: 150px; padding: 12px; }
}
