﻿/* 微秒记 —— 清爽、移动优先 */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #f4f6f5;
  --card: #ffffff;
  --primary: #0f766e;
  --primary-soft: #e6f4f2;
  --text: #1c2b2a;
  --muted: #7a8a88;
  --line: #e3e9e7;
  --high: #d93025;
  --medium: #e37400;
  --low: #1a73e8;
  --radius: 14px;
  /* 语义色（浅色值；暗色模式在下方统一覆盖） */
  --input-bg: #fafcfb;
  --soft-red: #fdeeee;      --red-strong: #d93025;
  --soft-orange: #fff3e0;   --orange-strong: #e65100;
  --soft-yellow: #fff9c4;   --yellow-strong: #f57f17;
  --soft-gold: #fdf6e3;     --gold-strong: #b8860b;
  --soft-green: #e8f5e9;    --green-strong: #2e7d32;
  --give: #e05b5b;          --give-bg: #fff0f0;
  --receive: #2e9e6b;       --receive-bg: #eafaf1;
  --pin: #f0c94e;           --pin-bg: #fffdf4;
  --muted-2: #a3b0ae;       --muted-3: #b0b7c3;
  --ph: #b6c2c0;            --del: #c9d2d0;
}

html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 560px;
  margin: 0 auto;
  min-height: 100%;
}

.hidden { display: none !important; }

