/* =========================================================
   蛭田记 · 设计系统
   风格：水乡田野笔记 —— 宣纸底色 / 墨青主色 / 陶土点缀
   ========================================================= */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --paper:        #EFEADF;
  --paper-deep:   #E4DDCD;
  --surface:      #FFFFFF;
  --surface-2:    #FAF7F0;
  --ink:          #16241F;
  --ink-2:        #46584F;
  --ink-3:        #7C8A81;
  --line:         #E3DCCD;
  --line-strong:  #D3C9B6;

  --brand:        #136B5B;
  --brand-deep:   #0C4B41;
  --brand-2:      #2E9C86;
  --brand-soft:   #E3F1EC;
  --brand-tint:   #F1F8F5;

  --accent:       #C05A34;
  --accent-soft:  #F7E7DE;

  --ok:           #1E7A5A;
  --ok-soft:      #E4F1EA;
  --warn:         #A8791A;
  --warn-soft:    #F7EED8;
  --bad:          #B23A28;
  --bad-soft:     #F8E5E0;

  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;

  --r-sm: 10px;
  --r:    14px;
  --r-lg: 20px;
  --r-full: 999px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;

  --shadow-sm: 0 1px 2px rgba(22, 36, 31, .05);
  --shadow:    0 6px 20px -10px rgba(22, 36, 31, .22);
  --shadow-lg: 0 24px 60px -22px rgba(22, 36, 31, .38);

  --frame: 520px;
  --tabbar-h: 62px;
  --ease: cubic-bezier(.22, .72, .28, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:      #141A18;
    --paper-deep: #0D1211;
    --surface:    #1C2321;
    --surface-2:  #232B28;
    --ink:        #E8EDE9;
    --ink-2:      #A9B6AF;
    --ink-3:      #7A8781;
    --line:       #2C3532;
    --line-strong:#3A443F;
    --brand:      #3FB79D;
    --brand-deep:  #2A9E86;
    --brand-soft:  #1B3A33;
    --brand-tint:  #172A25;
    --accent:      #E07A52;
    --accent-soft: #3A251D;
    --ok:          #43C08D;
    --ok-soft:     #17352A;
    --warn:        #E0B04C;
    --warn-soft:   #372C15;
    --bad:         #E8785F;
    --bad-soft:    #3A211C;
    --shadow:      0 6px 20px -10px rgba(0, 0, 0, .6);
    --shadow-lg:   0 24px 60px -22px rgba(0, 0, 0, .7);
  }
}

/* ---------- 2. 基础 ---------- */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper-deep);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; border: none; background: none; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--brand-soft); }

/* 宣纸颗粒质感 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}

/* ---------- 3. 应用外壳 ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: var(--frame);
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 560px) {
  body { padding: 0; }
  .app { min-height: 100dvh; }
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 54px;
  padding: calc(env(safe-area-inset-top) + 8px) var(--sp-3) 8px;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.appbar.is-scrolled { border-bottom-color: var(--line); }

.appbar-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .04em;
  flex: 1;
  padding-left: var(--sp-1);
}
.appbar-back {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  margin-left: -4px;
  color: var(--ink-2);
  transition: background .2s var(--ease);
}
.appbar-back:active { background: var(--line); }
.appbar-actions { display: flex; gap: var(--sp-1); }
.icon-btn {
  display: grid; place-items: center;
  width: 34px; height: 34px;
  border-radius: var(--r-full);
  color: var(--ink-2);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.icon-btn:active { background: var(--line); color: var(--ink); }
.icon-btn svg, .appbar-back svg { width: 20px; height: 20px; }

.view {
  flex: 1;
  padding: var(--sp-3) var(--sp-4) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 90px);
}

/* ---------- 4. 底部导航 ---------- */
.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(18px);
  -webkit-backdrop-filter: saturate(1.4) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  letter-spacing: .02em;
  color: var(--ink-3);
  transition: color .22s var(--ease);
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--brand); }
.tab.active::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 22px; height: 3px;
  border-radius: var(--r-full);
  background: var(--brand);
  animation: tabIn .34s var(--ease) both;
}
@keyframes tabIn { from { transform: scaleX(.2); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }

/* ---------- 5. FAB ---------- */
.fab {
  position: fixed;
  z-index: 40;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px);
  right: max(16px, calc((100dvw - var(--frame)) / 2 + 18px));
  width: 56px; height: 56px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 12px 26px -8px color-mix(in srgb, var(--brand) 65%, transparent);
  display: grid; place-items: center;
  transition: transform .18s var(--ease), background .2s var(--ease);
  animation: fabIn .5s .15s var(--ease) both;
}
.fab:active { transform: scale(.92); }
.fab-icon, .fab-icon::after {
  position: absolute;
  width: 20px; height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.fab-icon::after { content: ""; transform: rotate(90deg); }
@keyframes fabIn { from { transform: scale(.4) rotate(-90deg); opacity: 0; } }

/* ---------- 6. 通用组件 ---------- */
.section { margin-bottom: var(--sp-5); animation: rise .42s var(--ease) both; }
.section:nth-child(2) { animation-delay: .05s; }
.section:nth-child(3) { animation-delay: .10s; }
.section:nth-child(4) { animation-delay: .15s; }
.section:nth-child(5) { animation-delay: .20s; }

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.section-label {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--ink-3);
  margin-bottom: var(--sp-3);
  text-transform: uppercase;
}
.section-label::before {
  content: "";
  width: 14px; height: 2px;
  background: var(--brand);
  border-radius: 2px;
}
.section-label .count { letter-spacing: 0; text-transform: none; color: var(--ink-3); font-weight: 500; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--sp-4); }
.card + .card { margin-top: var(--sp-2); }

