/* ============================================================
   植觉 · features.css
   §A 应用化布局 —— 设计稿是四屏静态展示，应用只保留一台手机并
      让 .scroll 真正可滚动；除此以外不触碰 design.css 任何规则。
   §B 起 —— 新功能（聊天室 / 建档 / 诊断 / 设置…）的样式，
      全部沿用设计稿的玻璃、圆角、字距与墨色体系。
   ============================================================ */

/* ================= §A 应用化布局 ================= */
body.app-mode { padding: 0; min-height: 100dvh; overflow: hidden; }
.app-stage {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 1; padding: 26px 0;
}
body.app-mode .scroll {
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
  /* 注：不加 -webkit-overflow-scrolling:touch —— 它会打断 iOS 的 backdrop-filter */
}
body.app-mode .scroll::-webkit-scrollbar { display: none; }

/* 首页「我的植物」横滑(下方留白给卡片阴影,避免裁切出一条硬线) */
.plant-scroll {
  overflow-x: auto;
  scrollbar-width: none; scroll-snap-type: x proximity;
  padding-bottom: 26px; margin-bottom: -14px;
  /* 与「今日养护」等玻璃卡对齐:全局卡片系左右缘 20px(design.css 原稿 26px 是文字系)。
     scroll-padding 同步:不然 snap 会把首卡吸到贴边,滚一下边距就被吃掉 */
  padding-left: 20px; padding-right: 20px;
  scroll-padding-left: 20px; scroll-padding-right: 20px;
}
.plant-scroll::-webkit-scrollbar { display: none; }
.plant-scroll .plant-card { scroll-snap-align: start; }

/* 屏幕通用：给浮动 dock 留出底部空间 */
.screen { min-height: 100%; padding-bottom: 118px; }
.screen.flush { padding-bottom: 0; height: 100%; }
.app.no-dock .dock { display: none; }

/* 手机业务层叠放在天空之上 */
.app { z-index: 3; }