/* ---------- 登录 / 注册 ---------- */
.auth-view {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 28px 20px;
  background:
    radial-gradient(720px 360px at 15% -10%, rgba(15, 118, 110, .14), transparent 60%),
    radial-gradient(560px 320px at 105% 8%, rgba(13, 148, 136, .12), transparent 55%),
    linear-gradient(180deg, #f0f7f6 0%, var(--bg) 60%);
}
.auth-wrap { width: 100%; max-width: 360px; flex-shrink: 0; margin: auto 0; }

/* ---------- 新用户引导 A：登录页入口按钮 + 演示弹层（T-034 · 2026-09-25 太行山） ----------
   用户拍板②（2026-09-25）：演示不再占登录布局 → 收敛成「一分钟了解微秒记」入口按钮，
   点击才展开弹层。动画仍是纯 CSS/原生 JS，零依赖、零后端、离线可用。
   入口按钮刻意做成次级描边样式：不抢登录主按钮的视线。 */
.demo-entry {
  display: block; width: 100%; margin-top: 14px; padding: 11px 14px;
  border: 1px solid var(--line); background: transparent; color: var(--primary);
  border-radius: 12px; font-size: 13px; letter-spacing: .5px; cursor: pointer;
}
.demo-entry:active { background: rgba(15, 118, 110, .08); }
.demo-body { width: 100%; }
.demo-title { font-size: 15px; color: var(--primary); text-align: center; letter-spacing: 1px; margin-bottom: 10px; }
.demo-card { background: var(--card); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 6px 18px rgba(15, 118, 110, .10); }
.demo-row { display: flex; align-items: center; gap: 8px; }
.demo-mic { font-size: 16px; }
.demo-typed { flex: 1; min-height: 26px; font-size: 14px; color: var(--text, #1c2b2a);
  background: rgba(15, 118, 110, .06); border-radius: 10px; padding: 5px 10px; }
.demo-caret { display: inline-block; width: 1px; height: 14px; background: var(--primary);
  margin-left: 2px; vertical-align: -2px; animation: demoCaret 1s steps(1) infinite; }
@keyframes demoCaret { 50% { opacity: 0; } }
.demo-arrow { text-align: center; font-size: 12px; color: var(--muted); margin: 8px 0 6px; }
.demo-parsed { display: flex; gap: 6px; opacity: 0; transform: translateY(4px);
  transition: opacity .35s ease, transform .35s ease; }
.demo-parsed.on { opacity: 1; transform: none; }
.demo-parsed .demo-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: #e6f4f2; color: #0f766e; }
.demo-wave { display: flex; align-items: center; justify-content: center; gap: 4px; height: 26px; }
.demo-wave i { width: 3px; height: 8px; border-radius: 3px; background: var(--primary); opacity: .75;
  animation: demoWave 1.1s ease-in-out infinite; }
.demo-wave i:nth-child(1) { animation-delay: 0s; }
.demo-wave i:nth-child(2) { animation-delay: .13s; }
.demo-wave i:nth-child(3) { animation-delay: .26s; }
.demo-wave i:nth-child(4) { animation-delay: .39s; }
.demo-wave i:nth-child(5) { animation-delay: .52s; }
@keyframes demoWave { 0%, 100% { height: 7px; } 50% { height: 22px; } }
.demo-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.demo-tags span { font-size: 12px; padding: 3px 9px; border-radius: 999px;
  background: rgba(15, 118, 110, .08); color: var(--primary); }
.demo-desc { font-size: 12px; color: var(--muted); text-align: center; margin-top: 8px; line-height: 1.6; }
.demo-foot { font-size: 11px; color: var(--muted); text-align: center; margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) {
  .demo-caret, .demo-wave i { animation: none; }
}
/* PC 宽屏：登录页回归单栏居中（T-034 用户拍板②：演示不再占位，原来的「左演示 / 右登录卡」
   两栏布局随之取消）。 */

/* 品牌区 */
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo {
  width: 84px; height: 84px; margin: 0 auto 14px;
  border-radius: 24px;
  background: linear-gradient(160deg, #0d9488, #0f766e);
  box-shadow: 0 12px 28px rgba(15, 118, 110, .30);
  display: flex; align-items: center; justify-content: center;
}
.auth-brand h1 { font-size: 26px; color: var(--primary); letter-spacing: 2px; }
.slogan { color: var(--muted); font-size: 14px; margin-top: 6px; letter-spacing: 1px; }
.app-version {
  text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0 22px;
  font-variant-numeric: tabular-nums; position: relative; z-index: 2;
}

/* 登录卡片 */
.auth-card {
  background: var(--card); border-radius: 22px;
  padding: 26px 24px 18px; width: 100%;
  box-shadow: 0 14px 40px rgba(15, 118, 110, .12);
  position: relative; z-index: 1;
}

.field { margin-bottom: 2px; }
.field label .opt { font-weight: 400; color: var(--muted-2); font-size: 12px; }

/* 注册方式切换（用户名 / 手机号） */
.reg-tabs {
  display: flex; background: var(--bg); border-radius: 10px; padding: 4px;
  margin: 2px 0 6px;
}
.reg-tab {
  flex: 1; border: 0; background: transparent; padding: 8px;
  border-radius: 8px; color: var(--muted); font-size: 13px; cursor: pointer;
}
.reg-tab.active { background: var(--card); color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.field label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.field input {
  width: 100%; padding: 13px 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; outline: none; background: var(--input-bg);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field input:focus { border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.field input::placeholder { color: var(--ph); }
.field-err { color: var(--high); font-size: 12px; min-height: 0; margin-top: 4px; display: none; }
.field-err.show { display: block; }

.code-row { display: flex; gap: 10px; }
.code-row input { flex: 1; min-width: 0; }
.code-btn {
  flex-shrink: 0; border: 1px solid var(--primary); background: var(--primary-soft);
  color: var(--primary); border-radius: 12px; padding: 0 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.code-btn:disabled { opacity: .55; cursor: default; }

.pwd-row { position: relative; }
.pwd-row input { padding-right: 46px; }
.eye-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; font-size: 16px; padding: 8px; cursor: pointer; opacity: .55;
}
.eye-btn:active { opacity: 1; }

.link-forgot {
  border: 0; background: none; color: var(--muted); font-size: 12px;
  margin-top: 6px; padding: 0; cursor: pointer; text-decoration: underline;
}

.agree { display: flex !important; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); margin-top: 14px !important; line-height: 1.6; }
.agree input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--primary); flex-shrink: 0; }
.agree a { color: var(--primary); text-decoration: none; }

.auth-msg { font-size: 13px; min-height: 18px; margin: 10px 0 4px; display: none; }
.auth-msg.show { display: block; }
.auth-msg.err { color: var(--high); }
.auth-msg.ok { color: var(--primary); }

.btn {
  border: 0; border-radius: 12px; padding: 13px 18px; font-size: 15px;
  cursor: pointer; font-weight: 600;
  font-family: inherit;
}
.btn.primary {
  background: linear-gradient(135deg, #0d9488, #0f766e); color: #fff;
  box-shadow: 0 6px 16px rgba(15, 118, 110, .28);
}
.btn.primary:active { opacity: .88; }
.btn.primary:disabled { opacity: .6; cursor: default; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--muted); }
/* T-048①（2026-09-26 太行山）：描边次级按钮——月度总结「重新生成」用，与实心主按钮拉开层次 */
.btn.outline { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.outline:active { background: var(--primary-soft); }
.btn.outline:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; margin-top: 8px; }
.btn.small { padding: 8px 14px; font-size: 13px; border: 1px solid var(--border, #e5e7eb); white-space: nowrap; }

/* 模式切换链接 */
.auth-switch {
  display: flex; justify-content: center; gap: 6px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.switch-link {
  border: 0; background: none; color: var(--primary); font-size: 13px;
  padding: 6px 10px; cursor: pointer;
}
.switch-link:hover { text-decoration: underline; }
.auth-foot { text-align: center; color: var(--muted-2); font-size: 11px; margin-top: 14px; }

/* 服务器地址设置（安卓版） */
.server-row { display: flex; gap: 8px; margin-top: 12px; }
.server-row input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; color: var(--muted); background: var(--input-bg); outline: none;
}
.server-row input:focus { border-color: var(--primary); background: var(--card); }

/* ---------- 主界面 ---------- */
.main-view { padding-bottom: 96px; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--primary); color: #fff;
  padding: calc(14px + env(safe-area-inset-top)) 18px 14px;
  border-radius: 0 0 18px 18px;
}
.app-title { font-size: 19px; font-weight: 700; }
.today-label { font-size: 12px; opacity: .85; margin-top: 3px; }
.icon-btn {
  background: rgba(255,255,255,.18); border: 0; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer;
}

.list { padding: 14px 14px 0; }

.group-label { font-size: 13px; color: var(--muted); margin: 16px 4px 8px; font-weight: 600; }
.group-label:first-child { margin-top: 4px; }

.card {
  background: var(--card); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  cursor: pointer;
  animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.97); opacity: .5; } to { transform: scale(1); opacity: 1; } }

.check {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 13px;
}
.check.on { background: var(--primary); border-color: var(--primary); }

.card-body { flex: 1; min-width: 0; }
.card-title { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 12px; color: var(--muted); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag {
  font-size: 11px; padding: 1px 7px; border-radius: 20px; background: var(--primary-soft);
  color: var(--primary);
}
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.high { background: var(--high); } .dot.medium { background: var(--medium); } .dot.low { background: var(--low); }

.card.done { opacity: .55; }
.card.done .card-title { text-decoration: line-through; }
.card.overdue .card-title { color: var(--high); }

.del-btn {
  border: 0; background: transparent; color: var(--del); font-size: 18px;
  padding: 6px; cursor: pointer; flex-shrink: 0;
}
.del-btn:active { color: var(--high); }

.empty { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 14px; }
.empty .big { font-size: 44px; display: block; margin-bottom: 12px; }

/* ---------- 浮动添加按钮 ---------- */
.fab {
  position: fixed; bottom: calc(64px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  width: 58px; height: 58px; border-radius: 50%; border: 0;
  background: var(--primary); color: #fff; font-size: 30px;
  box-shadow: 0 6px 18px rgba(15, 118, 110, .35);
  cursor: pointer; z-index: 20;
}
.fab:active { transform: translateX(-50%) scale(.94); }

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(20, 32, 30, .45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 30;
}
/* 登录失效对话框：始终居中 */
#session-modal { align-items: center; }
/* T-045（2026-09-26 太行山）：通用中文确认 / 提示弹窗 —— 替代原生 confirm / alert（按钮是系统英文 CANCEL/OK） */
#ui-modal { align-items: center; z-index: 1200; }   /* 居中显示（同「登录已失效」）；z-index 必须高于经验全屏阅读视图 .exp-reader(1000)，否则在阅读页里点「取消分享/删除」时弹窗被压在下面（2026-09-26 用户实测缺陷） */
#ui-msg { white-space: pre-line; }        /* 保留文案里的换行（如「发现新版本」三段式） */
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { flex: 1; padding: 12px 0; }
.dialog {
  background: var(--card); width: calc(100% - 48px); max-width: 320px;
  border-radius: 18px; padding: 24px 22px; text-align: center;
  box-shadow: 0 14px 44px rgba(0, 0, 0, .22);
  animation: pop .18s ease;
}
.dialog h3 { font-size: 16px; margin-bottom: 8px; }
.dialog p { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.sheet {
  background: var(--card); width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  animation: slide .2s ease;
}
/* 弹窗内容超高统一可滚动（T-060b · 2026-10-02 太行山）
   .modal 是 align-items:flex-end（贴底）+ .sheet 高度 auto：内容比视口高时，弹窗顶部会被
   顶到视口上方，而且整条链路没有任何滚动容器 → 只能看到底部，顶部内容既看不见也滚不上去。
   beta6 真机实测（操作台）：内容 1650px / 视口 616px，①概览 top=-858、②导出 top=-448。
   兜底：所有 .sheet 限高到一屏 + 纵向可滚（打开时 scrollTop 归零，见 app.js openDocModal）。
   - 高度不足一屏的弹窗是 auto 高度，max-height 不生效 → 外观零变化；
   - 自带限高的（.doc-sheet 86vh / .search-sheet 82vh / #year-modal .sheet 88vh）仍按各自规则。 */
.sheet { max-height: 100%; overflow-y: auto; }
/* 宽屏（桌面 / 平板）：弹窗居中显示，不再贴底 */
@media (min-width: 600px) {
  .modal { align-items: center; padding: 20px; }
  .sheet { border-radius: 18px; max-width: 460px; }
}
@keyframes slide { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sheet h2 { font-size: 17px; margin-bottom: 16px; }
#item-form input[type=text], #item-form textarea, #item-form select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; outline: none; background: var(--input-bg); margin-bottom: 12px;
  font-family: inherit;
}
#item-form input:focus, #item-form textarea:focus { border-color: var(--primary); background: var(--card); }
#item-form textarea { resize: vertical; }

/* 弹窗表单统一输入样式（信用卡/账单/收支/记事/随礼等所有 sheet 表单） */
.sheet input[type=text], .sheet input[type=number], .sheet input[type=date],
.sheet input[type=time], .sheet input[type=password], .sheet select, .sheet textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; outline: none; background: var(--input-bg); margin-bottom: 12px;
  font-family: inherit; box-sizing: border-box; color: var(--text);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.sheet select {
  appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230f766e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.sheet input:focus, .sheet select:focus, .sheet textarea:focus {
  border-color: var(--primary); background: var(--card); box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}
.sheet textarea { resize: vertical; }
.row { display: flex; gap: 10px; }
.row label { flex: 1; font-size: 12px; color: var(--muted); }
.row select { margin-top: 4px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }

/* ---------- 提醒横幅 ---------- */
.alert-banner {
  position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  width: calc(100% - 24px); max-width: 536px; z-index: 40;
  background: var(--card); border: 2px solid var(--high); border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  animation: slideDown .25s ease;
}
@keyframes slideDown { from { transform: translate(-50%, -20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.alert-info { flex: 1; min-width: 0; }
.alert-info strong { display: block; font-size: 15px; color: var(--high); }
.alert-info span { font-size: 12px; color: var(--muted); }
.alert-actions { display: flex; gap: 6px; flex-shrink: 0; }
.mini {
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; cursor: pointer;
}
.mini.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.mini.ghost { border-color: transparent; color: var(--muted); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar .tab {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  font-size: 13px; padding: 12px 0 10px; cursor: pointer;
}
.tabbar .tab.active { color: var(--primary); font-weight: 700; }

/* ---------- 账单模块 ---------- */
.bills-view { padding: 12px 14px 0; }
.bill-tabs {
  display: flex; background: var(--primary-soft); border-radius: 12px; padding: 3px; gap: 3px;
  margin-bottom: 12px;
}
.bill-tab {
  flex: 1; border: 0; background: transparent; border-radius: 9px;
  padding: 8px 0; font-size: 14px; color: var(--muted); cursor: pointer;
}
.bill-tab.active { background: var(--card); color: var(--primary); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.bills-pane { min-height: 60vh; }

/* 信用卡汇总条 */
.csum {
  display: flex; background: var(--primary); color: #fff; border-radius: 14px;
  padding: 14px 16px; margin-bottom: 12px; gap: 12px;
}
.csum div { flex: 1; text-align: center; }
.csum .n { font-size: 16px; font-weight: 700; }
.csum .t { font-size: 11px; opacity: .85; margin-top: 2px; }

/* 信用卡卡片（可展开） */
.ccard {
  background: var(--card); border-radius: var(--radius); margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05); overflow: hidden;
}
.ccard-head {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer;
}
.ccard-head .bank { font-size: 15px; font-weight: 700; }
.ccard-head .sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ccard-head .arrow { color: var(--del); font-size: 12px; transition: transform .18s; }
.ccard.open .ccard-head .arrow { transform: rotate(90deg); }
.ccard-head .due {
  margin-left: auto; text-align: right; font-size: 12px;
}
.ccard-head .due b { display: block; font-size: 15px; color: var(--high); }
.ccard-head .due.ok b { color: var(--primary); }
/* 还款日状态标签 */
.due-tag { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; margin-left: 4px; vertical-align: middle; }
.due-tag.overdue { background: #d93025; color: #fff; font-weight: 700; }
.due-tag.urgent-red { background: var(--soft-red); color: #d93025; font-weight: 700; }
.due-tag.urgent-orange { background: var(--soft-orange); color: var(--orange-strong); }
.due-tag.urgent-yellow { background: var(--soft-yellow); color: var(--yellow-strong); }
.due-tag.urgent { background: var(--soft-gold); color: var(--gold-strong); }
.due-tag.normal { background: var(--soft-green); color: var(--green-strong); }
.due-tag.far { background: var(--bg); color: var(--muted); }
.ccard-actions { display: flex; gap: 6px; }
.mini.danger { color: var(--high); border-color: transparent; }

/* 账单列表（展开区） */
.cbill-list { border-top: 1px dashed var(--line); padding: 8px 14px 12px; background: var(--input-bg); }
.cbill {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.cbill:last-child { border-bottom: 0; }
.cbill .p { font-weight: 700; font-size: 13px; }
.cbill .m { flex: 1; font-size: 12px; color: var(--muted); }
.cbill .amt { text-align: right; font-size: 13px; }
.cbill .amt b { display: block; }
.cbill .amt small { color: var(--muted); font-size: 11px; }
.tag.paid { background: var(--primary-soft); color: var(--primary); }
.tag.unpaid { background: var(--soft-red); color: var(--high); }
.tag.partial { background: var(--soft-gold); color: var(--gold-strong); }

/* 收支月度统计 */
.tsum {
  display: flex; background: var(--card); border-radius: 14px; padding: 12px 14px;
  margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); gap: 8px; align-items: center;
}
.tsum .nav { border: 0; background: var(--primary-soft); color: var(--primary); width: 30px; height: 30px; border-radius: 8px; font-size: 15px; cursor: pointer; }
.tsum .mid { flex: 1; text-align: center; }
.tsum .mid .mon { font-size: 14px; font-weight: 700; }
.tsum .nums { display: flex; justify-content: space-around; margin-top: 8px; }
.tsum .nums div { text-align: center; }
.tsum .nums .v { font-size: 15px; font-weight: 700; }
.tsum .nums .v.in { color: var(--primary); }
.tsum .nums .v.out { color: var(--high); }
.tsum .nums .l { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* 分类占比 */
.catbar { background: var(--card); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.catbar h4 { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.cat-row { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 6px; }
.cat-row .cn { width: 56px; flex-shrink: 0; color: var(--text); }
.cat-row .bar { flex: 1; height: 8px; background: var(--primary-soft); border-radius: 6px; overflow: hidden; }
.cat-row .bar i { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.cat-row .cv { width: 64px; text-align: right; color: var(--muted); }

/* 流水列表 */
.tx-group { margin-bottom: 6px; }
.tx-group .gd { font-size: 12px; color: var(--muted); padding: 10px 4px 4px; font-weight: 600; }
.tx-row {
  display: flex; align-items: center; gap: 10px; background: var(--card);
  padding: 10px 14px; margin-bottom: 6px; border-radius: var(--radius); cursor: pointer;
}
.tx-row .ico {
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0;
}
.tx-row .ico.out { background: var(--soft-red); color: var(--high); }
.tx-row .info { flex: 1; min-width: 0; }
.tx-row .info .c { font-size: 14px; font-weight: 600; }
.tx-row .info .n { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-row .amt { font-size: 15px; font-weight: 700; }
.tx-row .amt.in { color: var(--primary); }
.tx-row .amt.out { color: var(--high); }

/* 支出/收入切换 */
.seg { display: flex; background: var(--primary-soft); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.seg-btn { flex: 1; border: 0; background: transparent; padding: 7px 0; border-radius: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.seg-btn.active { background: var(--card); color: var(--primary); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 账单导入 */
.import-tip { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; background: var(--primary-soft); border-radius: 10px; padding: 10px 12px; }
.imp-status { font-size: 13px; color: var(--primary); margin: 10px 0; }
.imp-records { font-size: 12px; color: var(--muted); margin: -4px 0 8px; }
.imp-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.imp-row { display: grid; grid-template-columns: 20px 104px 1fr 74px 58px 72px auto; gap: 6px; align-items: center; padding: 6px 4px; border-bottom: 1px solid var(--line); font-size: 12px; }
.imp-row:last-child { border-bottom: 0; }
.imp-row input[type="date"], .imp-row input[type="text"], .imp-row input[type="number"] {
  border: 1px solid var(--line); border-radius: 7px; padding: 5px 6px; font-size: 12px; min-width: 0; width: 100%; box-sizing: border-box;
}
.imp-row select { border: 1px solid var(--line); border-radius: 7px; padding: 5px 4px; font-size: 12px; background: var(--card); }
/* 已导入过的重复记录：整行变淡、默认不勾选，用户仍可手动勾上强制再导一次 */
.imp-dup { opacity: .55; }
.imp-tag { font-size: 11px; line-height: 1.6; padding: 0 7px; border-radius: 8px; white-space: nowrap; justify-self: start; }
.imp-tag.dup { background: var(--line); color: var(--muted); }
.imp-tag.ai { background: var(--primary-soft); color: var(--primary); }
.imp-tag.rule { background: var(--soft-orange); color: var(--orange-strong); }

/* 短信导入（T-037）：粘贴 → 预览确认。缺字段高亮提醒用户补，绝不瞎猜后写库 */
.sms-preview { border-top: 1px dashed var(--line); margin-top: 12px; padding-top: 12px; }
.sms-preview label { font-size: 12px; color: var(--muted); }
.sms-preview .row { gap: 10px; }
.sms-dup {
  font-size: 12px; line-height: 1.6; color: var(--primary); background: var(--primary-soft);
  border-radius: 8px; padding: 8px 10px; margin: 2px 0 10px;
}
/* T-037c（2026-09-26 太行山）：同账期「更新」不再无脑保留旧 paid/status —— 重置勾选 + 后果说明 */
.sms-reset {
  display: block; margin: 0 0 10px; padding: 9px 10px; border-radius: 8px;
  background: var(--soft-orange); font-size: 12px; line-height: 1.6;
}
.sms-reset label { display: flex; gap: 8px; align-items: flex-start; color: var(--text); font-size: 12.5px; }
.sms-reset input[type="checkbox"] { flex: 0 0 auto; margin: 3px 0 0; width: auto; }
.sms-reset #sms-reset-note { margin-top: 6px; color: var(--muted); }
/* 账单表单：已还 / 应还 自洽提示（源头防 paid > amount 脏数据） */
.bf-hint {
  font-size: 12px; line-height: 1.6; color: var(--primary); background: var(--primary-soft);
  border-radius: 8px; padding: 8px 10px; margin: 2px 0 8px;
}
.bf-hint.warn { color: var(--orange-strong); background: var(--soft-orange); }
.sms-preview input.miss, .sms-preview select.miss {
  border-color: var(--orange-strong); background: var(--soft-orange);
}
.sms-preview input.miss::placeholder { color: var(--orange-strong); }
.sms-raw { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.sms-raw summary { cursor: pointer; }
.sms-raw div {
  margin-top: 6px; padding: 8px 10px; border-radius: 8px; background: var(--input-bg);
  color: var(--text); line-height: 1.6; word-break: break-all;
}

/* ---------- 连续记账天数条（T-030 · 首页顶部） ---------- */
.streak-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px 8px; padding: 9px 13px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  font-size: 13px; color: var(--text);
}
.streak-bar .streak-fire { font-size: 16px; line-height: 1; }
.streak-bar .streak-text { font-weight: 600; color: var(--primary); }
.streak-bar .streak-badge {
  font-size: 11px; background: var(--primary-soft); color: var(--primary);
  border-radius: 8px; padding: 2px 8px;
}
.streak-bar .streak-next { margin-left: auto; font-size: 11px; color: var(--muted); }
.remind-banner { border-color: var(--primary); }
.remind-banner .alert-info strong { color: var(--primary); }

/* ---------- 记事模块 ---------- */
.note-ops { padding: 2px 0 12px; }
.note-ops input {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 14px; font-size: 14px; box-sizing: border-box; background: var(--input-bg); outline: none;
}
.note-ops input:focus { border-color: var(--primary); background: var(--card); }
/* T-043：记事 tab 顶栏 = 搜索框 + 「＋经验」按钮（用户拍板：比 FAB 长按好发现） */
.note-ops.note-ops-bar { display: flex; align-items: center; gap: 8px; padding: 2px 0 8px; }
.note-ops.note-ops-bar input { flex: 1 1 auto; width: auto; min-width: 0; }
#btn-add-exp { flex: 0 0 auto; white-space: nowrap; }
/* T-043：合并列表里经验卡的类型标（分类胶囊）与「已分享」角标 */
.note-card .nt .nt-tag {
  float: right; font-size: 11px; color: #0f766e; background: #e6f4f2;
  border-radius: 10px; padding: 1px 8px; margin-left: 6px; font-weight: 400;
}
.exp-shared-mark {
  display: inline-block; padding: 1px 6px; border-radius: 8px;
  font-size: 10px; line-height: 1.6; white-space: nowrap;
}
/* T-046：两种分享状态配色区分 —— 链接分享＝青（受限）/ 广场公开＝蓝（公开可见） */
.exp-shared-mark.link-only { color: #0f766e; background: #e6f4f2; border: 1px solid #cfe0de; }
.exp-shared-mark.plaza { color: #1d4ed8; background: #e8efff; border: 1px solid #ccd9f7; }
.note-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; margin-bottom: 10px; cursor: pointer;
}
.note-card.pinned { border-color: var(--pin); background: var(--pin-bg); }
.note-card .nt { font-weight: 600; font-size: 15px; margin-bottom: 4px; word-break: break-all; }
.note-card .nc { font-size: 13px; color: var(--muted); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: break-all; }
.note-card .nm { font-size: 11px; color: var(--muted-3); margin-top: 6px; }
.pin-row { display: flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 12px; color: var(--muted); }
.btn.danger { background: var(--give-bg); color: #d94b4b; }

/* ---------- 记录页 · 广场二级 tab（T-041 紧凑胶囊） ----------
   一级 tab（.bill-tabs＝等宽分段控件）已经很占视线，二级 tab 再等宽分段会形成两层同级控件 → 这里收成
   靠左的小胶囊、字号降一档、间距收紧，形成「一级 > 二级」的层级关系，同时省掉一行面积 */
.pseg {
  display: inline-flex; width: auto; background: transparent;
  padding: 0; gap: 6px; margin: 0 0 8px;
}
.pseg .seg-btn {
  flex: 0 0 auto; padding: 4px 14px; border-radius: 999px; font-size: 12px; line-height: 1.5;
  background: var(--input-bg); border: 1px solid var(--line); color: var(--muted);
}
.pseg .seg-btn.active {
  background: var(--primary-soft); border-color: var(--primary); color: var(--primary);
  font-weight: 600; box-shadow: none;
}
/* 一级 tab 与二级 tab 之间收紧（原为 12px + 内联 10px，两层控件挨得太散） */
#records-view .bill-tabs { margin-bottom: 8px; }

/* ---------- 随礼模块 ---------- */
.gseg { margin-bottom: 4px; }
.gsum {
  display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 0; margin: 10px 0;
}
.gsum > div { flex: 1; text-align: center; }
.gsum .n { font-size: 16px; font-weight: 700; }
.gsum .t { font-size: 11px; color: var(--muted); margin-top: 3px; }
/* 人情往来可折叠区块 */
.gperson-section { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.gperson-header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; user-select: none; }
.gperson-header:active { background: var(--primary-soft); }
.gperson-title { font-size: 14px; font-weight: 600; }
.gperson-count { font-size: 12px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 10px; }
.gperson-arrow { margin-left: auto; font-size: 18px; color: var(--muted); transition: transform 0.2s; }
.gperson-section.expanded .gperson-arrow { transform: rotate(90deg); }
.gperson-body { padding: 0 14px 12px; border-top: 1px solid var(--line); }
.gperson-search { width: 100%; box-sizing: border-box; margin: 10px 0 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: var(--bg); }
.gperson-search:focus { outline: none; border-color: var(--primary); background: var(--card); }
.p-row { display: flex; align-items: center; gap: 8px; padding: 9px 4px; font-size: 13px; border-bottom: 1px dashed var(--line); cursor: pointer; border-radius: 6px; }
.p-row:last-child { border-bottom: 0; }
.p-row:hover { background: var(--primary-soft); }
.p-row.active { background: var(--primary-soft); }
.p-row.active .pn { color: var(--primary); }
.p-row .pn { font-weight: 600; min-width: 56px; word-break: break-all; }
.p-row .pm { flex: 1; color: var(--muted); font-size: 12px; }
.p-row .ps { font-size: 12px; font-weight: 600; white-space: nowrap; }
.p-row.owe .ps { color: var(--give); }
.p-row.owed .ps { color: var(--receive); }
.p-row.ok .ps { color: var(--muted); }
.person-empty { text-align: center; color: var(--muted); font-size: 12px; padding: 12px 0; }
/* 筛选状态条 */
.gfilter-bar { display: flex; align-items: center; gap: 8px; background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: 13px; }
.gfilter-bar #gift-filter-text { flex: 1; color: var(--primary); font-weight: 500; }
.gfilter-clear { background: none; border: 1px solid var(--primary); color: var(--primary); border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.gfilter-clear:active { background: var(--primary); color: #fff; }
.gift-row {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
}
.gift-row .ico {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700;
}
.gift-row .ico.give { background: var(--give-bg); color: var(--give); }
.gift-row .ico.receive { background: var(--receive-bg); color: var(--receive); }
.gift-row .info { flex: 1; min-width: 0; }
.gift-row .info .c { font-size: 14px; font-weight: 600; word-break: break-all; }
.gift-row .info .n { font-size: 12px; color: var(--muted); margin-top: 2px; }
.gift-row .amt { font-weight: 700; white-space: nowrap; }
.gift-row .amt.give { color: var(--give); }
.gift-row .amt.receive { color: var(--receive); }

/* ---------- 月度预算（收支模块顶部） ---------- */
.bbar {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); cursor: pointer;
}
.bbar.emptybar { border-style: dashed; }
.bb-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); }
.bb-head b { color: var(--text); font-size: 14px; }
.bb-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.bb-bar { height: 8px; background: var(--primary-soft); border-radius: 6px; overflow: hidden; margin: 10px 0 6px; }
.bb-bar i { display: block; height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s ease; }
.bbar.warn .bb-bar i { background: var(--medium); }
.bbar.over .bb-bar i { background: var(--high); }
.bb-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.bb-meta span.ok { color: var(--green-strong); }
.bb-meta span.warn { color: var(--medium); }
.bb-meta span.over { color: var(--high); font-weight: 700; }

/* ---------- 全局搜索弹窗 ---------- */
.search-sheet { max-height: 82vh; display: flex; flex-direction: column; }
#search-input { font-size: 16px; }
.search-status { font-size: 12px; color: var(--muted); padding: 4px 2px 8px; }
.search-results { flex: 1; overflow-y: auto; margin: 0 -4px; }
.s-row { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-radius: 10px; cursor: pointer; }
.s-row:active { background: var(--primary-soft); }
.s-row + .s-row { border-top: 1px solid var(--line); }
.s-ico { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--primary-soft);
  display: flex; align-items: center; justify-content: center; font-size: 15px; }
.s-info { flex: 1; min-width: 0; }
.s-t { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-s { font-size: 12px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-go { color: var(--muted-2); font-size: 16px; }

/* ---------- 暗色模式 ---------- */
[data-theme="dark"] {
  --bg: #10161a;
  --card: #1a2228;
  --primary: #2dd4bf;
  --primary-soft: #16313a;
  --text: #e5edf0;
  --muted: #8b9aa0;
  --line: #2a363d;
  --high: #f87171;
  --medium: #fbbf24;
  --low: #60a5fa;
  --input-bg: #141c21;
  --soft-red: #3a1f22;      --red-strong: #f87171;
  --soft-orange: #3a2b17;   --orange-strong: #fb923c;
  --soft-yellow: #3a3216;   --yellow-strong: #facc15;
  --soft-gold: #3a3018;     --gold-strong: #eab308;
  --soft-green: #173128;    --green-strong: #34d399;
  --give: #f87171;          --give-bg: #3a2224;
  --receive: #34d399;       --receive-bg: #163029;
  --pin: #eab308;           --pin-bg: #2c291a;
  --muted-2: #6b7a80;       --muted-3: #5d6b71;
  --ph: #56636a;            --del: #56636a;
}
[data-theme="dark"] .auth-view {
  background:
    radial-gradient(720px 360px at 15% -10%, rgba(45, 212, 191, .10), transparent 60%),
    radial-gradient(560px 320px at 105% 8%, rgba(45, 212, 191, .08), transparent 55%),
    linear-gradient(180deg, #0f1a20 0%, var(--bg) 60%);
}
[data-theme="dark"] .auth-logo { box-shadow: 0 12px 28px rgba(0,0,0,.4); }
[data-theme="dark"] .btn.primary { background: linear-gradient(135deg, #14b8a6, #0f766e); color: #fff; box-shadow: 0 6px 16px rgba(0,0,0,.35); }
[data-theme="dark"] .topbar { background: #0f766e; }
[data-theme="dark"] .due-tag.overdue { background: #b91c1c; color: #fff; }
[data-theme="dark"] .modal { background: rgba(0, 0, 0, .55); }
[data-theme="dark"] .fab { box-shadow: 0 6px 18px rgba(0,0,0,.45); }
[data-theme="dark"] .alert-banner { box-shadow: 0 8px 30px rgba(0,0,0,.5); }
[data-theme="dark"] .note-card.pinned { border-color: var(--pin); background: var(--pin-bg); }
/* T-043：合并列表的经验/已分享标记在暗色下的可读性 */
[data-theme="dark"] .note-card .nt .nt-tag { background: #16313a; color: #2dd4bf; }
[data-theme="dark"] .exp-shared-mark.link-only { color: #2dd4bf; background: #16313a; border-color: #23504d; }
[data-theme="dark"] .exp-shared-mark.plaza { color: #93c5fd; background: #172a44; border-color: #2b4a70; }
/* T-034：演示弹层在暗色下的可读性（打字条 / 解析 chips / 分类标签） */
[data-theme="dark"] .demo-card { box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
[data-theme="dark"] .demo-typed { background: rgba(45, 212, 191, .10); }
[data-theme="dark"] .demo-parsed .demo-chip,
[data-theme="dark"] .demo-tags span { background: #16313a; color: #2dd4bf; }
[data-theme="dark"] .demo-entry:active { background: rgba(45, 212, 191, .12); }

/* ---------- 经验：全屏阅读视图（博客式） ---------- */
.exp-reader {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--bg, #f6f8fa);
  display: flex; flex-direction: column;
  max-height: 100vh; width: 100%;
}
.er-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; flex-shrink: 0;
  background: var(--card, #fff); border-bottom: 1px solid var(--border, #e3e8ee);
}
.er-back {
  background: none; border: none; color: #0f766e;
  font-size: 15px; font-weight: 600; padding: 6px 10px; cursor: pointer; border-radius: 8px;
}
.er-back:active { background: #e6f4f2; }
.er-top-tip { font-size: 12px; color: var(--muted-2); }
.er-body {
  flex: 1; overflow-y: auto; padding: 22px 18px 40px;
  max-width: 720px; margin: 0 auto; width: 100%; box-sizing: border-box;
}
.exp-read-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.exp-cat-tag {
  display: inline-block; background: #e6f4f2; color: #0f766e;
  font-size: 12px; padding: 2px 10px; border-radius: 20px;
}
.exp-time-tag { font-size: 12px; color: var(--muted-2); }
.exp-read-title {
  font-size: 24px; font-weight: 700; color: #15302d;
  margin: 6px 0 18px; line-height: 1.35; word-break: break-word;
}
.exp-read-content {
  font-size: 16px; line-height: 1.95; color: #2c3f3d;
  white-space: pre-wrap; word-break: break-word;
  background: none; padding: 0;
}
.er-actions { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; justify-content: center; }
.er-pager {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; flex-shrink: 0;
  background: var(--card, #fff); border-top: 1px solid var(--border, #e3e8ee);
}
.er-page {
  background: none; border: 1px solid #cfe0de; color: #0f766e;
  font-size: 13px; padding: 8px 14px; border-radius: 10px; cursor: pointer; min-height: 36px;
}
.er-page:disabled { opacity: .35; cursor: default; }
.er-page:not(:disabled):active { background: #e6f4f2; }
.er-page-ind { font-size: 12px; color: var(--muted-2); }
.exp-shared-badge {
  margin-top: 14px; background: #e6f4f2; color: #0f766e;
  font-size: 12px; padding: 8px 12px; border-radius: 10px; line-height: 1.6;
  word-break: break-all;
}
/* T-046：阅读页角标同样两种状态（与列表角标同口径） */
.exp-shared-badge.plaza { background: #e8efff; color: #1d4ed8; }
.exp-shared-badge.plaza .exp-share-url-inline { color: #1d4ed8; }
.exp-share-url-inline { color: #0f766e; opacity: .85; font-size: 11px; word-break: break-all; }

/* ---------- 经验：分享预览 ---------- */
.exp-share-card {
  background: #f0f7f6; border-radius: 14px; padding: 16px 16px 14px;
  margin: 6px 0 16px;
}
.esc-brand {
  text-align: center; color: #0f766e; font-weight: 700;
  font-size: 14px; letter-spacing: 2px; margin-bottom: 10px;
}
.esc-title { font-size: 17px; font-weight: 700; color: #15302d; margin-bottom: 8px; line-height: 1.4; word-break: break-word; }
.esc-content {
  font-size: 13px; color: #2c3f3d; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  max-height: 160px; overflow: hidden;
}
.exp-qr-box {
  text-align: center; background: #fff; border-radius: 14px;
  padding: 18px 12px 14px; margin-bottom: 14px;
  border: 1px solid #e3eae9;
}
.exp-qr-box img { width: 160px; height: 160px; display: block; margin: 0 auto; }
.exp-qr-tip { color: #8aa09d; font-size: 12px; margin-top: 10px; }
.exp-share-url-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--input-bg); border-radius: 10px; padding: 8px 10px;
}
.exp-share-url-text {
  flex: 1; font-size: 11px; color: var(--muted);
  word-break: break-all; line-height: 1.5;
}
[data-theme="dark"] .exp-share-card { background: #152524; }
[data-theme="dark"] .exp-read-content { background: none; color: #d8e2e0; }
[data-theme="dark"] .exp-qr-box { background: #fff; border-color: #2a3a38; }
[data-theme="dark"] .esc-title { color: #e6efee; }
[data-theme="dark"] .esc-content { color: #b8c8c6; }
[data-theme="dark"] .exp-cat-tag { background: #16313a; color: #2dd4bf; }
[data-theme="dark"] .exp-shared-badge { background: #16313a; color: #2dd4bf; }
[data-theme="dark"] .exp-shared-badge.plaza { background: #172a44; color: #93c5fd; }
[data-theme="dark"] .exp-shared-badge.plaza .exp-share-url-inline { color: #93c5fd; }
[data-theme="dark"] .exp-share-url-inline { color: #2dd4bf; opacity: .85; }

/* ---------- 「我的」页（v1.9.0） ---------- */
.me-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: 16px;
  padding: 18px 16px; margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.me-avatar {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(150deg, #0d9488, #0f766e); color: #fff;
  font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.me-info { flex: 1; min-width: 0; }
.me-name { font-size: 17px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-sub { font-size: 12px; color: var(--muted); margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.me-section {
  background: var(--card); border-radius: 14px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); overflow: hidden;
}
.me-item {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; font-size: 14px; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.me-item + .me-item { border-top: 1px solid var(--line); }
.me-item:active { background: var(--primary-soft); }
.me-item span:first-child { flex: 1; min-width: 0; }
.me-arrow { color: var(--del); font-size: 16px; }
.me-val { color: var(--muted); font-size: 13px; }

.me-logout {
  margin-top: 6px;
  background: var(--give-bg); color: var(--give);
  box-shadow: none;
}
.me-logout:active { opacity: .85; }

/* 数据恢复文件选择 */
#restore-modal input[type="file"] {
  width: 100%; padding: 12px; border: 1.5px dashed var(--line); border-radius: 12px;
  font-size: 13px; color: var(--muted); background: var(--input-bg);
  cursor: pointer; box-sizing: border-box;
}
#restore-modal input[type="file"]::-webkit-file-upload-button {
  border: 0; background: var(--primary-soft); color: var(--primary);
  border-radius: 8px; padding: 7px 14px; font-size: 13px; font-weight: 600;
  margin-right: 10px; cursor: pointer;
}

/* 「我的」页暗色适配 */
[data-theme="dark"] .me-card { box-shadow: 0 1px 4px rgba(0,0,0,.25); }
[data-theme="dark"] .me-section { box-shadow: 0 1px 3px rgba(0,0,0,.2); }


/* ---------- 月度生活总结弹窗（AI 一期② 2026-09-23 太行山） ---------- */
.story-body {
  line-height: 1.9; font-size: 15px; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
  margin: 12px 0 4px; min-height: 60px;
}
.story-body.loading, .story-body.empty { color: var(--muted); font-size: 14px; }
.story-stat-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.story-chip {
  background: var(--primary-soft); color: var(--primary);
  border-radius: 999px; padding: 3px 10px; font-size: 12px;
}
.story-note { margin-top: 8px; font-size: 12px; color: var(--muted-2); }
/* ---- T-048②（2026-09-26 太行山）：本月小建议区块 + 免责小字 ---- */
.story-tips { margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft); }
.story-tips-head { font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.story-tip { font-size: 13px; line-height: 1.75; color: var(--text); }
.story-disclaimer { margin-top: 10px; font-size: 11.5px; line-height: 1.6; color: var(--muted-2); }
/* ---- T-039（2026-09-25 太行山）：月度总结 生成进度 + 存为记录 / 分享 ---- */
.story-progress { margin-top: 10px; }
.sp-bar { height: 6px; border-radius: 6px; background: var(--border, #e5e7eb); overflow: hidden; }
.sp-bar i { display: block; height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(135deg, #14b8a6, #0f766e); transition: width .3s linear; }
.sp-txt { display: block; margin-top: 6px; font-size: 12px; color: var(--muted-2); }
.story-extra { display: flex; gap: 8px; margin-top: 12px; }
.story-extra .btn { flex: 1; }
.story-confirm { font-size: 14px; color: var(--muted); line-height: 1.8; }
.story-confirm b { color: var(--fg, #1c2b2a); }

/* ---------- 「去年的今天」回忆卡片（T-032 · 2026-09-25 太行山） ---------- */
.mm-card {
  background: linear-gradient(150deg, rgba(13,148,136,.10), rgba(13,148,136,.02));
  border: 1px solid rgba(13,148,136,.18);
  border-radius: 16px; padding: 14px 16px; margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.mm-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mm-title { font-size: 14px; font-weight: 700; color: var(--primary); }
.mm-date { font-size: 12px; color: var(--muted); }
.mm-body { margin-top: 8px; font-size: 14px; line-height: 1.7; color: var(--text); }
.mm-body.empty { color: var(--muted); font-size: 13px; }
.mm-toggle {
  margin-top: 8px; border: 0; background: none; color: var(--primary);
  font-size: 13px; padding: 4px 0; cursor: pointer;
}
.mm-detail { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 8px; }
.mm-detail-title { font-size: 12px; color: var(--muted); margin: 8px 0 4px; }
.mm-row { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.mm-row-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-row-amt { color: var(--give); flex-shrink: 0; }
.mm-row-amt.in { color: var(--primary); }
[data-theme="dark"] .mm-card { border-color: rgba(45,212,191,.25); }

/* ---------- 年度生活报告弹窗（T-031 · 2026-09-25 太行山） ---------- */
#year-modal .sheet { max-height: 88vh; overflow-y: auto; }
.ys-months-title, .ys-block-title { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.ys-bars { display: flex; align-items: flex-end; gap: 4px; height: 96px; padding: 0 2px; }
.ys-bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; height: 100%; }
.ys-bar { width: 100%; max-width: 18px; background: var(--primary); border-radius: 3px 3px 0 0; opacity: .8; }
.ys-bar-x { font-size: 10px; color: var(--muted-2); margin-top: 3px; }
.ys-block { margin-top: 4px; }
.ys-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.ys-row span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ys-note { font-size: 12px; color: var(--muted-2); margin-top: 6px; }

/* ---------- 文档弹窗（协议/隐私/下载中心） ---------- */
.doc-sheet {
  width: min(560px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.doc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--card); z-index: 1;
}
.doc-head h2 { margin: 0; font-size: 16px; color: var(--primary); }
.doc-close {
  border: 0; background: var(--primary-soft); color: var(--primary);
  width: 32px; height: 32px; border-radius: 50%; font-size: 15px; cursor: pointer;
}
.doc-body { padding: 16px 18px; overflow-y: auto; font-size: 14px; line-height: 1.8; color: #2c3d3a; }
.doc-body h3 { font-size: 15px; color: var(--primary); margin: 16px 0 6px; }
.doc-body p { margin: 8px 0; }
.doc-body ul { padding-left: 20px; margin: 6px 0; }
.doc-body li { margin: 4px 0; }
.doc-meta { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.doc-tip { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.7; }
.doc-link { color: var(--primary); cursor: pointer; text-decoration: underline; }

/* 全局搜索结果跳转定位高亮（2026-09-23）：账单 / 收支 / 卡片没有详情弹层，
   跳过去后让目标那一行闪一下，用户才知道跳到了哪一条 */
.hit-flash { animation: hitFlash 2.2s ease-out 1; }
@keyframes hitFlash {
  0%   { background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); }
  70%  { background: var(--primary-soft); box-shadow: 0 0 0 2px var(--primary); }
  100% { background: transparent; box-shadow: none; }
}

/* 随礼阅读页明细行（2026-09-23） */
.gr-row { display: flex; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.6; }
.gr-row:last-child { border-bottom: none; }
.gr-k { flex: 0 0 52px; color: var(--muted); }
.gr-v { flex: 1; min-width: 0; word-break: break-word; }
.gr-v.give { color: #e05b5b; font-weight: 600; }
.gr-v.receive { color: #2e9e6b; font-weight: 600; }
.gr-v.expense { color: #e05b5b; font-weight: 600; }
.gr-v.income { color: #2e9e6b; font-weight: 600; }
.exp-cat-tag.expense { background: #fdecec; color: #e05b5b; }
.ir-todos-wrap { margin-top: 14px; }
.ir-todos-title { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.ir-todo { display: flex; gap: 8px; padding: 6px 2px; font-size: 14px; border-bottom: 1px dashed var(--line); }
.ir-todo.done { color: var(--muted); text-decoration: line-through; }
.ir-todo-mark { color: var(--primary); }
.ir-todo-empty { font-size: 13px; color: var(--muted); padding: 6px 2px; }
.exp-cat-tag.receive { background: #e8f7ef; color: #2e9e6b; }

/* ---------- AI 一句话记账（2026-09-23 太行山）---------- */
.ai-bar { display: flex; gap: 8px; align-items: center; padding: 2px 0 10px; }
.ai-bar input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 14px; font-size: 14px; box-sizing: border-box; background: var(--input-bg); outline: none;
}
.ai-bar input:focus { border-color: var(--primary); background: var(--card); }
.ai-bar .mini { white-space: nowrap; flex: 0 0 auto; }
/* 语音输入（T-028）：录音中按钮变红并呼吸闪烁，秒数写在按钮上 */
.ai-bar .mini.mic { font-size: 15px; line-height: 1; padding: 7px 11px; }
.ai-bar .mini.mic.rec {
  background: var(--soft-red); color: var(--red-strong); border-color: var(--red-strong);
  font-size: 12px; animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.ai-hint {
  margin: 0 0 12px; padding: 8px 11px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.5; background: var(--primary-soft); color: var(--primary);
}
.ai-hint.warn { background: var(--soft-orange); color: var(--orange-strong); }

/* 数据恢复进度条（T-036d · 2026-09-27 用户建议：恢复时要有进度反馈）
   上传阶段 = 真实上传百分比；服务端处理阶段 = 不确定态滑动条（单次 POST 没有分阶段进度，不假装精确） */
.prog { height: 6px; border-radius: 3px; background: var(--primary-soft); overflow: hidden; margin: 10px 0 4px; }
.prog-bar { height: 100%; width: 0; border-radius: 3px; background: var(--primary); transition: width .25s ease; }
.prog.indet .prog-bar { width: 34%; transition: none; animation: progSlide 1.05s cubic-bezier(.4, 0, .6, 1) infinite; }
@keyframes progSlide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }
.prog.done .prog-bar { width: 100%; }
.prog.err .prog-bar { width: 100%; background: var(--danger, #dc2626); }

/* 分类管理（T-036g · 2026-09-27）：每行 = 名字 + 标签 + 行内操作；手机上按钮要能点得中 */
.cat-add { display: flex; gap: 8px; margin: 10px 0 6px; }
.cat-add input { flex: 1; }
.cat-list { max-height: 46vh; overflow-y: auto; margin-top: 4px; }
.cat-row { display: flex; align-items: center; gap: 6px; padding: 7px 2px;
  border-bottom: 1px solid var(--line, #eef2f1); }
.cat-row.off { opacity: .55; }
.cat-row .cat-name { flex: 1; font-size: 14.5px; }
.cat-row .cat-name input { width: 100%; }
.cat-tag { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 8px;
  background: var(--primary-soft); color: var(--primary); }
.cat-tag.keep { background: var(--soft-orange, #fdeccd); color: #a16207; }
.cat-tag.off { background: #eef1f0; color: #7c8b88; }
.cat-ops { display: flex; gap: 4px; }
.cat-ops .mini { padding: 4px 7px; font-size: 12px; }
.cat-ops .mini.red { color: var(--danger, #dc2626); }
.cat-empty { padding: 14px 0; font-size: 13px; color: var(--muted, #8aa09d); text-align: center; }

/* ---------- 语音输入「按住说话」弹层（T-053 · 2026-09-28 用户拍板：微信式按住说话）----------
   元素 id 与 app.js 的 voiceState()/voiceLive() 一一对应；z-index 要盖过经验阅读页(1000)与 ui-modal(1200)。 */
#voice-modal { align-items: center; z-index: 1250; }
.voice-dialog { max-width: 340px; }
.voice-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.voice-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); flex: 0 0 auto; }
.voice-dot.on { background: var(--red-strong); animation: voiceDotPulse 1s ease-in-out infinite; }
.voice-dot.cancel { background: var(--orange-strong); }
@keyframes voiceDotPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.72); } }
.voice-status { font-size: 14px; font-weight: 600; color: var(--text); }
.voice-time { margin-left: auto; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.voice-wave { display: flex; align-items: center; justify-content: center; gap: 6px; height: 54px; margin: 2px 0 10px; }
.voice-wave i {
  display: block; width: 5px; height: 6px; border-radius: 3px; background: var(--primary);
  opacity: .3; transition: height .1s linear, opacity .25s ease;
}
.voice-wave.live i { opacity: .85; }
#voice-modal.cancel .voice-wave i { background: var(--orange-strong); }
.voice-live {
  min-height: 56px; max-height: 104px; overflow-y: auto; text-align: left; white-space: pre-wrap; word-break: break-word;
  font-size: 14px; line-height: 1.6; color: var(--muted); background: var(--input-bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px;
}
.voice-live.has-text { color: var(--text); }
.voice-live.final { border-color: var(--primary-soft); background: var(--primary-soft); }
.voice-ptt {
  width: 100%; padding: 15px 0; border: 0; border-radius: 14px; font-size: 16px; font-weight: 600;
  color: #fff; background: var(--primary); cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: transform .1s ease, background .2s ease;
}
.voice-ptt:active { transform: scale(.985); }
#voice-modal.rec .voice-ptt { background: var(--red-strong); }
#voice-modal.cancel .voice-ptt { background: var(--orange-strong); }
.voice-tip { min-height: 17px; margin: 10px 0 16px; font-size: 12.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .voice-dot.on { animation: none; }
  .voice-wave i { transition: none; }
}

T-060-PATCH · 数据管理操作台样式 ================= */
.data-promise { background: var(--primary-soft); border-radius: 12px; padding: 12px 14px; margin-bottom: 4px; }
.data-promise-t { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.data-promise-b { font-size: 13px; line-height: 1.6; color: var(--text); margin-bottom: 6px; }
.data-h { font-size: 15px; margin: 18px 0 6px; color: var(--text); }
.data-tip { font-size: 12px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; }
.data-ov { display: flex; flex-wrap: wrap; gap: 8px; }
.data-ov .ov-chip { background: var(--input-bg); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 86px; }
.data-ov .ov-chip .ov-n { font-size: 17px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.data-ov .ov-chip.zero .ov-n { color: var(--muted-2); font-weight: 600; }
.data-ov .ov-chip .ov-k { font-size: 12px; color: var(--muted); }
.data-ov-loading { font-size: 13px; color: var(--muted); }
.data-ov-total { margin-top: 8px; font-size: 13px; color: var(--muted); }
.data-danger { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--input-bg); }
.data-danger-warn { font-size: 13px; color: var(--red-strong); margin-bottom: 10px; }
.data-danger-blk { padding-top: 12px; margin-top: 12px; border-top: 1px dashed var(--line); }
.data-danger-blk:first-of-type { padding-top: 0; margin-top: 0; border-top: 0; }
.data-danger-name { font-size: 14px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.data-danger input { width: 100%; margin-bottom: 8px; }
.btn.danger { background: var(--give-bg); color: #d94b4b; }
.btn:disabled { opacity: .5; }

/* ===== T-061 微信卡片：预览弹窗（2026-10-02 太行山）=====
   图是 1080×1440 的原图，这里只按宽度缩放显示（点开就是微信里看到的效果） */
.card-preview { display: flex; justify-content: center; margin: 8px 0 4px; }
.card-preview img { width: 100%; max-width: 300px; border-radius: 12px; border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(15, 118, 110, .10); background: #fff; }
.card-actions { display: flex; gap: 10px; margin-top: 6px; }
.card-actions .btn { flex: 1; margin: 0; }

/* ---------- T-060c 数据管理操作台「两级改版」（2026-10-02 太行山）---------- */
.dm-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 4px; }
.dm-item { display: block; width: 100%; text-align: left; background: var(--input-bg);
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; }
.dm-item:active { background: var(--primary-soft); }
.dm-item-t { display: block; font-size: 14px; font-weight: 700; color: var(--text); }
.dm-item-s { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.dm-promise-tip { margin-top: 14px; line-height: 1.6; }
.dm-back { background: none; border: 0; padding: 0 0 10px; font: inherit; font-size: 14px;
  color: var(--primary); cursor: pointer; }
.dm-del-title { color: #d94b4b; }
.dm-del-warn { background: var(--give-bg); border: 1px solid #f0c4c4; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px; }
.dm-del-warn p { font-size: 13px; line-height: 1.6; color: var(--text); }
.dm-del-blk { margin-top: 4px; }
.dm-del-blk input { width: 100%; margin-bottom: 8px; }