/* 主视觉 Hero */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-5) var(--sp-4);
  margin-bottom: var(--sp-5);
  color: #EAF3EF;
  background:
    radial-gradient(120% 130% at 88% -20%, color-mix(in srgb, var(--brand-2) 70%, transparent), transparent 58%),
    linear-gradient(150deg, var(--brand-deep), var(--brand));
  box-shadow: var(--shadow);
  animation: rise .5s var(--ease) both;
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px; height: 46px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='46' viewBox='0 0 520 46'%3E%3Cpath d='M0 24c60 0 90-12 150-12s90 12 150 12 90-12 150-12 60 8 70 10v24H0z' fill='%23ffffff' opacity='.10'/%3E%3Cpath d='M0 32c60 0 90-10 150-10s90 10 150 10 90-10 150-10 60 6 70 8v16H0z' fill='%23ffffff' opacity='.07'/%3E%3C/svg%3E");
  background-size: cover;
  pointer-events: none;
}
.hero-kicker {
  font-size: 12px;
  letter-spacing: .22em;
  opacity: .72;
  margin-bottom: var(--sp-2);
}
.hero-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.25;
}
.hero-sub { font-size: 13px; opacity: .82; margin-top: var(--sp-2); }
.hero-stats {
  display: flex;
  gap: var(--sp-5);
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid rgba(255, 255, 255, .18);
}
.hero-stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.hero-stat span { font-size: 11px; opacity: .75; letter-spacing: .05em; }

/* 快捷记录 */
.quick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.quick-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-3) var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.quick-card:active { transform: scale(.96); border-color: var(--brand-2); }
.quick-icon {
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand-tint);
  color: var(--brand);
}
.quick-icon svg { width: 21px; height: 21px; }
.quick-card b { font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.quick-card span { font-size: 11px; color: var(--ink-3); line-height: 1.35; }

/* 统计条 */
.stat-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.stat { padding: var(--sp-3) var(--sp-3); text-align: center; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.stat span { font-size: 11px; color: var(--ink-3); }

/* 记录列表 */
.rec-list { display: flex; flex-direction: column; gap: var(--sp-2); }
.rec-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), border-color .2s var(--ease);
  animation: rise .4s var(--ease) both;
}
.rec-item:active { transform: scale(.985); border-color: var(--line-strong); }
.rec-icon {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-tint);
  color: var(--brand);
}
.rec-icon svg { width: 21px; height: 21px; }
.rec-icon.t-feed { background: var(--accent-soft); color: var(--accent); }
.rec-icon.t-growth { background: var(--ok-soft); color: var(--ok); }
.rec-main { flex: 1; min-width: 0; }
.rec-title { display: flex; align-items: center; gap: var(--sp-2); font-weight: 600; font-size: 14px; }
.rec-title .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.rec-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-val {
  flex: none;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
  color: var(--ink);
  text-align: right;
}
.rec-val small { display: block; font-family: var(--font-body); font-size: 10px; font-weight: 400; color: var(--ink-3); letter-spacing: .04em; }

