/* Silas v4 · 蓝粉 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #F5F6FA; --surface: #ffffff; --text: #1D1F27; --sub: #8D90A0;
  --line: #ECEDF3; --blue: #5B8CF5; --pink: #F27BA5;
  --grad: linear-gradient(135deg, #7FB2FF 0%, #F59AC0 100%);
  --soft: #EEF3FF;
  --card-shadow: 0 1px 2px rgba(30,40,70,.04), 0 6px 20px rgba(30,40,70,.05);
}
html, body { height: 100%; overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 16px;
  -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
}
b { font-weight: 650; }

/* ---------- 屏幕 ---------- */
.screen { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .34s cubic-bezier(.32,.72,.35,1); z-index: 10; }
.screen.active { transform: none; }
#screen-home { background: transparent; }

/* ---------- 主屏幕 ---------- */
.wallpaper { position: absolute; inset: 0; background: linear-gradient(180deg,#dfe9f3,#f7f9fb);
  background-size: cover; background-position: center; z-index: -1; }
.statusbar { position: absolute; top: 0; left: 0; right: 0; padding: 10px 20px 0;
  display: flex; justify-content: space-between; color: #17171A; font-weight: 600; font-size: 13.5px; }
.home-greet { position: absolute; top: 92px; left: 0; right: 0; text-align: center;
  font-size: 21px; font-weight: 500; letter-spacing: .05em; color: #1D1F27;
  text-shadow: 0 1px 10px rgba(255,255,255,.95), 0 0 2px rgba(255,255,255,.9); }
.home-date { position: absolute; top: 124px; left: 0; right: 0; text-align: center;
  font-size: 12.5px; color: rgba(29,31,39,.68); letter-spacing: .06em;
  text-shadow: 0 1px 8px rgba(255,255,255,.95); }
.home-weather { position: absolute; top: 148px; left: 0; right: 0; text-align: center;
  font-size: 13px; color: rgba(29,31,39,.72); letter-spacing: .03em;
  text-shadow: 0 1px 8px rgba(255,255,255,.95); }
/* 深色壁纸（夜空）上字换成白色，不然看不清 */
.dark-wp .home-greet, .dark-wp .home-date, .dark-wp .home-weather, .dark-wp .statusbar {
  color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.home-widgets { position: absolute; top: 192px; left: 26px; right: 26px; display: flex; gap: 10px; }
.hw { flex: 1; background: rgba(255,255,255,.7); backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6); border: .5px solid rgba(255,255,255,.8);
  border-radius: 18px; padding: 16px 8px 13px; text-align: center; cursor: pointer;
  box-shadow: 0 6px 22px rgba(30,40,60,.08); transition: transform .16s; }
.hw:active { transform: scale(.94); }
.hw-v { display: block; font-size: 19px; font-weight: 550; color: #23272e;
  font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.hw-k { display: block; font-size: 10.5px; color: rgba(23,23,26,.55); margin-top: 5px; letter-spacing: .05em; }
.home-cards { position: absolute; top: 278px; left: 26px; right: 26px;
  display: flex; flex-direction: column; gap: 8px;
  /* 小屏（比如 375x667）上卡片多时别被 dock 挡住，放不下就自己滚 */
  max-height: max(180px, calc(100vh - 400px)); overflow-y: auto;
  scrollbar-width: none; padding-bottom: 2px; }
.home-cards::-webkit-scrollbar { display: none; }
.hw-msg, .hw-diary, .hw-note, .hw-sched, .hw-spin {
  background: rgba(255,255,255,.74); backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6); border: .5px solid rgba(255,255,255,.8);
  border-radius: 18px; padding: 10px 14px; display: flex; align-items: center; gap: 10px;
  cursor: pointer; box-shadow: 0 6px 22px rgba(30,40,60,.08); transition: transform .16s;
  flex-shrink: 0; }
.hw-msg:active, .hw-diary:active, .hw-note:active, .hw-sched:active, .hw-spin:active { transform: scale(.97); }
.hw-msg-av, .hw-diary-icon, .hw-note-icon, .hw-sched-icon, .hw-spin-icon { width: 34px; height: 34px; border-radius: 50%; background: #EDEFF3; background-size: cover;
  background-position: center; display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0; }
.hw-msg-body, .hw-diary-body, .hw-note-body, .hw-sched-body, .hw-spin-body { flex: 1; min-width: 0; }
.hw-msg-title, .hw-diary-date, .hw-note-title, .hw-sched-title, .hw-spin-title { font-size: 12px; color: rgba(23,23,26,.55); }
.hw-msg-preview, .hw-diary-preview, .hw-note-preview, .hw-sched-preview, .hw-spin-preview { font-size: 14px; color: #23272e; margin-top: 3px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.hw-note-icon { background: #FBF3E4; }
.hw-sched-icon { background: #FFF0E2; }
.hw-spin-icon { background: #FCE8F1; }
.hw-sched-count { flex-shrink: 0; background: #FFEDD9; color: #C46A12; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.hw-sched-count:empty { display: none; }
.hw-msg-count { flex-shrink: 0; background: var(--grad); color: #fff; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; }
.dock { position: absolute; bottom: calc(44px + env(safe-area-inset-bottom)); left: 18px; right: 18px;
  background: rgba(255,255,255,.7); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: .5px solid rgba(255,255,255,.8); border-radius: 26px;
  display: flex; justify-content: space-around; padding: 14px 6px 12px;
  box-shadow: 0 10px 34px rgba(30,40,60,.10); }
.dock-item { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer;
  transition: transform .16s; }
.dock-item:active { transform: scale(.9); }
.dock-item { position: relative; }
.badge { position: absolute; top: -6px; right: 4px; min-width: 17px; height: 17px; border-radius: 9px;
  background: #F2668F; border: 2px solid rgba(255,255,255,.9); color: #fff; font-size: 10px;
  font-weight: 600; display: flex; align-items: center; justify-content: center; padding: 0 4px;
  font-variant-numeric: tabular-nums; }
.dock-item svg { width: 25px; height: 25px; fill: none; stroke: #2b2f36; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
.dock-item span { font-size: 11px; color: #3a3f47; font-weight: 500; letter-spacing: .02em; }
.home-settings { position: absolute; top: 40px; right: 20px; width: 40px; height: 40px;
  background: rgba(255,255,255,.55); backdrop-filter: blur(16px); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer; border: .5px solid rgba(255,255,255,.7); }
.home-settings svg { width: 20px; height: 20px; fill: none; stroke: #2b2f36; stroke-width: 1.6; stroke-linecap: round; }

/* ---------- 导航栏 ---------- */
.navbar { height: 94px; padding-top: 44px; background: rgba(245,246,250,.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-bottom: .5px solid var(--line);
  display: flex; align-items: center; padding-left: 6px; padding-right: 14px; gap: 2px; position: relative; z-index: 5; }
.back { border: none; background: none; font-size: 28px; color: var(--blue); width: 40px; height: 46px; cursor: pointer; }
.nav-title { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.nav-name { font-size: 17.5px; font-weight: 650; letter-spacing: .01em; }
.nav-sub { font-size: 11px; color: var(--sub); margin-top: 1px; letter-spacing: .03em; }
.nav-sub:empty { display: none; }
.nav-act { border: none; background: none; color: var(--blue); font-size: 17px; padding: 6px 7px; cursor: pointer; }
.month-label { font-size: 13.5px; font-weight: 550; color: var(--sub); min-width: 76px; text-align: center; }
.nav-plus { border: none; background: var(--surface); width: 34px; height: 34px; border-radius: 50%;
  font-size: 19px; color: var(--text); cursor: pointer; line-height: 1; margin-left: 6px;
  box-shadow: 0 1px 2px rgba(30,40,70,.06), 0 3px 10px rgba(30,40,70,.06); }
.nav-plus:active { transform: scale(.92); }
.nav-plus.icon-btn { display: flex; align-items: center; justify-content: center; }
.nav-plus.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: #3a3f47; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 朋友圈 ---------- */
.mom-card { background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--card-shadow); }
.mom-head { display: flex; align-items: center; gap: 10px; }
.mom-av { width: 38px; height: 38px; border-radius: 50%; background: #EDEFF3; background-size: cover;
  background-position: center; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.mom-name { font-size: 14.5px; font-weight: 600; }
.mom-time { font-size: 11px; color: var(--sub); margin-top: 2px; }
.mom-text { font-size: 15px; line-height: 1.6; margin: 10px 0 0; white-space: pre-wrap; word-break: break-word; }
.mom-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; margin-top: 10px; display: block; }
.mom-ops { display: flex; gap: 22px; margin-top: 10px; padding-top: 10px; border-top: .5px solid var(--line); }
.mom-op { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--sub);
  background: none; border: none; cursor: pointer; padding: 0; }
.mom-op.liked { color: var(--pink); font-weight: 600; }
.mom-cmts { margin-top: 8px; background: #F6F7FB; border-radius: 10px; padding: 8px 12px; }
.mom-cmt { font-size: 13.5px; line-height: 1.55; padding: 2px 0; }
.mom-cmt b { font-weight: 600; color: #5876B8; }
.mom-cmt-in { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.mom-cmt-in input { flex: 1; border: none; outline: none; background: #F2F4F9; border-radius: 16px;
  font-size: 13.5px; padding: 8px 14px; min-width: 0; }
.mom-cmt-in .mom-op { color: var(--blue); font-weight: 600; }

/* ---------- 内容 ---------- */
.content { flex: 1; overflow-y: auto; padding: 18px 16px 60px; display: flex; flex-direction: column; gap: 18px;
  -webkit-overflow-scrolling: touch; }
.sec { background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--card-shadow); }
.sec-title { font-size: 11.5px; color: var(--sub); letter-spacing: .08em; margin-bottom: 12px; text-transform: uppercase; }
.empty { color: var(--sub); font-size: 14px; text-align: center; padding: 20px 10px; line-height: 1.7; }
.sub-val { font-size: 13px; color: var(--sub); margin-top: 3px; }
.big-num { font-size: 38px; font-weight: 300; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.big-num i { font-style: normal; font-size: 14px; color: var(--sub); font-weight: 400; }

/* ---------- 汇总块 ---------- */
.sum-block { background: linear-gradient(135deg, #EAF2FF 0%, #FDEFF5 100%); border-radius: 18px;
  display: flex; padding: 20px 12px; align-items: stretch; box-shadow: var(--card-shadow); }
.sum-block > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.sum-block b { font-size: 30px; font-weight: 320; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.sum-block .sum-cap { font-size: 11px; color: var(--sub); letter-spacing: .08em; }
.sum-div { width: .5px; background: rgba(120,130,170,.22); flex: 0 0 .5px !important; }

/* ---------- 行 ---------- */
.row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0;
  border-bottom: .5px solid var(--line); font-size: 14.5px; }
.row:last-child { border-bottom: none; }
.row b { font-weight: 550; color: var(--text); }
.row b.pink { color: var(--pink); }

/* ---------- 记录行 ---------- */
.rec { display: flex; align-items: center; padding: 12px 0; border-bottom: .5px solid var(--line); gap: 12px; cursor: pointer; }
.rec:last-child { border-bottom: none; }
.rec:active { opacity: .6; }
.rec-emoji { width: 36px; height: 36px; border-radius: 11px; background: #F2F5FC; display: flex;
  align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.rec-main { flex: 1; min-width: 0; }
.rec-title { font-size: 14.5px; font-weight: 550; }
.rec-sub { font-size: 12px; color: var(--sub); margin-top: 2px; }
.rec-amt { font-weight: 550; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.rec-amt.income { color: #2FA45C; }
.rec-del { color: var(--sub); font-size: 13px; padding: 6px 2px 6px 8px; }

/* ---------- 分类条 ---------- */
.cat-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.cat-name { width: 60px; flex-shrink: 0; color: var(--sub); }
.cat-bar-wrap { flex: 1; height: 6px; background: #F1F2F7; border-radius: 3px; overflow: hidden; }
.cat-bar { height: 100%; border-radius: 3px; background: linear-gradient(90deg, #9DC2FF, #F5A6C6); }
.cat-sum { width: 72px; text-align: right; color: var(--sub); flex-shrink: 0; font-variant-numeric: tabular-nums; }

/* ---------- 柱状图 ---------- */
.bars { display: flex; align-items: flex-end; gap: 7px; height: 96px; padding-top: 6px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; justify-content: flex-end; }
.bar { width: 100%; max-width: 22px; background: #DDE3EE; border-radius: 6px; min-height: 3px; transition: height .4s; }
.bar.today { background: linear-gradient(180deg, #F59AC0, #7FB2FF); }
.bar-day { font-size: 10px; color: var(--sub); }

/* ---------- 聊天 ---------- */
.chat-list { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 9px;
  -webkit-overflow-scrolling: touch; background: linear-gradient(180deg, #F2F6FD 0%, #FBF4F8 100%); }
.chat-tobottom { position: absolute; right: 14px; bottom: 86px; width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); border: .5px solid var(--line); box-shadow: 0 4px 14px rgba(30,40,70,.16);
  color: var(--blue); cursor: pointer; z-index: 6; display: flex; align-items: center; justify-content: center;
  animation: fadein .2s ease; }
.chat-tobottom:active { transform: scale(.9); }
.chat-tobottom svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
.msgrow { display: flex; gap: 8px; align-items: flex-end; }
.msgrow.mine { flex-direction: row-reverse; }
.chat-av { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background-size: cover;
  background-position: center; background-color: #EDEFF3; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(30,40,70,.12); }
.chat-av.emoji { display: flex; align-items: center; justify-content: center; font-size: 18px; }
.msgcol { display: flex; flex-direction: column; align-items: flex-start; max-width: 76%; gap: 6px; }
.msgrow.mine .msgcol { align-items: flex-end; }
.msg { padding: 10px 15px; border-radius: 18px; font-size: 15.5px; line-height: 1.52;
  word-break: break-word; white-space: pre-wrap; animation: pop .18s ease-out; }
.msg.me { background: linear-gradient(135deg, #D3E4FF 0%, #F9DAE8 100%); color: #26304A;
  border-bottom-right-radius: 6px; box-shadow: 0 2px 8px rgba(120,110,180,.10); }
.msg.you { background: #fff; color: var(--text); border-bottom-left-radius: 6px;
  box-shadow: 0 1px 2px rgba(30,40,70,.05), 0 3px 12px rgba(30,40,70,.05); }
.msg-img { max-width: 72%; max-height: 260px; border-radius: 16px; display: block;
  box-shadow: 0 2px 10px rgba(30,40,70,.10); }
.typing { background: #fff; border-radius: 18px; padding: 13px 16px; display: flex; gap: 5px;
  box-shadow: 0 1px 2px rgba(30,40,70,.05), 0 3px 12px rgba(30,40,70,.05); }
.sys-line { align-self: center; font-size: 11.5px; color: var(--sub); padding: 2px 0 4px; }
.transfer-card { display: flex; align-items: center; gap: 10px; width: 176px;
  border-radius: 14px; background: linear-gradient(145deg, #FFB65C 0%, #FF8A1F 100%);
  box-shadow: 0 3px 12px rgba(255,138,31,.2); margin-top: 4px; padding: 11px 14px;
  cursor: default; }
.tc-icon { width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.95); color: #FF8A1F; }
.tc-body { display: flex; flex-direction: column; min-width: 0; }
.tc-amt { font-size: 19px; font-weight: 600; color: #fff; line-height: 1.2;
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tc-label { font-size: 11px; color: rgba(255,255,255,.82); margin-top: 3px; line-height: 1.2; }
.time-line { align-self: center; font-size: 11px; color: #9A9DAA; margin: 8px 0 2px; padding: 2px 10px;
  background: rgba(255,255,255,.7); border-radius: 10px; }
.sys-retry { align-self: center; border: none; background: #FFF0F4; color: #D9547A; font-size: 12px;
  padding: 6px 14px; border-radius: 14px; cursor: pointer; margin: 2px 0; }
.pending-card { background: #fff; border: 1px solid #E3D7F5; border-radius: 14px;
  padding: 10px 13px; max-width: 250px; box-shadow: 0 2px 10px rgba(30,40,70,.06); }
.pc-title { font-size: 12px; color: #8A7FA8; margin-bottom: 4px; }
.pc-name { font-size: 14px; color: #3A334E; word-break: break-all; }
.pc-btns { margin-top: 9px; display: flex; gap: 8px; }
.pc-btns .pc-ok { background: linear-gradient(135deg, #7AA7FF 0%, #6F8CFF 100%); color: #fff;
  border: none; border-radius: 14px; padding: 5px 16px; font-size: 13px; cursor: pointer; }
.pc-btns .pc-no { background: #F1EDF8; color: #8A7FA8; border: none; border-radius: 14px;
  padding: 5px 16px; font-size: 13px; cursor: pointer; }
.pc-btns .pc-ok:active, .pc-btns .pc-no:active { opacity: .6; }
.pc-btns .pc-state { font-size: 12.5px; color: #8A7FA8; }
.sys-retry:active { opacity: .6; }
.older-btn { align-self: center; border: none; background: none; color: var(--blue); font-size: 13px;
  padding: 8px; cursor: pointer; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: #B4B7BE; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s } .typing i:nth-child(3) { animation-delay: .4s }
@keyframes blink { 0%,60%,100% { opacity: .3 } 30% { opacity: 1 } }
@keyframes pop { from { transform: scale(.97); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.chat-bar { display: flex; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.94); border-top: .5px solid var(--line); align-items: center; }
#quote-bar { display: flex; align-items: center; gap: 8px; padding: 7px 12px;
  background: #F4F7FE; border-top: .5px solid var(--line); border-left: 3px solid #7DA2F0; }
#quote-bar .q-text { flex: 1; font-size: 12px; color: #5A6B8C; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
#quote-bar .q-cancel { border: none; background: none; color: #8A93A6; font-size: 15px;
  padding: 4px 6px; cursor: pointer; flex-shrink: 0; }
#quote-bar .q-cancel:active { transform: scale(.9); }
.quote-line { font-size: 11.5px; color: #7E8CA6; background: rgba(125,162,240,.12);
  border-left: 3px solid #7DA2F0; padding: 4px 8px; margin-bottom: 5px; border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
#chat-input { flex: 1; border: 1px solid transparent; outline: none; font-size: 16px; padding: 11px 16px;
  border-radius: 22px; background: #F2F4F9; transition: border-color .2s, background .2s; }
#chat-input:focus { background: #fff; border-color: #C9D9FB; }
.img-btn { border: none; background: #F2F4F9; width: 42px; height: 42px; border-radius: 50%;
  cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.img-btn:active { transform: scale(.92); }
#emoji-panel { border-top: .5px solid var(--line); background: #fff; padding: 10px 12px 4px;
  max-height: 220px; overflow-y: auto; }
.ep-title { font-size: 11px; color: var(--sub); letter-spacing: .05em; padding: 6px 2px; }
.ep-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
#ep-stickers { grid-template-columns: repeat(6, 1fr); gap: 6px; }
#ep-stickers img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 10px;
  background: #fff; cursor: pointer; box-shadow: 0 1px 3px rgba(30,40,70,.08); }
#ep-stickers img:active { transform: scale(.94); }
.ep-empty { font-size: 12px; color: var(--sub); padding: 4px 2px; }
.ep-item { font-size: 26px; text-align: center; padding: 4px 0; cursor: pointer; border-radius: 8px;
  background: none; border: none; line-height: 1.2; }
.ep-item:active { background: #F2F2F5; }
.ep-item.kao { font-size: 13px; grid-column: span 4; text-align: left; padding: 6px 8px; }
.msg.sticker { background: transparent; font-size: 52px; padding: 2px 4px; line-height: 1.2; }
.msg.sticker.kao { font-size: 17px; background: transparent; padding: 4px 6px; }
.img-btn svg { width: 21px; height: 21px; fill: none; stroke: #555b63; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round; }
.send-btn { border: none; background: var(--grad); color: #fff; font-size: 14.5px; padding: 0 20px;
  border-radius: 22px; font-weight: 600; flex-shrink: 0; white-space: nowrap; height: 44px;
  box-shadow: 0 3px 10px rgba(150,140,220,.28); letter-spacing: .04em; }
.send-btn:active { opacity: .75; }
#chat-input { min-width: 0; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20,22,26,.32); z-index: 50; display: none; align-items: flex-end; }
.modal-mask.show { display: flex; }
.sheet { width: 100%; background: #fff; border-radius: 22px 22px 0 0; padding: 18px 20px calc(26px + env(safe-area-inset-bottom));
  max-height: 84vh; overflow-y: auto; animation: sheetup .3s cubic-bezier(.32,.72,.35,1); }
@keyframes sheetup { from { transform: translateY(100%) } to { transform: none } }
.sheet-title { font-size: 16.5px; font-weight: 650; text-align: center; margin-bottom: 16px; }
.seg { display: flex; background: #F2F2F5; border-radius: 10px; padding: 3px; margin-bottom: 16px; }
.seg button { flex: 1; border: none; background: none; padding: 9px; border-radius: 8px; font-size: 14.5px;
  color: var(--sub); cursor: pointer; font-weight: 500; }
.seg button.on { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.big-input { width: 100%; border: none; outline: none; font-size: 34px; font-weight: 350; text-align: center;
  padding: 10px 0; border-bottom: 1px solid var(--line); margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.chip-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.chip { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 11px 4px; border-radius: 12px;
  background: #F4F4F6; border: 1px solid transparent; cursor: pointer; font-size: 12px; color: var(--text); }
.chip .e { font-size: 22px; }
.chip.on { border-color: var(--blue); background: var(--soft); }
.chip-text { padding: 13px 4px; font-size: 14px; font-weight: 550; }
.avatar-note { font-size: 12.5px; color: var(--sub); }
.line-input { width: 100%; border: none; outline: none; font-size: 15.5px; padding: 12px 4px;
  border-bottom: 1px solid var(--line); margin-bottom: 12px; background: transparent; font-family: inherit;
  color: var(--text); }
input[type=date].line-input { color: var(--sub); }
.btn-primary { width: 100%; border: none; background: var(--grad); color: #fff; font-size: 16px; font-weight: 600;
  padding: 14px; border-radius: 14px; cursor: pointer; letter-spacing: .04em;
  box-shadow: 0 4px 14px rgba(150,140,220,.30); }
.btn-primary:active { opacity: .8; }

/* ---------- 身体 ---------- */
#h-weight-chart { width: 100%; height: 76px; margin-top: 10px; }
#h-weight-chart polyline { fill: none; stroke: var(--pink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mood-row { display: flex; gap: 16px; flex-wrap: wrap; }
.mood-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mood-item span { font-size: 10.5px; color: var(--sub); }
.mood-item span:first-child { font-size: 28px; line-height: 1.1; }
.mood-item.tap { cursor: pointer; }
.sleep-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--sub); padding: 5px 0; }
.sleep-row.tap { cursor: pointer; }
.sleep-row.tap:active { opacity: .6; }

/* ---------- 纪念日（倒数日卡片，每个可点进详情） ---------- */
.anniv-card { background: var(--surface); border-radius: 18px; box-shadow: var(--card-shadow);
  padding: 18px 16px; display: flex; align-items: center; gap: 16px; }
.anniv-card:first-child { background: linear-gradient(135deg, #EAF2FF 0%, #FDEBF3 100%); }
.anniv-card.tap { cursor: pointer; }
.anniv-card.tap:active { opacity: .6; }
.anniv-num { font-size: 40px; font-weight: 300; letter-spacing: .01em; min-width: 92px;
  text-align: center; font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #5B8CF5 0%, #E8709B 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.anniv-num i { font-style: normal; font-size: 12px; color: var(--sub); margin-left: 2px;
  -webkit-text-fill-color: var(--sub); }
.anniv-info { flex: 1; }
.anniv-name { font-size: 15px; font-weight: 600; }
.anniv-date { font-size: 12.5px; color: var(--sub); margin-top: 4px; }
.anniv-date { font-size: 12.5px; color: var(--sub); margin-top: 4px; }

/* ---------- 日历 ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-nav { border: none; background: none; font-size: 20px; color: var(--blue); padding: 6px 14px; cursor: pointer; }
.cal-label { font-size: 14.5px; font-weight: 600; }
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center;
  font-size: 10.5px; color: var(--sub); padding: 4px 0; letter-spacing: .04em; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-day { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 14px;
  border-radius: 50%; cursor: pointer; position: relative; color: var(--text); }
.cal-day.empty { cursor: default; }
.cal-day.today { font-weight: 700; box-shadow: inset 0 0 0 1.5px var(--blue); }
.cal-day.period { background: linear-gradient(135deg, #F7A1C1, #EE6F9B); color: #fff; font-weight: 600; }
.cal-day.pred { box-shadow: inset 0 0 0 1.5px var(--pink); }

/* ---------- 裁剪 ---------- */
.crop-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.crop-box { width: 260px; height: 260px; border-radius: 16px; overflow: hidden; position: relative;
  background: #EFEFF2; touch-action: none; }
.crop-img { position: absolute; left: 0; top: 0; max-width: none; user-select: none;
  -webkit-user-select: none; -webkit-user-drag: none; -webkit-touch-callout: none;
  pointer-events: none; touch-action: none; }
.crop-zoom { width: 260px; }
.crop-zoombar { display: flex; align-items: center; gap: 16px; }
.zm-btn { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; font-size: 22px; cursor: pointer; color: var(--text); }
.zm-val { min-width: 52px; text-align: center; font-size: 14px; color: var(--sub);
  font-variant-numeric: tabular-nums; }
.crop-ops { display: flex; gap: 12px; width: 260px; }
.crop-ops button { flex: 1; border: none; padding: 12px; border-radius: 12px; font-size: 15px; cursor: pointer; }
.crop-cancel { background: #F2F2F5; color: var(--text); }
.crop-ok { background: var(--blue); color: #fff; font-weight: 600; }

/* ---------- 设置 ---------- */
.avatar-line { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar-big { width: 62px; height: 62px; border-radius: 50%; background: #EDEFF3; display: flex;
  align-items: center; justify-content: center; font-size: 32px; overflow: hidden; background-size: cover;
  background-position: center; flex-shrink: 0; }
.emoji-row { display: flex; gap: 7px; flex-wrap: wrap; }
.emoji-item { width: 38px; height: 38px; border-radius: 50%; background: #F4F4F6; display: flex;
  align-items: center; justify-content: center; font-size: 19px; cursor: pointer; border: 1px solid transparent; }
.emoji-item.on { border-color: var(--blue); background: #EDF4FF; }
.wall-row { display: flex; gap: 9px; margin-bottom: 14px; flex-wrap: wrap; }
.wall-item { width: 62px; height: 62px; border-radius: 13px; cursor: pointer; border: 2px solid transparent;
  background-size: cover; background-position: center; }
.wall-item.on { border-color: var(--blue); }
.btn-line { display: block; width: 100%; text-align: center; padding: 12px; border-radius: 13px;
  background: #F2F4F9; border: none; font-family: inherit; font-size: 14.5px; cursor: pointer;
  margin-top: 4px; color: var(--text); }
.btn-line:active { opacity: .7; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(20px);
  background: rgba(23,23,26,.86); color: #fff; padding: 10px 20px; border-radius: 18px; font-size: 13.5px;
  opacity: 0; transition: .25s; z-index: 99; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- APK 原生适配（去掉网页版为状态栏预留的空隙） ---------- */
body.native .statusbar { display: none; }
body.native .navbar { padding-top: 6px; height: 52px; }
body.native .home-greet { top: 56px; }
body.native .home-date { top: 88px; }
body.native .home-weather { top: 112px; }
body.native .home-widgets { top: 154px; }
body.native .hw-msg { top: 240px; }
body.native .home-settings { top: 8px; }

/* ---------- 登录 ---------- */
#login { position: fixed; inset: 0; background: linear-gradient(180deg, #EEF4FF 0%, #FDF0F6 100%);
  z-index: 100; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
#login.show { display: flex; }
#login .login-heart { font-size: 34px; color: var(--pink); }
#login h2 { font-weight: 400; letter-spacing: .3em; font-size: 24px; }
#login input { width: 66%; padding: 13px 0; border: none; border-bottom: 1px solid var(--line); font-size: 16px;
  outline: none; text-align: center; background: transparent; }
#login button { background: var(--grad); color: #fff; border: none; padding: 12px 44px; border-radius: 22px;
  font-size: 15px; cursor: pointer; box-shadow: 0 4px 14px rgba(150,140,220,.30); }

/* ---------- 朋友圈删除 / 长按 ---------- */
.mom-del { border: none; background: none; color: #C2C2C8; font-size: 11.5px;
  padding: 4px 2px; cursor: pointer; letter-spacing: .04em; flex-shrink: 0; }
.mom-del:active { opacity: .55; }
.mom-cmt.mine { border-radius: 6px; }
.mom-cmt.mine:active { background: rgba(10,132,255,.08); }

/* ---------- 纪念日详情（弹窗） ---------- */
.anniv-detail-emoji { font-size: 44px; text-align: center; }
.anniv-detail-title { font-size: 17px; font-weight: 700; color: var(--text); text-align: center; margin-top: 8px; }
.anniv-detail-days { font-size: 15px; font-weight: 700; color: #5B8CF5; text-align: center; margin-top: 6px; }
.anniv-detail-date { font-size: 12.5px; color: var(--sub); text-align: center; margin-top: 4px; }
.anniv-detail-note { font-size: 13px; color: var(--text); text-align: center; margin-top: 12px; line-height: 1.6;
  background: #f5f6f8; border-radius: 10px; padding: 10px 12px; }

/* ---------- 记忆系统提示 ---------- */
.sys-mem { color: #B7B7BE; font-size: 10.5px; letter-spacing: .03em; }

/* ---------- 饮水 ---------- */
.wbar { height: 8px; background: #F1F2F7; border-radius: 4px; overflow: hidden; margin: 12px 0 6px; }
.wbar-fill { height: 100%; background: linear-gradient(90deg, #8EC0FF, #5B8CF5); border-radius: 4px;
  transition: width .5s ease; }
.wbar-txt { font-size: 12px; color: var(--sub); }

/* ---------- 更新日志（按日期折叠） ---------- */
.log-entry { margin-bottom: 10px; }
.log-entry:last-child { margin-bottom: 0; }
.log-date { font-size: 12.5px; font-weight: 600; color: var(--sub); letter-spacing: .04em;
  cursor: pointer; user-select: none; -webkit-user-select: none; }
.fold-arrow { display: inline-block; font-size: 11px; color: var(--blue); transition: transform .18s;
  width: 14px; }
.log-items { margin-top: 6px; }
.log-item { font-size: 13px; line-height: 1.6; padding: 2.5px 0 2.5px 14px; position: relative; }
.log-item::before { content: ''; position: absolute; left: 3px; top: 12px; width: 4px; height: 4px;
  border-radius: 50%; background: #C9C9CF; }

/* ---------- 日记 ---------- */
/* 注意：content 是 flex column，卡片不能设 overflow:hidden（会把卡片压缩进可视区导致滑不动），
   也要 flex-shrink:0 防止被压扁 */
.diary-entry { background: var(--surface); border-radius: 18px; padding: 0;
  box-shadow: var(--card-shadow); flex-shrink: 0; }
.diary-head { display: flex; align-items: center; gap: 4px; padding: 13px 16px; cursor: pointer;
  user-select: none; -webkit-user-select: none; }
.diary-arrow { font-size: 11px; color: var(--blue); transition: transform .18s; width: 14px; }
.diary-arrow.on { transform: rotate(90deg); }
.diary-date { font-size: 13.5px; font-weight: 600; }
.diary-body { padding: 2px 16px 15px; font-size: 13.5px; line-height: 1.85; color: var(--text);
  white-space: normal; word-break: break-word; }

/* ---------- 虚拟转账 ---------- */
.transfer-block { background: linear-gradient(135deg, #FFF5F5 0%, #FFF0F6 100%); border-radius: 16px;
  margin-bottom: 14px; overflow: hidden; flex-shrink: 0; }
.transfer-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  cursor: pointer; user-select: none; }
.transfer-header:active { opacity: .65; }
.transfer-title { font-size: 13.5px; color: #c94f6e; font-weight: 550; flex: 1; }
.transfer-bal { font-size: 15px; font-weight: 600; color: #d44a6a; font-variant-numeric: tabular-nums; }
.transfer-arrow { color: #c9949f; font-size: 13px; }
.transfer-list { border-top: 1px solid rgba(201,79,110,.12); padding: 6px 0; }
.tf-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  cursor: pointer; }
.tf-row:active { background: rgba(201,79,110,.06); }
.tf-note { flex: 1; font-size: 13.5px; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.tf-ts { font-size: 11.5px; color: var(--sub); flex-shrink: 0; }
.tf-amt { font-size: 14px; font-weight: 550; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.tf-amt.tf-in { color: #d44a6a; }
.tf-amt.tf-out { color: #2FA45C; }

/* ---------- 账单导入 ---------- */
.bill-import { width: 100%; padding: 11px 12px; border-radius: 14px; cursor: pointer;
  border: 1px dashed rgba(91,140,245,.38); background: rgba(255,255,255,.62);
  color: #5a6f96; font-size: 13px; letter-spacing: .02em; flex-shrink: 0; }
.bill-import:active { opacity: .65; }
.bill-help { font-size: 12.5px; line-height: 1.75; color: var(--sub); background: #F6F8FC;
  border-radius: 14px; padding: 12px 13px; margin-bottom: 14px; }
.bill-help b { color: #4d5a72; font-weight: 600; }
.bill-sum { background: #F7F9FC; border-radius: 14px; padding: 14px; margin: 14px 0; }
.bill-sum-main { font-size: 14px; color: var(--text); line-height: 1.6; }
.bill-sum-sub { font-size: 12.5px; color: var(--sub); margin-top: 6px; }
.bill-sum-sub b { color: var(--blue); }

/* ---------- 我的手账（横线本） ---------- */
.content.notes-scroll { padding: 0; gap: 0; background: #EFE9DC; }
.notes-paper { flex: 1 0 auto; position: relative; min-height: 100%;
  padding: 26px 20px 90px 56px; background-color: #FFFDF7;
  background-image: repeating-linear-gradient(to bottom,
    transparent 0, transparent 31px, rgba(110,145,190,.20) 31px, rgba(110,145,190,.20) 32px);
  background-size: 100% 32px; }
.notes-paper::before { content: ''; position: absolute; top: 0; bottom: 0; left: 38px; width: 1px;
  background: rgba(216,120,120,.32); }
.note-entry { padding: 4px 0 18px; cursor: pointer; }
.note-entry:active { opacity: .62; }
.note-top { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.note-date { font-size: 11.5px; color: #A08D78; letter-spacing: .02em; }
.note-tag { font-size: 10.5px; padding: 2px 8px; border-radius: 999px; letter-spacing: .03em; }
.note-tag.daily { background: #E9F1E4; color: #5F7D5A; }
.note-tag.shop { background: #FCEEDF; color: #A06A3B; }
.note-tag.other { background: #EFEBF6; color: #6F6488; }
.note-tag.idea { background: #FCE9EF; color: #A05B72; }
.note-amt { margin-left: auto; font-size: 12px; color: #B07A5A; font-variant-numeric: tabular-nums; }
.note-text { font-family: "Kaiti SC", "KaiTi", "STKaiti", "PingFang SC", serif;
  font-size: 17px; line-height: 32px; color: #3A342C; margin-top: 2px;
  white-space: normal; word-break: break-word; }
.notes-paper .empty { padding-top: 30px; color: #A79A87; }
.note-input { font-family: "Kaiti SC", "KaiTi", "STKaiti", "PingFang SC", serif;
  font-size: 16px; line-height: 1.7; resize: vertical; }

/* ---------- 日程（每天要做的事） ---------- */
.sched-wrap { display: flex; flex-direction: column; }
.sched-top:not(:empty) { padding-bottom: 12px; }
.sched-today { display: block; margin-left: auto; border: none; background: #FFF1E2; color: #C46A12;
  font-family: inherit; font-size: 12.5px; padding: 6px 13px; border-radius: 999px; cursor: pointer; }
.sched-today:active { opacity: .65; }
.sched-sum { display: flex; align-items: baseline; justify-content: space-between;
  padding: 2px 4px 11px; }
.sched-sum-main { font-size: 15px; font-weight: 550; color: var(--text); }
.sched-sum span:last-child { font-size: 11.5px; color: var(--sub); }
.sched-row { display: flex; align-items: flex-start; gap: 12px; background: #fff;
  border-radius: 16px; padding: 14px 14px 14px 13px; margin-bottom: 9px;
  box-shadow: var(--card-shadow); cursor: pointer; transition: opacity .15s; }
.sched-row:active { opacity: .7; }
.sched-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #FFB15C;
  flex-shrink: 0; margin-top: 1px; position: relative; background: #fff;
  transition: background .15s, border-color .15s; }
.sched-check.on { background: #FF9A2E; border-color: #FF9A2E; }
.sched-check.on::after { content: '✓'; position: absolute; inset: 0; color: #fff;
  font-size: 13px; line-height: 18px; text-align: center; font-weight: 700; }
.sched-main { flex: 1; min-width: 0; }
.sched-text { font-size: 15px; color: var(--text); line-height: 1.45; word-break: break-word; }
.sched-row.done .sched-text { color: #B9BCC7; text-decoration: line-through; }
.sched-time { display: inline-block; margin-top: 5px; font-size: 11.5px; color: #C46A12;
  background: #FFF3E5; border-radius: 7px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.sched-row.done .sched-time { color: #C9C3B9; background: #F5F3EF; }
.sched-hint { text-align: center; font-size: 11.5px; color: var(--sub); padding: 12px 0 6px; }

/* ---------- 转盘 ---------- */
.spin-list { display: flex; flex-direction: column; gap: 11px; }
.spin-item { background: var(--surface); border-radius: 18px; padding: 14px; display: flex;
  align-items: center; gap: 12px; box-shadow: var(--card-shadow); cursor: pointer; transition: transform .16s; }
.spin-item:active { transform: scale(.98); }
.spin-item-icon { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #FFE7F0, #FDF0E4); display: flex; align-items: center;
  justify-content: center; font-size: 22px; }
.spin-item-body { flex: 1; min-width: 0; }
.spin-item-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.spin-by { font-size: 10.5px; color: #c94f6e; background: #FFEFF4; border-radius: 999px;
  padding: 2px 8px; font-weight: 600; flex-shrink: 0; }
.spin-item-opts { font-size: 12.5px; color: var(--sub); margin-top: 4px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.spin-item-go { color: #C9CBD6; font-size: 20px; }
.spin-turn { display: none; flex-direction: column; gap: 16px; padding-top: 2px; }
.spin-detail-head { text-align: center; }
.spin-detail-title { font-size: 19px; font-weight: 650; }
.spin-detail-sub { font-size: 12px; color: var(--sub); margin-top: 5px; }
.spin-stage { position: relative; display: flex; justify-content: center; padding-top: 12px; }
.spin-stage canvas { width: min(296px, 76vw); height: auto; aspect-ratio: 1; display: block;
  border-radius: 50%; box-shadow: 0 12px 32px rgba(30, 40, 70, .13);
  transform-origin: 50% 50%; position: relative; z-index: 1; }
.spin-pin { position: absolute; top: 0; left: 50%; margin-left: -11px; width: 0; height: 0;
  border-left: 11px solid transparent; border-right: 11px solid transparent;
  border-top: 20px solid #F2668F; z-index: 2; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18)); }
.spin-result { min-height: 46px; text-align: center; font-size: 18px; font-weight: 650;
  color: #2b3a56; opacity: 0; transform: translateY(5px);
  transition: opacity .35s, transform .35s; }
.spin-result.on { opacity: 1; transform: none; }
.spin-result .spin-res-cap { display: block; font-size: 11.5px; color: var(--sub);
  font-weight: 500; margin-bottom: 4px; letter-spacing: .08em; }
.spin-go { margin-top: -4px; }
.spin-opts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.spin-opt { display: inline-flex; align-items: center; gap: 6px; background: var(--surface);
  border-radius: 999px; padding: 6px 12px; font-size: 13px; box-shadow: var(--card-shadow); }
.spin-opt i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.spin-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 2px; }
.spin-actions .btn-line { background: var(--surface); color: var(--text); }
.spin-del { color: #e0484f; }
.spin-opts-input { background: #F7F8FB; border-radius: 12px; padding: 12px;
  resize: none; line-height: 1.6; }
/* 聊天里的转盘卡片 */
.spin-card { width: 226px; background: linear-gradient(135deg, #EAF1FF 0%, #FFEFF6 100%);
  border-radius: 16px; padding: 13px 14px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 4px 14px rgba(91, 140, 245, .16); }
.spin-card-title { font-size: 12.5px; color: #5c6470; }
.spin-card-pick { font-size: 22px; font-weight: 700; color: #2b3a56; margin: 2px 0 1px; }
.spin-card-opts { font-size: 11.5px; color: #8D90A0; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; }
.spin-card-go { margin-top: 8px; border: none; background: rgba(255, 255, 255, .72);
  color: #E2668F; border-radius: 999px; padding: 7px 0; font-size: 12.5px;
  font-weight: 600; font-family: inherit; cursor: pointer; }
.spin-card-go:active { opacity: .7; }
