/* METs Lab · Liquid Glass 主题层
   在 styles.css 之后加载：只覆盖视觉与动效，不改布局结构。 */

:root {
  --bg: #eef1e8;
  --card: rgba(255, 255, 255, 0.62);
  --line: rgba(20, 38, 28, 0.09);
  --line-2: rgba(20, 38, 28, 0.06);
  --glass: rgba(255, 255, 255, 0.56);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-edge: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 60px -36px rgba(18, 50, 30, 0.42), 0 2px 8px rgba(18, 50, 30, 0.05);
  --shadow-lift: 0 32px 74px -34px rgba(18, 50, 30, 0.5), 0 4px 14px rgba(18, 50, 30, 0.07);
  --radius: 22px;
  --ease: cubic-bezier(0.22, 0.9, 0.24, 1);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

html { background: #eef1e8; }

body {
  background-color: #eef1e8;
  background-image:
    radial-gradient(1100px 720px at 6% -10%, rgba(214, 241, 183, 0.9) 0%, rgba(214, 241, 183, 0) 58%),
    radial-gradient(980px 660px at 104% 2%, rgba(203, 228, 247, 0.85) 0%, rgba(203, 228, 247, 0) 56%),
    radial-gradient(920px 720px at 52% 112%, rgba(250, 224, 203, 0.72) 0%, rgba(250, 224, 203, 0) 58%),
    linear-gradient(180deg, #f7f9f2 0%, #eef2e8 56%, #ecf1e5 100%);
  background-attachment: fixed;
}

::selection { background: rgba(163, 230, 53, 0.35); color: #10251a; }

* { scrollbar-width: thin; scrollbar-color: rgba(20, 38, 28, 0.22) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(20, 38, 28, 0.16); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(20, 38, 28, 0.28); background-clip: content-box; }

:focus-visible { outline: 2px solid rgba(31, 107, 59, 0.75); outline-offset: 2px; }

/* ---------- 玻璃侧栏 ---------- */
.sidebar {
  background: linear-gradient(168deg, rgba(31, 99, 58, 0.94) 0%, rgba(19, 68, 39, 0.96) 46%, rgba(10, 42, 24, 0.98) 100%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  backdrop-filter: blur(26px) saturate(150%);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 10px 0 50px -34px rgba(8, 34, 18, 0.8);
}
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(110% 46% at 0% -6%, rgba(163, 230, 53, 0.2), transparent 62%),
    radial-gradient(80% 40% at 110% 104%, rgba(163, 230, 53, 0.09), transparent 60%);
}
.sidebar > * { position: relative; }
.brand-mark {
  background: linear-gradient(160deg, #c7f776 0%, #a3e635 46%, #8ed226 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65), inset 0 -2px 4px rgba(52, 92, 12, 0.25), 0 8px 18px -10px rgba(163, 230, 53, 0.7);
}
.brand-sub { color: #a9c6a6; }

.nav a {
  position: relative;
  border: 1px solid transparent;
  transition: background 0.28s var(--ease), color 0.24s, border-color 0.28s, transform 0.18s var(--ease), box-shadow 0.28s;
}
.nav a:hover { background: rgba(255, 255, 255, 0.08); transform: translateX(1px); }
.nav a.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.19), rgba(255, 255, 255, 0.08));
  border-color: rgba(255, 255, 255, 0.17);
  color: #f3ffe8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.26), 0 10px 22px -16px rgba(0, 0, 0, 0.55);
}
.nav a.active svg { color: var(--lime); filter: drop-shadow(0 0 8px rgba(163, 230, 53, 0.45)); }
.nav a:active { transform: scale(0.985); }
.sidebar-foot { border-top-color: rgba(255, 255, 255, 0.12); }
.user-chip { transition: background 0.25s; }
.user-chip:hover { background: rgba(255, 255, 255, 0.07); }
.logout-btn { transition: background 0.2s, color 0.2s, transform 0.2s; }
.logout-btn:active { transform: scale(0.94); }

/* ---------- 顶栏与内容 ---------- */
.topbar {
  background: linear-gradient(180deg, rgba(249, 251, 245, 0.74), rgba(249, 251, 245, 0.5));
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
  transition: background 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.topbar.scrolled {
  border-bottom-color: rgba(20, 38, 28, 0.07);
  box-shadow: 0 14px 34px -30px rgba(18, 50, 30, 0.55);
}
.date-chip {
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 #fff, 0 4px 14px -10px rgba(18, 50, 30, 0.35);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* ---------- 玻璃卡片 ---------- */
.card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.52) 100%);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-highlight), var(--shadow);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  transition: box-shadow 0.32s var(--ease), border-color 0.32s, background 0.32s;
}
.card:hover { border-color: rgba(255, 255, 255, 0.9); box-shadow: var(--glass-highlight), var(--shadow-lift); }
.card.flush { background: linear-gradient(160deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.52)); }