/* 状态徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  background: var(--line);
  color: var(--ink-2);
}
.badge.ok   { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad  { background: var(--bad-soft); color: var(--bad); }
.badge.soft { background: var(--brand-tint); color: var(--brand); }

/* 筛选 chips */
.chip-row {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding: var(--sp-1) var(--sp-4) var(--sp-3);
  margin: 0 calc(var(--sp-4) * -1) var(--sp-2);
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 14px;
  border-radius: var(--r-full);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: 13px;
  color: var(--ink-2);
  transition: all .18s var(--ease);
}
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 分组日期头 */
.day-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  margin: var(--sp-4) 0 var(--sp-2);
  font-size: 12px;
  color: var(--ink-3);
}
.day-head:first-child { margin-top: 0; }
.day-head b { font-family: var(--font-display); font-size: 14px; color: var(--ink); font-weight: 600; letter-spacing: .04em; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 12px 18px;
  border-radius: var(--r);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .03em;
  transition: transform .15s var(--ease), filter .2s var(--ease), background .2s var(--ease);
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn-primary:active { filter: brightness(.94); }
.btn-ghost { background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); }
.btn-danger { background: var(--bad-soft); color: var(--bad); }
.btn-block { width: 100%; }

.btn-row { display: flex; gap: var(--sp-2); }
.btn-row .btn { flex: 1; }

/* 空状态 */
.empty {
  text-align: center;
  padding: var(--sp-8) var(--sp-4);
  color: var(--ink-3);
}
.empty-mark {
  width: 64px; height: 64px;
  margin: 0 auto var(--sp-3);
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand-tint);
  color: var(--brand);
  opacity: .9;
}
.empty-mark svg { width: 30px; height: 30px; }
.empty h3 { font-family: var(--font-display); font-size: 16px; color: var(--ink); margin-bottom: var(--sp-1); font-weight: 600; }
.empty p { font-size: 13px; line-height: 1.6; max-width: 240px; margin: 0 auto var(--sp-4); }