/* 手机端：充满视口 */
@media (max-width: 560px) {
  .app-stage { padding: 0; }
  .phone {
    /* --zj-vh 由 viewport.js 写入真实可视高度：键盘弹出时布局收缩，输入框抬到键盘上方 */
    width: 100vw; height: var(--zj-vh, 100dvh); border: none; border-radius: 0; box-shadow: none;
  }
  .phone::before { display: none; }

  /* 真机自带系统状态栏：假状态栏(时间/电量)整条去掉，顶部用安全区退让 */
  .statusbar { display: none; }
  .home-top { padding-top: calc(env(safe-area-inset-top, 24px) + 20px); }
  .page-head { padding-top: calc(env(safe-area-inset-top, 24px) + 26px); }
  .chatroom .chat-top { padding-top: calc(env(safe-area-inset-top, 24px) + 12px); }

  /* 拍摄键收进胶囊里，不再上凸 */
  .scan-btn {
    margin-top: 0; width: 50px; height: 50px;
    box-shadow: 0 4px 12px rgba(31,41,55,.18), inset 0 1px 0 rgba(255,255,255,1);
  }

  /* dock 与输入栏避开 iPhone 底部横条 */
  .dock { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .screen { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .fab { bottom: calc(106px + env(safe-area-inset-bottom, 0px)); }
  .toast-dock { bottom: calc(106px + env(safe-area-inset-bottom, 0px)); }
}

/* iOS(WebKit) 专属修补：
   1) filter:blur 在大面积动画元素上常被降级 → 云朵直接烘焙成径向渐变软边，
      不再依赖 blur，杜绝“移动的矩形”
   2) 毛玻璃强调 -webkit- 前缀写法(折射滤镜是 Chromium 专属，iOS 走磨砂降级) */
@supports (-webkit-touch-callout: none) {
  .cloud {
    background: radial-gradient(50% 50% at 50% 50%, var(--cloud) 0%, rgba(255,255,255,0) 72%) !important;
    filter: blur(6px);
  }
  .glass {
    -webkit-backdrop-filter: blur(22px) saturate(1.8);
    backdrop-filter: blur(22px) saturate(1.8);
  }
  .glass-deep {
    -webkit-backdrop-filter: blur(20px) saturate(1.7);
    backdrop-filter: blur(20px) saturate(1.7);
  }
  .dock, .scan-btn, .fab, .chat-send {
    -webkit-backdrop-filter: blur(16px) saturate(1.7);
  }
}
@media (max-width: 900px) { .wx-switch { display: none; } }

/* 桌面矮窗口：整机等比缩放，保留手机边框 */
@media (min-width: 561px) and (max-height: 930px) { .phone { transform: scale(.94); } }
@media (min-width: 561px) and (max-height: 850px) { .phone { transform: scale(.85); } }
@media (min-width: 561px) and (max-height: 770px) { .phone { transform: scale(.76); } }
@media (min-width: 561px) and (max-height: 690px) { .phone { transform: scale(.66); } }
@media (min-width: 561px) { .app-stage { padding: 16px 0; } }

/* ================= §B 通用元件 ================= */

/* 启动占位 / 加载 */
.boot-splash { margin-top: 150px; text-align: center; color: var(--ink-soft); }
.boot-splash p { margin-top: 14px; font-size: 12px; letter-spacing: .18em; }
.spin {
  width: 20px; height: 20px; margin: 0 auto; border-radius: 50%;
  border: 2px solid rgba(23,27,33,.15); border-top-color: var(--graphite);
  animation: zj-spin .8s linear infinite;
}
.spin.lg { width: 30px; height: 30px; border-width: 2.5px; }
@keyframes zj-spin { to { transform: rotate(360deg); } }
.loading-tile { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 30px 0 22px; color: var(--ink-soft); }
.loading-tile p { font-size: 12px; letter-spacing: .14em; }

/* 空状态 */
.empty { text-align: center; padding: 34px 30px; color: var(--ink-soft); }
.empty .em-ic {
  width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.65);
}
.empty b { font-size: 14.5px; font-weight: 600; letter-spacing: .04em; color: var(--ink); }
.empty p { font-size: 11.5px; margin-top: 7px; line-height: 1.8; letter-spacing: .04em; opacity: .8; }

/* Toast */
.toast-dock {
  position: absolute; left: 0; right: 0; bottom: 112px; z-index: 90;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  max-width: 78%; padding: 11px 20px; border-radius: 999px;
  background: rgba(16,20,25,.82); color: #F4F6F8;
  font-size: 12px; font-weight: 500; letter-spacing: .08em;
  border: 1px solid rgba(255,255,255,.16);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
  animation: zj-toast-in .26s cubic-bezier(.2,.9,.3,1.2);
}
.toast.gone { opacity: 0; transform: translateY(8px); transition: all .3s; }
@keyframes zj-toast-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* 底部弹层 */
.veil {
  position: absolute; inset: 0; z-index: 80; display: flex; align-items: flex-end;
  background: rgba(16,22,28,.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  animation: zj-fade .2s ease;
}
.veil.gone { opacity: 0; transition: opacity .22s; }
@keyframes zj-fade { from { opacity: 0; } }
.sheet {
  width: 100%; max-height: 76%; overflow-y: auto; scrollbar-width: none;
  border-radius: 30px 30px 0 0; padding: 12px 24px calc(26px + env(safe-area-inset-bottom, 0px));
  animation: zj-rise .3s cubic-bezier(.2,.9,.3,1);
}
.sheet::-webkit-scrollbar { display: none; }
.veil.gone .sheet { transform: translateY(30px); transition: transform .22s; }
@keyframes zj-rise { from { transform: translateY(46px); opacity: .6; } }
.sheet .grip { width: 36px; height: 4px; border-radius: 2px; background: rgba(23,27,33,.22); margin: 0 auto 16px; }
.sheet h3 { font-size: 19px; font-weight: 600; letter-spacing: .03em; }
.sheet .sub { font-size: 11.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.75; letter-spacing: .03em; opacity: .85; }
.sheet .sub code { font-family: inherit; font-weight: 600; letter-spacing: .04em; }

/* 表单 */
.field { margin-top: 14px; }
.field label {
  display: block; font-size: 10px; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.input, .textarea {
  width: 100%; border: 1px solid rgba(255,255,255,.55); border-radius: 16px;
  background: rgba(255,255,255,.42); padding: 13px 15px;
  font-family: var(--sans); font-size: 13.5px; color: var(--ink); letter-spacing: .03em;
  outline: none; transition: border-color .18s, background .18s;
}
.input:focus, .textarea:focus { border-color: rgba(23,27,33,.4); background: rgba(255,255,255,.6); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { min-height: 76px; resize: none; line-height: 1.7; }
.field-pair { display: flex; gap: 10px; }
.field-pair .field { flex: 1; }
.hint-line { font-size: 10.5px; color: var(--ink-soft); margin-top: 8px; line-height: 1.7; letter-spacing: .03em; opacity: .7; }
.linkish { text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 600; }

/* 按钮（沿用 scan-actions 的胶囊语言） */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font-family: var(--sans); font-size: 12.5px; font-weight: 600;
  padding: 13px 20px; border-radius: 999px; letter-spacing: .1em;
  color: var(--ink); border: 1px solid rgba(255,255,255,.65);
  -webkit-tap-highlight-color: transparent;
}
.btn svg { width: 16px; height: 16px; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.plain { background: rgba(255,255,255,.3); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-soft); }
.btn.danger { background: rgba(154,64,56,.12); color: #9A4038; border-color: rgba(154,64,56,.25); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* 分段开关 */
.segment {
  margin: 16px 20px 0; padding: 5px; border-radius: 999px;
  display: flex; gap: 4px;
}
.segment button {
  flex: 1; border: none; background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .1em;
  color: var(--ink-soft); padding: 9px 0; border-radius: 999px; transition: all .2s;
}
.segment button.on {
  background: rgba(255,255,255,.85); color: var(--ink); font-weight: 600;
  box-shadow: 0 3px 10px rgba(31,41,55,.12), inset 0 1px 0 #fff;
}

/* 悬浮加号 */
.fab {
  position: absolute; right: 22px; bottom: 112px; z-index: 40;
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, rgba(255,255,255,.75), rgba(255,255,255,.4));
  backdrop-filter: blur(16px) saturate(1.7); -webkit-backdrop-filter: blur(16px) saturate(1.7);
  border: 1px solid rgba(255,255,255,.75);
  box-shadow: 0 12px 26px rgba(31,41,55,.22), inset 0 1px 0 rgba(255,255,255,1);
}
.fab svg { width: 22px; height: 22px; }

/* 分组小标题 */
.mini-cap {
  font-size: 10px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  color: var(--muted); margin: 20px 26px 9px;
}

/* 头像（照片或表情兜底） */
.pav {
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background-size: cover; background-position: center;
  background-color: rgba(255,255,255,.55);
  border: 1.5px solid rgba(255,255,255,.85);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(31,41,55,.14);
}

/* 照片上的状态徽标:底永远是浅色胶囊,字色固定深墨(不随雨天/雷暴翻浅) */
.plant-img .badge { color: #171B21; }
.phone[data-w="storm"] .plant-img .badge,
.phone[data-w="rain"] .plant-img .badge {
  color: #171B21;
  background: rgba(255,255,255,.66);
  border-color: rgba(255,255,255,.8);
}

/* ================= 我的植物 · 网格 ================= */
.plant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 18px 20px 0; }
.plant-grid .plant-card { width: auto; }

/* ================= 详情 · 动作行 ================= */
.duo-actions { display: flex; gap: 10px; padding: 0 20px; margin-top: 12px; }
.duo-actions .btn { flex: 1; }

/* ================= 扫描 / 建档 / 诊断 ================= */
.shot-view { position: absolute; inset: 0; }
.shot-view img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot-x {
  position: absolute; top: 14px; right: 14px; z-index: 5; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: rgba(16,20,25,.4); border: 1px solid rgba(255,255,255,.4);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.shot-x svg { width: 14px; height: 14px; }
.scan-line.sweep { animation: zj-sweep 2.4s ease-in-out infinite; }
@keyframes zj-sweep { 0%,100% { top: 15%; } 50% { top: 82%; } }

.verdict { padding: 0 20px; margin-top: 18px; }
.verdict-card { border-radius: 26px; padding: 20px 22px 18px; }
.verdict-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.verdict-top .vt-name b { font-size: 21px; font-weight: 600; letter-spacing: .02em; display: block; }
.verdict-top .vt-name small {
  font-size: 10.5px; color: var(--ink-soft); letter-spacing: .06em; display: block; margin-top: 3px; opacity: .7;
}
.verdict-note { font-size: 12px; color: var(--ink-soft); line-height: 1.8; margin-top: 12px; letter-spacing: .02em; }
.v-sect { margin-top: 15px; }
.v-sect h4 {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 600; letter-spacing: .16em; color: var(--ink-soft); text-transform: uppercase;
}
.v-sect h4 svg { width: 13px; height: 13px; }
.v-sect ul { list-style: none; margin-top: 8px; }
.v-sect li {
  position: relative; font-size: 12px; line-height: 1.75; color: var(--ink);
  padding: 3px 0 3px 16px; letter-spacing: .02em;
}
.v-sect li::before {
  content: ''; position: absolute; left: 2px; top: 12px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--graphite); opacity: .55;
}
.sev-pill {
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; padding: 6px 12px;
  border-radius: 999px; flex-shrink: 0; border: 1px solid rgba(255,255,255,.6);
}
.sev-pill.ok   { background: rgba(96,132,86,.16);  color: #46603E; border-color: rgba(96,132,86,.3); }
.sev-pill.mild { background: rgba(255,255,255,.4); color: var(--ink); }
.sev-pill.mid  { background: rgba(178,132,52,.16); color: #7A5A20; border-color: rgba(178,132,52,.3); }
.sev-pill.bad  { background: rgba(154,64,56,.15);  color: #9A4038; border-color: rgba(154,64,56,.3); }
.sev-track { height: 3px; border-radius: 2px; background: rgba(23,27,33,.12); margin-top: 14px; overflow: hidden; }
.sev-track i { display: block; height: 100%; border-radius: 2px; background: var(--graphite); }
.verdict .acts { display: flex; gap: 10px; margin-top: 18px; }
.verdict .acts .btn { flex: 1; }

/* ================= 植物聊天室 ================= */
.chatroom { height: 100%; display: flex; flex-direction: column; }
.chat-top {
  padding: 64px 18px 12px; display: flex; align-items: center; gap: 11px;
  position: relative; z-index: 6;
}
.chat-top .back-orb {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.chat-top .back-orb svg { width: 17px; height: 17px; }
.chat-top .who { flex: 1; min-width: 0; }
.chat-top .who b { display: block; font-size: 16.5px; font-weight: 600; letter-spacing: .03em; }
.chat-top .who small {
  display: block; font-size: 10.5px; color: var(--ink-soft); margin-top: 2px;
  letter-spacing: .05em; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-top .stack { display: flex; }
.chat-top .pav { width: 30px; height: 30px; font-size: 15px; }
.chat-top .pav + .pav { margin-left: -10px; }

.chat-flow { flex: 1; overflow-y: auto; scrollbar-width: none; padding: 8px 18px 14px; }
.chat-flow::-webkit-scrollbar { display: none; }
.day-stamp {
  text-align: center; font-size: 10px; letter-spacing: .16em; color: var(--ink-soft);
  opacity: .6; margin: 10px 0 4px;
}
.msg { display: flex; gap: 9px; margin-top: 13px; align-items: flex-start; }
.msg .pav { width: 34px; height: 34px; font-size: 17px; margin-top: 2px; }
.msg .m-body { max-width: 76%; display: flex; flex-direction: column; align-items: flex-start; }
.msg .m-tag {
  font-size: 10px; color: var(--ink-soft); letter-spacing: .08em; margin: 0 4px 4px; opacity: .75;
}
.bubble {
  padding: 10px 14px; border-radius: 18px; font-size: 13px; line-height: 1.65; letter-spacing: .02em;
  background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.7);
  border-top-left-radius: 6px; color: var(--ink);
  box-shadow: 0 3px 10px rgba(31,41,55,.07); word-break: break-word;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.msg.mine { flex-direction: row-reverse; }
.msg.mine .m-body { align-items: flex-end; }
.msg.mine .bubble {
  background: rgba(35,40,47,.82); color: #F2F5F8; border-color: rgba(255,255,255,.14);
  border-radius: 18px; border-top-right-radius: 6px;
}
.typing { display: inline-flex; gap: 4px; padding: 3px 2px; }
.typing i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--ink-soft); opacity: .5;
  animation: zj-typing 1.1s ease-in-out infinite;
}
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes zj-typing { 0%,100% { transform: translateY(0); opacity: .35; } 40% { transform: translateY(-3px); opacity: .9; } }

.chat-bar {
  display: flex; align-items: flex-end; gap: 9px;
  padding: 10px 14px calc(14px + env(safe-area-inset-bottom, 0px));
  position: relative; z-index: 6;
}
.chat-field {
  flex: 1; max-height: 96px; border-radius: 22px; border: 1px solid rgba(255,255,255,.6);
  background: rgba(255,255,255,.45); padding: 12px 16px;
  font-family: var(--sans); font-size: 13px; color: var(--ink); letter-spacing: .02em;
  line-height: 1.5; resize: none; outline: none; scrollbar-width: none;
}
.chat-field::-webkit-scrollbar { display: none; }
.chat-field::placeholder { color: var(--faint); }

/* ---- 聊天发图 ---- */
.chat-cam {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); border: 1px solid rgba(255,255,255,.6);
}
.chat-cam:active { transform: scale(.94); }
.chat-cam[disabled] { opacity: .45; pointer-events: none; }
.msg.mine .b-img {
  display: block; max-width: 210px; max-height: 260px; margin-left: auto;
  border-radius: 20px; border: 2px solid rgba(255,255,255,.75);
  box-shadow: 0 6px 18px rgba(31,41,55,.16); object-fit: cover;
}
.msg.mine .b-img + .bubble { margin-top: 6px; }

/* ---- dock 未读红点(独立于当前页指示的 .t-dot) ---- */
.dock .tab { position: relative; }
.t-badge {
  position: absolute; top: 9px; right: calc(50% - 17px);
  width: 7px; height: 7px; border-radius: 50%;
  background: #C0574F; box-shadow: 0 0 0 2px rgba(255,255,255,.65);
  opacity: 0; transform: scale(.4); transition: all .25s;
  pointer-events: none;
}
.t-badge.on { opacity: 1; transform: none; }
.chat-send {
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: var(--ink);
  border: 1px solid rgba(255,255,255,.7);
}
.chat-send svg { width: 18px; height: 18px; }
.chat-send[disabled] { opacity: .45; pointer-events: none; }

/* ---- 天气物理层画布：盖在 UI 上、不挡点击 ---- */
/* canvas 是替换元素：inset:0 不会自动拉伸，必须显式给 100% 尺寸 */
.wx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 54; pointer-events: none; }

/* ---- 植物诉求：一键完成 ---- */
.plea-row { margin-top: 9px; }
.plea-act {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .08em;
  color: var(--ink); padding: 7px 14px; border-radius: 999px;
  background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.8);
  box-shadow: 0 3px 10px rgba(31,41,55,.1), inset 0 1px 0 rgba(255,255,255,.9);
}
.plea-act:active { transform: scale(.97); }
.plea-act.done {
  cursor: default; color: var(--ink-soft); opacity: .75;
  background: rgba(23,27,33,.08); border-color: rgba(23,27,33,.14); box-shadow: none;
}
.plea-act svg { width: 12px; height: 12px; }

/* ---- 日历：待办 / 备忘行 ---- */
.agenda-item .ag-body { flex: 1; min-width: 0; }
.agenda-item .ag-body b { font-size: 13px; font-weight: 600; display: block; letter-spacing: .03em; line-height: 1.5; }
.agenda-item .ag-body small { font-size: 10.5px; color: var(--ink-soft); font-weight: 400; opacity: .7; display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.agenda-item.is-done .ag-body b { text-decoration: line-through; opacity: .5; }
.agenda-item.is-done { opacity: .8; }
.agenda-item .task-check { cursor: pointer; }
.agenda-item .row-x {
  color: var(--ink-soft); opacity: .35; cursor: pointer; flex-shrink: 0;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
}
.agenda-item .row-x:active { opacity: .8; }
.by-line { display: inline-flex; align-items: center; gap: 5px; }
.pav.mini { width: 16px; height: 16px; font-size: 9px; border-width: 1px; box-shadow: none; }


/* ---- 时间系统:晨昏光线(叠在天空上,随真实时间切换) ---- */
.daylight {
  position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity 2.5s ease;
}
.daylight.dl-dawn {
  opacity: 1;
  background: linear-gradient(180deg, rgba(255,196,150,.22), rgba(200,170,190,.15) 55%, rgba(150,160,190,.08));
}
.daylight.dl-dusk {
  opacity: 1;
  background: linear-gradient(180deg, rgba(255,150,80,.17), rgba(160,95,120,.2) 55%, rgba(72,66,112,.24));
}
.daylight.dl-night {
  opacity: 1;
  background: linear-gradient(180deg, rgba(9,16,32,.5), rgba(14,22,40,.44) 45%, rgba(24,32,48,.36));
}
.moon {
  position: absolute; top: 66px; right: 46px; width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 40% 38%, #FDFBF2 0%, #E9E6D8 55%, rgba(233,230,216,0) 74%);
  box-shadow: 0 0 44px 14px rgba(250,244,218,.32);
  animation: sunPulse 11s ease-in-out infinite;
}

/* ---- 备忘·日记编辑器 ---- */
.diary-pad {
  min-height: 240px; margin-top: 14px;
  font-size: 14px; line-height: 2.05; letter-spacing: .03em;
  background:
    repeating-linear-gradient(180deg, transparent 0 28px, rgba(23,27,33,.07) 28px 29px),
    rgba(255,255,255,.42);
  background-attachment: local;
  padding: 6px 15px 13px;
}

/* 全屏沉浸模式：没有纸——直接写在天上。
   背后的界面(日历/dock/近景粒子)整层淡出,只留天空与飘着的天气。 */
.phone.immersed .app .scroll,
.phone.immersed .dock,
.phone.immersed .fab {
  opacity: 0; pointer-events: none;
}
body.app-mode .scroll, .dock, .fab, .wx-canvas { transition: opacity .4s ease; }
.veil.full {
  align-items: stretch;
  background: rgba(28,36,46,.10);
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
}
.veil.full .sheet.full {
  max-height: none; height: 100%; border-radius: 0;
  display: flex; flex-direction: column;
  background: transparent; border: none; box-shadow: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  padding: calc(env(safe-area-inset-top, 22px) + 46px) 24px calc(env(safe-area-inset-bottom, 0px) + 18px);
  animation: zj-fade .25s ease;
}
/* 天色偏暗(夜晚/雨/雷暴)时,沉浸层文字自动切浅色 */
.veil.full.on-dark {
  --ink: #EFF4F9;
  --ink-soft: rgba(233,240,247,.78);
  --muted: rgba(233,240,247,.6);
  --faint: rgba(233,240,247,.45);
  color: #EFF4F9;
}
.veil.full.on-dark .df-pad { text-shadow: 0 1px 3px rgba(8,14,24,.4); caret-color: #EFF4F9; }
.veil.full.on-dark .back-orb { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #EFF4F9; }
.veil.full.on-dark .btn { color: #EFF4F9; background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.32); }
.sheet.full .grip { display: none; }
.diary-full { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.df-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.df-head .back-orb {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.df-pad {
  flex: 1; min-height: 0; width: 100%;
  background: transparent; border: none; outline: none; box-shadow: none;
  -webkit-appearance: none; appearance: none; resize: none;
  font-family: var(--sans); font-size: 15.5px; line-height: 2.15; letter-spacing: .04em;
  color: var(--ink); caret-color: var(--ink);
  text-shadow: 0 1px 0 rgba(255,255,255,.22);
  padding: 2px 2px;
}
.df-pad:focus { background: transparent; border: none; outline: none; }
.df-pad::placeholder { color: var(--faint); }
.df-actions { display: flex; gap: 10px; margin-top: 14px; }
.phone[data-w="storm"] .df-pad, .phone[data-w="rain"] .df-pad { text-shadow: none; }

/* ---- 记账分类胶囊 ---- */
.cat-row { display: flex; flex-wrap: wrap; gap: 7px; }
.cat-row .fchip { cursor: pointer; }

/* ---- 记账金额 ---- */
.agenda-item time.money { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.agenda-item .row-x { margin-left: 2px; }

/* ---- 记账月度统计（页头「本月记账」点开） ---- */
.page-head .linkish { font-weight: 500; }
.ledger-stats { padding: 2px 2px 4px; }
.ls-head { display: flex; align-items: flex-start; justify-content: space-between; }
.ls-arrows { display: flex; gap: 8px; }
.ls-arrows span {
  width: 28px; height: 28px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-soft);
  background: rgba(255,255,255,.4); border: 1px solid rgba(255,255,255,.6);
}
.ls-arrows span:active { transform: scale(.94); }
.ls-total { margin-top: 18px; }
.ls-total small {
  display: block; font-size: 10px; font-weight: 600; letter-spacing: .22em;
  text-transform: uppercase; color: var(--ink-soft); opacity: .7;
}
.ls-total b {
  display: block; margin-top: 5px; font-size: 34px; font-weight: 600;
  letter-spacing: .02em; font-variant-numeric: tabular-nums;
}
.ls-trend { display: flex; gap: 9px; height: 76px; margin-top: 18px; padding: 0 2px; }
.ls-bar {
  flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; gap: 6px; cursor: pointer;
}
.ls-bar i {
  display: block; width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px;
  background: rgba(23,27,33,.14); transition: height .28s;
}
.ls-bar.on i { background: var(--graphite); }
.ls-bar small {
  font-size: 9.5px; letter-spacing: .06em; color: var(--ink-soft);
  opacity: .65; font-variant-numeric: tabular-nums;
}
.ls-bar.on small { opacity: 1; font-weight: 600; }
.ls-cats { margin-top: 20px; }
.ls-row + .ls-row { margin-top: 14px; }
.ls-line { display: flex; align-items: baseline; gap: 8px; }
.ls-line b { font-size: 13px; font-weight: 600; letter-spacing: .04em; }
.ls-line small { font-size: 10.5px; color: var(--ink-soft); opacity: .7; letter-spacing: .05em; }
.ls-line .ls-amt {
  margin-left: auto; font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.ls-track { height: 6px; margin-top: 7px; border-radius: 3px; background: rgba(23,27,33,.08); overflow: hidden; }
.ls-track i { display: block; height: 100%; border-radius: 3px; background: var(--graphite); transition: width .3s; }

/* ================= 我的 · 设置 ================= */
.prefs { margin: 12px 20px 0; border-radius: 24px; padding: 3px 18px; }
.pref-row { display: flex; align-items: center; gap: 13px; padding: 14px 0; cursor: pointer; }
.pref-row + .pref-row { border-top: 1px solid rgba(23,27,33,.08); }
.pref-row .pf-ic {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.7);
}
.pref-row .pf-ic svg { width: 16px; height: 16px; }
.pref-row .pf-tx { flex: 1; min-width: 0; }
.pref-row .pf-tx b { display: block; font-size: 13.5px; font-weight: 600; letter-spacing: .03em; }
.pref-row .pf-tx small {
  display: block; font-size: 11px; color: var(--ink-soft); margin-top: 2px; letter-spacing: .03em; opacity: .75;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pref-row .pf-go { color: var(--ink-soft); opacity: .55; flex-shrink: 0; }
.pref-row .pf-go svg { width: 15px; height: 15px; }
.state-pill {
  font-size: 10px; font-weight: 600; letter-spacing: .12em; padding: 5px 11px;
  border-radius: 999px; flex-shrink: 0; border: 1px solid rgba(255,255,255,.6);
}
.state-pill.ok  { background: rgba(96,132,86,.16); color: #46603E; border-color: rgba(96,132,86,.3); }
.state-pill.off { background: rgba(255,255,255,.35); color: var(--ink-soft); }
.key-eye {
  font-size: 10.5px; font-weight: 600; letter-spacing: .1em; color: var(--ink-soft);
  cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.model-pick {
  display: flex; align-items: center; width: 100%; margin-top: 8px; cursor: pointer;
  font-family: var(--sans); font-size: 12px; font-weight: 500; letter-spacing: .04em;
  color: var(--ink); text-align: left; padding: 11px 15px; border-radius: 16px;
  background: rgba(255,255,255,.35); border: 1px solid rgba(255,255,255,.55);
}
.model-pick.on { border-color: rgba(23,27,33,.4); background: rgba(255,255,255,.6); font-weight: 600; }
.model-pick small { margin-left: auto; font-size: 10px; color: var(--ink-soft); letter-spacing: .06em; opacity: .7; }

/* ================= 雨天 / 雷暴 · 新组件同步翻转为浅色 ================= */
.phone[data-w="storm"] .empty .em-ic, .phone[data-w="rain"] .empty .em-ic,
.phone[data-w="storm"] .pref-row .pf-ic, .phone[data-w="rain"] .pref-row .pf-ic {
  background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3);
}
.phone[data-w="storm"] .pref-row + .pref-row, .phone[data-w="rain"] .pref-row + .pref-row { border-top-color: rgba(255,255,255,.12); }
.phone[data-w="storm"] .input, .phone[data-w="rain"] .input,
.phone[data-w="storm"] .textarea, .phone[data-w="rain"] .textarea,
.phone[data-w="storm"] .chat-field, .phone[data-w="rain"] .chat-field {
  background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: #EFF4F9;
}
.phone[data-w="storm"] .bubble, .phone[data-w="rain"] .bubble {
  background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.26); color: #EFF4F9;
}
.phone[data-w="storm"] .chat-cam, .phone[data-w="rain"] .chat-cam {
  background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: rgba(233,240,247,.85);
}
.phone[data-w="storm"] .msg.mine .bubble, .phone[data-w="rain"] .msg.mine .bubble {
  background: rgba(255,255,255,.86); color: #171B21;
}
.phone[data-w="storm"] .model-pick, .phone[data-w="rain"] .model-pick {
  background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: rgba(233,240,247,.85);
}
.phone[data-w="storm"] .segment button.on, .phone[data-w="rain"] .segment button.on { background: rgba(255,255,255,.9); color: #171B21; }
.phone[data-w="storm"] .sev-track, .phone[data-w="rain"] .sev-track { background: rgba(255,255,255,.18); }
.phone[data-w="storm"] .plea-act, .phone[data-w="rain"] .plea-act {
  background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.35); color: #EFF4F9; box-shadow: none;
}
.phone[data-w="storm"] .plea-act.done, .phone[data-w="rain"] .plea-act.done { background: rgba(255,255,255,.1); color: rgba(233,240,247,.7); }
.phone[data-w="storm"] .v-sect li::before, .phone[data-w="rain"] .v-sect li::before { background: #EFF4F9; }
.phone[data-w="storm"] .spin, .phone[data-w="rain"] .spin { border-color: rgba(255,255,255,.25); border-top-color: #EFF4F9; }
.phone[data-w="storm"] .sheet .grip, .phone[data-w="rain"] .sheet .grip { background: rgba(255,255,255,.3); }
/* 统计浮层与其它 sheet 一致：暗天下仍走深墨（sheet 不在 .app 翻色作用域内） */

@media (prefers-reduced-motion: reduce) {
  .scan-line.sweep, .typing i, .spin { animation: none !important; }
}
