/* ============================================================
   健康档案 health.s1.css
   红橙渐变主题 + 玻璃拟态，移动端自适应
   ============================================================ */

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

/* ---------- 登录引导 ---------- */
.health-login-guide { text-align: center; padding: 34px 16px 26px; position: relative; z-index: 1; }
.health-login-guide i { font-size: 40px; background: linear-gradient(135deg,#ef4444,#f97316); -webkit-background-clip: text; background-clip: text; color: transparent; }
.health-login-guide h3 { margin: 12px 0 6px; font-size: 1.05rem; color: #1e293b; }
.health-login-guide p { margin: 0 0 18px; font-size: 0.85rem; color: #64748b; }
.health-login-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.health-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;
}
.health-login-btns a.main { background: linear-gradient(135deg,#ef4444,#f97316); color: #fff; box-shadow: 0 6px 16px rgba(239,68,68,0.35); }
.health-login-btns a.main:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(249,115,22,0.45); }
.health-login-btns a.ghost { border: 1.5px solid rgba(239,68,68,0.45); color: #b91c1c; background: rgba(255,255,255,0.7); }
.health-login-btns a.ghost:hover { background: rgba(239,68,68,0.08); }

/* ---------- Tabs ---------- */
.health-tabs {
    display: flex; gap: 5px; margin: 6px 0 16px;
    background: rgba(254,226,226,0.55); border: 1px solid rgba(239,68,68,0.28);
    padding: 5px; border-radius: 14px;
    position: relative; z-index: 1;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.health-tabs::-webkit-scrollbar { display: none; }
.health-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;
}
.health-tab i { font-size: 0.8rem; }
.health-tab:hover { color: #b91c1c; }
.health-tab.active {
    background: linear-gradient(135deg,#ef4444,#f97316); color: #fff;
    box-shadow: 0 4px 14px rgba(239,68,68,0.35);
}
.health-pane { display: none; animation: health-slide-in .3s ease; position: relative; z-index: 1; }
.health-pane.active { display: block; }
@keyframes health-slide-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- 概览网格 ---------- */
.health-summary-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px;
    margin-bottom: 16px;
}
.health-summary-item {
    background: rgba(255,255,255,0.8); border: 1px solid rgba(239,68,68,0.18);
    border-radius: 14px; padding: 14px; cursor: pointer; transition: all .2s;
}
.health-summary-item:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(239,68,68,0.12); }
.health-sum-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.health-sum-ico { width: 30px; height: 30px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 0.85rem; flex-shrink: 0; }
.health-sum-name { font-size: 0.82rem; font-weight: 600; color: #1e293b; }
.health-sum-val { font-size: 1.2rem; font-weight: 800; color: #1e293b; line-height: 1.2; }
.health-sum-unit { font-size: 0.72rem; color: #94a3b8; margin-left: 2px; }
.health-sum-date { font-size: 0.72rem; color: #94a3b8; margin-top: 4px; }
.health-sum-count { display: inline-block; font-size: 0.7rem; color: #b91c1c; background: rgba(239,68,68,0.08); padding: 1px 8px; border-radius: 999px; margin-top: 6px; }
.health-sum-empty { font-size: 0.78rem; color: #94a3b8; }

/* ---------- 表单 ---------- */
.health-form-card {
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(239,68,68,0.22);
    border-radius: 16px; padding: 18px;
    margin-bottom: 18px;
}
.health-form-title { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; font-weight: 700; color: #991b1b; margin-bottom: 16px; }
.health-form-title i { color: #ef4444; }

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

.health-note-input {
    width: 100%; box-sizing: border-box;
    padding: 11px 12px; border: 1.5px solid rgba(239,68,68,0.25);
    border-radius: 10px; font-size: 0.88rem; color: #1e293b;
    background: #fff; resize: vertical; min-height: 70px; font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
}
.health-note-input:focus { outline: none; border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.12); }

/* 类型选择 */
.health-type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.health-type-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px; border: 1.5px solid rgba(239,68,68,0.25); border-radius: 12px;
    cursor: pointer; transition: all .2s; background: #fff; text-align: center;
}
.health-type-item i { font-size: 1.1rem; }
.health-type-item .health-type-name { font-size: 0.75rem; color: #64748b; }
.health-type-item.active { background: rgba(239,68,68,0.10); border-color: #ef4444; transform: translateY(-2px); }
.health-type-item.active .health-type-name { color: #991b1b; font-weight: 600; }

/* 类型行（统计/筛选页） */
.health-type-row { display: flex; gap: 8px; flex-wrap: wrap; }
.health-type-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 7px 14px; border: 1.5px solid rgba(239,68,68,0.25); border-radius: 999px;
    cursor: pointer; transition: all .2s; background: #fff; font-size: 0.82rem; color: #475569;
}
.health-type-chip i { font-size: 0.85rem; }
.health-type-chip.active { background: linear-gradient(135deg,#ef4444,#f97316); color: #fff; border-color: transparent; box-shadow: 0 4px 12px rgba(239,68,68,0.3); }

/* 保存按钮 */
.health-save-row { display: flex; gap: 10px; margin-top: 6px; }
.health-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,#ef4444,#f97316);
    box-shadow: 0 6px 16px rgba(239,68,68,0.35);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: all .25s ease;
}
.health-save-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(249,115,22,0.45); }
.health-cancel-btn {
    border: 1.5px solid rgba(239,68,68,0.4); cursor: pointer;
    padding: 12px 20px; border-radius: 12px;
    font-size: 0.92rem; font-weight: 600; color: #b91c1c; background: rgba(255,255,255,0.7);
    transition: all .2s;
}
.health-cancel-btn:hover { background: rgba(239,68,68,0.08); }

/* ---------- 标题 ---------- */
.health-top-title { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; font-weight: 700; color: #991b1b; margin: 18px 0 12px; }
.health-top-title i { color: #ef4444; }

/* ---------- 历史列表 ---------- */
.health-history-list { display: flex; flex-direction: column; gap: 10px; }
.health-history-item {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.8); border: 1px solid rgba(239,68,68,0.18);
    border-radius: 12px; padding: 12px 14px;
}
.health-hist-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.health-hist-info { flex: 1; min-width: 0; }
.health-hist-date { font-size: 0.85rem; font-weight: 600; color: #1e293b; }
.health-hist-meta { font-size: 0.75rem; color: #94a3b8; margin-top: 2px; }
.health-hist-type { display: inline-block; font-size: 0.7rem; color: #fff; padding: 1px 8px; border-radius: 999px; margin-right: 6px; }
.health-hist-actions { display: flex; gap: 6px; }
.health-hist-btn { border: none; background: rgba(239,68,68,0.08); color: #b91c1c; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 0.8rem; transition: all .2s; }
.health-hist-btn:hover { background: rgba(239,68,68,0.18); }
.health-hist-btn.del { color: #ef4444; background: rgba(239,68,68,0.08); }
.health-hist-btn.del:hover { background: rgba(239,68,68,0.18); }

/* ---------- 分页 ---------- */
.health-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; }
.health-page-btn {
    border: 1px solid rgba(239,68,68,0.25); background: #fff; color: #b91c1c;
    padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 0.8rem; transition: all .2s;
}
.health-page-btn:hover:not(:disabled) { background: rgba(239,68,68,0.08); }
.health-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.health-page-info { font-size: 0.8rem; color: #64748b; }

/* ---------- 统计页 ---------- */
.health-stats-type-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.health-stats-label { font-size: 0.85rem; font-weight: 600; color: #475569; }
.health-stats-label i { color: #ef4444; }

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

/* 趋势列表 */
.health-trend-list { display: flex; flex-direction: column; gap: 8px; }
.health-trend-item {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.8); border: 1px solid rgba(239,68,68,0.15);
    border-radius: 10px; padding: 10px 14px;
}
.health-trend-date { font-size: 0.82rem; color: #475569; min-width: 90px; }
.health-trend-bar { flex: 1; height: 8px; background: rgba(239,68,68,0.1); border-radius: 999px; overflow: hidden; }
.health-trend-fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.health-trend-val { font-size: 0.85rem; font-weight: 700; color: #1e293b; min-width: 70px; text-align: right; }

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

/* ---------- Toast ---------- */
.health-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 #ef4444;
    animation: health-toast-in .3s ease;
    max-width: 90vw;
}
.health-toast.success { border-left-color: #10b981; }
.health-toast.error { border-left-color: #ef4444; }
.health-toast.warning { border-left-color: #f59e0b; }
.health-toast.info { border-left-color: #3b82f6; }
.health-toast i { font-size: 1rem; }
.health-toast.success i { color: #10b981; }
.health-toast.error i { color: #ef4444; }
.health-toast.warning i { color: #f59e0b; }
.health-toast.info i { color: #3b82f6; }
@keyframes health-toast-in { from { opacity: 0; transform: translateX(-50%) translateY(-15px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------- 弹窗 ---------- */
.health-modal-mask {
    position: fixed; inset: 0; background: rgba(15,23,42,0.45);
    z-index: 999998; display: flex; align-items: center; justify-content: center;
    padding: 16px; animation: health-fade .2s ease;
}
@keyframes health-fade { from { opacity: 0; } to { opacity: 1; } }
.health-modal {
    background: #fff; border-radius: 18px; max-width: 420px; width: 100%;
    padding: 22px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    animation: health-pop .25s ease;
    max-height: 85vh; overflow-y: auto;
}
@keyframes health-pop { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: scale(1); } }
.health-modal-title { font-size: 1.05rem; font-weight: 700; color: #991b1b; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.health-modal-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f1f5f9; font-size: 0.85rem; }
.health-modal-row:last-child { border-bottom: none; }
.health-modal-row .health-mr-label { color: #64748b; }
.health-modal-row .health-mr-val { font-weight: 600; color: #1e293b; }
.health-modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.health-modal-btn {
    flex: 1; border: none; cursor: pointer; padding: 10px; border-radius: 10px;
    font-size: 0.88rem; font-weight: 600; transition: all .2s;
}
.health-modal-btn.primary { background: linear-gradient(135deg,#ef4444,#f97316); color: #fff; }
.health-modal-btn.primary:hover { transform: translateY(-1px); }
.health-modal-btn.ghost { background: rgba(239,68,68,0.08); color: #b91c1c; }

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
    .health-card { padding: 14px; border-radius: 16px; }
    .health-tab { padding: 8px 10px; font-size: 0.78rem; }
    .health-tab i { display: none; }
    .health-summary-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .health-summary-item { padding: 12px; }
    .health-sum-val { font-size: 1.05rem; }
    .health-form-card { padding: 14px; }
    .health-field-row { gap: 8px; }
    .health-type-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
    .health-stat-grid { gap: 8px; }
    .health-stat-card { padding: 12px; }
    .health-stat-value { font-size: 1.25rem; }
    .health-trend-date { min-width: 72px; font-size: 0.75rem; }
    .health-trend-val { min-width: 56px; font-size: 0.78rem; }
}