/* 塘口卡片 */
.pond-card { display: block; width: 100%; text-align: left; padding: var(--sp-4); }
.pond-card .row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.pond-name { font-family: var(--font-display); font-size: 17px; font-weight: 600; letter-spacing: .03em; }
.pond-tags { display: flex; gap: var(--sp-1); margin-top: var(--sp-2); flex-wrap: wrap; }
.pond-mini {
  display: flex; gap: var(--sp-4);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px dashed var(--line-strong);
}
.pond-mini div b { display: block; font-family: var(--font-display); font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pond-mini div span { font-size: 11px; color: var(--ink-3); }

/* 详情键值表 */
.kv { display: flex; flex-direction: column; }
.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px dashed var(--line);
}
.kv-row:last-child { border-bottom: none; }
.kv-k { font-size: 13px; color: var(--ink-2); display: flex; align-items: center; gap: var(--sp-2); }
.kv-v { font-family: var(--font-display); font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kv-v .u { font-family: var(--font-body); font-size: 11px; color: var(--ink-3); font-weight: 400; margin-left: 3px; }
.kv-v.is-warn { color: var(--warn); }
.kv-v.is-bad { color: var(--bad); }

/* 表单 */
.form { display: flex; flex-direction: column; gap: var(--sp-4); }
.field { display: flex; flex-direction: column; gap: var(--sp-2); }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; justify-content: space-between; }
.field-label .hint { font-weight: 400; font-size: 11px; color: var(--ink-3); }
.field-input, .field-textarea, select.field-input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink);
  transition: border-color .18s var(--ease), background .18s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.field-input:focus, .field-textarea:focus, select.field-input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
}
.field-textarea { min-height: 76px; resize: vertical; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .unit {
  position: absolute; right: 12px;
  font-size: 12px; color: var(--ink-3);
  pointer-events: none;
}
.input-wrap .field-input { padding-right: 52px; }
select.field-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237C8A81' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }

/* 分段选择 */
.segmented { display: flex; gap: var(--sp-1); padding: 3px; background: var(--line); border-radius: var(--r-sm); }
.segmented button {
  flex: 1;
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  transition: all .18s var(--ease);
}
.segmented button.active { background: var(--surface); color: var(--brand); font-weight: 600; box-shadow: var(--shadow-sm); }

/* 拍照 */
.photo-pick {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 13px;
}
.photo-pick svg { width: 22px; height: 22px; color: var(--brand); flex: none; }
.photo-preview { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.photo-preview img { display: block; width: 100%; max-height: 200px; object-fit: cover; }
.photo-preview button {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff;
  display: grid; place-items: center;
}
.photo-preview button svg { width: 16px; height: 16px; }

/* 底部弹层 */
.sheet-root { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.sheet-root.open { pointer-events: auto; }
.scrim {
  position: absolute; inset: 0;
  background: rgba(12, 26, 22, .42);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity .28s var(--ease);
}
.sheet-root.open .scrim { opacity: 1; }
.sheet {
  position: absolute;
  left: 50%; bottom: 0;
  transform: translate(-50%, 100%);
  width: 100%;
  max-width: var(--frame);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  box-shadow: var(--shadow-lg);
  transition: transform .34s var(--ease);
}
.sheet-root.open .sheet { transform: translate(-50%, 0); }
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 10px auto 0; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.sheet-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; letter-spacing: .04em; }
.sheet-body { padding: var(--sp-4); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-foot {
  padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

/* 提示条 */
.notice {
  display: flex; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-3);
  border-radius: var(--r);
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid transparent;
}
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 25%, transparent); }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.notice.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 25%, transparent); }
.notice strong { font-weight: 700; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 84px);
  transform: translate(-50%, 12px);
  z-index: 80;
  max-width: 80vw;
  padding: 10px 18px;
  border-radius: var(--r-full);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  letter-spacing: .02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .26s var(--ease), transform .26s var(--ease);
}
.toast.show { opacity: .96; transform: translate(-50%, 0); }

/* 趋势图容器 */
.chart-card { padding: var(--sp-4); }
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.chart-legend { display: flex; gap: var(--sp-3); }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-3); }
.chart-legend i { width: 10px; height: 3px; border-radius: 2px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }

/* 条形排位 */
.bar-rows { display: flex; flex-direction: column; gap: var(--sp-3); }
.bar-row { display: grid; grid-template-columns: 68px 1fr auto; align-items: center; gap: var(--sp-3); font-size: 13px; }
.bar-row .name { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: block; height: 8px; border-radius: var(--r-full); background: var(--line); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: var(--r-full); background: var(--brand-2); transform-origin: left center; animation: barGrow .7s var(--ease) both; }
@keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.bar-row .val { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 设置项列表 */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm); }
.rows .row-item {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-4);
  text-align: left;
  border-bottom: 1px solid var(--line);
  transition: background .18s var(--ease);
}
.rows .row-item:last-child { border-bottom: none; }
.rows .row-item:active { background: var(--surface-2); }
.row-item .ri-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); flex: none; }
.row-item .ri-icon svg { width: 18px; height: 18px; }
.row-item .ri-main { flex: 1; min-width: 0; }
.row-item .ri-title { font-size: 14px; font-weight: 500; }
.row-item .ri-sub { font-size: 12px; color: var(--ink-3); margin-top: 1px; }
.chev { color: var(--ink-3); flex: none; width: 18px; height: 18px; }
.ph-icon { width: 21px; height: 21px; flex: none; color: var(--brand); }

/* 同步状态指示 */
.sync-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  border: 1px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease), transform .12s var(--ease);
}
.sync-chip .sync-ic { width: 15px; height: 15px; flex: none; }
.sync-chip i { font-style: normal; white-space: nowrap; }
.sync-chip.ok { color: var(--ink-3); padding: 0 6px; }
.sync-chip.pending { color: var(--brand); background: var(--brand-soft); }
.sync-chip.off {
  color: var(--warn);
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn) 22%, transparent);
}
.sync-chip:active { transform: scale(.96); }

/* 打印/无障碍 */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}