:root {
  --bg: #f4f6f9;
  --panel: #fff;
  --line: #e6e9ef;
  --line-2: #eef1f5;
  --text: #1b1f26;
  --text-2: #5b6472;
  --text-3: #9aa3b0;
  --accent: #2b6cf6;
  --accent-soft: #eaf1ff;
  --danger: #e5484d;
  --radius: 14px;
  --shadow-s: 0 1px 2px rgba(16,24,40,.04);
  --shadow-m: 0 2px 6px rgba(16,24,40,.05), 0 12px 28px rgba(16,24,40,.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.65 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: #1f5ce8; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d7dce5; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c3cad6; }

/* ===== 顶栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 12px 22px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; white-space: nowrap; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff; font-size: 15px;
  box-shadow: 0 4px 10px rgba(59,130,246,.28);
}
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  padding: 7px 13px; border-radius: 10px; color: var(--text-2);
  font-size: 13.5px; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
  transition: .14s;
}
.nav-item:hover { background: #eef1f6; color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.who {
  color: var(--text-2); font-size: 13px; max-width: 150px; overflow: hidden;
  text-overflow: ellipsis; padding: 6px 12px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px;
  display: inline-block; transition: .14s; -webkit-tap-highlight-color: transparent;
}
.who:hover { border-color: var(--accent); color: var(--accent); }
.who:active { transform: scale(.96); }

/* ===== 按钮 ===== */
.btn {
  height: 38px; padding: 0 15px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line);
  background: #fff; transition: .16s; white-space: nowrap; text-decoration: none; color: var(--text);
}
.btn:hover { border-color: #cfd8e6; background: #fbfcfe; color: var(--text); }
.btn.primary, .btn.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 3px 10px rgba(43,108,246,.25); }
.btn.primary:hover, .btn.btn-primary:hover { background: #1f5ce8; color: #fff; }
/* 记一笔提交按钮：全宽放大，突出主操作 */
.bk-submit {
  width: 100%; height: 46px; font-size: 16px; letter-spacing: 10px;
  padding-left: 25px; justify-content: center; border-radius: 12px;
}
/* 记一笔按钮配色调浅：比全站主按钮的深蓝更清爽（特异性需覆盖 .btn.btn-primary） */
.btn.bk-submit {
  background: #5b8df5; border-color: #5b8df5;
  box-shadow: 0 3px 12px rgba(91,141,245,.26);
}
.btn.bk-submit:hover { background: #4a7ce8; border-color: #4a7ce8; color: #fff; }
.bk-submit:active { transform: scale(.985); }
.btn.danger-ghost { color: var(--danger); border-color: #ffd9d9; }
.btn.danger-ghost:hover { background: #fff5f5; color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; font-weight: 500; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-3); }
.btn.ghost:hover { background: #eef1f6; color: var(--text); }

/* ===== 布局 ===== */
.container { max-width: 1320px; margin: 0 auto; padding: 22px; min-height: calc(100vh - 170px); }
.footer { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 18px 0 30px; }
.page-head { display: flex; align-items: baseline; gap: 12px; margin: 2px 0 18px; flex-wrap: wrap; }
.page-title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.page-sub { color: var(--text-3); font-size: 12.5px; }
.head-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow-s);
}
.card h3 { font-size: 15.5px; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 900px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ===== 表单 ===== */
label.f { display: block; font-size: 12.5px; color: var(--text-2); margin: 0 0 5px; font-weight: 600; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date],
input[type=time], input[type=search], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; background: #fafbfd; outline: none; transition: .16s;
}
input:focus, select:focus, textarea:focus {
  background: #fff; border-color: #bcd2ff; box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 90px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.form-row > div { flex: 1; min-width: 140px; }
.form-row > div.narrow { flex: 0 0 130px; }
.fld { margin-bottom: 13px; }

/* ===== 列表 / 表格 ===== */
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.8px; }
.tbl th { text-align: left; color: var(--text-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:hover td { background: #fafbfe; }
.tbl .actions { white-space: nowrap; text-align: right; }
.table-wrap { overflow-x: auto; }
tr.row-disabled td { opacity: .55; }

/* ===== 标签 ===== */
.tag { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; background: #eef1f6; color: var(--text-2); margin-right: 4px; }
.tag.p-high { background: #fff0f0; color: var(--danger); }
.tag.p-mid { background: #fff7e6; color: #d9480f; }
.tag.p-low { background: #eefcf1; color: #2b8a3e; }
.tag.done { background: #eefcf1; color: #2b8a3e; }
.tag.cat { background: var(--accent-soft); color: var(--accent); }

/* ===== 提示条 ===== */
.flash { padding: 11px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 13.5px; animation: rise .2s ease; }
.flash-ok { background: #ebfbee; color: #2b8a3e; border: 1px solid #b2f2bb; }
.flash-err { background: #fff1f1; color: var(--danger); border: 1px solid #ffd9d9; }

/* ===== 收藏页：侧栏 + 卡片网格 ===== */
.layout { display: flex; gap: 22px; align-items: flex-start; }
.sidebar { width: 208px; flex: none; position: sticky; top: 80px; }
.side-title { font-size: 11.5px; font-weight: 700; color: var(--text-3); letter-spacing: .06em; padding: 0 10px 8px; }
.cat {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 10px;
  color: var(--text-2); transition: .14s;
}
.cat:hover { background: #eef1f6; color: var(--text); }
.cat.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.cat .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.cat .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat .cnt { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cat.active .cnt { color: var(--accent); opacity: .75; }
.cat .tools { display: flex; gap: 2px; }
.cat .tools button { padding: 2px 4px; border-radius: 5px; color: var(--text-3); background: none; border: 0; font-size: 12px; }
.cat .tools button:hover { background: #fff; color: var(--text); }
.addcat {
  width: 100%; margin-top: 4px; padding: 9px 10px; border-radius: 10px; border: 1px dashed var(--line);
  color: var(--text-3); font-size: 13px; text-align: left; display: flex; gap: 8px; align-items: center; background: none;
}
.addcat:hover { border-color: #bcd2ff; color: var(--accent); background: #fbfcff; }

.bmain { flex: 1; min-width: 0; }
.sec-head { display: flex; align-items: baseline; gap: 10px; margin: 2px 0 16px; flex-wrap: wrap; }
.sec-head h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.sec-head .hint { font-size: 12.5px; color: var(--text-3); }
.sec-head .tools-right { margin-left: auto; display: flex; gap: 8px; }

.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 14px; }
.bcard {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; display: flex; gap: 12px; align-items: flex-start;
  transition: transform .16s, box-shadow .16s, border-color .16s;
}
.bcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); border-color: #dbe3f0; }
.bcard.starred { border-color: #ffe58f; background: #fffdf5; }
/* 整卡超链接：透明层覆盖整个卡片，点击任意空白处都能打开网址 */
.card-link { position: absolute; inset: 0; z-index: 1; border-radius: inherit; text-decoration: none; }
.c-acts { position: absolute; top: 10px; right: 10px; display: none; gap: 3px; z-index: 2; }
.fav {
  width: 38px; height: 38px; flex: none; border-radius: 10px; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 16px;
}
.c-body { min-width: 0; flex: 1; }
.c-name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; }
.c-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-name .star-mark { color: #f59f00; font-size: 12px; }
.c-desc {
  font-size: 12.5px; color: var(--text-2); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.c-url { font-size: 11.5px; color: var(--text-3); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-url a { color: var(--text-3); text-decoration: none; }
.c-url a:hover { color: var(--accent); text-decoration: underline; }
.c-name .c-link { color: inherit; text-decoration: none; }
.bcard:hover .c-name .c-link { color: var(--accent); text-decoration: underline; }
.bcard:hover .c-acts { display: flex; }
.c-acts button {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  color: var(--text-3); background: #fff; border: 1px solid var(--line-2); font-size: 13px;
}
.c-acts button:hover { color: var(--text); border-color: #cfd8e6; }
.c-acts button.del:hover { color: var(--danger); background: #fff5f5; border-color: #ffd9d9; }
.c-acts button.star-on { color: #f59f00; }

@media (max-width: 880px) {
  .layout { flex-direction: column; gap: 14px; }
  .sidebar { width: 100%; position: static; display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
  .side-title, .addcat { display: none; }
  .cat { flex: none; border: 1px solid var(--line); background: #fff; }
  .cat .cnt, .cat .tools { display: none; }
  .bgrid { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 11px; }
}

/* ===== 弹窗 ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,.34); backdrop-filter: blur(2px);
  display: none; align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 60;
}
.overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 470px; background: #fff; border-radius: 16px;
  box-shadow: 0 24px 60px rgba(16,24,40,.22); animation: rise .18s ease; overflow: hidden;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.99); } }
.modal h3 { margin: 0; padding: 18px 22px 0; font-size: 16.5px; }
.modal .body { padding: 16px 22px 4px; display: grid; gap: 13px; }
.modal .field label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; font-weight: 600; }
.modal .field input, .modal .field textarea, .modal .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fafbfd; outline: none; transition: .16s; resize: vertical;
}
.modal .field input:focus, .modal .field textarea:focus, .modal .field select:focus {
  background: #fff; border-color: #bcd2ff; box-shadow: 0 0 0 3px var(--accent-soft);
}
.modal .field .tip { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .foot { padding: 16px 22px 20px; display: flex; gap: 10px; justify-content: flex-end; }
.modal .foot .left { margin-right: auto; }

/* ===== 日历 ===== */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-wd { text-align: center; color: var(--text-3); font-size: 12.5px; padding: 4px 0; }
.cal-day {
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  min-height: 92px; padding: 6px 8px; font-size: 12.5px; position: relative;
  min-width: 0; overflow: hidden;
}
.cal-day.blank { background: transparent; border-color: transparent; }
.cal-day.today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.cal-day .d-num { font-weight: 700; font-size: 14px; }
.cal-day .lunar { color: var(--text-3); font-size: 10.5px; margin-left: 4px; }
.cal-day .evt { margin-top: 4px; padding: 1px 6px; background: var(--accent-soft); color: var(--accent); border-radius: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; }
.cal-day .evt.done { background: #eefcf1; color: #2b8a3e; text-decoration: line-through; }
.cal-day .evt a { color: inherit; }
@media (max-width: 720px) { .cal-day { min-height: 64px; } }

/* ===== 日历升级版（月/周/日程） ===== */
.cal-toolbar { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-title { font-size: 16px; }
.cal-day.cal-add { cursor: pointer; }
.cal-day.cal-add:hover { border-color: var(--accent); background: #f7f9ff; }
.evt-time { opacity: .85; margin-right: 4px; font-size: 10.5px; }
.evt.jr { background: #fff4e6; color: #d9480f; }
/* 周视图 */
.wk-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.wk-col { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-height: 320px; }
.wk-head { padding: 8px 10px; border-bottom: 1px solid var(--line-2); background: #fafbfe; display: flex; flex-direction: column; gap: 2px; }
.wk-head .d-num { font-size: 16px; font-weight: 700; }
.wk-col.wk-today { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wk-col.wk-today .wk-head { background: var(--accent-soft); }
.wk-body { flex: 1; padding: 8px; display: flex; flex-direction: column; gap: 4px; cursor: pointer; }
.wk-body:hover { background: #f7f9ff; }
.wk-body .evt { white-space: normal; }
.wk-add-hint { margin-top: auto; text-align: center; color: var(--text-3); font-size: 12px; opacity: 0; transition: opacity .15s; }
.wk-body:hover .wk-add-hint { opacity: 1; }
/* 日程列表（Agenda） */
.ag-day { display: flex; gap: 14px; padding: 10px 4px; border-bottom: 1px solid var(--line-2); }
.ag-day:last-child { border-bottom: none; }
.ag-today { background: #f7f9ff; border-radius: var(--radius); }
.ag-date { width: 64px; flex-shrink: 0; text-align: center; }
.ag-d { font-size: 22px; font-weight: 800; color: var(--accent); }
.ag-m { font-size: 11.5px; color: var(--text-3); }
.ag-items { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.ag-items .evt { white-space: normal; padding: 5px 10px; border-radius: 8px; }
/* 颜色选择 */
.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-pick .cp { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--line-2); border-radius: 999px; padding: 4px 12px 4px 6px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.color-pick .cp input { width: 14px; height: 14px; accent-color: var(--c, var(--accent)); margin: 0; }
.color-pick .cp.sel { border-color: var(--c, var(--accent)); color: var(--text); background: #f7f9ff; }
/* 弹窗内删除条 / 悬浮添加按钮 */
.modal-delbar { display: flex; justify-content: flex-end; padding: 0 0 8px; }
.fab { position: fixed; right: 26px; bottom: 30px; width: 52px; height: 52px; border-radius: 50%; border: none; background: var(--accent); color: #fff; font-size: 26px; line-height: 1; box-shadow: 0 8px 20px rgba(43,108,246,.35); cursor: pointer; z-index: 60; transition: transform .15s, box-shadow .15s; }
.fab:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(43,108,246,.45); }

/* ===== 笔记编辑器（基础，增强样式见文末“博客富文本编辑器”） ===== */
#editor pre, #editor code, .note-content pre, .note-content code {
  background: #f4f6f9; border-radius: 4px; font-family: Consolas, Menlo, monospace; font-size: 13px;
}
#editor pre, .note-content pre { padding: 8px 10px; overflow-x: auto; }
#editor blockquote, .note-content blockquote {
  border-left: 3px solid var(--accent); padding-left: 10px; color: var(--text-2); margin: 6px 0;
}
#editor img, .note-content img { max-width: 100%; }
#editor mark, .note-content mark { background: #fff3bf; }
.note-content { line-height: 1.8; }

/* ===== 首页统计 ===== */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
@media (max-width: 720px) { .stat-row { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow-s); }
a.stat { display: block; text-decoration: none; color: inherit; transition: transform .16s, box-shadow .16s, border-color .16s; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); border-color: #dbe3f0; }
a.stat:hover .num { color: var(--accent); }
a.stat:hover .lbl { color: var(--accent); }
.stat .num { font-size: 24px; font-weight: 800; color: var(--accent); }
.stat .lbl { color: var(--text-3); font-size: 12.5px; }

/* ===== 通用列表行 ===== */
.list-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line-2); position: relative; }
.list-item:last-child { border-bottom: none; }
.list-item .grow { flex: 1; min-width: 0; }
/* 整行超链接：透明层铺满整行 */
.list-item .row-link { position: absolute; inset: 0; z-index: 1; text-decoration: none; }
.list-item:hover { background: #fafbfe; }
.list-item:hover .small-title { color: var(--accent); }
.muted { color: var(--text-3); font-size: 12.5px; }
.small-title { font-weight: 600; }
.empty {
  padding: 56px 20px; text-align: center; color: var(--text-3);
  border: 1px dashed var(--line); border-radius: var(--radius); background: #fbfcfe; font-size: 13px;
}
.empty .big { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }
.stars { color: #f59f00; }
.qk-item { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; }
.priority-high { border-left: 3px solid var(--danger); }

/* ===== 登录注册 ===== */
.auth-box { max-width: 410px; margin: 8vh auto 0; }
.auth-box .card { padding: 30px; border-radius: 16px; }
.auth-box h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.auth-box .sub { text-align: center; color: var(--text-3); font-size: 12.5px; margin-bottom: 20px; }
.auth-box .alt { text-align: center; margin-top: 14px; font-size: 13px; color: var(--text-3); }

/* ---------- 记账本 ---------- */
.row4 { display: grid; grid-template-columns: 1.2fr 0.8fr 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .row4 { grid-template-columns: 1fr 1fr; } }
.bill-item { border-bottom: 1px solid var(--line-2); padding: 12px 2px; }
.bill-item:last-child { border-bottom: none; }
.bill-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bill-line .b-cat { font-weight: 600; font-size: 13.5px; }
.bill-line .b-note { color: var(--text-2); font-size: 13px; flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-line .b-amt { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; margin-left: auto; white-space: nowrap; }
.amt-in  { color: #e8590c; }
.amt-out { color: var(--text-1); }
.v-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.v-box { position: relative; }
.v-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; cursor: zoom-in; }
.v-file { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px dashed var(--line); font-size: 11px; color: var(--text-2); background: #f8fafc; text-decoration: none; }
.v-del { position: absolute; top: -6px; right: -6px; display: none; }
.v-box:hover .v-del { display: block; }
.v-del button { width: 18px; height: 18px; border-radius: 50%; border: none; background: #e03131; color: #fff; font-size: 10px; line-height: 1; cursor: pointer; }

/* ---------- 多账簿切换条 ---------- */
.bk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.bk-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; background: var(--panel); font-size: 13px; }
.bk-chip a { color: var(--text-2); text-decoration: none; }
.bk-chip.active { border-color: var(--accent); background: var(--accent-soft); }
.bk-chip.active a { color: var(--accent); font-weight: 600; }
.bk-chip.bk-add { border-style: dashed; color: var(--text-3); cursor: pointer; }
.bk-chip.bk-add:hover { border-color: var(--accent); color: var(--accent); }
.bk-mgr { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 0 2px; line-height: 1; }
.bk-mgr:hover { color: var(--accent); }

/* ---------- 账单表格 ---------- */
.bill-tbl .note-cell { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bill-tbl .v-toggle { padding: 3px 10px; font-size: 12px; }
.bill-tbl tr.bill-extra > td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); }
.bill-tbl tr.bill-editrow > td { padding: 12px; border-bottom: 1px solid var(--line-2); }
.bill-tbl .bal-cell { color: var(--text-2); font-variant-numeric: tabular-nums; }
.bill-tbl tfoot tr.add-row td { border-top: 2px solid var(--line); border-bottom: none; background: #f8fafc; padding: 8px 10px; }
.bill-tbl tfoot tr.add-row input, .bill-tbl tfoot tr.add-row select { font-size: 12.5px; padding: 5px 8px; }

/* ---------- 日历农历 / 节日 / 休班 ---------- */.cal-day .lunar { color: var(--text-3); font-size: 10.5px; margin-left: 4px; }
.lunar.fest { color: #e03131; font-weight: 700; }
.lunar.term { color: #1971c2; }
.hd { display: inline-block; font-size: 10px; line-height: 1; padding: 2px 4px; border-radius: 4px; margin-left: 3px; font-weight: 700; vertical-align: 1px; }
.hd-off { background: #fff0f0; color: #e03131; }
.hd-work { background: #fff4e6; color: #e8590c; }
.wk-head .lunar { font-size: 11.5px; }

/* ---------- 笔记中心 · 博客模式 ---------- */
.blog-feed { max-width: 860px; margin: 0 auto; }
.blog-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.blog-cats .bc { border: 1px solid var(--line); border-radius: 999px; padding: 5px 16px; font-size: 13px; background: var(--panel); color: var(--text-2); text-decoration: none; }
.blog-cats .bc:hover { border-color: var(--accent); color: var(--accent); }
.blog-cats .bc.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

.post-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 20px 24px 16px; margin-bottom: 16px; position: relative; transition: box-shadow .15s, transform .15s; }
.post-card:hover { box-shadow: var(--shadow-m); transform: translateY(-1px); }
.post-card.pinned { border-color: #ffe58f; background: #fffdf5; }
.pc-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pc-pin { color: #e8590c; font-size: 12px; font-weight: 600; }
.pc-acts { margin-left: auto; display: flex; gap: 6px; align-items: center; opacity: 0; transition: opacity .15s; }
.post-card:hover .pc-acts { opacity: 1; }
.pc-acts a { color: var(--text-3); text-decoration: none; font-size: 14px; }
.pc-acts a:hover { color: var(--accent); }
.pc-acts button { border: none; background: none; color: var(--text-3); cursor: pointer; font-size: 13px; padding: 0; }
.pc-acts button:hover { color: var(--danger); }
.post-cat { display: inline-block; font-size: 11.5px; font-weight: 600; color: var(--accent); background: var(--accent-soft, #eef3ff); border-radius: 999px; padding: 2px 10px; text-decoration: none; }
a.post-cat:hover { text-decoration: none; opacity: .85; }
.post-title { margin: 2px 0 8px; font-size: 20px; line-height: 1.4; }
.post-title a { color: var(--text-1); text-decoration: none; }
.post-title a:hover { color: var(--accent); }
.post-excerpt { color: var(--text-2); font-size: 14px; line-height: 1.75; margin: 0 0 12px; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-3); font-size: 12.5px; }
.post-meta .tag { text-decoration: none; }
.post-meta .tag:hover { color: var(--accent); }
.pc-read { margin-left: auto; color: var(--accent); text-decoration: none; font-weight: 600; }
.pc-read:hover { text-decoration: underline; }

/* 阅读页 */
.post-full { max-width: 860px; margin: 0 auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-s); padding: 34px 42px 26px; }
.post-title-lg { font-size: 27px; line-height: 1.35; margin: 10px 0 8px; }
.post-head { border-bottom: 1px solid var(--line-2); padding-bottom: 16px; margin-bottom: 20px; }
.post-actions { display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--line-2); margin-top: 26px; padding-top: 16px; }
.post-content { font-size: 15.5px; line-height: 1.9; color: var(--text-1); word-break: break-word; }
.post-content h2 { font-size: 21px; margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
.post-content h3 { font-size: 17.5px; margin: 18px 0 8px; }
.post-content p { margin: 10px 0; }
.post-content a { color: var(--accent); }
.post-content blockquote { margin: 14px 0; padding: 10px 16px; border-left: 4px solid var(--accent); background: #f6f9ff; border-radius: 0 8px 8px 0; color: var(--text-2); }
.post-content pre { background: #0d1b2a; color: #dce8f5; padding: 14px 16px; border-radius: 10px; overflow-x: auto; font-size: 13.5px; line-height: 1.7; }
.post-content code { background: #eef2f8; border-radius: 4px; padding: 1px 6px; font-size: 13.5px; }
.post-content pre code { background: none; padding: 0; }
.post-content ul, .post-content ol { padding-left: 26px; margin: 10px 0; }
.post-content li { margin: 4px 0; }
.post-content img { max-width: 100%; border-radius: 8px; }
.post-content hr { border: none; border-top: 1px solid var(--line-2); margin: 20px 0; }
@media (max-width: 720px) { .post-full { padding: 22px 18px 18px; } .post-title { font-size: 18px; } .post-title-lg { font-size: 22px; } }

/* ============ 博客富文本编辑器 ============ */
.editor-wrap { border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #fff; }
.editor-wrap.fs {
  position: fixed; inset: 0; z-index: 999; border-radius: 0; border: none;
  display: flex; flex-direction: column; max-width: none; margin: 0; padding: 0;
  overflow-y: auto;
}
.editor-wrap.fs #editor { flex: 1; min-height: 0; border: none; border-radius: 0; box-shadow: none; max-width: 860px; width: 100%; margin: 0 auto; padding: 0; }
.editor-wrap.fs #editor .ql-editor { min-height: 0; height: 100%; max-width: 860px; margin: 0 auto; padding: 24px 20px 80px; }
.editor-toolbar {
  padding: 6px 8px; background: #f7f9fd; border-bottom: 1px solid var(--line-2);
  position: sticky; top: 56px; z-index: 5;
}
.editor-wrap.fs .editor-toolbar { top: 0; }
.tb-row { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tb-row + .tb-row { margin-top: 4px; padding-top: 6px; border-top: 1px dashed var(--line-2); }
.editor-toolbar button {
  border: 1px solid transparent; background: none; border-radius: 6px;
  padding: 4px 8px; font-size: 13px; color: var(--text-2); cursor: pointer; line-height: 1.4;
}
.editor-toolbar button:hover { border-color: #bcd2ff; color: var(--accent); background: #fbfcff; }
.editor-toolbar button.on { border-color: #bcd2ff; color: var(--accent); background: var(--accent-soft); }
.editor-toolbar select {
  border: 1px solid var(--line-2); border-radius: 6px; padding: 4px 6px;
  font-size: 13px; color: var(--text-1); background: #fff; cursor: pointer;
}
.tb-sep { width: 1px; height: 18px; background: var(--line-2); margin: 0 4px; }
.tb-color {
  position: relative; display: inline-flex; align-items: center; gap: 2px;
  border: 1px solid transparent; border-radius: 6px; padding: 3px 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer; font-weight: 600;
}
.tb-color:hover { border-color: #bcd2ff; color: var(--accent); background: #fbfcff; }
.tb-color input[type="color"] {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer;
}
.editor-count { font-size: 12.5px; color: var(--text-3); margin-right: 4px; }
/* Quill 编辑器：外壳高度由内部 .ql-editor 撑起，排版样式也挂在 .ql-editor 上 */
#editor .ql-editor {
  min-height: 380px; outline: none; font-size: 15.5px; line-height: 1.9;
  font-family: inherit; color: var(--text-1); word-break: break-word;
  -webkit-user-select: text; user-select: text; cursor: text;
}
#editor:focus { box-shadow: none; border-color: transparent; }
#editor h1 { font-size: 24px; margin: 20px 0 12px; }
#editor h2 { font-size: 21px; margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); }
#editor h3 { font-size: 17.5px; margin: 16px 0 8px; }
#editor h4 { font-size: 15.5px; margin: 14px 0 6px; }
#editor p { margin: 10px 0; }
#editor table { border-collapse: collapse; margin: 12px 0; width: auto; min-width: 240px; }
#editor th, #editor td { border: 1px solid #c9d4e3; padding: 6px 12px; font-size: 14px; }
#editor th { background: #eef3fb; font-weight: 600; }
.post-content table { border-collapse: collapse; margin: 14px 0; }
.post-content th, .post-content td { border: 1px solid #d5deea; padding: 7px 12px; font-size: 14.5px; }
.post-content th { background: #f2f6fc; font-weight: 600; }
.post-content h1 { font-size: 24px; margin: 22px 0 12px; }
.post-content h4 { font-size: 15.5px; margin: 14px 0 6px; }
.post-content figcaption { text-align: center; color: var(--text-3); font-size: 13px; margin-top: 4px; }

/* ============ Quill 工具栏适配（中文标签 + 触摸友好） ============ */
#note-form .ql-toolbar.ql-snow {
  border: none; border-bottom: 1px solid var(--line-2);
  padding: 6px 8px; font-family: inherit; background: #f7f9fd;
}
#note-form .ql-toolbar.ql-snow .ql-formats { margin-right: 12px; }
#note-form .ql-toolbar.ql-snow button { width: auto; min-width: 28px; }
#note-form .ql-toolbar.ql-snow .ql-picker { height: 28px; }
#note-form .ql-toolbar.ql-snow .ql-picker-label { font-size: 13.5px; line-height: 26px; }
#note-form .ql-snow .ql-picker.ql-header .ql-picker-label::before { content: '正文'; }
#note-form .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="1"]::before { content: '标题 H1'; }
#note-form .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before { content: '标题 H2'; }
#note-form .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before { content: '标题 H3'; }
#note-form .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="1"]::before { content: '标题 H1'; }
#note-form .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: '标题 H2'; }
#note-form .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: '标题 H3'; }
#note-form .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="false"]::before { content: '正文'; }
#note-form .ql-fullscreen-btn { padding: 0 8px !important; font-size: 15px; }
#note-form .ql-fullscreen-btn.on { border-color: #bcd2ff; color: var(--accent); background: var(--accent-soft); }
/* 编辑器下方：全屏按钮 + 字数 */
.editor-meta { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.editor-meta #btn-fullscreen {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 6px 12px; font-size: 13px; color: var(--text-2); cursor: pointer;
}
.editor-meta #btn-fullscreen:hover { border-color: #cfd8e6; background: #fbfcfe; }
/* 全屏时：退出按钮浮在右上角 */
.editor-wrap.fs + .editor-meta { position: fixed; top: 10px; right: 10px; z-index: 1000; margin: 0; }
.editor-wrap.fs + .editor-meta .editor-count { display: none; }
.editor-wrap.fs + .editor-meta #btn-fullscreen { box-shadow: 0 4px 14px rgba(16, 24, 40, .22); border-color: var(--line-2); }

/* ============ 编辑器图片缩放工具条 ============ */
#img-bar {
  display: none; position: absolute; z-index: 1000; gap: 2px; align-items: center;
  background: #223047; border-radius: 8px; padding: 4px 6px;
  box-shadow: 0 4px 16px rgba(13, 27, 42, .35); white-space: nowrap;
}
#img-bar button {
  border: none; background: none; color: #e8eef7; font-size: 12px;
  padding: 4px 8px; border-radius: 5px; cursor: pointer; line-height: 1.3;
}
#img-bar button:hover { background: #33465f; }
.ib-sep { width: 1px; height: 16px; background: #40536e; margin: 0 4px; }
#editor img { cursor: pointer; }
#editor img.img-selected { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ============ 特殊字符面板 ============ */
#char-pop {
  display: none; position: absolute; z-index: 1000; flex-wrap: wrap; gap: 2px;
  width: 320px; max-width: calc(100vw - 20px); padding: 8px;
  background: #223047; border-radius: 10px; box-shadow: 0 4px 16px rgba(13, 27, 42, .35);
}
#char-pop button {
  width: 28px; height: 28px; border: none; background: none; color: #e8eef7;
  font-size: 15px; border-radius: 6px; cursor: pointer; line-height: 1;
}
#char-pop button:hover { background: #33465f; }

/* ============ PWA：手机底部标签栏（≤720px 显示） ============ */
.app-nav { display: none; }

/* ============ 「我的」页全部功能宫格 ============ */
.apps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.app-cell {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 13px 4px 11px; border-radius: 12px; background: #f8fafd;
  color: var(--text-2); font-size: 12.5px; text-decoration: none; transition: .15s;
}
.app-cell:hover { background: var(--accent-soft); color: var(--accent); }
.app-cell .ai { font-size: 22px; line-height: 1; }
@media (max-width: 720px) { .apps-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; } .app-cell { padding: 11px 2px 9px; } }

/* ============ 移动端整体优化（≤720px） ============ */
@media (max-width: 720px) {
  /* 触摸体验：去点按高亮，按压有反馈 */
  body, a, button { -webkit-tap-highlight-color: transparent; }
  .btn:active, .app-nav a:active, .nav-item:active, .app-cell:active { transform: scale(.96); }

  /* 顶栏精简：主导航交给底部标签栏，顶栏只留品牌+用户 */
  .topbar .nav { display: none; }
  .topbar-inner { padding: 10px 14px; gap: 10px; }
  .brand { font-size: 15px; }
  .who { max-width: 110px; padding: 5px 9px; }

  /* 页面留白收紧 */
  .container { padding: 14px 12px 90px; }
  .card { padding: 15px 14px; border-radius: 12px; margin-bottom: 13px; }
  .page-head { margin: 0 0 13px; }
  .page-title { font-size: 17.5px; }
  .footer { padding-bottom: 84px; }

  /* 输入框 16px 防 iOS 聚焦自动放大 */
  input[type=text], input[type=email], input[type=password], input[type=url], input[type=date],
  input[type=time], input[type=search], select, textarea { font-size: 16px; padding: 9px 11px; }
  input[type=date] { min-height: 42px; }

  /* 触摸目标加大 */
  .btn { height: 40px; padding: 0 14px; font-size: 13.5px; }
  .btn.sm { height: 33px; padding: 0 11px; }
  .nav-item { display: none; }

  /* 表单两列自适应：手机上不再固定 130px 窄列 */
  .form-row { gap: 9px; }
  .form-row > div { flex: 1 1 46%; min-width: 0; }
  /* 内联 flex:2 的主字段（如“任务内容”）手机上独占一行——!important 压过内联 flex:2 的 0 基准 */
  .form-row > div[style*="flex:2"] { flex: 1 1 100% !important; }
  .form-row > div.narrow { flex: 1 1 46%; }

  /* 待办列表项：手机上操作按钮换到第二行，标题不再被挤成竖条 */
  .list-item { flex-wrap: wrap; row-gap: 6px; }
  .list-item .td-toggle { order: 0; }
  .list-item .td-main { order: 1; flex: 1 1 calc(100% - 56px); }
  .list-item .td-main .small-title { white-space: normal; }
  .list-item .td-tag { order: 2; margin-right: auto; }
  .list-item .td-editform { order: 9; flex: 1 1 100%; }

  /* 列表/弹窗更紧凑 */
  .list-item { padding: 10px 2px; }
  .overlay { padding: 3vh 12px; }
  .modal .body { padding: 14px 16px 4px; }
  .modal .foot { padding: 13px 16px 17px; }
  .modal .foot .btn { flex: 1; justify-content: center; }

  /* 表格横向滚动顺手 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  .tbl { font-size: 13.2px; }

  /* 日历周视图可横向滑动 */
  .wk-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .wk-col { min-width: 108px; }

  /* 编辑器工具栏在小屏更密 */
  .editor-toolbar button { padding: 4px 7px; font-size: 12.5px; }
  .editor-toolbar select { max-width: 92px; }

  /* 底部标签栏：激活态加浅色底 + 顶部指示线 */
  .app-nav a.active { background: var(--accent-soft); border-radius: 10px; }
  .app-nav { padding-left: 4px; padding-right: 4px; gap: 2px; }
}

@media (max-width: 720px) {
  .app-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: #fff; border-top: 1px solid var(--line-2);
    box-shadow: 0 -4px 14px rgba(16, 24, 40, .06);
    padding: 4px 2px calc(4px + env(safe-area-inset-bottom));
  }
  .app-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
    font-size: 9.5px; color: var(--text-3); text-decoration: none;
    padding: 3px 0; border-radius: 8px; min-width: 0;
  }
  .app-nav a .ni { font-size: 18px; line-height: 1.25; }
  .app-nav a.active { color: var(--accent); font-weight: 600; }
  .app-nav a.active .ni { transform: scale(1.08); }
}

/* ============ 首页记账摘要条 ============ */
.bk-mini-sum {
  display: flex; gap: 14px; padding: 7px 10px; margin-bottom: 8px;
  background: #f8fafd; border-radius: 10px; font-size: 12.5px; color: var(--text-2);
}
.bk-mini-sum b { font-size: 13.5px; }

/* ============ 记账本 App 化（对标随手记/钱迹） ============ */
html { scroll-behavior: smooth; }

/* 本月概览大卡片 */
.bk-hero {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border-radius: 16px; padding: 20px 22px; color: #fff; margin-bottom: 16px;
  box-shadow: 0 8px 22px rgba(59, 102, 241, .25);
}
.bh-top { display: flex; justify-content: space-between; font-size: 12.5px; opacity: .88; }
.bh-bal { font-size: 34px; font-weight: 800; margin: 6px 0 14px; letter-spacing: -.5px; }
.bh-bal-sign {
  font-size: 11.5px; font-weight: 600; background: rgba(255, 255, 255, .22);
  border-radius: 999px; padding: 3px 11px; margin-left: 10px; vertical-align: 6px;
}
.bh-io { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.bh-cell { background: rgba(255, 255, 255, .14); border-radius: 12px; padding: 9px 12px; min-width: 0; }
.bh-lbl { display: block; font-size: 11.5px; opacity: .82; margin-bottom: 2px; }
.bh-cell b { font-size: 15px; font-weight: 700; white-space: nowrap; }
.bh-sub { font-size: 11.5px; opacity: .82; margin-top: 9px; line-height: 1.5; }

/* 上传凭证区：粘贴图片的落点（点一下按 Ctrl+V / 手机长按选粘贴） */
.vch-paste {
  margin-top: 4px; padding: 7px 10px; border: 1px dashed var(--line);
  border-radius: 10px; background: #f8fafc; color: var(--text-3);
  font-size: 12.5px; line-height: 1.45; text-align: center;
  cursor: pointer; caret-color: transparent; word-break: break-all;
}
.vch-paste:focus {
  outline: none; border-color: var(--accent);
  background: #eff6ff; color: var(--accent); border-style: solid;
}
.vch-paste.vp-ok {
  border-style: solid; border-color: #86efac;
  background: #f0fdf4; color: #047857;
}
.vch-paste .vp-list { display: block; margin-top: 2px; font-size: 11px; color: var(--text-3); }
.vch-paste.vp-mini { margin-top: 3px; padding: 4px 6px; font-size: 11px; }
.vch-paste.vp-mini .vp-list { font-size: 10.5px; }

/* 记账：记一笔卡片锚点定位留白（手机点「＋」跳转时标题不被吸顶栏遮住） */
#bkAddCard { scroll-margin-top: 64px; }

/* 记账：日期区间查询条（紧凑工具条，白底一体） */
.bk-range {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 10px; padding: 6px 8px; background: #fff;
  border: 1px solid var(--line); border-radius: 12px;
}
.bk-range .br-lbl { font-size: 12.5px; color: var(--text-2); white-space: nowrap; flex: 0 0 auto; }
.bk-range .br-sep { font-size: 12px; color: var(--text-3); flex: 0 0 auto; }
.bk-range input[type="date"] {
  flex: 1 1 116px; width: auto; min-width: 0; height: 30px;
  padding: 0 7px; font-size: 13px; border-radius: 8px;
}
.bk-range .btn { flex: 0 0 auto; }
.bk-range .br-clear {
  width: 30px; padding: 0; justify-content: center;
  color: var(--text-3); font-size: 12px;
}

/* 常用分类点选条 */
.cat-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: -2px 0 12px; }
.cat-chips button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; color: var(--text-2); cursor: pointer; transition: .14s;
}
.cat-chips button:hover { border-color: #bcd2ff; color: var(--accent); }
.cat-chips button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.cat-chips button.in:hover, .cat-chips button.in.active { border-color: #8ce99a; color: #2b8a3e; background: #ebfbee; }

/* 手机流水列表（桌面隐藏，≤720px 替代表格） */
.bill-flow { display: none; }
.fab-add { display: none; }

@media (max-width: 720px) {
  /* 概览卡在手机上略收 */
  .bk-hero { padding: 16px 16px; margin-bottom: 12px; }
  .bh-bal { font-size: 29px; margin-bottom: 12px; }
  .bh-io { gap: 8px; }
  .bh-cell { padding: 8px 9px; }
  .bh-cell b { font-size: 13px; }
  .bh-sub { font-size: 11px; }

  /* 日期区间查询条：压成一行「日期—日期—查询—✕」，标签让位不占行 */
  .bk-range { gap: 4px; padding: 5px 7px; }
  .bk-range .br-lbl { display: none; }
  .bk-range input[type="date"] {
    flex: 1 1 72px; min-width: 0; min-height: 0; height: 32px;
    font-size: 13px; padding: 0 5px;
  }
  .bk-range .btn { height: 32px; padding: 0 10px; font-size: 12.5px; }
  .bk-range .br-clear { width: 32px; padding: 0; }

  /* 记一笔表单：手机上强制两列（覆盖内联四列样式），标签不竖排 */
  .row4 { grid-template-columns: 1fr 1fr !important; gap: 9px; }
  .row4 .field label, .row4 label { white-space: nowrap; }
  .row4 .field input, .row4 .field select { width: 100%; min-width: 0; }
  .row4 input[type=number] { text-align: right; }

  /* 表格换流水列表 */
  .bk-detail-card .table-wrap { display: none; }
  .bill-flow { display: block; }
  .bf-dayhead {
    display: flex; justify-content: space-between; padding: 13px 4px 6px;
    font-size: 12.5px; color: var(--text-3); font-weight: 600;
  }
  .bf-item { display: flex; align-items: center; gap: 11px; padding: 10px 2px; border-bottom: 1px solid var(--line-2); }
  .bf-ico { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 19px; flex: none; }
  .bf-ico.out { background: #eef3fe; }
  .bf-ico.in { background: #ebfbee; }
  .bf-main { flex: 1; min-width: 0; }
  .bf-note { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bf-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bf-vbtn { border: none; background: none; color: var(--accent); font-size: 11.5px; padding: 0; cursor: pointer; }
  .bf-right { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
  .bf-amt { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
  .bf-edit { color: var(--text-3); font-size: 11.5px; text-decoration: none; }
  .bf-extra { padding: 8px 2px 12px; border-bottom: 1px solid var(--line-2); }
  .bf-editcard { background: #f8fafd; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; margin: 4px 0 10px; }

  /* 悬浮记账按钮 */
  .fab-add {
    display: flex; position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom));
    width: 54px; height: 54px; border-radius: 50%; z-index: 51;
    background: linear-gradient(135deg, #3b82f6, #6366f1); color: #fff;
    font-size: 28px; align-items: center; justify-content: center;
    text-decoration: none; box-shadow: 0 6px 18px rgba(59, 102, 241, .4);
  }
  .fab-add:active { transform: scale(.92); }

  /* 手机上月切换按钮一行排开 */
  .page-head > div:last-child { display: flex; gap: 6px; width: 100%; margin-top: 4px; }
  .page-head > div:last-child .btn { flex: 1; justify-content: center; }

  /* 笔记写作页：标题独占一行，分类+置顶并排 */
  #note-form .form-row > div:first-child { flex: 1 1 100%; }
  /* 正文编辑区 16px 防 iOS 聚焦缩放 */
  #editor .ql-editor { font-size: 16px; }
  /* 手机顶栏更矮，工具栏吸顶位置同步 */
  .editor-toolbar { top: 46px; }

  /* 日历月视图：格子不再被事件文字撑破，紧凑排布 */
  .cal-grid { gap: 4px; }
  .cal-day { padding: 4px 5px; min-height: 60px; }
  .cal-day .d-num { font-size: 12.5px; }
  .cal-day .lunar { font-size: 9.5px; margin-left: 2px; }
  .cal-day .evt { font-size: 10px; padding: 1px 4px; }

  /* 日历页悬浮＋按钮：抬到底部标签栏上方 */
  .fab { right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); }

  /* 待办列表：操作收进行尾「⋯」菜单 */
  .list-item .td-more { order: 3; }
}

/* ============ 待办「⋯」操作菜单 ============ */
/* 旧版行内“编辑/删除”按钮彻底隐藏（编辑表单仍由菜单调起） */
.list-item .td-edit-btn, .list-item > .td-del { display: none !important; }
.td-more {
  flex: none; width: 30px; height: 30px; border: 1px solid var(--line);
  background: #fff; border-radius: 8px; color: var(--text-3);
  font-size: 16px; line-height: 1; cursor: pointer; letter-spacing: 1px;
}
.td-more:hover { color: var(--accent); border-color: #bcd2ff; }
#td-menu {
  display: none; position: fixed; z-index: 1000; min-width: 132px; padding: 6px;
  background: #fff; border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .18);
}
#td-menu button {
  display: flex; width: 100%; align-items: center; gap: 8px;
  border: none; background: none; padding: 10px 12px; border-radius: 8px;
  font-size: 13.5px; color: var(--text); cursor: pointer;
}
#td-menu button:hover { background: #f2f5fa; }
#td-menu button[data-act="del"] { color: var(--danger); }

/* ============ 底部动作面板（ActionSheet，微信同款交互） ============ */
.as-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 1100;
  opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.as-mask.open { opacity: 1; visibility: visible; }
.as-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1101;
  background: #fff; border-radius: 18px 18px 0 0;
  padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(16, 24, 40, .18);
  transform: translateY(105%); visibility: hidden;
  transition: transform .25s ease, visibility .25s;
}
.as-sheet.open { transform: translateY(0); visibility: visible; }
.as-grip { width: 40px; height: 4px; border-radius: 2px; background: #d8e0ec; margin: 4px auto 8px; }
.as-hint { text-align: center; font-size: 12.5px; color: var(--text-3); padding: 2px 0 6px; }
.as-danger-hint { color: #e5484d; font-weight: 600; font-size: 13.5px; }
.as-btn {
  display: block; width: 100%; margin-top: 8px; padding: 13px;
  border: none; border-radius: 12px; background: #f3f6fb;
  font-size: 15px; color: var(--text); cursor: pointer; text-align: center;
}
.as-btn:active { background: #e8edf5; }
.as-btn.as-danger { color: #e5484d; font-weight: 600; }
.as-btn.as-cancel { background: #fff; border: 1px solid var(--line); color: var(--text-2); margin-bottom: 2px; }

/* ============ 置顶开关条（写作页紧凑化） ============ */
.pin-toggle {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fafbfd;
  font-size: 13px; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.pin-toggle input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }

/* ============ 写作页手机紧凑化 ============ */
@media (max-width: 720px) {
  #note-form .form-row { margin-bottom: 8px; gap: 8px; }
  #note-form label.f { margin-bottom: 3px; }
  #note-form input, #note-form select { padding: 8px 10px; }
  #note-form .fld { margin-bottom: 8px; }
  #editor .ql-editor { min-height: 230px; }
  #note-form .ql-toolbar.ql-snow { padding: 4px 5px; }
  #note-form .ql-toolbar.ql-snow .ql-formats { margin-right: 8px; }
  #note-form .ql-toolbar.ql-snow button { padding: 6px 7px; }
  .editor-toolbar button { padding: 4px 6px; }
  /* 标签输入更矮 */
  #note-form input[name="tags"] { padding: 8px 10px; }
}