.hero {
  background:
    radial-gradient(120% 140% at 88% -18%, rgba(163, 230, 53, 0.38) 0%, transparent 56%),
    linear-gradient(132deg, #1e6439 0%, #2a7a44 54%, #1a4e2d 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 -1px 0 rgba(0, 0, 0, 0.12), 0 36px 74px -42px rgba(20, 80, 40, 0.9);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(58% 100% at 18% -8%, rgba(255, 255, 255, 0.22), transparent 68%);
}
.hero::after { filter: blur(2px); }
.hero-inner { position: relative; z-index: 2; }

/* ---------- 按钮 ---------- */
.btn {
  background: linear-gradient(180deg, #2b8149 0%, #1f6b3b 58%, #1b5f35 100%);
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 12px 24px -16px rgba(23, 83, 45, 0.95);
  transition: transform 0.18s var(--ease), box-shadow 0.24s, filter 0.2s, background 0.2s;
}
.btn:hover {
  background: linear-gradient(180deg, #308a4f 0%, #237240 58%, #1d6538 100%);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), inset 0 -1px 0 rgba(0, 0, 0, 0.1), 0 18px 30px -16px rgba(23, 83, 45, 0.9);
}
.btn:active { transform: translateY(0) scale(0.972); filter: brightness(0.98); }
.btn.ghost {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.56));
  border-color: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  box-shadow: inset 0 1px 0 #fff, 0 6px 18px -14px rgba(18, 50, 30, 0.45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.btn.ghost:hover { background: rgba(255, 255, 255, 0.92); }
.btn.lime {
  background: linear-gradient(180deg, #bdf566 0%, #a3e635 55%, #94d92b 100%);
  color: #17351c;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 12px 24px -16px rgba(94, 148, 20, 0.75);
}
.btn.lime:hover { background: linear-gradient(180deg, #c7fb79, #a9ea3c 55%, #9ade2f); }
.btn.soft {
  background: linear-gradient(180deg, rgba(232, 242, 230, 0.95), rgba(220, 236, 216, 0.8));
  border-color: rgba(255, 255, 255, 0.6);
  color: var(--green);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.btn.soft:hover { background: rgba(220, 236, 216, 0.95); }
.btn.danger {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(253, 241, 238, 0.7));
  border-color: rgba(212, 85, 63, 0.2);
  color: var(--red);
  box-shadow: inset 0 1px 0 #fff;
}
.btn.danger:hover { background: #fdf1ee; }
.btn:disabled { transform: none; filter: none; box-shadow: none; }

.icon-btn { transition: background 0.2s, color 0.2s, transform 0.16s var(--ease); }
.icon-btn:hover { background: rgba(255, 255, 255, 0.62); box-shadow: inset 0 1px 0 #fff; }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.danger:hover { background: rgba(253, 241, 238, 0.9); }

/* ---------- 输入控件 ---------- */
.input, .select, .textarea {
  background-color: rgba(255, 255, 255, 0.56);
  border-color: rgba(20, 38, 28, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 1px 2px rgba(18, 50, 30, 0.03);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}
.input:hover, .select:hover, .textarea:hover { border-color: rgba(20, 38, 28, 0.18); }
.input:focus, .select:focus, .textarea:focus {
  background-color: rgba(255, 255, 255, 0.88);
  border-color: rgba(31, 107, 59, 0.5);
  box-shadow: 0 0 0 4px rgba(163, 230, 53, 0.24), inset 0 1px 0 #fff;
}
.checkbox input { accent-color: var(--green); }

/* ---------- 分段控件 / 标签 / 日期芯片 ---------- */
.tabs {
  background: rgba(20, 38, 28, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: inset 0 1px 2px rgba(18, 50, 30, 0.06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: 14px;
}
.tabs button { transition: color 0.2s, background 0.26s var(--ease), box-shadow 0.26s; }
.tabs button:hover { color: var(--ink); }
.tabs button.active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
  box-shadow: inset 0 1px 0 #fff, 0 3px 10px -4px rgba(18, 50, 30, 0.28);
}

.chip {
  background: rgba(255, 255, 255, 0.56);
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 #fff;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.16s var(--ease);
}
.chip:hover { background: rgba(255, 255, 255, 0.92); transform: translateY(-1px); }
.chip:active { transform: scale(0.97); }

.day-chip {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 #fff;
  transition: transform 0.18s var(--ease), border-color 0.2s, background 0.24s, box-shadow 0.24s;
}
.day-chip:hover { transform: translateY(-1px); border-color: rgba(31, 107, 59, 0.3); }
.day-chip.active {
  border-color: rgba(31, 107, 59, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(240, 250, 236, 0.75));
  box-shadow: inset 0 0 0 1px rgba(31, 107, 59, 0.4), 0 6px 16px -12px rgba(31, 107, 59, 0.6);
}
.day-chip.today {
  background: linear-gradient(180deg, #2b8149, #1c6238);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 8px 18px -12px rgba(23, 83, 45, 0.9);
}

.editor-day {
  background: rgba(255, 255, 255, 0.52);
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: inset 0 1px 0 #fff;
  transition: background 0.2s, color 0.2s, transform 0.16s var(--ease);
}
.editor-day:hover { background: rgba(255, 255, 255, 0.85); }
.editor-day.active {
  background: linear-gradient(180deg, #2b8149, #1d6338);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ---------- 内容块 ---------- */
.meal-slot, .plan-block, .session, .supp-item {
  background: rgba(255, 255, 255, 0.4);
  border-color: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: background 0.24s, border-color 0.24s, box-shadow 0.24s;
}
.meal-slot.done {
  background: linear-gradient(180deg, rgba(242, 251, 236, 0.85), rgba(250, 253, 246, 0.6));
  border-color: rgba(163, 200, 140, 0.5);
}
.meal-slot:hover { border-color: rgba(31, 107, 59, 0.22); }
.plan-block { border-radius: 16px; }
.session:hover { border-color: rgba(31, 107, 59, 0.2); }
.supp-item { background: transparent; box-shadow: none; border-bottom-color: rgba(20, 38, 28, 0.08); }
.slot-note {
  background: rgba(253, 248, 231, 0.78);
  border: 1px solid rgba(240, 226, 184, 0.7);
  color: #7a5f16;
}

.pill {
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.pill.gray { background: rgba(241, 243, 237, 0.7); }

.progress { background: rgba(20, 38, 28, 0.075); box-shadow: inset 0 1px 2px rgba(18, 50, 30, 0.08); }
.progress > i { background: linear-gradient(90deg, #2b8149, #3d9a55); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28); }
.progress.lime > i { background: linear-gradient(90deg, #8ed226, #b4ef52); }

.table th {
  background: rgba(255, 255, 255, 0.44);
  border-bottom-color: rgba(20, 38, 28, 0.07);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.table td { border-bottom-color: rgba(20, 38, 28, 0.055); }
.table tr.clickable:hover td { background: rgba(255, 255, 255, 0.55); }
.table tr.clickable { transition: background 0.18s; }

.chart .line { filter: drop-shadow(0 4px 8px rgba(31, 107, 59, 0.22)); }
.chart .point { filter: drop-shadow(0 2px 4px rgba(31, 107, 59, 0.28)); }

.empty {
  background: rgba(255, 255, 255, 0.34);
  border-color: rgba(20, 38, 28, 0.14);
}

.ai-answer {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.62), rgba(244, 248, 239, 0.5));
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 1px 0 #fff;
  animation: rise 0.35s var(--ease) both;
}

.warn-box {
  background: rgba(253, 249, 236, 0.72);
  border-color: rgba(240, 226, 184, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

/* ---------- 模态框与提示 ---------- */
.modal-backdrop {
  background: rgba(10, 26, 17, 0.4);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  backdrop-filter: blur(14px) saturate(120%);
  animation: overlay-in 0.24s ease both;
}
.modal {
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.78) 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 0 #fff, 0 44px 120px -34px rgba(8, 30, 18, 0.62);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  animation: modal-in 0.34s var(--ease) both;
}
.modal-foot {
  background: rgba(255, 255, 255, 0.42);
  border-top-color: rgba(20, 38, 28, 0.07);
}
.modal-backdrop.closing { animation: overlay-out 0.17s ease both; }
.modal-backdrop.closing .modal { animation: modal-out 0.17s ease both; }

.toast {
  background: rgba(19, 34, 24, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 18px 44px -18px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  animation: toast-in 0.3s var(--ease) both;
}
.toast.err { background: rgba(122, 43, 30, 0.86); }

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.35) 25%, rgba(255, 255, 255, 0.72) 37%, rgba(255, 255, 255, 0.35) 63%);
  background-size: 400% 100%;
}

/* ---------- 认证页 ---------- */
.auth-wrap { background: transparent; }
.auth-side {
  background:
    radial-gradient(100% 70% at 0% 0%, rgba(60, 141, 86, 0.96) 0%, rgba(30, 100, 57, 0.97) 42%, rgba(11, 45, 25, 0.99) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.06);
}
.auth-side::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(90% 70% at 100% 100%, rgba(163, 230, 53, 0.18), transparent 62%),
    radial-gradient(80% 50% at 10% 100%, rgba(255, 255, 255, 0.08), transparent 60%);
}
.auth-side > * { position: relative; z-index: 1; }
.auth-card {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.84) 0%, rgba(255, 255, 255, 0.58) 100%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 28px;
  padding: 34px 34px 30px;
  box-shadow: inset 0 1px 0 #fff, 0 44px 110px -56px rgba(12, 46, 25, 0.62);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
}
.auth-card .safety-note { border-top-color: rgba(20, 38, 28, 0.08); }

/* ---------- 报告与编辑器 ---------- */
.report-page {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.68));
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: var(--glass-highlight), var(--shadow-lift);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
}
.report-metric {
  background: rgba(255, 255, 255, 0.44);
  border-color: rgba(20, 38, 28, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 1px 2px rgba(18, 50, 30, 0.03);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.report-note { border-top-color: rgba(20, 38, 28, 0.08); }
.setting-row { border-bottom-color: rgba(20, 38, 28, 0.06); }

/* ---------- 移动端底部导航 ---------- */
@media (max-width: 900px) {
  .tabbar {
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.64));
    box-shadow: inset 0 1px 0 #fff, 0 22px 48px -22px rgba(18, 50, 30, 0.48);
    -webkit-backdrop-filter: blur(26px) saturate(180%);
    backdrop-filter: blur(26px) saturate(180%);
    padding: 7px 6px;
  }
  .tabbar a {
    border-radius: 14px;
    transition: color 0.2s, background 0.26s var(--ease), transform 0.16s var(--ease);
  }
  .tabbar a.active {
    background: linear-gradient(180deg, rgba(31, 107, 59, 0.16), rgba(31, 107, 59, 0.09));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    color: var(--green);
  }
  .tabbar a:active { transform: scale(0.94); }
  .content { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }
  .card {
    background: linear-gradient(155deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.72));
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    backdrop-filter: blur(14px) saturate(140%);
  }
  body { background-attachment: scroll; }
  .modal, .modal.lg, .modal.xl {
    background: rgba(250, 252, 247, 0.97);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border: 0;
  }
}

@media (max-width: 620px) {
  .auth-card { padding: 24px 20px 22px; border-radius: 24px; }
  .card { border-radius: 18px; }
  .hero { border-radius: 22px; }
}

/* ---------- 动效 ---------- */
@keyframes page-in {
  0% { opacity: 0; transform: translateY(10px) scale(0.996); filter: blur(3px); }
  60% { filter: blur(0); }
  100% { opacity: 1; transform: none; filter: blur(0); }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes overlay-out { to { opacity: 0; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes modal-out { to { opacity: 0; transform: translateY(8px) scale(0.985); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }

#view.page-in { animation: page-in 0.42s var(--ease) both; }
#view.page-in .rise { animation: rise 0.5s var(--ease) both; }

.hero, .card, .report-page { will-change: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  #view.page-in { animation: none !important; }
}

/* 不支持毛玻璃时的回退 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card, .report-page, .auth-card, .modal { background: rgba(255, 255, 255, 0.95); }
  .sidebar { background: #17532d; }
  .topbar { background: rgba(247, 249, 242, 0.96); }
  .tabbar { background: rgba(255, 255, 255, 0.96); }
  .input, .select, .textarea { background-color: #fff; }
}

/* 触屏上不保留 hover 的位移，避免点完后卡片一直浮起 */
@media (hover: none) {
  .card:hover { transform: none; border-color: var(--glass-edge); box-shadow: var(--glass-highlight), var(--shadow); }
  .btn:hover, .chip:hover, .day-chip:hover, .icon-btn:hover, .nav a:hover { transform: none; }
}

/* 打印时回归纸面 */
@media print {
  body { background: #fff !important; }
  .card, .report-page, .report-metric, .auth-card {
    background: #fff !important;
    box-shadow: none !important;
    border-color: #e3e7dd !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  #view.page-in, #view.page-in .rise { animation: none !important; }
  .hero { box-shadow: none !important; }
}
