/* 好管家 */
:root {
  --primary: #4f7cff;
  --primary-dark: #3a63e0;
  --bg: #f4f6fb;
  --card: #ffffff;
  --text: #2b3245;
  --text-sub: #7a839c;
  --border: #e6e9f2;
  --danger: #e74c3c;
  --success: #27ae60;
  --warn: #f39c12;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(45, 60, 110, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

.layout { display: flex; min-height: 100vh; }

/* ---------- 侧边栏 ---------- */
.sidebar {
  --hg-nav-w: 220px;
  width: var(--hg-nav-w); flex-shrink: 0; background: #1f2740;
  color: #cfd6ea; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { width: 34px; height: 34px; }
.brand h1 { font-size: 17px; color: #fff; font-weight: 600; }
.brand .sub { font-size: 11px; color: #8d97b8; }
#nav { flex: 1; padding: 10px 8px; overflow-y: auto;
  /* 深色侧栏滚动条：细条 + 去掉原生 ▲▼ 箭头 + 轨道透明透出深蓝、滑块半透明白 */
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.22) transparent;
}
#nav::-webkit-scrollbar { width: 8px; }
#nav::-webkit-scrollbar-button { display: none !important; width: 0; height: 0; }
#nav::-webkit-scrollbar-track { background: transparent; }
#nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 6px; }
#nav::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.34); }
#nav a {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 9px;
  color: #cfd6ea; font-size: 14px; margin-bottom: 2px;
}
#nav a:hover { background: rgba(255,255,255,.07); }
#nav a.active { background: var(--primary); color: #fff; }

/* ---------- 风琴式二级菜单 ---------- */
.nav-group { margin-bottom: 2px; }
.nav-group-sys > .nav-head { color: #9fb4ff; font-weight: 600; }
.nav-head {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 10px 12px; border: none; background: transparent; border-radius: 9px;
  color: #cfd6ea; font-size: 14px; font-family: inherit; text-align: left; cursor: pointer;
}
.nav-head:hover { background: rgba(255,255,255,.07); }
.nav-arrow { margin-left: auto; font-style: normal; font-size: 11px; color: #8d97b8; transition: transform .18s ease; }
.nav-group.open .nav-arrow { transform: rotate(180deg); }
.nav-sub {
  display: none; flex-direction: column;
  margin: 2px 8px 4px 26px; padding-left: 8px;
  border-left: 2px solid rgba(255,255,255,.14);
}
.nav-group.open .nav-sub { display: flex; }
.nav-sub a { font-size: 13px; padding: 8px 10px; margin-bottom: 1px; }
.sidebar-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.sidebar-foot input {
  width: 100%; margin-top: 6px; padding: 7px 9px; border-radius: 8px; border: 1px solid #3a446b;
  background: #2a3354; color: #e6ebff; outline: none;
}
.backend-tag { display: inline-block; margin-top: 8px; font-size: 11px; color: #8d97b8; }

/* ---------- 侧栏折叠按钮：圆形，贴在侧栏右边缘、垂直居中（一半压在边线上） ---------- */
.nav-toggle {
  position: absolute; right: -13px; top: 50%; transform: translateY(-50%);
  margin: 0; flex: none; z-index: 78;
  width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; font-family: inherit; cursor: pointer;
  color: #dbe3ff; background: #1f2740;
  border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 4px 14px rgba(8, 12, 26, .28);
  transition: background .12s, color .12s, border-color .12s, transform .16s ease;
}
.nav-toggle:hover { color: #fff; background: #2b3657; border-color: rgba(120, 160, 255, .8); }
.nav-toggle:focus-visible { outline: 2px solid #8aa4ff; outline-offset: 1px; }
/* 折叠态：同一个圆钮留在边线上，箭头翻转 */
.layout.nav-collapsed .sidebar .nav-toggle { transform: translateY(-50%) rotate(180deg); }

/* ---------- 左侧菜单工具条：全部展开/折叠、滚到顶/底、左右折叠 ---------- */
.nav-tools {
  display: grid; gap: 4px;
  padding: 8px 10px 7px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.nav-tools-row { display: flex; gap: 4px; }
.nav-tools button {
  flex: 1 1 0; min-width: 0; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border-radius: 7px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.055); color: #cfd6ea;
  line-height: 1; white-space: nowrap;
  overflow: hidden;
  font-family: inherit; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.nav-tools button svg {
  width: 17px; height: 17px;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}
.nav-tools button:hover { color: #fff; background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.22); }
.nav-tools button:active { background: rgba(255,255,255,.2); }
.nav-tools button:focus-visible { outline: 2px solid #8aa4ff; outline-offset: 1px; }

/* ---------- 侧栏右边缘拖动：只调整宽度，不改变折叠态 ---------- */
.nav-resizer {
  display: none; position: absolute; right: -4px; top: 0; bottom: 0; width: 9px;
  z-index: 76; cursor: col-resize; touch-action: none;
}
.nav-resizer::after {
  content: ''; position: absolute; right: 4px; top: 0; bottom: 0; width: 2px;
  border-radius: 2px; background: rgba(255,255,255,.10);
  transition: background .12s;
}
.nav-resizer:hover::after, .nav-resizer:focus-visible::after, .nav-resizer.dragging::after {
  background: #8aa4ff;
}
.nav-resizer:focus-visible { outline: 2px solid #8aa4ff; outline-offset: 1px; }
body.nav-resizing { cursor: col-resize; user-select: none; }
@media (min-width: 901px) {
  .nav-resizer { display: block; }
  .layout.nav-collapsed .nav-resizer { display: none; }
}

/* ---------- 侧栏折叠态：只留图标；鼠标指到某个图标，右侧浮出它自己的二级菜单 ---------- */
@media (min-width: 901px) {
  .layout.nav-collapsed { padding-left: 64px; }
  .layout.nav-collapsed .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; width: 64px; height: 100vh;
    z-index: 70; overflow: visible; transition: width .16s ease;
    box-shadow: 4px 0 16px rgba(8, 12, 26, .18);
  }
  /* 折叠时：文字、箭头、底部信息全部收起，只留图标 */
  .layout.nav-collapsed .sidebar .brand > div,
  .layout.nav-collapsed .sidebar #nav a span,
  .layout.nav-collapsed .sidebar #nav a .nav-badge,
  .layout.nav-collapsed .sidebar .nav-head span,
  .layout.nav-collapsed .sidebar .nav-arrow,
  .layout.nav-collapsed .sidebar .nav-tools,
  .layout.nav-collapsed .sidebar .sidebar-top-lang,
  .layout.nav-collapsed .sidebar .sidebar-foot,
  .layout.nav-collapsed .sidebar .nav-sub { display: none; }
  .layout.nav-collapsed .sidebar .brand {
    flex-direction: column; gap: 6px; padding: 12px 0;
  }
  .layout.nav-collapsed .sidebar .brand img { width: 28px; height: 28px; }
  .layout.nav-collapsed .sidebar #nav { padding: 8px 6px; scrollbar-width: none; }
  .layout.nav-collapsed .sidebar #nav::-webkit-scrollbar { width: 0; }
  .layout.nav-collapsed .sidebar #nav a,
  .layout.nav-collapsed .sidebar .nav-head { justify-content: center; gap: 0; padding: 10px 0; }
}

/* 折叠态浮出的二级菜单：侧栏宽度不变，鼠标指到哪个图标就浮出哪一组 */
.nav-flyout {
  position: fixed; z-index: 80; display: none;
  min-width: 176px; max-width: 260px; padding: 8px;
  background: #1f2740; color: #cfd6ea;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(8, 12, 26, .42);
}
.nav-fly-title {
  padding: 3px 8px 8px; font-size: 11.5px; color: #8d97b8; letter-spacing: .4px;
}
.nav-fly-list { display: flex; flex-direction: column; gap: 2px; }
.nav-flyout .nav-fly-list a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 8px; margin: 0;
  color: #cfd6ea; font-size: 13px; text-decoration: none; white-space: nowrap;
}
.nav-flyout .nav-fly-list a:hover { background: rgba(255, 255, 255, .1); }
.nav-flyout .nav-fly-list a.active { background: var(--primary); color: #fff; }


/* ---------- 帮助弹窗：内嵌手册（页面内查看，不新开窗口） ---------- */
.hp-modal-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.hp-modal-tip { font-size: 11.5px; color: var(--text-sub); }
.hp-modal-tools { display: flex; align-items: center; gap: 8px; }
.hp-modal-frame {
  display: block; width: 100%;
  height: clamp(400px, calc(100vh - 250px), 760px);
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
}

/* ---------- 页面标题栏的帮助图标（打开手册对应章节） ---------- */
.pg-help {
  width: 30px; height: 30px; flex: none; align-self: center;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; font-family: inherit; cursor: pointer;
  font-size: 14px; font-weight: 700; line-height: 1;
  color: #fff; background: var(--primary); border: 1px solid var(--primary);
  border-radius: 50%; text-decoration: none;
  box-shadow: 0 2px 6px rgba(79, 124, 255, .3);
  transition: background .12s, transform .12s, box-shadow .12s;
}
.pg-help:hover {
  background: var(--primary-dark); border-color: var(--primary-dark);
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79, 124, 255, .4);
}

/* ---------- 主区域 ---------- */
.view { flex: 1; padding: 22px 26px 90px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.page-head h2 { font-size: 20px; }
.page-head .actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 标题栏这一排统一高度：普通按钮、主按钮、下拉框都与圆形帮助图标（30px）齐平，避免高矮不齐 */
.page-head .actions > .btn,
.page-head .actions > button.btn,
.page-head .actions > a.btn,
.page-head .actions > select {
  height: 30px;
  padding-top: 0;
  padding-bottom: 0;
  line-height: 1;
}
.page-head .actions > select { padding-left: 8px; padding-right: 8px; }

/* ---------- 多标签工作区：左侧导航点击后右侧内容区以标签形式同时打开多个页面 ---------- */
.view.has-tabs { display: flex; flex-direction: column; padding: 0; min-height: 0; height: 100vh; overflow: hidden; }
.tabbar-wrap {
  display: flex; align-items: stretch; flex: none;
  border-bottom: 1px solid var(--border); background: var(--card);
}
.tabbar {
  display: flex; align-items: stretch; gap: 4px; padding: 8px 8px 0;
  overflow-x: auto; overflow-y: hidden; flex: 1; min-width: 0;
  /* 彻底隐藏横向滚动条：改用右侧箭头按钮滚动，避免任何浏览器/模式下出现滚动条或 ▲▼ */
  scrollbar-width: none; -ms-overflow-style: none;
}
.tabbar::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* 标签栏右侧固定操作区（不随标签横向滚动），承载左右滚动箭头 + 「关闭全部」按钮 */
.tabbar-actions {
  flex: none; display: flex; align-items: center; padding: 0 16px 0 8px;
  border-left: 1px solid var(--border);
}
/* 左右滚动箭头：默认隐藏，标签溢出时由 .can-scroll 显示；到两端时 .disabled 置灰 */
.tab-scroll {
  display: none;
  align-items: center; justify-content: center;
  width: 26px; height: 26px; margin: 0 2px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card); color: var(--text-sub);
  font-size: 17px; line-height: 1; cursor: pointer; user-select: none; flex: none;
  transition: color .12s, border-color .12s;
}
.tab-scroll:hover:not(.disabled) { color: var(--primary); border-color: var(--primary); }
.tab-scroll:active:not(.disabled) { transform: translateY(1px); }
.tab-scroll:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.tab-scroll.disabled { opacity: .3; cursor: default; pointer-events: none; }
.tabbar-actions.can-scroll .tab-scroll { display: inline-flex; }
.tab-close-all {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 11px; border-radius: 14px; cursor: pointer; user-select: none;
  background: var(--card); color: var(--text-sub);
  border: 1px solid var(--border); font-size: 12px; line-height: 1; white-space: nowrap;
}
.tab-close-all:hover { color: var(--danger); border-color: var(--danger); background: #fff5f4; }
.tab-close-all:active { transform: translateY(1px); }
.tab-close-all:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.tab-close-all .tca-icon { font-size: 14px; line-height: 1; }
.tab {
  display: inline-flex; align-items: center; gap: 6px; max-width: 200px;
  padding: 8px 10px; border: 1px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0; background: #f3f5fa; color: var(--text-sub);
  font-size: 13px; cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .12s, color .12s; margin-bottom: -1px;
}
.tab:hover { background: #e9edf6; color: var(--text); }
.tab.active { background: var(--card); color: var(--primary); border-color: var(--border); font-weight: 600; box-shadow: 0 -2px 0 var(--primary) inset; }
.tab .t-icon { font-size: 14px; }
.tab .t-label { overflow: hidden; text-overflow: ellipsis; }
.tab .t-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%; font-size: 12px; line-height: 1;
  color: var(--text-sub); margin-left: 2px; flex: none;
}
.tab .t-close:hover { background: rgba(231, 76, 60, .15); color: var(--danger); }
.tab .t-pin { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; margin-left: 2px; flex: none; }
/* 页签右键菜单：固定/关闭此页/关闭左侧/关闭右侧 */
.tab-menu {
  position: fixed; z-index: 5000; min-width: 172px; padding: 5px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(20, 35, 70, .20);
}
.tab-menu-item {
  display: flex; width: 100%; align-items: center; gap: 8px;
  padding: 8px 10px; border: 0; border-radius: 7px; background: transparent;
  font: inherit; font-size: 13px; color: var(--text); text-align: left; cursor: pointer;
}
.tab-menu-item:hover:not(:disabled) { background: #eef3ff; color: var(--primary); }
.tab-menu-item.danger:hover:not(:disabled) { background: #fff5f4; color: var(--danger); }
.tab-menu-item:disabled { opacity: .38; cursor: default; }
.tab-menu-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.tmi-icon { width: 16px; text-align: center; flex: none; }
.tmi-label { min-width: 0; white-space: nowrap; }
.view.has-tabs .tab-content { flex: 1; min-height: 0; overflow: auto; padding: 16px 26px 24px; -ms-overflow-style: none; scrollbar-width: none; }
/* 彻底隐藏内容区滚动条（宽度 0），无论从哪个浏览器/滚动条模式都不会再出现右侧 ▲▼ 箭头按钮；
   内容过长时仍可用鼠标滚轮 / 触控板 / 键盘滚动 */
.view.has-tabs .tab-content::-webkit-scrollbar { width: 0; height: 0; display: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 13px;
  cursor: pointer; transition: .15s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

/* ---------- 卡片与网格 ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px; border: 1px solid var(--border);
}
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat-card b { font-size: 24px; display: block; }
.stat-card span { color: var(--text-sub); font-size: 12px; }
.stat-card.accent b { color: var(--primary); }

/* 首页「今天」行动中心：只放需要今天处理的事，不放统计图 */
.today-card {
  background: linear-gradient(135deg, #f7f9ff 0%, #fff 62%);
  border: 1px solid #dfe6f5; border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 6px; box-shadow: var(--shadow);
}
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.today-head h3 { margin: 0; font-size: 16px; }
.today-head .today-date { color: var(--text-sub); font-size: 12px; margin-left: 8px; font-weight: 400; }
.today-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.today-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 10px; }
.today-item {
  display: block; min-width: 0; padding: 12px 13px; border-radius: 10px; text-decoration: none;
  background: #fff; border: 1px solid #e4e9f4; color: var(--text); transition: border-color .16s, transform .16s, box-shadow .16s;
}
.today-item:hover { border-color: var(--primary); box-shadow: 0 6px 16px rgba(79, 124, 255, .12); transform: translateY(-1px); }
.today-item b { display: block; font-size: 22px; line-height: 1.1; }
.today-item span { display: block; color: var(--text-sub); font-size: 12px; margin-top: 3px; }
.today-item em { display: block; font-style: normal; font-size: 11.5px; color: var(--primary); margin-top: 6px; }
.today-item.warn b { color: #c77b12; }
.today-item.danger b { color: var(--danger); }
.today-item.quiet { background: #fff; border-style: dashed; }
.today-quiet { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-sub); font-size: 13px; }
.today-quiet .btn { flex: 0 0 auto; }

/* 仪表盘卡片折叠：默认只折叠「最新动态」，状态按账号记在 localStorage */
.dash-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dash-card-head h3 { margin: 0; font-size: 15px; }
.dash-toggle {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: 999px; background: #fff;
  color: var(--text-sub); padding: 3px 9px; font-size: 12px; line-height: 1.6;
  cursor: pointer; transition: border-color .16s, color .16s, background .16s;
}
.dash-toggle:hover { border-color: var(--primary); color: var(--primary); background: #f7f9ff; }
.dash-toggle-ico { font-size: 11px; line-height: 1; }
.dash-card.dash-collapsed > .dash-body { display: none; }
.dash-card.dash-collapsed .today-head,
.dash-card.dash-collapsed .dash-card-head { margin-bottom: 0; }
.dash-stats .stat-cards { margin-bottom: 0; }
.chart-card .dash-card-head h3 { margin: 0; }

/* 快速添加弹窗：三个入口 + 最小字段 */
.quick-add-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 10px 0 4px; }
.quick-add-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 10px; border: 1px solid #e1e7f2; background: #fbfcff; text-align: left; }
.quick-add-opt:hover { border-color: var(--primary); background: #f5f8ff; }
.quick-add-opt b { font-size: 14px; }
.quick-add-opt span { font-size: 12px; color: var(--text-sub); line-height: 1.5; }
.quick-add-opt .ico { font-size: 22px; line-height: 1; }
@media (max-width: 720px) {
  .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-card { padding: 14px; }
}

/* ---------- 表格 ---------- */
.table-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-sub); font-weight: 500; background: #fafbfe; position: sticky; top: 0; }
tbody tr:hover { background: #f8faff; }

/* ---------- 用户框 ---------- */
.user-box { display: flex; align-items: center; gap: 6px; }
.user-box .user-link {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0;
  padding: 5px 7px; margin: -5px -1px -5px -5px; border-radius: 10px;
  text-decoration: none; cursor: pointer;
  transition: background .16s, box-shadow .16s;
}
.user-box .user-link:hover { background: rgba(255, 255, 255, .12); }
.user-box .user-link:focus-visible { outline: 2px solid rgba(160, 190, 255, .7); outline-offset: 1px; }
.user-box .user-link .user-avatar { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.user-box .user-name { color: #e6ebff; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box .user-link:hover .user-name { color: #fff; }
.user-box .btn { background: #2a3354; border-color: #3a446b; color: #cfd6ea; }

/* ---------- 登录/注册 ---------- */
.auth-wrap { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.auth-card {
  position: relative;
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow); padding: 26px 26px 20px;
}
/* 登录框右下角：手机版入口二维码（点开显示 /m/ 地址 + 二维码） */
.auth-mqr {
  position: absolute; right: 12px; bottom: 12px;
  width: 34px; height: 34px; padding: 0; border-radius: 10px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); color: var(--text-sub);
  box-shadow: 0 2px 8px rgba(45, 60, 110, .06);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.auth-mqr:hover {
  color: var(--primary); border-color: #bcd0ff; background: #f2f6ff;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .10); transform: translateY(-1px);
}
.auth-mqr:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 420px) { .auth-mqr { right: 8px; bottom: 8px; width: 30px; height: 30px; } }

/* ---------- 独立登录模式（未登录/未配置数据库）：隐藏菜单，全屏科技感背景 ---------- */
body.auth-mode .sidebar, body.auth-mode .bottom-nav { display: none !important; }
body.auth-mode .layout { display: block; }
body.auth-mode .view { padding: 0; }
body.auth-mode {
  /* 温馨家庭背景（登录页，5 张随机）：暖色调底色 */
  background: #f3e9dc;
}
body.auth-mode .auth-wrap {
  min-height: 100vh; padding: 40px 16px;
  position: relative;
}
/* 登录背景图层：JS 随机指定 login-bg-1~5 */
body.auth-mode .auth-bg {
  position: fixed; inset: 0; z-index: 0;
  background: #f3e9dc center / cover no-repeat;
}
body.auth-mode .auth-card {
  border: none;
  position: relative; z-index: 1;
  box-shadow: 0 24px 70px rgba(96, 64, 28, .38), 0 0 0 1px rgba(255, 255, 255, .25) inset;
}

.auth-card .brand-line { text-align: center; margin-bottom: 18px; }
.auth-card .brand-line img { width: 44px; height: 44px; }
.auth-card .brand-line h1 { font-size: 18px; margin-top: 6px; }
.auth-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 18px; }
.auth-tabs button {
  flex: 1; background: none; border: none; padding: 10px; font-size: 15px; cursor: pointer;
  color: var(--text-sub); border-bottom: 2px solid transparent; margin-bottom: -2px; font-family: inherit;
}
.auth-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.auth-card .field { margin-bottom: 12px; }

/* 登录：记住用户名（用户名下拉 + 勾选框） */
.usr-wrap { position: relative; }
.usr-wrap input { padding-right: 34px !important; }
.usr-pick {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: #6b7488; cursor: pointer;
  font-size: 13px; line-height: 1; display: flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}
.usr-pick:hover { background: #eef3ff; color: var(--primary); }
.usr-pick[hidden] { display: none; }
/* 登录密码框：明文/密文切换，按钮不占额外宽度 */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 38px !important; }
.pwd-eye {
  position: absolute; right: 5px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: #6b7488; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color .15s ease, color .15s ease;
}
.pwd-eye:hover { background: #eef3ff; color: var(--primary); }
.pwd-eye:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.pwd-eye svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pwd-eye .eye-off { display: none; }
.pwd-eye.showing .eye-on { display: none; }
.pwd-eye.showing .eye-off { display: block; }
.pwd-eye.showing { color: var(--primary); }
.usr-menu {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(31, 39, 64, .16); padding: 5px;
  max-height: 206px; overflow: auto;
}
.usr-menu[hidden] { display: none; }
.usr-item {
  display: block; width: 100%; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 7px; background: transparent;
  font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
}
.usr-item:hover { background: #f2f6ff; color: var(--primary); }
.usr-item.latest::after { content: '最近'; float: right; font-size: 11px; color: #9aa3b8; }
.usr-item.clear {
  color: #b94a48; margin-top: 4px; border-top: 1px solid #f0f2f7;
  border-radius: 0 0 7px 7px;
}
.usr-item.clear:hover { background: #fff4f3; color: #b94a48; }
.remember-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-sub);
  margin: -2px 0 12px; cursor: pointer; user-select: none;
}
.remember-row input { width: auto; margin: 0; accent-color: var(--primary); cursor: pointer; }
.remember-row span { line-height: 1.4; }
.remember-row span.warn { color: #b94a48; font-weight: 600; }
.auth-foot { text-align: center; font-size: 12px; color: var(--text-sub); margin-top: 12px; }

/* ---------- 首次初始化管理员 ---------- */
.setup-note {
  padding: 11px 13px; margin-bottom: 14px; border-radius: 10px;
  background: #f2f6ff; border: 1px solid #dbe6fb;
  font-size: 12.5px; line-height: 1.7; color: #3f5b96;
}
.setup-foot { margin-top: 10px; font-size: 11.5px; line-height: 1.6; color: var(--text-sub); text-align: center; }

/* ---------- 扫码登录 ---------- */
.qr-login { display: flex; flex-direction: column; align-items: center; padding: 4px 0 2px; }
.qr-login-box {
  width: 196px; height: 196px; box-sizing: border-box; padding: 8px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
}
.qr-login-img { width: 180px; height: 180px; display: block; border-radius: 6px; }
.qr-login-empty { font-size: 13px; color: var(--text-sub); text-align: center; line-height: 1.6; }
.qr-login-tip { margin-top: 12px; font-size: 13.5px; font-weight: 600; text-align: center; }
.qr-login-tip.ok { color: #1f7a45; }
.qr-login-tip.err { color: #c0392b; }
.qr-login-sub { margin-top: 4px; font-size: 12px; color: var(--text-sub); line-height: 1.6; text-align: center; max-width: 268px; }

/* ---------- 找回密码：密保 / 请家人协助 ---------- */
.fg-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.fg-tab {
  flex: 1; padding: 8px 6px; font-size: 13px; font-family: inherit; cursor: pointer;
  border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--text-sub);
  transition: border-color .15s, color .15s, background .15s;
}
.fg-tab:hover { border-color: var(--primary); color: var(--primary); }
.fg-tab.active { border-color: var(--primary); background: #eef3ff; color: var(--primary); font-weight: 600; }
/* 等待家人确认：转圈 + 文案 */
.fg-wait {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 18px 12px; background: var(--bg-sub, #f4f6fb); border-radius: 10px;
  font-size: 13.5px; color: var(--text-sub);
}
.fg-spin {
  width: 15px; height: 15px; border-radius: 50%; flex: none;
  border: 2px solid #d3dcf0; border-top-color: var(--primary);
  animation: fgspin .8s linear infinite;
}
@keyframes fgspin { to { transform: rotate(360deg); } }
.fg-ok {
  padding: 10px 12px; border-radius: 10px; font-size: 13.5px;
  background: #eaf7ef; color: #1f7a45; border: 1px solid #c9ecda;
}
.fg-tip {
  padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.6;
  background: #fff7e8; color: #8a5a12; border: 1px solid #f4e2c2;
}
.fg-code { letter-spacing: 2px; font-family: ui-monospace, Consolas, "Courier New", monospace; text-transform: uppercase; }
/* 协助码展示（家人端弹窗）：大字、易读、可一眼念给对方 */
.hp-code-tip { font-size: 13px; color: var(--text-sub); line-height: 1.7; }
.hp-code {
  margin: 12px 0 4px; padding: 16px 12px; text-align: center;
  font-family: ui-monospace, Consolas, "Courier New", monospace; font-size: 27px; font-weight: 700;
  letter-spacing: 4px; color: var(--primary); background: #f2f6ff;
  border: 1px dashed #b9cdf5; border-radius: 12px; user-select: all;
}

/* ---------- Excel 导入 ---------- */
.import-drop { border: 1.5px dashed var(--border); border-radius: 12px; padding: 20px 16px; text-align: center; cursor: pointer; background: #fbfcff; transition: .15s; }
.import-drop:hover, .import-drop.on { border-color: var(--primary); background: #f2f6ff; }
.import-drop.picked { border-style: solid; border-color: var(--primary); background: #f6f9ff; }
.imp-drop-icon { font-size: 26px; line-height: 1.2; }
.imp-drop-text { font-size: 13px; margin: 6px 0 4px; font-weight: 500; }
.imp-drop-hint { font-size: 11.5px; color: var(--text-sub); }
.imp-tip { font-size: 12.5px; color: var(--text-sub); margin: 4px 0 10px; }
.imp-stat-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 8px; }
.imp-stat { flex: 1; min-width: 80px; background: #f7f9fd; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; text-align: center; }
.imp-stat b { display: block; font-size: 17px; line-height: 1.4; }
.imp-stat b.ok { color: var(--success); }
.imp-stat b.err { color: var(--danger); }
.imp-stat span { font-size: 11.5px; color: var(--text-sub); }
.imp-created { font-size: 12px; color: #8a6212; background: #fff8e8; border: 1px solid #f6e2b3; border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; }
.imp-sub { font-size: 12px; font-weight: 600; margin: 12px 0 6px; color: var(--text-sub); }
.imp-errors { max-height: 170px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.imp-err { display: flex; gap: 10px; font-size: 12px; padding: 6px 10px; border-bottom: 1px solid #f0f2f8; }
.imp-err:last-child { border-bottom: none; }
.imp-err b { color: var(--danger); flex: 0 0 66px; font-weight: 600; }
.imp-err.warn b { color: #b7791f; }
.imp-preview { max-height: 150px; overflow: auto; font-size: 12px; color: var(--text-sub); background: #fafbfe; border-radius: 10px; padding: 8px 10px; line-height: 1.8; }

/* ---------- 盘点进度 ---------- */
.progress { height: 10px; background: #eef1f8; border-radius: 6px; overflow: hidden; margin-bottom: 6px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), #8fb3ff); border-radius: 6px; transition: width .2s; }
tr.row-danger td { background: #fff7f6; }

/* ---------- 搜索历史 / 命中高亮 ---------- */
.search-history { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-sub); margin: 6px 0 12px; }
.search-history .chip { cursor: pointer; background: #f2f4fa; border: 1px solid var(--border); color: var(--text); border-radius: 14px; padding: 3px 10px; font-size: 12px; }
.search-history .chip:hover { border-color: var(--primary); color: var(--primary); }
.search-history .chip.ghost { background: transparent; color: var(--text-sub); }
mark { background: #fff3bf; color: inherit; padding: 0 2px; border-radius: 3px; }
.list-hint { font-size: 12px; color: var(--text-sub); margin: 0 0 10px; }

/* ---------- 数据存储 ---------- */
.storage-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.storage-row:last-child { border-bottom: none; }
.storage-row .k { color: var(--text-sub); }
/* 数据存储页各面板折叠：标题行常驻，内容收进 body */
.st-card-head {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 0 !important; padding: 2px 0; border-radius: 7px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: color .15s ease;
}
.st-card-head:hover { color: var(--primary); }
.st-card-head:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.st-caret {
  margin-left: auto; flex: none; font-size: 12px; line-height: 1;
  color: var(--text-sub); transition: transform .18s ease;
}
.st-card.collapsed .st-caret { transform: rotate(-90deg); }
.st-card.collapsed .st-card-body { display: none; }
.st-card.collapsed { padding-bottom: 14px; }
.st-card-body { margin-top: 10px; }
.opt-group { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 14px; }
.opt {
  border: 1.5px solid var(--border); border-radius: 10px; padding: 12px 16px; cursor: pointer;
  font-size: 13px; background: #fff; min-width: 150px;
}
.opt b { display: block; font-size: 14px; margin-bottom: 3px; }
.opt span { color: var(--text-sub); font-size: 12px; }
.opt.on { border-color: var(--primary); background: #f2f6ff; }
.opt-disabled { opacity: .55; cursor: not-allowed; }
.field-textarea {
  width: 100%; min-height: 96px; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 9px; font-size: 12.5px; font-family: Consolas, "Courier New", monospace;
  color: var(--text); outline: none; resize: vertical; line-height: 1.6; background: #fff;
}
.field-textarea:focus { border-color: var(--primary); }
code {
  background: #f2f4fa; border: 1px solid #e6e9f2; border-radius: 4px;
  padding: 1px 5px; font-size: 11.5px; font-family: Consolas, monospace; word-break: break-all;
}
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 8px 0; }
.check-line input { width: 16px; height: 16px; }
.status-ok { color: var(--success); }
.status-err { color: var(--danger); }
.warn-box { background: #fff8e8; border: 1px solid #f6e2b3; color: #8a6212; border-radius: 10px; padding: 10px 12px; font-size: 12.5px; line-height: 1.7; margin-top: 10px; }

/* ---------- 徽章 ---------- */
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; }
.badge.in { background: #e8f8ef; color: var(--success); }
.badge.out { background: #fef0ee; color: var(--danger); }
.badge.borrow { background: #f1ecff; color: #7c5cd6; }
.badge.tag { background: #edf1ff; color: var(--primary); }

/* ---------- 页头用户名胶囊（点击打开个人中心） ---------- */
.user-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 240px;
  padding: 4px 14px 4px 4px; border-radius: 999px;
  background: #edf1ff; color: var(--primary);
  font-size: 13px; font-weight: 600; line-height: 1; text-decoration: none;
  border: 1px solid transparent;
  transition: background .16s, border-color .16s, box-shadow .16s, transform .1s;
}
.user-chip:hover { background: #e3e9ff; border-color: rgba(79, 124, 255, .35); box-shadow: 0 2px 8px rgba(79, 124, 255, .14); color: var(--primary); }
.user-chip:active { transform: translateY(1px); }
.user-chip:focus-visible { outline: 2px solid rgba(79, 124, 255, .45); outline-offset: 2px; }
.user-chip-av { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block; flex: 0 0 auto; background: rgba(79, 124, 255, .14); }
.user-chip-av-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.user-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-go { font-size: 15px; line-height: 1; opacity: .5; margin-left: -2px; }
.mm-group-sys { background: linear-gradient(180deg,#f3f6ff,#eef2ff) !important; border: 1px solid #d7e0ff; }
/* 菜单管理：已隐藏的菜单项（仅本人侧边栏不显示，可随时恢复） */
.mm-item.hid .mm-item-label { opacity: .45; text-decoration: line-through; }
.mm-item.hid [data-iicon], .mm-item.hid [data-ticon] { opacity: .45; }
.mm-eye { filter: grayscale(.15); }
.mm-item .mm-eye { font-size: 14px; }
.mm-eye.off { background: #fdecec; border-color: #f5c2c2; }
.mm-eye.lock { opacity: .4; cursor: not-allowed; }
/* 菜单管理：分组可折叠（默认折叠），点标题行任意空白处或箭头切换
   注意：本项目的 <div class="row"> 没有 flex 定义（浏览器默认块级+基线对齐，按钮会歪），
   这里显式给标题行/菜单项行加 flex，保证折叠箭头与图标、名称、排序按钮垂直居中对齐 */
.mm-group-head { display: flex; align-items: center; cursor: pointer; user-select: none; }
.mm-item { display: flex; align-items: center; }
.mm-group-head .mm-caret { color: var(--primary); font-size: 15px; line-height: 1; padding: 3px 7px; font-weight: 700; align-self: center; }
.mm-group.collapsed .mm-group-body { display: none; }
.mm-group.collapsed .mm-group-head { opacity: .92; }

/* ---------- 消息已读/未读圆点标志 ---------- */
.msg-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.msg-dot.unread { background: var(--danger); box-shadow: 0 0 0 3px rgba(231, 76, 60, .15); animation: msgDotPulse 1.6s ease-in-out infinite; }
.msg-dot.read { background: var(--success); opacity: .5; }
@keyframes msgDotPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.3); } }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
/* 弹窗表单行间距：字段统一留白，网格布局内靠 gap 不叠加 */
.modal-body .field { margin-bottom: 14px; }
.modal-body .form-grid .field, .modal-body .form-grid .field:last-child { margin-bottom: 0; }
/* 表单内一行三列（如：数量/单位/颜色） */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.field label { display: block; font-size: 12px; color: var(--text-sub); margin-bottom: 5px; }
.field input:not([type="checkbox"]):not([type="radio"]), .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 14px; font-family: inherit; outline: none; background: #fafbff; color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.field input:not([type="checkbox"]):not([type="radio"]):hover, .field select:hover, .field textarea:hover { border-color: var(--primary); background-color: #f5f8ff; }
.field input:not([type="checkbox"]):not([type="radio"]):focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); background-color: #fff; box-shadow: 0 0 0 3px rgba(79,124,255,.22);
}
.field textarea { resize: vertical; min-height: 64px; }

/* 待办任务：负责人候选行（checkbox + 姓名，防止被 .field 全局输入样式污染） */
.todo-cand {
  display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text);
  padding: 7px 10px; border: 1px solid var(--border, #e6e9f2); border-radius: 9px;
  cursor: pointer; background: #fff; margin-bottom: 0;
}
.todo-cand:hover { border-color: var(--primary); background: var(--bg-sub, #f5f7fc); }
.todo-cand input[type="checkbox"] { width: auto; margin: 0; flex: 0 0 auto; }

/* 待办详情：汇报输入行（圆角浅灰底、聚焦主题色描边+柔光光晕） */
/* 设施详情：层 / 格结构树 */
.fs-empty { padding: 10px 2px; font-size: 12.5px; color: var(--text-sub); }
.fs-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: 8px; border-bottom: 1px solid #f4f6fb;
}
.fs-row:last-child { border-bottom: none; }
.fs-row:hover { background: #f8faff; }
.fs-ico { flex: none; font-size: 13px; }
.fs-ico.is-layer { color: #4f7cff; }
.fs-ico.is-cell { color: #8b93a7; }
.fs-name { font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; }
.fs-name:hover { color: var(--primary); }
.fs-kind { flex: none; font-size: 10.5px; color: var(--text-sub); background: #eef1f8; border-radius: 5px; padding: 0 5px; }
.fs-sub { flex: none; font-size: 11.5px; color: var(--text-sub); }
.fs-cnt { flex: none; font-size: 11.5px; color: #b3bdd0; background: #f6f8fc; border-radius: 6px; padding: 1px 7px; }
.fs-cnt.has { color: var(--primary); background: #eef3ff; font-weight: 600; }
.fs-row .btn.sm { padding: 2px 8px; font-size: 11.5px; }

/* 统一确认弹窗：圆形图标 + 标题 + 正文 + 危险红按钮 */
.cf-box { text-align: center; padding: 6px 2px 0; }
.cf-ico {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; background: #eef3ff;
}
.cf-ico.danger { background: #fdecec; }
.cf-title { font-size: 15.5px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.cf-msg { font-size: 13.5px; line-height: 1.7; color: #5a627a; word-break: break-word; }
.cf-hint { margin-top: 10px; font-size: 12px; color: var(--text-sub); }
.cf-foot { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.cf-foot .btn { min-width: 104px; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { filter: brightness(.94); }

/* 新建待办：重复结束方式整行排列（不用 .row，项目里没有定义） */
.td-repeat-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.td-repeat-hd { font-size: 12.5px; font-weight: 600; color: var(--text-sub); white-space: nowrap; }
.td-repeat-line input[type=number],
.td-repeat-line input[type=date] {
  padding: 6px 9px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 12.5px; background: #fafbff; color: var(--text); font-family: inherit;
}
.td-repeat-line input:disabled { background: #f2f4f9; color: #b3bdd0; cursor: not-allowed; }
.td-repeat-line input[type=number]:focus,
.td-repeat-line input[type=date]:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(79,124,255,.18); }

/* 新建待办：重复设置的行内单选项 */
.todo-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.todo-inline input[type=radio] { margin: 0; }

.todo-report-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.todo-report-row select {
  flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--border, #e6e9f2); border-radius: 12px;
  font-size: 13.5px; font-family: inherit; background: var(--bg-sub, #f5f7fc); color: var(--text);
  outline: none; cursor: pointer; transition: border-color .15s, background .15s;
}
.todo-report-row select:focus { border-color: var(--primary); background: #fff; }
.todo-soft-input {
  flex: 1; min-width: 100px; padding: 9px 14px; border: 1px solid var(--border, #e6e9f2); border-radius: 14px;
  font-size: 13.5px; font-family: inherit; background: var(--bg-sub, #f5f7fc); color: var(--text);
  outline: none; box-sizing: border-box; transition: border-color .15s, background .15s, box-shadow .15s;
}
.todo-soft-input:focus {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .12);
}
.todo-report-btn { border-radius: 999px; padding: 9px 22px; flex: 0 0 auto; }

/* 待办任务月历视图 */
.todo-cal-heads { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.todo-cal-head { text-align: center; font-size: 12px; font-weight: 600; color: var(--text-sub); padding: 4px 0; }
.todo-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.todo-cal-cell {
  min-height: 88px; border: 1px solid var(--border, #e6e9f2); border-radius: 10px;
  padding: 6px; background: #fff; overflow: hidden;
}
.todo-cal-cell.dim { background: var(--bg-sub, #f5f7fc); opacity: .55; }
.todo-cal-cell.today { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(79, 124, 255, .15); }
.todo-cal-day { font-size: 12.5px; font-weight: 600; margin-bottom: 4px; }
.todo-cal-cell.today .todo-cal-day { color: var(--primary); }
.todo-cal-ev {
  font-size: 11px; line-height: 1.3; padding: 2px 6px; border-radius: 6px; margin-bottom: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
}
.todo-cal-ev:hover { filter: brightness(.94); }
.te-plan { background: #fff7e0; color: #8a6100; border: 1px solid #ffd86b; }
.te-created { background: #edf1ff; color: #4f7cff; }
.te-report { background: #f1ecff; color: #7c5cd6; }
.te-done { background: #e8f8ef; color: #27ae60; }
.te-closed { background: #fdecea; color: #e74c3c; }
.todo-cal-more { font-size: 10.5px; color: var(--text-sub); margin-top: 2px; }

/* ---------- 待办任务汇总表 ---------- */
.todo-sum-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.todo-sum-table th, .todo-sum-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.todo-sum-table thead th { font-size: 12px; color: var(--text-sub); font-weight: 600; white-space: nowrap; }
.todo-sum-table tbody tr:last-child td { border-bottom: none; }
.todo-sum-table tbody tr:hover { background: var(--bg-sub, #f5f7fc); }
@media print { .todo-sum-table tbody tr:hover { background: none; } }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 28, 50, .45); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto;
}
.modal {
  position: relative;
  background: #fff; border-radius: 14px; width: 100%; max-width: 640px;
  /* flex 纵向布局：控制栏（标题栏）固定不动，内容区独立滚动 */
  display: flex; flex-direction: column;
  max-height: calc(100vh - 80px);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.2); animation: pop .18s ease;
}
.modal-body {
  flex: 1; min-height: 0;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 22px 20px;
}
/* 固定控制栏（标题+关闭按钮）：不随内容滚动，整栏可拖动 */
.modal-head {
  position: relative; flex: 0 0 auto; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: #fff;
  padding: 14px 14px 9px 22px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; flex: 1; min-width: 0; }
/* 无标题弹窗（如图片查看）：头部不占高度，仅右上角悬浮关闭按钮 */
.modal-head.bare { position: absolute; top: 10px; right: 12px; padding: 0; background: none; border-bottom: none; z-index: 6; }
/* 弹窗右上角关闭图标 */
.modal-x {
  flex: 0 0 auto;
  width: 28px; height: 28px; line-height: 26px; text-align: center;
  border-radius: 50%; font-size: 18px; color: var(--text-sub);
  cursor: pointer; user-select: none; text-decoration: none;
}
.modal-x:hover { background: var(--bg-soft, #f0f2f8); color: var(--text); }
.modal.wide { max-width: 860px; }
.modal.xl { max-width: min(1180px, 96vw); }

/* 消费流水明细弹窗：固定列宽表格，超长商户/商品名省略显示，弹窗内不出现水平滚动条 */
#bl-modal-body .table-wrap { overflow-x: hidden; }
.bl-detail-tbl { width: 100%; min-width: 0; table-layout: fixed; }
.bl-detail-tbl th, .bl-detail-tbl td { overflow: hidden; text-overflow: ellipsis; }
.bl-detail-tbl td .chip { max-width: 100%; }
.bl-detail-tbl td .btn.sm { padding: 4px 7px; }
/* 分页栏固定在顶部、水平居中；只有明细区滚动（弹窗内容区本身不再滚动） */
.modal-body:has(> #bl-modal-body) { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 12px; }
#bl-modal-body { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.bl-pager {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 0 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.bl-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
/* 明细滚动时表头吸顶（th 已有 position:sticky）：滚动区里 table-wrap 不能自己成为滚动容器，否则 sticky 失效 */
#bl-modal-body #bl-scroll .table-wrap {
  overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none;
}
#bl-modal-body #bl-scroll .bl-detail-tbl thead th { background: #fafbfe; z-index: 2; }
/* 底部提示条：固定在明细区下方，与滚动的表格之间有分隔线 */
#bl-modal-body > .list-hint {
  flex: 0 0 auto; background: #fff; border-top: 1px solid var(--border);
  padding: 8px 0 0; margin: 8px 0 0;
}
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal h3 { margin-bottom: 14px; font-size: 17px; }
.modal-head h3 { margin-bottom: 0; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 18px; }
/* 弹窗底部按钮若位于 .form-grid 内，必须独占一整行并垂直居中，避免被同行的自定义面板拉伸成「高条」 */
.form-grid .modal-foot { grid-column: 1 / -1; }

/* 标题栏拖动手柄：文字由 data-i18n 渲染，避免 CSS 写死中文 */
.modal-head h3.modal-drag { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.modal-head.dragging { cursor: grabbing; }
.modal-head.dragging h3.modal-drag { opacity: .75; }
.modal-drag-hint {
  float: right; font-size: 11px; color: var(--text-sub);
  opacity: .55; font-weight: 400; letter-spacing: 1px; pointer-events: none;
}
.modal-drag-hint .drag-icon { margin-right: 4px; letter-spacing: 1px; }

/* ---------- 家庭文件共享 ---------- */
.ff-card { cursor: default; }
.ff-card-head { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ff-card-head:hover .ff-name { color: var(--primary); }
.ff-card .ff-ic { font-size: 22px; }
.ff-card .ff-name { font-size: 14.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-badge {
  flex: 0 0 auto; font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: #f0f2f8; color: var(--text-sub); border: 1px solid var(--border);
}
.ff-badge.pub { background: rgba(79, 110, 255, .1); color: var(--primary); border-color: rgba(79, 110, 255, .25); }
.ff-badge.custom { background: rgba(230, 148, 32, .12); color: #996100; border-color: rgba(230, 148, 32, .3); }
/* 文件夹/相册封面图 */
.ff-cover {
  position: relative; height: 120px; border-radius: 9px; overflow: hidden;
  margin-bottom: 8px; cursor: pointer; background: #eef1f8;
}
.ff-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.ff-cover:hover img { transform: scale(1.04); }
.ff-cover .ff-cover-badge { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.92); }
/* 相册格子封面角标（与删除角标并排，hover 显示；当前封面常显） */
.ff-photo { position: relative; }
.ff-photo .ff-cov {
  position: absolute; top: 6px; right: 34px; width: 22px; height: 22px; line-height: 22px; text-align: center;
  background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; font-size: 12px; text-decoration: none;
  opacity: 0; transition: opacity .15s; z-index: 2; cursor: pointer;
}
.ff-photo:hover .ff-cov { opacity: 1; }
.ff-photo .ff-cov.on { opacity: 1; background: var(--primary); }
.ff-filelist { display: flex; flex-direction: column; gap: 8px; }
.ff-file {
  display: flex; align-items: center; gap: 10px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px;
}
.ff-file .ff-fic { font-size: 20px; flex: 0 0 auto; }
.ff-file .ff-fmain { flex: 1; min-width: 0; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.ff-file .ff-fmain:hover b { color: var(--primary); }
.ff-file .ff-fmain b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ff-album { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ff-photo {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  background: #eef1f8; cursor: zoom-in; border: 1px solid var(--border);
}
.ff-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ff-photo:hover { border-color: var(--primary); }
.ff-photo .ff-vph {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; font-size: 26px; background: linear-gradient(160deg, #2a3350, #171e33); color: #dfe6ff;
  padding: 8px; text-align: center; cursor: pointer;
}
.ff-photo .ff-vph span { font-size: 11.5px; line-height: 1.4; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ff-photo.is-video { cursor: pointer; }
.ff-photo .ff-del {
  position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; line-height: 20px; text-align: center;
  background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; font-size: 12px; text-decoration: none;
  opacity: 0; transition: opacity .15s; z-index: 2;
}
.ff-photo:hover .ff-del { opacity: 1; }

/* 家庭管理搜索框 */
.fam-search {
  display: flex; align-items: center; gap: 6px;
  background: #f7f9fd; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 5px 5px 5px 12px; transition: border-color .15s, box-shadow .15s, background .15s;
}
.fam-search:focus-within {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .12);
}
.fam-search .fs-ico { font-size: 15px; opacity: .55; pointer-events: none; }
.fam-search input {
  flex: 1; min-width: 0; width: auto; border: none !important; outline: none;
  background: transparent; padding: 8px 4px; font-size: 13.5px; color: var(--text);
  box-shadow: none;
}
.fam-search input::placeholder { color: #a7aec4; }
.fam-search .btn { flex: 0 0 auto; border-radius: 9px; padding: 8px 18px; }

/* ---------- 全家福：封面照 + 简介 ---------- */
/* 注意：这里的 "empty" 只是修饰类，不要被全局空状态 .empty（46px 内边距 + 虚线框 + 卡片底色）撞上 */
.fam-cover { position: relative; margin: -1px -1px 10px; border-radius: 12px 12px 0 0; overflow: hidden; background: linear-gradient(135deg, #eef2fb, #e3e9f7); }
.fam-cover.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px; border: 0; border-radius: 12px 12px 0 0; }
.fam-cover-ph { font-size: 13px; color: var(--text-sub); }
.fam-cover-img { display: block; width: 100%; min-height: 120px; max-height: 520px; object-fit: cover; cursor: zoom-in; }
.fam-cover-ops { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; z-index: 2; }
.fam-cover-ops .btn { box-shadow: 0 2px 8px rgba(0,0,0,.18); background: rgba(255,255,255,.92); }
/* 家庭名 + 简介：简介字号放大、行距放松，左侧一条主色细杠做引文感 */
.fam-name { display: inline-block; font-size: 16px; font-weight: 700; letter-spacing: .2px; color: var(--text); }
.fam-bio-row { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0 0; }
.fam-bio {
  flex: 0 1 auto; min-width: 0; max-width: 72ch;
  font-size: 13.5px; line-height: 1.7; letter-spacing: .2px;
  color: var(--text); white-space: pre-wrap;
  padding-left: 10px; border-left: 3px solid rgba(79, 124, 255, .32); border-radius: 2px;
}
.fam-bio.empty {
  color: var(--text-sub); padding: 0; border: 0; background: none;
  border-radius: 0; text-align: left; font-size: 13px; line-height: 1.6; letter-spacing: 0;
}
.fam-bio-edit {
  flex: 0 0 auto; margin-top: 1px;
  font-size: 12px; line-height: 1.6; color: var(--primary); cursor: pointer; white-space: nowrap;
  padding: 1px 9px; border-radius: 999px;
  border: 1px solid rgba(79, 124, 255, .28); background: rgba(79, 124, 255, .06);
}
.fam-bio-edit:hover { background: rgba(79, 124, 255, .16); border-color: rgba(79, 124, 255, .5); }
/* 简介里的富文本内容：段落/列表紧凑一些，别把卡片撑太高 */
.fam-bio p { margin: 0 0 4px; }
.fam-bio p:last-child { margin-bottom: 0; }
.fam-bio ul, .fam-bio ol { margin: 2px 0 2px 18px; padding: 0; }
.fam-bio li { margin: 1px 0; }
.fam-bio b, .fam-bio strong { font-weight: 700; }
.fam-bio mark { background: #fff3c4; border-radius: 3px; padding: 0 2px; }

/* ---------- 富文本编辑器（家庭简介弹窗） ---------- */
.rte { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px; background: #f7f9fd; border-bottom: 1px solid var(--border); }
.rte-btn {
  min-width: 28px; height: 26px; padding: 0 8px; font-size: 13px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 7px; cursor: pointer;
}
.rte-btn:hover { border-color: var(--primary); color: var(--primary); }
.rte-btn:active { background: #eef3ff; }
.rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 2px; }
.rte-swatch i { display: block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .08); }
.rte-body {
  min-height: 96px; max-height: 240px; overflow-y: auto; padding: 10px 12px;
  font-size: 14px; line-height: 1.7; color: var(--text); outline: none;
}
.rte-body:empty::before { content: attr(data-ph); color: #a8b0c4; pointer-events: none; }
.rte-body p { margin: 0 0 4px; }
.rte-body ul, .rte-body ol { margin: 4px 0 4px 20px; }
.rte-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 10px; border-top: 1px solid var(--border); background: #fbfcfe; }
.rte-tip { font-size: 11.5px; color: var(--text-sub); }
.rte-count { font-size: 11.5px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.rte-count.over { color: var(--danger); font-weight: 600; }

/* ---------- 提示 ---------- */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #2b3245; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: pop .2s ease; max-width: 90vw;
}
.toast.err { background: var(--danger); }

/* ---------- 物品卡片 ---------- */
.item-card { display: flex; flex-direction: column; gap: 8px; }
.item-card .thumb {
  width: 100%; height: 150px; border-radius: 9px; background: #eef1f8 center/cover no-repeat;
  display: flex; align-items: center; justify-content: center; color: #b6bed4; font-size: 34px;
  cursor: pointer;
}
.item-card .name { font-weight: 600; font-size: 15px; cursor: pointer; }
.item-card .name:hover { color: var(--primary); }
.item-card .meta { font-size: 12px; color: var(--text-sub); line-height: 1.7; }
.item-card .ops { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.loc-path { color: var(--primary); font-size: 12px; cursor: pointer; }

/* ---------- 图片上传 ---------- */
.img-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.img-picker .pick-box {
  width: 76px; height: 76px; border: 1.5px dashed #c3cbdf; border-radius: 9px; display: flex;
  align-items: center; justify-content: center; cursor: pointer; color: var(--text-sub); font-size: 12px;
  text-align: center;
}
.img-picker .pick-box:hover { border-color: var(--primary); color: var(--primary); }
.img-item { position: relative; width: 76px; height: 76px; }
.img-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); }
.img-item .del {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--danger); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1;
}

/* ---------- 户型图 ---------- */
.floorplan-wrap { position: relative; display: inline-block; max-width: 100%; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); background: #fff; }
.floorplan-wrap img { display: block; max-height: 460px; user-select: none; }
.fp-marker {
  position: absolute; transform: translate(-50%, -50%); background: var(--primary); color: #fff;
  font-size: 11px; padding: 3px 8px; border-radius: 12px; white-space: nowrap; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); border: 2px solid #fff;
}
.fp-marker.hot { background: var(--warn); }
.fp-crosshair { cursor: crosshair !important; }
.room-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 6px; background: #fafbfe; }
/* 家庭称谓列表成员头像：图片加载失败时回退到首字母默认头像 */
.kn-av-box { position: relative; width: 32px; height: 32px; flex: 0 0 32px; display: inline-flex; }
.kn-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.kn-av-t { display: inline-flex; align-items: center; justify-content: center; background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; }
.kn-av-img { position: absolute; inset: 0; display: none; }
.room-row input { flex: 1; border: none; background: transparent; outline: none; font-size: 13px; color: var(--text); }
.room-row .hint { font-size: 11px; color: var(--text-sub); }
/* 家庭成员行里的小标签（身份 / 称呼），让两个输入框的含义一眼能看懂 */
.room-row .fm-lb {
  font-size: 11.5px; color: var(--text-sub);
  background: #eef3ff; border: 1px solid #dbe5ff; border-radius: 6px;
  padding: 2px 6px; margin-right: 1px; white-space: nowrap;
}

/* ---------- 二维码 ---------- */
.qr-box { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.qr-box .qr-title { font-weight: 600; font-size: 14px; }
.qr-box .qr-sub { font-size: 11px; color: var(--text-sub); }
.labels-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.qr-box .btn.sm { margin-top: 4px; }

/* ---------- 二维码标签树 ---------- */
.form-item { margin-bottom: 10px; }
.form-label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.input { width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 14px; border: 1px solid var(--border); border-radius: 9px; outline: none; background: #fafbff; color: var(--text); transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.input:hover { border-color: var(--primary); background-color: #f5f8ff; }
.input:focus { border-color: var(--primary); background-color: #fff; box-shadow: 0 0 0 3px rgba(79,124,255,.22); }
.lb-node { padding: 6px 0; }
.lb-house { border-bottom: 1px dashed var(--border); padding: 10px 0; }
.lb-house > .lb-check { font-size: 15px; }
.lb-room { margin-left: 16px; padding: 6px 0; }
.lb-children { margin-left: 28px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.lb-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 3px 0; }
.lb-check input { width: 15px; height: 15px; accent-color: var(--primary); }
.lb-check b { font-weight: 600; }
/* 层 / 格子节点：纵向缩进（与设施/房间的横向 flex 区分） */
.lb-slot-kids { margin-left: 22px; display: block; }
/* 每个层 / 格独占一行（.lb-check 默认是 inline-flex，会被挤成一行）；
   注意只对 label 生效，别把 .lb-node 变成 flex，否则其子级会跑到同一行右侧 */
.lb-slot-kids > .lb-check,
.lb-slot > .lb-check,
.lb-fac > .lb-check { display: flex; }
.lb-slot { padding: 4px 0; }
/* 「选中 / 取消下一级」小方框：全选打勾、部分选中显示横线 */
.lb-bulk {
  flex: none; display: inline-flex; align-items: center; margin-left: 5px;
  padding: 2px; cursor: pointer; border-radius: 4px; transition: background .15s;
}
.lb-bulk:hover { background: #eef3ff; }
.lb-bulk-box {
  width: 12px; height: 12px; box-sizing: border-box; display: block; position: relative;
  border: 1.5px solid #b9c2d4; border-radius: 3px; background: #fff;
  transition: background .15s, border-color .15s;
}
.lb-bulk.all .lb-bulk-box { background: var(--primary); border-color: var(--primary); }
.lb-bulk.all .lb-bulk-box::after {
  content: ''; position: absolute; left: 3px; top: 0; width: 4px; height: 7px;
  border-right: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(45deg);
}
.lb-bulk.some .lb-bulk-box { background: #e8eefc; border-color: var(--primary); }
.lb-bulk.some .lb-bulk-box::after {
  content: ''; position: absolute; left: 2px; top: 3.5px; width: 5px; height: 2px; background: var(--primary);
}

/* 标签树上的二维码图标：查看该位置二维码 */
.lb-qr {
  flex: none; display: inline-flex; align-items: center; margin-left: 4px; padding: 2px 3px;
  color: #5f6b82; cursor: pointer; border-radius: 5px; transition: background .15s, color .15s;
}
.lb-qr-ico { display: block; }
/* 层格行按钮内的二维码图标：与文字按钮同高 */
.fs-row .btn.sm .lb-qr-ico { display: block; }
.lb-qr:hover { color: var(--primary); background: #eef3ff; }

.lb-tag { font-style: normal; font-size: 11px; color: var(--text-sub); background: #eef1f8; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
/* 子节点数量胶囊：与类型标签相邻，弱化但可直接读到下级规模 */
.lb-cnt {
  font-style: normal; font-size: 11px; line-height: 1.5; white-space: nowrap;
  color: #516d9c; background: #f2f6fd; border: 1px solid #dfe8f8;
  border-radius: 6px; padding: 0 7px; margin-left: 5px;
  font-variant-numeric: tabular-nums;
}
/* 房屋行字号更大，计数同步放大一档，避免视觉失衡 */
.lb-house > .lb-check .lb-cnt { font-size: 12px; padding: 0 8px; }
/* 二维码标签树：搜索框 + 折叠三角 */
.lb-search { margin-bottom: 10px; }
.lb-caret {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; font-size: 11px; color: #8b93a7;
  cursor: pointer; user-select: none; transition: transform .15s ease, color .15s ease;
}
.lb-caret.open { transform: rotate(90deg); }
.lb-caret:hover { color: var(--primary); }
.lb-caret-ph { visibility: hidden; cursor: default; }
/* 预览区（折叠块）：标题右侧的说明文字，非等宽字体、弱化显示 */
.lb-prev-tip { font-size: 12px; font-weight: 400; color: var(--text-sub); }
/* 预览区标题栏的「打包下载」按钮：不继承标题的加粗与字号，也不吃标题的点击展开 */
.lb-zip-btn { flex: none; font-weight: 400; white-space: nowrap; }
.lb-zip-btn:disabled { opacity: .6; cursor: default; border-color: var(--border); color: var(--text-sub); }
#lb-prev .rp-section-body { padding-top: 8px; }

/* ---------- 搜索 ---------- */
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-bar input {
  flex: 1; padding: 13px 16px; font-size: 15px; border: 2px solid var(--border); border-radius: 12px; outline: none;
  background: #fafbff; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.search-bar input:hover { border-color: var(--primary); background-color: #f5f8ff; }
.search-bar input:focus { border-color: var(--primary); background-color: #fff; box-shadow: 0 0 0 3px rgba(79,124,255,.22); }
.search-tip { color: var(--text-sub); font-size: 12px; margin-bottom: 14px; }

/* ---------- 户型房屋卡片 ---------- */
.house-card .fp-thumb { height: 130px; border-radius: 9px; background: #eef1f8 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #b6bed4; margin-bottom: 10px; }

/* 可点击放大的图片缩略图（房屋户型图等） */
.fp-thumb.zoomable { position: relative; cursor: zoom-in; }
.fp-thumb.zoomable::after {
  content: '🔍 放大'; position: absolute; right: 8px; bottom: 8px;
  background: rgba(20, 28, 50, .55); color: #fff; font-size: 11px;
  padding: 3px 9px; border-radius: 10px; opacity: 0; transition: opacity .15s; pointer-events: none;
}
.fp-thumb.zoomable:hover::after { opacity: 1; }
.fp-thumb.zoomable:hover { filter: brightness(.93); }

/* 详情弹窗明细表 */
.detail-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 13px; }
.detail-table th, .detail-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.detail-table th { color: var(--text-sub); font-weight: 500; font-size: 12px; background: #f7f9fd; }
.detail-table tr:last-child td { border-bottom: none; }

/* 关联用户搜索下拉（设施归属等单选场景） */
.user-pick { position: relative; }
.user-pick .up-input {
  width: 100%; box-sizing: border-box; padding: 9px 11px; font-size: 13.5px;
  border: 1px solid var(--border); border-radius: 9px; outline: none; background: #fafbff; color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.user-pick .up-input:hover { border-color: var(--primary); background-color: #f5f8ff; }
.user-pick .up-input:focus { border-color: var(--primary); background-color: #fff; box-shadow: 0 0 0 3px rgba(79,124,255,.22); }
.user-pick .up-list {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 10px 30px rgba(20, 28, 50, .15); max-height: 210px; overflow-y: auto; padding: 4px;
}
.user-pick.open .up-list { display: block; }
.up-item { padding: 8px 10px; border-radius: 7px; font-size: 13.5px; cursor: pointer; }
.up-item:hover { background: #f2f6ff; }
.up-item.on { background: #edf1ff; color: var(--primary); font-weight: 600; }
.up-empty { padding: 10px; font-size: 12.5px; color: var(--text-sub); text-align: center; }

/* ---------- 记录列表 ---------- */
.rec-list .rec { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: baseline; flex-wrap: wrap; }
.rec-list .rec:last-child { border-bottom: none; }
.rec { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; align-items: center; flex-wrap: wrap; }
.rec:last-child { border-bottom: none; }
.rec .muted { color: var(--text-sub); font-size: 12px; }
.rec .row-actions { margin-left: auto; display: inline-flex; gap: 6px; flex-shrink: 0; }
.rec .t { color: var(--text-sub); font-size: 12px; min-width: 128px; }
.rec .who { color: var(--warn); font-size: 12px; }
.act-in { color: var(--success); font-weight: 600; }
.act-out { color: var(--danger); font-weight: 600; }
.act-edit { color: var(--warn); font-weight: 600; }

/* ---------- 图表 ---------- */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; margin-top: 6px; }
.chart-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.chart-card h3 { font-size: 15px; margin-bottom: 12px; }
.chart-card .chart-holder { position: relative; height: 260px; }
/* 身体指标因子（健康因子第 6 维） */
.inf-body-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; color: var(--text-sub); }
.inf-body-top b { font-size: 20px; font-weight: 700; }
/* 身体指标因子（健康因子第 6 维） */
.inf-body-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px; color: var(--text-sub); }
.inf-body-top b { font-size: 20px; font-weight: 700; }
/* 收支分析：每日收支因子得分（单卡独占一行，放在 KPI 与汇总建议之间） */
.fin-chart-solo { margin: 14px 0; }
/* 收支因子每日得分曲线：独占一整行 */
.chart-card-full { grid-column: 1 / -1; }
.fin-empty {
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-sub);
  background: repeating-linear-gradient(45deg, #fafbff, #fafbff 8px, #f4f6fc 8px, #f4f6fc 16px);
  border-radius: 10px;
}

/* 收支分析：汇总建议（综合评分 + 四维评估 + 建议清单） */
.an-advice {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px 14px; margin: 0 0 18px;
}
.an-advice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.an-advice-head > b { font-size: 15px; }
.an-grade {
  font-size: 13px; font-weight: 600; border: 1px solid currentColor; border-radius: 999px;
  padding: 3px 12px; background: rgba(79, 124, 255, .06); white-space: nowrap;
}
.an-verdict { margin: 8px 0 14px; font-size: 13.5px; line-height: 1.7; color: var(--text); }
/* 宽屏 4 列；窄屏自动退成 2×2（避免 3+1 落单） */
.an-dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 12px; margin-bottom: 14px; }
.an-dim { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px 9px; background: #fbfcff; }
.an-dim-top { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-sub); }
.an-dim-lv { font-weight: 600; }
.an-dim-val { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 7px; }
.an-dim-val b { font-size: 20px; line-height: 1.1; color: var(--text); }
.an-dim-val span { font-size: 11px; color: var(--text-sub); }
.an-dim-bar { height: 5px; border-radius: 3px; background: #eef1f8; overflow: hidden; }
.an-dim-bar i { display: block; height: 100%; border-radius: 3px; transition: width .3s ease; }
.an-dim-sub { font-size: 11.5px; color: var(--text-sub); margin-top: 6px; line-height: 1.5; }
.an-tips { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.an-tip {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: 9px;
  padding: 9px 12px; background: #fbfcff;
}
.an-tip.bad { border-left-color: var(--danger); background: rgba(231, 76, 60, .05); }
.an-tip.warn { border-left-color: var(--warn); background: rgba(243, 156, 18, .07); }
.an-tip.info { border-left-color: var(--primary); background: rgba(79, 124, 255, .05); }
.an-tip.good { border-left-color: var(--success); background: rgba(39, 174, 96, .06); }
.an-tip-ico { font-size: 15px; line-height: 1.4; flex: 0 0 auto; }
.an-tip-txt b { font-size: 13px; }
.an-tip-txt p { font-size: 12.5px; color: var(--text-sub); line-height: 1.65; margin-top: 2px; }
.an-method { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 9px; }
.an-method summary { font-size: 12px; color: var(--text-sub); cursor: pointer; user-select: none; }
.an-method summary:hover { color: var(--primary); }
.an-method ul { margin: 8px 0 0 4px; padding-left: 14px; list-style: disc; }
.an-method li { font-size: 12px; color: var(--text-sub); line-height: 1.75; }
@media (max-width: 720px) {
  .an-advice { padding: 14px; }
  .an-dim-val b { font-size: 18px; }
}

/* 消费分析：明细区块折叠（默认折叠，带展开/折叠图标） */
.rp-section { border: 1px solid var(--border); border-radius: var(--radius); margin: 14px 0; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.rp-section-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; cursor: pointer; user-select: none; font-weight: 600; font-size: 15px; background: var(--card); transition: background .15s; }
.rp-section-head:hover { background: var(--card-hover, #f3f4f6); }
.rp-section-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.rp-caret { display: inline-block; color: var(--primary); font-size: 12px; transition: transform .2s ease; }
.rp-section.collapsed .rp-caret { transform: rotate(-90deg); }
.rp-section-title { flex: 1; }
.rp-section-body { padding: 4px 16px 14px; }
.rp-section.collapsed .rp-section-body { display: none; }

/* ---------- 家庭管理：三个区块（待我审批/我的家人/我发出的申请）可折叠，并排于搜索卡 ---------- */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.fam-sections { display: flex; flex-direction: column; gap: 14px; }
/* 「搜索用户」独立成块，放在家庭管理页最下方 */
.fam-search-card { margin-top: 14px; }
.fam-sections .rp-section { margin: 0; }
@media (max-width: 820px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* ---------- 报表打印区 ---------- */
.report-section { margin-bottom: 22px; }
.report-section h3 { font-size: 16px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 2px solid var(--primary); display: inline-block; }
.report-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.report-item { border: 1px solid var(--border); border-radius: 9px; padding: 8px; background: #fff; page-break-inside: avoid; }
.report-item .rimg { height: 90px; border-radius: 6px; background: #eef1f8 center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #b6bed4; margin-bottom: 6px; }
.report-item b { font-size: 13px; display: block; }
.report-item span { font-size: 11px; color: var(--text-sub); }

/* ---------- 图文报表：家庭文件统计汇总 ---------- */
.rp-files-wrap { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, 1fr); gap: 14px; align-items: start; }
.rp-fcats { display: flex; flex-direction: column; gap: 8px; }
.rp-fcat {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; box-shadow: var(--shadow); page-break-inside: avoid;
}
.rp-fcat.zero { opacity: .5; }
.rp-fcat-ic {
  width: 30px; height: 30px; flex: none; border-radius: 9px; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-sub, #eef1f8);
}
.rp-fcat-main { flex: 1; min-width: 0; }
.rp-fcat-t { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rp-fcat-t b { font-size: 13px; }
.rp-fcat-t span { font-size: 11.5px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
.rp-fcat-bar { height: 6px; border-radius: 4px; margin-top: 6px; overflow: hidden; background: var(--bg-sub, #eef1f8); }
.rp-fcat-bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #7f9dff, var(--primary, #4f7cff)); }
.rp-fcat-p { flex: none; min-width: 40px; text-align: right; font-size: 12px; color: var(--text-sub); font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .rp-files-wrap { grid-template-columns: 1fr; } }

/* ---------- 详情页 ---------- */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
.gallery { display: flex; gap: 8px; flex-wrap: wrap; }
.gallery img { width: 110px; height: 110px; object-fit: cover; border-radius: 9px; border: 1px solid var(--border); cursor: zoom-in; }
.kv { display: grid; grid-template-columns: 84px 1fr; gap: 7px 12px; font-size: 13px; }
.kv .k { color: var(--text-sub); }
.breadcrumb { font-size: 13px; color: var(--text-sub); margin-bottom: 14px; }
.breadcrumb b { color: var(--primary); }

/* ---------- 空状态 ---------- */
.empty { text-align: center; color: var(--text-sub); padding: 46px 10px; background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty .big { font-size: 38px; margin-bottom: 8px; }

/* ---------- 过滤条 ---------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.filters select, .filters input {
  padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; font-size: 13px; background: #fafbff; outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.filters select:hover, .filters input:hover { border-color: var(--primary); background-color: #f5f8ff; }
.filters input { width: 200px; }
.filters input:focus, .filters select:focus {
  border-color: var(--primary); background-color: #fff; box-shadow: 0 0 0 3px rgba(79, 124, 255, .22);
}
.filters input.fa-q { width: 250px; }

/* ---------- 设施详情：进出记录筛选 / 分页 ---------- */
.fd-rec-hint { font-size: 11.5px; color: var(--text-sub); }
.fd-pager { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; }
.fd-pager .btn.sm { padding: 5px 10px; font-size: 12px; }
.fd-pager .fd-pg-cur { cursor: default; opacity: .95; }
.fd-pg-dot { color: var(--text-sub); font-size: 12px; padding: 0 1px; }
.fd-pg-info { font-size: 11.5px; color: var(--text-sub); }
.fd-pg-size {
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 12px; background: #fafbff; color: var(--text); outline: none; cursor: pointer;
}
.fd-pg-size:hover { border-color: var(--primary); }

/* ---------- 无引用图片查看器 ---------- */
.orph-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px;
  max-height: min(52vh, 460px); overflow-y: auto; padding: 2px;
}
.orph-card {
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card, #fff);
}
.orph-thumb {
  display: flex; align-items: center; justify-content: center;
  height: 92px; border-radius: 8px; overflow: hidden;
  background: var(--bg-sub, #eef1f8); text-decoration: none;
}
.orph-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.orph-noimg { font-size: 26px; opacity: .5; }
.orph-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.orph-name {
  font-size: 11.5px; color: var(--text); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.orph-size { font-size: 11px; color: var(--text-sub); }
.orph-card .btn.sm { align-self: flex-start; }
.orph-card .btn.sm { padding: 3px 10px; font-size: 12px; }

/* ---------- 盘点详情：清单头 + 分页开关 ---------- */
.tk-list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tk-list-head .hint { font-size: 12px; color: var(--text-sub); }
.tk-switch {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; user-select: none; font-size: 12.5px; color: var(--text-sub);
}
.tk-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tk-slider {
  width: 34px; height: 19px; border-radius: 999px; background: #d7dced;
  position: relative; flex: none; transition: background .18s;
}
.tk-slider::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .18s;
}
.tk-switch input:checked + .tk-slider { background: var(--primary, #4f7cff); }
.tk-switch input:checked + .tk-slider::after { transform: translateX(15px); }
.tk-switch input:focus-visible + .tk-slider { outline: 2px solid var(--primary, #4f7cff); outline-offset: 2px; }
.tk-switch-txt { font-weight: 600; color: var(--text); }

/* ---------- 移动端 ---------- */
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .view { padding: 14px 12px 84px; }
  .bottom-nav {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
    background: #fff; border-top: 1px solid var(--border);
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
  }
  .bottom-nav a { flex: 1; text-align: center; font-size: 10px; color: var(--text-sub); padding: 5px 0; }
  .bottom-nav a span { display: block; font-size: 17px; }
  .bottom-nav a.active { color: var(--primary); }
  .view.has-tabs .tab-content { padding: 12px 12px 84px; }
  .tab { max-width: 150px; padding: 7px 8px; }
  .detail-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr; }
  .modal-mask { padding: 16px 10px; }
  .modal { max-height: calc(100vh - 32px); }
}

/* ---------- 借出管理页 ---------- */
.tabs { display: flex; gap: 4px; margin: 4px 0 14px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 8px 14px; cursor: pointer; color: var(--text-sub); font-size: 13.5px; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.loan-card .name { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.loan-card .meta { color: var(--text-sub); font-size: 12.5px; line-height: 1.7; margin-top: 4px; }

/* ---------- 批量操作条 ---------- */
.batch-bar {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; margin-top: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.batch-bar #it-batchcount { font-size: 13px; color: var(--text-sub); margin-right: auto; }
.batch-cb { position: absolute; top: 8px; left: 8px; z-index: 2; }
.batch-cb input { width: 18px; height: 18px; cursor: pointer; }
.item-card { position: relative; padding-left: 30px; }

/* ---------- 服务器二维码（扫码配置） ---------- */
.qr-center { text-align: center; padding: 8px 0; }
.qr-center img { display: inline-block; border-radius: 8px; background: #fff; padding: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; }
  .sidebar, .bottom-nav, .page-head .actions, .no-print, #toast-root { display: none !important; }
  .view { padding: 0; }
  .card, .chart-card, .report-item { box-shadow: none; }
}

/* ---------- 消息徽标 ---------- */
.nav-badge {
  display: inline-block;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  padding: 0 4px;
  vertical-align: middle;
}

/* 登录后未读消息右下角提示框 */
.msg-notify {
  position: fixed; right: 18px; bottom: 18px; z-index: 2600;
  display: flex; align-items: center; gap: 12px;
  background: #fff; color: var(--text, #222);
  border: 1px solid var(--border, #e3e7f2); border-left: 4px solid var(--primary, #4f7cff);
  border-radius: 12px; padding: 12px 14px; max-width: 320px;
  box-shadow: 0 10px 30px rgba(20, 30, 60, .18);
  cursor: pointer; user-select: none;
  animation: msgNotifyIn .3s ease-out;
}
.msg-notify.out { animation: msgNotifyOut .3s ease-in forwards; }
@keyframes msgNotifyIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes msgNotifyOut { to { opacity: 0; transform: translateX(30px); } }
.msg-notify-icon { font-size: 26px; line-height: 1; }
.msg-notify-body { display: flex; flex-direction: column; gap: 3px; }
.msg-notify-body b { font-size: 14px; }
.msg-notify-body span { font-size: 12px; color: var(--text-sub, #7a8199); }
.msg-notify-close { background: none; border: none; color: var(--text-sub, #7a8199); font-size: 18px; cursor: pointer; padding: 0 2px; line-height: 1; }
.msg-notify-close:hover { color: var(--text, #222); }

/* 对话详情回复输入区：圆角胶囊 + 聚焦光晕 */
.msg-reply-input {
  flex: 1; resize: vertical; min-height: 46px;
  border: 1.5px solid var(--border, #e3e7f2); border-radius: 14px;
  background: var(--bg-sub, #f5f7fc);
  padding: 10px 14px; font-size: 13.5px; line-height: 1.5; font-family: inherit;
  color: var(--text, #222);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.msg-reply-input:focus {
  outline: none; border-color: var(--primary, #4f7cff); background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .14);
}
.msg-reply-send { border-radius: 999px; padding: 8px 24px; align-self: flex-end; }

/* ---------- 手工记账弹窗：表单控件美化 ---------- */
.blm-form { display: flex; flex-direction: column; gap: 14px; }
.blm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.blm-grid .blm-field { min-width: 0; }
.blm-field { position: relative; }
.blm-field > label {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--text-sub, #7a8199); margin-bottom: 6px;
}
.blm-field .blm-hint { font-size: 11px; font-weight: 400; color: #a9b4c9; }
.blm-input, .blm-select {
  width: 100%; padding: 9px 12px;
  border: 1.5px solid var(--border, #dfe5f0); border-radius: 10px;
  font-size: 13.5px; font-family: inherit; outline: none;
  background: #fbfcfe; color: var(--text, #222);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.blm-input:hover, .blm-select:hover { border-color: #b9c6de; }
.blm-input:focus, .blm-select:focus {
  border-color: var(--primary, #4f7cff); background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .14);
}
.blm-input::placeholder { color: #b3bdd0; }
.blm-select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  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='%239aa6bd' stroke-width='2.5' 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 11px center; background-size: 12px;
  padding-right: 32px;
}
.blm-select:focus {
  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='%234f7cff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  /* 关键：.blm-input:focus,.blm-select:focus 的 background:#fff 简写会把 background-repeat 重置为 repeat，
     此处必须显式补回 no-repeat 与定位/尺寸，否则聚焦(点开)时蓝色箭头会被平铺成「很多蓝色向下小箭头」 */
  background-repeat: no-repeat; background-position: right 11px center; background-size: 12px;
}
.blm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 2px; }

/* 缓存候选下拉：卡片式浮层 + 圆角选项 */
.bl-cache-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 60;
  background: #fff; border: 1px solid var(--border, #dfe5f0); border-radius: 10px;
  box-shadow: 0 10px 32px rgba(30, 45, 90, .18);
  max-height: 210px; overflow: auto; margin-top: 6px; padding: 5px; display: none;
}
.bl-cache-list .bl-cache-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 10px; font-size: 13px; cursor: pointer; border-radius: 7px;
  transition: background .1s;
}
.bl-cache-list .bl-cache-opt:hover { background: #f2f6ff; }
.bl-cache-list .bl-cache-opt span { flex: 1; word-break: break-all; }
.bl-cache-del {
  color: #c2cadb; cursor: pointer; font-size: 13px; flex-shrink: 0;
  width: 20px; height: 20px; line-height: 20px; text-align: center;
  border-radius: 5px; transition: color .12s, background .12s;
}
.bl-cache-list .bl-cache-opt:hover .bl-cache-del { color: var(--danger, #e05656); }
.bl-cache-del:hover { background: #feecea; }
.bl-cache-empty { padding: 10px 12px; font-size: 12px; color: var(--text-sub, #7a8199); text-align: center; }

/* ---------- 智能助手（对话页） ---------- */
.wc-page {
  display: flex; flex-direction: column;
  height: 100%; min-height: 480px;
  padding: 18px 20px 16px;
  border: 1px solid #e5ebf8; border-radius: 24px;
  background: linear-gradient(145deg, #f8faff 0%, #eef3ff 48%, #f6f8ff 100%);
  box-shadow: 0 10px 30px rgba(45, 60, 110, .06);
}
/* 智能助手页铺满整个内容区：去掉外层留白，横向纵向都占满 */
.view.has-tabs .tab-content:has(#wc-page) { padding: 0; overflow: hidden; }
.view.has-tabs .tab-content:has(#wc-page) .wc-page {
  border: 0; border-radius: 0; box-shadow: none; min-height: 0; height: 100%;
}
.wc-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.wc-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: .3px; }
.wc-logo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 13px; font-size: 19px;
  background: linear-gradient(135deg, #5b86ff, #4f6ff5);
  box-shadow: 0 5px 14px rgba(79, 124, 255, .35);
}
.wc-sub { font-size: 12px; color: var(--text-sub); font-weight: 400; margin: 5px 0 0 46px; }
.wc-head .actions .btn { border-radius: 999px; box-shadow: 0 2px 8px rgba(45, 60, 110, .05); }

/* 消息记录区：大圆角白卡 + 柔和内阴影 */
.wc-body {
  flex: 1; min-height: 0; overflow-y: auto;
  border: 1px solid #e9eef9; border-radius: 20px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  box-shadow: inset 0 1px 0 #fff, 0 4px 18px rgba(45, 60, 110, .05);
}
.wc-list { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.wc-msg { display: flex; align-items: flex-end; }
.wc-msg.me { justify-content: flex-end; }
.wc-avatar {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  box-shadow: 0 3px 10px rgba(45, 60, 110, .10);
}
.wc-msg.bot .wc-avatar { margin-right: 10px; background: linear-gradient(135deg, #e9f0ff, #d7e4ff); }
.wc-msg.me .wc-avatar { order: 2; margin-left: 10px; background: linear-gradient(135deg, #dbe6ff, #c9d9ff); }

/* 消息气泡：22px 大圆角，靠头像一侧留小圆角做「尾巴」 */
.wc-bubble {
  position: relative; max-width: 72%; padding: 11px 16px 9px;
  border-radius: 22px; font-size: 13.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
  box-shadow: 0 4px 14px rgba(45, 60, 110, .08);
}
.wc-msg.bot .wc-bubble {
  background: linear-gradient(135deg, #e7f0ff 0%, #d2e2ff 100%); color: var(--text); border: 1px solid #c6d9f8;
  border-bottom-left-radius: 8px;
}
.wc-msg.me .wc-bubble {
  background: linear-gradient(135deg, #5b86ff 0%, #4f6ff5 100%); color: #fff;
  border-bottom-right-radius: 8px; box-shadow: 0 6px 16px rgba(79, 124, 255, .28);
}
.wc-time { display: block; margin-top: 5px; font-size: 10.5px; line-height: 1.2; opacity: .62; text-align: right; }
.wc-msg.bot .wc-time { color: var(--text-sub); }
.wc-del {
  position: absolute; top: -9px; right: -9px; width: 20px; height: 20px; line-height: 18px; text-align: center;
  border-radius: 50%; background: #fff; border: 1px solid var(--border); color: var(--text-sub);
  font-size: 11px; cursor: pointer; opacity: 0; transition: opacity .12s, color .12s, border-color .12s;
}
.wc-bubble:hover .wc-del { opacity: 1; }
.wc-del:hover { color: var(--danger); border-color: var(--danger); }
/* 可点击的对话消息（如「某天的日记」概要）：点一下弹详情 */
.wc-bubble.clickable { cursor: pointer; transition: box-shadow .15s ease, transform .15s ease; }
.wc-bubble.clickable:hover { box-shadow: 0 6px 20px rgba(79, 124, 255, .22); transform: translateY(-1px); }
.wc-bubble.clickable:active { transform: translateY(0); }
.wc-mark {
  display: none; flex-shrink: 0; width: 20px; height: 20px; margin: 0 8px 6px 0;
  border: 1.5px solid #b9c6de; border-radius: 50%; background: #fff;
  color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
.wc-page.selecting .wc-mark { display: block; }
.wc-page.selecting .wc-msg { cursor: pointer; }
.wc-page.selecting .wc-msg.sel .wc-mark { background: var(--primary); border-color: var(--primary); }
.wc-page.selecting .wc-msg.sel .wc-bubble { outline: 2px solid var(--primary); outline-offset: 2px; }

/* 多选操作栏：圆角胶囊卡片 */
.wc-selbar {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  margin: 10px 0 0; padding: 9px 14px;
  border: 1px solid #e5ebf8; border-radius: 16px; background: #fff;
  box-shadow: 0 4px 14px rgba(45, 60, 110, .05);
}
.wc-selbar .btn { border-radius: 999px; }
.wc-selcount { flex: 1; text-align: center; font-size: 12px; color: var(--text-sub); }

/* 快捷指令胶囊 + 输入栏 */
/* 快捷话题：允许换行（单行滚动会把最后一个入口裁掉，用户根本发现不了） */
.wc-chips { display: flex; flex-wrap: wrap; gap: 8px 9px; padding: 12px 2px 0; flex-shrink: 0; }
.wc-chip {
  flex-shrink: 0; padding: 7px 15px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); border: 1px solid #dbe5ff; color: var(--primary);
  font-size: 12.5px; cursor: pointer; box-shadow: 0 2px 8px rgba(45, 60, 110, .04);
  transition: transform .15s, background .15s, color .15s, box-shadow .15s;
}
.wc-chip:hover {
  background: linear-gradient(135deg, #5b86ff, #4f6ff5); color: #fff; border-color: transparent;
  transform: translateY(-2px); box-shadow: 0 6px 14px rgba(79, 124, 255, .28);
}
.wc-inputbar { display: flex; gap: 10px; padding: 12px 2px 0; flex-shrink: 0; }
.wc-input {
  flex: 1; min-width: 0; padding: 11px 18px; border: 1.5px solid #e3eafb; border-radius: 999px;
  font-size: 13.5px; font-family: inherit; outline: none; background: #fff; color: var(--text);
  box-shadow: 0 3px 12px rgba(45, 60, 110, .05);
  transition: border-color .15s, box-shadow .15s;
}
.wc-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 124, 255, .14), 0 3px 12px rgba(45, 60, 110, .05); }
.wc-send {
  border-radius: 999px; padding: 11px 28px; border-color: transparent;
  background: linear-gradient(135deg, #5b86ff, #4f6ff5);
  box-shadow: 0 6px 16px rgba(79, 124, 255, .28);
}
.wc-send:hover { background: linear-gradient(135deg, #4f7cff, #3a63e0); color: #fff; }
.wc-mic {
  flex-shrink: 0;
  width: 42px; height: 42px; padding: 0;
  border-radius: 50%;
  border: 1.5px solid #e3eafb;
  background: #fff;
  color: #5b86ff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(45, 60, 110, .06);
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.wc-mic:hover { background: #f3f6ff; border-color: #c9d7ff; }
.wc-mic.recording {
  background: #fff1f0; border-color: #ffb4ad; color: #d94a4a;
  box-shadow: 0 0 0 3px rgba(217, 74, 74, .12);
  animation: wc-mic-pulse 1.2s ease-in-out infinite;
}
@keyframes wc-mic-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(217, 74, 74, .10); }
  50% { box-shadow: 0 0 0 6px rgba(217, 74, 74, .16); }
}
.wc-learn-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
/* 「教我听懂」等弹窗里的按钮列表：高度按条目自适应（条目少时不留空白、不出滚动条），
   只有当条目多到超过父级（弹窗最大高度 calc(100vh - 80px)）的 67% 才出现纵向滚动条 */
.modal .wc-learn-list { max-height: calc((100vh - 80px) * 0.67); overflow-y: auto; padding-right: 2px; }
.wc-learn-list .btn, .wc-menu-grid .btn { justify-content: flex-start; border-radius: 12px; }
.wc-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; max-height: 320px; overflow-y: auto; }
/* 可用指令弹窗：页面菜单区可折叠（默认收起，展开后仅按钮区滚动） */
.wc-menu-sec { margin: 10px 0 0; border: 1px solid #e6ebf7; border-radius: 12px; background: #fbfcff; overflow: hidden; }
.wc-menu-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  cursor: pointer; user-select: none; font-size: 13.5px; font-weight: 600; color: #3d465c;
  transition: background .15s;
}
.wc-menu-head:hover { background: #f2f6ff; }
.wc-menu-head:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.wc-menu-head .rp-caret { font-size: 11px; }
.wc-menu-sec.collapsed .rp-caret { transform: rotate(-90deg); }
.wc-menu-title { flex: 0 0 auto; }
.wc-menu-hint { margin-left: auto; font-weight: 400; font-size: 12px; color: #8b93a8; }
.wc-menu-body { padding: 0 12px 12px; }
.wc-menu-sec.collapsed .wc-menu-body { display: none; }
.wc-menu-sec .wc-menu-grid { margin-top: 0; }
.wc-cmd-tip { margin: 6px 0 2px; font-size: 13px; color: #6b7488; line-height: 1.5; }
.wc-cmd-extra { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eef1f8; }
.wc-cmd-extra .btn { border-radius: 999px; }
/* 指令用法速查：分组标题 + 代码样式示例 */
.wc-cmd-help {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: #f6f8fe; border: 1px solid #e9eef9;
  font-size: 12px; line-height: 1.9; color: #5b6478;
}
.wc-cmd-help b { color: var(--text); }
.wc-cmd-help code {
  display: inline-block; margin: 1px 4px 1px 0; padding: 1px 6px;
  border-radius: 6px; background: #fff; border: 1px solid #e3e9f7;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: #3d5bb5;
}

@media (max-width: 900px) {
  .wc-page { height: calc(100vh - 170px); padding: 14px; border-radius: 18px; }
  .wc-sub { display: none; }
  .wc-bubble { max-width: 82%; }
  .wc-list { padding: 14px; }
}

/* ---------- 悬浮帮助按钮：长页面滚到哪儿都能点（在智能助手按钮上方） ---------- */
#fab-help {
  position: fixed; right: 30px; bottom: 92px; z-index: 59;
  width: 44px; height: 44px; padding: 0;
  border: 1px solid #dbe5ff; border-radius: 50%;
  background: #fff; color: var(--primary);
  font: 700 20px/1 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(31, 39, 64, .16);
  transition: background .15s, color .15s, transform .15s, box-shadow .15s;
}
#fab-help:hover {
  background: var(--primary); color: #fff; border-color: var(--primary);
  transform: translateY(-2px); box-shadow: 0 10px 24px rgba(79, 124, 255, .38);
}
#fab-help:active { transform: scale(.95); }
/* 登录页也保留帮助按钮：忘记密码、首次使用都能翻手册 */
#fab-help { display: none; }   /* 只给登录页用，其余页面隐藏 */

/* 版本号：侧边栏品牌标题后 + 登录页帮助按钮旁（同一个号，来自 /api/version） */
.brand h1 .ver-tag {
  font-size: 11px; font-weight: 600; color: #8d97b8;
  margin-left: 6px; letter-spacing: .2px; vertical-align: 1px;
  white-space: nowrap;
}
#login-ver { display: none; }
body.auth-mode #login-ver {
  display: inline-block; position: fixed; left: 80px; bottom: 44px; z-index: 59; line-height: 1;
  font-size: 12px; font-weight: 600; color: #8a93a8; letter-spacing: .3px;
  user-select: none; pointer-events: none;
}
@media (max-width: 760px) {
  body.auth-mode #login-ver { left: 72px; bottom: 41px; font-size: 11.5px; }
}

/* 登录页：帮助按钮固定在左下角，配合光圈脉冲吸引注意 */
body.auth-mode #fab-help {
  display: flex !important;
  right: auto; top: auto;
  left: 28px; bottom: 28px;
  animation: helpGlow 2.4s ease-in-out infinite;
}
body.auth-mode #fab-help:hover {
  animation: none;
  transform: scale(1.1);
  background: var(--primary); color: #fff; border-color: var(--primary);
}
/* 提示气泡挂在按钮上方 */
body.auth-mode #fab-help::after {
  content: attr(data-tip);
  position: absolute; left: 0; bottom: 56px; transform: none;
  padding: 6px 12px; border-radius: 999px;
  background: #1f2740; color: #fff; font-size: 12px; font-weight: 600;
  max-width: min(240px, calc(100vw - 56px));
  width: max-content;
  white-space: normal; text-align: left; line-height: 1.35;
  letter-spacing: .5px;
  box-shadow: 0 8px 18px rgba(20, 28, 48, .22);
}
body.auth-mode #fab-help::before {
  content: ''; position: absolute; left: 50%; bottom: 49px; transform: translateX(-50%) rotate(45deg);
  width: 8px; height: 8px; background: #1f2740; border-radius: 2px;
}
/* 小屏：登录卡片几乎占满屏，左上角放不下 → 收回到右下角，气泡改到上方 */
@media (max-width: 760px) {
  body.auth-mode #fab-help { left: 20px; bottom: 24px; }
}

@keyframes helpGlow {
  0%, 100% { box-shadow: 0 8px 20px rgba(31, 39, 64, .18), 0 0 0 0 rgba(79, 124, 255, .45); }
  50% { box-shadow: 0 14px 30px rgba(79, 124, 255, .42), 0 0 0 14px rgba(79, 124, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
  body.auth-mode #fab-help { animation: none; }
}

/* ---------- 悬浮智能助手按钮 ---------- */
#fab-assistant {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 8510;              /* 高于蹦迪氛围灯(8500)与烟花层(9000 之下)，任何特效都不会盖住它 */
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f7cff, #6a5cff);
  color: #fff;
  font-size: 26px;
  line-height: 56px;
  text-align: center;
  cursor: grab;
  box-shadow: 0 8px 22px rgba(79, 124, 255, .42);
  transition: transform .18s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;       /* 拖拽时禁止页面滚动 */
}
#fab-assistant:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 12px 28px rgba(79, 124, 255, .5);
}
#fab-assistant:active { transform: scale(.96); }
#fab-assistant.dragging {
  transform: scale(1.08);
  cursor: grabbing;
  transition: none;          /* 拖拽中取消过渡，跟手 */
  box-shadow: 0 14px 32px rgba(79, 124, 255, .55);
}
/* 「出去溜达」：在屏幕里随机走动，每步时长随机（--fab-walk-dur），快慢交替 */
#fab-assistant.walking {
  transition: left var(--fab-walk-dur, 2.4s) cubic-bezier(.32, .06, .28, 1),
              top var(--fab-walk-dur, 2.4s) cubic-bezier(.32, .06, .28, 1),
              box-shadow .18s ease;
}

/* ===== 小助手的娱乐技能：烟花粒子层 / 蹦迪 / 故事气泡 ===== */
#hg-fx-canvas {
  position: fixed;
  left: 0; top: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9000;
  display: none;
}

#fab-assistant.dancing {
  animation: fabDance .3s cubic-bezier(.36, .07, .19, .97) infinite alternate;
  filter: saturate(1.25) brightness(1.06);
  will-change: transform, box-shadow;
}
@keyframes fabDance {
  0%   { transform: rotate(-24deg) translateY(2px) scale(1.06); box-shadow: 0 12px 30px rgba(255, 72, 156, .6), 0 0 0 6px rgba(255, 72, 156, .16); }
  100% { transform: rotate(24deg) translateY(-18px) scale(1.26); box-shadow: 0 22px 46px rgba(96, 116, 255, .7), 0 0 0 10px rgba(96, 116, 255, .14); }
}

/* 蹦迪的全屏氛围灯：三束彩色光斑 + 色相旋转，只作背景，不挡点击 */
.fab-disco {
  position: fixed;
  inset: 0;
  z-index: 8500;             /* 页面之上、小助手之下：只染背景，不盖住机器人 */
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
  background:
    radial-gradient(58% 52% at 50% 76%, rgba(255, 60, 158, .30), transparent 72%),
    radial-gradient(44% 46% at 74% 58%, rgba(58, 176, 255, .26), transparent 72%),
    radial-gradient(44% 46% at 26% 58%, rgba(168, 255, 108, .22), transparent 72%),
    radial-gradient(70% 40% at 50% 50%, rgba(255, 214, 90, .16), transparent 74%);
  animation: fabDiscoHue 1.1s linear infinite, fabDiscoSway 2.2s ease-in-out infinite alternate;
}
.fab-disco.on { opacity: 1; }
@keyframes fabDiscoHue {
  0%   { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}
@keyframes fabDiscoSway {
  0%   { transform: translateX(-4%) scale(1.02); }
  100% { transform: translateX(4%) scale(1.08); }
}

.fab-note {
  position: fixed;
  z-index: 9001;
  pointer-events: none;
  font-size: 24px;
  line-height: 1;
  transform: translate(-50%, 0);
  animation: fabNoteUp 1.15s ease-out forwards;
}
@keyframes fabNoteUp {
  0%   { opacity: 1; transform: translate(-50%, 0) scale(.9) rotate(0deg); }
  60%  { opacity: .95; }
  100% { opacity: 0; transform: translate(-50%, -132px) scale(1.6) rotate(12deg); }
}

.fab-story {
  position: fixed;
  z-index: 9500;
  display: none;
  max-width: 262px;
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff;
  color: #1f2740;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-line;
  border: 1px solid #e3e8f5;
  box-shadow: 0 12px 32px rgba(20, 28, 60, .18);
}

@media (max-width: 900px) {
  /* 小屏：助手按钮抬到 72px，帮助按钮再往上让开 */
  #fab-help { right: 22px; bottom: 136px; width: 40px; height: 40px; font-size: 18px; }
  #fab-assistant {
    right: 16px;
    bottom: 72px;            /* 抬升到移动端底部导航之上 */
    width: 52px;
    height: 52px;
    font-size: 24px;
    line-height: 52px;
  }
}

/* ---------- 家庭大事记：垂直时间轨迹线 ---------- */
.fe-timeline { position: relative; padding: 2px 0 8px; }
.fe-item { display: flex; gap: 14px; align-items: stretch; }
.fe-axis { position: relative; width: 78px; flex: none; text-align: right; padding-right: 22px; }
.fe-axis::before {
  content: ''; position: absolute; right: 9px; top: 8px; bottom: -18px;
  width: 2px; background: var(--border);
}
.fe-item:last-child .fe-axis::before { bottom: auto; height: 18px; }
.fe-date {
  display: inline-block; font-size: 12px; color: var(--text-sub);
  background: var(--card); padding: 2px 7px; border-radius: 6px; border: 1px solid var(--border);
  position: relative; z-index: 1;
}
.fe-dot {
  position: absolute; right: 3px; top: 9px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--primary); border: 3px solid #fff; box-shadow: 0 0 0 2px var(--primary); z-index: 1;
}
.fe-card {
  flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 18px;
}
.fe-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fe-title { font-weight: 600; font-size: 15px; color: var(--text); }
.fe-ops { display: flex; gap: 6px; flex: none; }
.fe-content { margin-top: 6px; font-size: 13px; line-height: 1.65; color: var(--text); }
.fe-members { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.fe-mem {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  font-size: 12px; color: #fff; border: 1px solid #fff;
}
.fe-mem img { width: 100%; height: 100%; object-fit: cover; }
.fe-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 9px; }
.fe-thumb { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 1px solid var(--border); transition: opacity .15s; }
.fe-thumb:hover { opacity: .88; }
.fe-todos { margin-top: 9px; display: flex; flex-direction: column; gap: 6px; }
.fe-todo { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.fe-todo-main { display: flex; align-items: center; gap: 8px; cursor: pointer; flex: 1; min-width: 0; }
.fe-todo span { line-height: 1.5; }
.fe-todo.done .fe-todo-main span { text-decoration: line-through; color: var(--text-sub); }
.fe-todo-date { flex: none; font-size: 11.5px; color: var(--text-sub); background: #f4f6fb; border-radius: 6px; padding: 1px 7px; }
.fe-todo-flag { flex: none; font-size: 11.5px; color: var(--success); background: #e8f8ef; border-radius: 6px; padding: 1px 7px; }
.fe-todo .btn.sm { flex: none; padding: 3px 9px; }

/* 添加/编辑表单 */
.fe-form { display: flex; flex-direction: column; gap: 12px; }
.fe-fld { display: flex; flex-direction: column; gap: 5px; font-size: 13px; }
.fe-fld > span { font-weight: 600; color: var(--text-sub); }
.fe-form input[type=text], .fe-form input[type=date], .fe-form textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; box-sizing: border-box; background: #fff; color: var(--text);
}
.fe-form textarea { resize: vertical; }

/* 家庭大事记 —「事件日期」输入框美化 */
.fe-form input[type=date] {
  background-color: #fafbff;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.fe-form input[type=date]:hover {
  border-color: var(--primary);
  background-color: #f5f8ff;
}
.fe-form input[type=date]:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(79,124,255,.22);
}
/* 替换原生日历图标为品牌色 SVG（Chrome/Edge/Safari） */
.fe-form input[type=date]::-webkit-calendar-picker-indicator {
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f7cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cline x1='3' y1='9' x2='21' y2='9'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3C/svg%3E") no-repeat center / 18px 18px;
  width: 20px; height: 20px; cursor: pointer; opacity: .6;
  transition: opacity .15s ease, transform .15s ease;
}
.fe-form input[type=date]:hover::-webkit-calendar-picker-indicator,
.fe-form input[type=date]:focus::-webkit-calendar-picker-indicator {
  opacity: 1; transform: scale(1.06);
}
/* Firefox 日历图标 */
.fe-form input[type=date]::-moz-calendar-picker-indicator {
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f7cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cline x1='3' y1='9' x2='21' y2='9'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3C/svg%3E") no-repeat center / 18px 18px;
  width: 20px; height: 20px; cursor: pointer; opacity: .6;
}
.fe-form input[type=date]:hover::-moz-calendar-picker-indicator,
.fe-form input[type=date]:focus::-moz-calendar-picker-indicator { opacity: 1; }
.fe-form input[type=date]::-webkit-datetime-edit { color: var(--text); }

/* 家庭大事记 —「事件标题」输入框美化（与日期框风格统一） */
.fe-form input[type=text] {
  padding-left: 36px;
  background-color: #fafbff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f7cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='4 7 4 4 20 4 20 7'/%3E%3Cline x1='9' y1='20' x2='15' y2='20'/%3E%3Cline x1='12' y1='4' x2='12' y2='20'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 11px center;
  background-size: 16px 16px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.fe-form input[type=text]:hover { border-color: var(--primary); background-color: #f5f8ff; }
.fe-form input[type=text]:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(79,124,255,.22);
}
.fe-form input[type=text]::placeholder { color: #aab1c5; }

/* ============ 全站统一输入框美化（单行文本框 / 数字框 / 日期选择框） ============
   使用 :where() 保持 0 特异性：仅作用于「未被各作用域（.field/.filters/.search-bar/.fe-form/.input/.user-pick 等）自定义」的裸输入框，
   绝不覆盖聊天胶囊(.wc-input)、账单(.blm-input)、消息回复、待办软输入等已有专属样式的控件。 */
:where(input[type=text], input:not([type]), input[type=number], input[type=date]) {
  background-color: #fafbff;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
:where(input[type=text], input:not([type]), input[type=number], input[type=date]):hover {
  border-color: var(--primary); background-color: #f5f8ff;
}
:where(input[type=text], input:not([type]), input[type=number], input[type=date]):focus {
  outline: none; border-color: var(--primary); background-color: #fff;
  box-shadow: 0 0 0 3px rgba(79,124,255,.22);
}
/* 日期选择器：原生日历图标统一替换为品牌色 SVG（全站生效） */
:where(input[type=date])::-webkit-calendar-picker-indicator {
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f7cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cline x1='3' y1='9' x2='21' y2='9'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3C/svg%3E") no-repeat center / 18px 18px;
  width: 20px; height: 20px; cursor: pointer; opacity: .6;
  transition: opacity .15s ease, transform .15s ease;
}
:where(input[type=date]):hover::-webkit-calendar-picker-indicator,
:where(input[type=date]):focus::-webkit-calendar-picker-indicator { opacity: 1; transform: scale(1.06); }
:where(input[type=date])::-moz-calendar-picker-indicator {
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234f7cff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cline x1='3' y1='9' x2='21' y2='9'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3C/svg%3E") no-repeat center / 18px 18px;
  width: 20px; height: 20px; cursor: pointer; opacity: .6;
}
:where(input[type=date]):hover::-moz-calendar-picker-indicator,
:where(input[type=date]):focus::-moz-calendar-picker-indicator { opacity: 1; }
:where(input[type=date])::-webkit-datetime-edit { color: var(--text); }
.fe-mem-list { display: flex; flex-wrap: wrap; gap: 8px; }
.fe-mem-opt {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  background: #f3f5fa; border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; cursor: pointer;
}
.fe-mem-opt input { margin: 0; }
.fe-mem-mini { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; }
.fe-mem-mini-t { width: 18px; height: 18px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.fe-photo-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.fe-photo-prev { position: relative; width: 72px; height: 72px; }
.fe-photo-prev img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.fe-photo-x {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--danger); color: #fff; border: none; cursor: pointer; font-size: 12px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.fe-todo-edit { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.fe-todo-row { display: flex; align-items: center; gap: 6px; }
.fe-todo-text { flex: 1; min-width: 0; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: #fafbff; transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease; }
.fe-todo-text:hover { border-color: var(--primary); background-color: #f5f8ff; }
.fe-todo-text:focus { outline: none; border-color: var(--primary); background-color: #fff; box-shadow: 0 0 0 3px rgba(79,124,255,.22); }
.fe-todo-done { width: 16px; height: 16px; flex: none; }
/* 编辑弹窗里的日期输入：必须压过 .fe-form input[type=date]{width:100%}（否则会把文本框挤没） */
.fe-form input.fe-todo-date-inp {
  flex: 0 0 130px; width: 130px; min-width: 130px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 12.5px; background: #fafbff; color: var(--text);
}
.fe-form input.fe-todo-date-inp:hover { border-color: var(--primary); background-color: #f5f8ff; }
.fe-form input.fe-todo-date-inp:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px rgba(79,124,255,.22); }
.fe-todo-x { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--border); background: #fff; cursor: pointer; color: var(--text-sub); font-size: 13px; }

@media (max-width: 900px) {
  .fe-axis { width: 56px; padding-right: 18px; }
  .fe-thumb { width: 72px; height: 72px; }
  .fe-photo-prev, .fe-photo-prev img { width: 64px; height: 64px; }
}

/* ---------- 储物设施：列表首列缩略图 + 编辑封面图 ---------- */
/* 无任何封面图时整列隐藏（表格无 .fa-has-thumb），有图才出现独立首列 */
#fa-table .fac-thumb-th,
#fa-table .fac-thumb-td { width: 64px; text-align: center; white-space: nowrap; }
#fa-table .fac-thumb-td { padding-top: 7px; padding-bottom: 7px; }
#fa-table:not(.fa-has-thumb) .fac-thumb-th,
#fa-table:not(.fa-has-thumb) .fac-thumb-td { display: none; }
.fac-thumb {
  width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover;
  background: var(--bg-sub, #eef1f8); border: 1px solid var(--border);
  display: inline-block; vertical-align: middle; transition: transform .15s, box-shadow .15s;
}
#fa-table tbody tr:hover .fac-thumb { transform: scale(1.06); box-shadow: 0 3px 10px rgba(20, 40, 90, .16); }
/* 封面可点：点击弹出大图浏览窗 */
.fac-thumb-btn {
  border: 0; padding: 0; background: none; line-height: 0; border-radius: 8px;
  cursor: zoom-in; display: inline-flex; vertical-align: middle;
}
.fac-thumb-btn:focus-visible { outline: 2px solid var(--primary, #4f7cff); outline-offset: 2px; }
.fac-thumb-btn:hover .fac-thumb { transform: scale(1.12); box-shadow: 0 4px 14px rgba(20, 40, 90, .22); }
/* 封面文件丢失（例如被误清理）时的占位：一眼看出哪些设施需要重传封面 */
.fac-thumb-btn.fac-thumb-btn-miss {
  width: 44px; height: 44px; border-radius: 8px; cursor: default;
  background: var(--bg-sub, #eef1f8); border: 1px dashed var(--border);
  color: var(--text-sub); font-size: 15px; align-items: center; justify-content: center;
}
.fac-thumb-btn-miss::after { content: '🖼️'; opacity: .4; }
.fac-thumb-btn-miss:hover .fac-thumb { transform: none; box-shadow: none; }
/* 行双击打开详情：给出可点提示 */
#fa-table tbody tr[data-id] { cursor: pointer; }
.fac-img-row { display: flex; align-items: center; gap: 14px; }
.fac-img-prev {
  width: 88px; height: 88px; flex: none; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-sub, #eef1f8);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-sub, #8a93a6); font-size: 12px;
  padding: 0; text-align: center; /* 复位全局 .empty 的 46px 内边距与虚线框 */
}
.fac-img-prev.empty::after { content: '无封面'; }
.fac-img-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fac-img-ops { display: flex; gap: 8px; align-items: center; }


/* ---------- 存款目标页 ---------- */
.sv-lead { font-size: 13px; color: var(--text-sub); margin: -6px 0 14px; line-height: 1.6; }
.sv-hero {
  background: linear-gradient(135deg, #f7f9ff 0%, #eef3ff 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 20px 16px; margin-bottom: 16px;
}
.sv-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sv-hero-left { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sv-hero-label { font-size: 13px; color: var(--text-sub); }
.sv-hero-target { font-size: 30px; line-height: 1.1; letter-spacing: -.5px; }
.sv-status {
  font-size: 12px; font-weight: 600; border: 1px solid currentColor; border-radius: 999px;
  padding: 2px 10px; background: #fff; white-space: nowrap;
}
.sv-hero-right { display: flex; align-items: baseline; gap: 8px; }
.sv-hero-right span { font-size: 12px; color: var(--text-sub); }
.sv-hero-right b { font-size: 22px; }
.sv-hero-right small { font-size: 12px; color: var(--text-sub); }
.sv-bar {
  position: relative; height: 10px; border-radius: 6px; background: #e3e9f8;
  margin: 13px 0 8px; overflow: visible;
}
.sv-bar > i { display: block; height: 100%; border-radius: 6px; transition: width .35s ease; }
.sv-bar-expected {
  position: absolute; top: -4px; width: 2px; height: 18px; background: #2b3245;
  border-radius: 2px; opacity: .55;
}
.sv-bar-expected::after {
  content: '应达'; position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--text-sub); white-space: nowrap;
}
.sv-hero-foot { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--text-sub); margin-bottom: 12px; }
.sv-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.sv-kpi { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; }
.sv-kpi > span { display: block; font-size: 11.5px; color: var(--text-sub); }
.sv-kpi > b { display: block; font-size: 17px; margin: 2px 0 1px; }
.sv-kpi > small { font-size: 11px; color: var(--text-sub); }

.sv-empty {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 20px 22px; margin-bottom: 16px;
}
.sv-empty-icon { font-size: 34px; }
.sv-empty b { font-size: 15px; }
.sv-empty p { font-size: 13px; color: var(--text-sub); margin-top: 4px; line-height: 1.7; max-width: 620px; }

.sv-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.sv-card { margin-bottom: 16px; }
.sv-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.sv-card-head > b { font-size: 15px; }
.sv-card-head > span { font-size: 12.5px; color: var(--text-sub); display: flex; align-items: center; }
.sv-plan-tbl th, .sv-plan-tbl td, .sv-rec-tbl th, .sv-rec-tbl td { font-size: 12.5px; padding: 9px 10px; }
.sv-plan-ok { font-size: 13px; color: var(--success); line-height: 1.7; padding: 6px 0; }
.sv-plan-foot { font-size: 12.5px; color: var(--text-sub); margin-top: 10px; line-height: 1.7; }
.sv-plan-tip { font-size: 11.5px; }
.sv-rigid {
  font-size: 10px; color: var(--text-sub); border: 1px solid var(--border);
  border-radius: 4px; padding: 0 4px; margin-left: 4px;
}
.sv-ratio { display: inline-block; width: 46px; height: 5px; border-radius: 3px; background: #eef1f8; margin-right: 6px; vertical-align: middle; overflow: hidden; }
.sv-ratio > i { display: block; height: 100%; background: var(--warn); border-radius: 3px; }
.sv-sub { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.sv-tag { font-size: 11px; border-radius: 5px; padding: 1px 7px; border: 1px solid var(--border); color: var(--text-sub); }
.sv-tag.ok { color: var(--success); border-color: rgba(39,174,96,.35); background: rgba(39,174,96,.08); }
.sv-tag.wait { color: var(--warn); border-color: rgba(243,156,18,.35); background: rgba(243,156,18,.08); }
.sv-tag.off { color: var(--text-sub); background: #f3f4f8; }
.sv-tips .an-tip-txt p { font-size: 12px; }
.sv-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.sv-quick .btn.sm { font-size: 11.5px; padding: 3px 9px; }

/* 逐月净结余柱：基线在中间，正向上、负向下 */
.sv-months { display: flex; align-items: stretch; gap: 4px; height: 118px; padding: 4px 0 0; }
.sv-m { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sv-m-col { flex: 1; display: flex; align-items: flex-end; }
.sv-m-col > i { display: block; width: 100%; border-radius: 3px 3px 0 0; }
.sv-m-col > i.pos { background: var(--success); opacity: .85; }
.sv-m-col > i.neg { background: var(--danger); opacity: .8; }
.sv-m-x { font-size: 10px; color: var(--text-sub); text-align: center; margin-top: 4px; }
.sv-m.dim { opacity: .35; }

@media (max-width: 1080px) {
  .sv-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .sv-hero-target { font-size: 24px; }
  .sv-kpis { grid-template-columns: 1fr 1fr; }
  .sv-hero-foot { flex-direction: column; gap: 4px; }
}

/* 记账分类管理（树形，最多 3 层） */
.bc-tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.bc-card { padding: 4px 2px; }
/* 分类搜索框：图标 + 输入 + 清空 + 展开箭头 */
.cat-combo { position: relative; }
.cat-combo-input {
  width: 100%; padding: 9px 62px 9px 32px; box-sizing: border-box;
  border: 1.5px solid var(--border, #dfe5f0); border-radius: 10px;
  font-size: 13.5px; font-family: inherit; outline: none;
  background: #fbfcfe; color: var(--text, #222);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.cat-combo-input::placeholder { color: #b3bdd0; }
.cat-combo-input:hover { border-color: #b9c6de; }
.cat-combo-input:focus {
  border-color: var(--primary, #4f7cff); background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .14);
}
.cat-combo-ico {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12px; opacity: .6; pointer-events: none;
}
.cat-combo-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%;
  background: transparent; color: #9aa6bd; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .15s, color .15s, transform .15s;
}
.cat-combo-btn:hover { background: #eef3ff; color: var(--primary, #4f7cff); }
.cat-combo-clear { right: 30px; display: none; }
.cat-combo-arrow { right: 8px; transform: translateY(-50%) rotate(0deg); }
.cat-combo-arrow.open { transform: translateY(-50%) rotate(180deg); }

/* 分类可搜索下拉（手工记账 / 编辑账单）：输入过滤 + 层级缩进 */
.cat-list { max-height: 264px; padding: 6px; }
.cat-list-up { top: auto; bottom: 100%; margin-top: 0; margin-bottom: 6px; }
.cat-list .cat-opt {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 10px; font-size: 13px; cursor: pointer; border-radius: 7px;
  color: var(--text, #222); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .1s;
}
.cat-list .cat-opt:hover { background: #f2f6ff; }
.cat-opt-root { font-weight: 600; }
.cat-opt-dot { color: #c3cbdb; margin-right: 2px; }
.cat-opt-check { margin-left: auto; color: var(--primary, #4f7cff); font-weight: 700; font-size: 12px; }
.cat-opt-active { background: #edf2ff; color: var(--primary, #4f7cff); }
.cat-opt-active:hover { background: #e6eeff; }
.cat-opt-auto { color: var(--primary); font-weight: 600; }
.cat-opt-sub { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--text-sub); }
.cat-opt-history { color: var(--text-sub); font-style: italic; }
.cat-empty { padding: 9px 10px; font-size: 12.5px; color: var(--text-sub); }

/* 图表标题口径标注（如「按一级分类」） */
.ch-note { margin-left: 8px; font-size: 11px; font-weight: 400; color: var(--text-sub); }
.bc-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-bottom: 1px solid #f2f5fb; }
.bc-row:last-child { border-bottom: none; }
.bc-row:hover { background: #f8faff; }
.bc-ico { font-size: 14px; }
.bc-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.bc-sub { font-size: 11.5px; color: var(--text-sub); }
.bc-max { font-size: 11px; color: var(--text-sub); padding: 0 4px; white-space: nowrap; }
/* 分类树折叠：有子类时显示三角，收起后不再渲染后代；叶子节点用等宽占位保持层级对齐 */
.bc-tog {
  flex: 0 0 18px; width: 18px; height: 20px; padding: 0; margin: 0;
  border: none; background: transparent; cursor: pointer;
  font-size: 12px; line-height: 20px; color: #7a839c;
  transition: transform .15s ease, color .15s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.bc-tog.open { transform: rotate(90deg); }
.bc-tog:hover { color: var(--primary); }
.bc-tog-ph { cursor: default; }
.bc-row.bc-folded .bc-name { color: var(--text); }
.bc-row.bc-folded { background: #fbfcff; }

/* ---------- 系统管理 · 用户列表 ---------- */
.au-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.au-stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 11px 15px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.au-stat span { font-size: 12px; color: var(--text-sub); }
.au-stat b { font-size: 21px; line-height: 1.25; font-variant-numeric: tabular-nums; }

.au-search {
  width: 200px; padding: 7px 10px; font-size: 13px; font-family: inherit;
  color: inherit; background: var(--card);
  border: 1px solid var(--border); border-radius: 8px;
}
.au-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 124, 255, .12); }

/* 顶部居中的分页条：.fd-pager 本身已 justify-content:center，这里只补间距 */
.au-pager { display: flex; justify-content: center; margin-bottom: 10px; }
/* 消息中心的分页条同样在顶部，始终占位（min-height），切换每页条数时列表不会上下跳 */
.ms-pager { display: flex; justify-content: center; align-items: center; min-height: 34px; margin-bottom: 8px; }

/* 汇总视图日期行：元素之间留足间距，日期框与按钮组之间再空一格 */
.td-sum-bar { gap: 14px; align-items: center; margin: -2px 0 14px; flex-wrap: wrap; }
.td-sum-lb { font-size: 13px; color: var(--text-sub); }
.td-sum-gap { display: inline-block; width: 10px; }
.td-sum-tip { margin-left: 4px; font-size: 11.5px; color: var(--text-sub); }

/* 待办汇总表：数字可点（跳到列表并按成员 + 状态筛选） */
.td-sum-num {
  border: none; background: none;
  /* 负 margin 抵消内边距：数字左边缘与表头对齐，加按钮后不会整列右移 */
  padding: 0 6px; margin-left: -6px; border-radius: 6px;
  font: inherit; font-size: 13px; line-height: 1.55; font-variant-numeric: tabular-nums;
  color: inherit; cursor: pointer;
}
.td-sum-num:hover { background: #eef3ff; color: var(--primary); text-decoration: underline; }
.td-cond {
  font-size: 11.5px; color: #3f63b0; background: #eef3ff;
  border: 1px solid #dbe5ff; padding: 3px 10px; border-radius: 999px;
}
.td-cond a { color: var(--danger); text-decoration: none; margin-left: 2px; }

/* ---------- 待办任务 · 月历年月选择 ---------- */
.td-ctitle { font-size: 15px; font-weight: 700; min-width: 118px; text-align: center; }
.cp-year-row { display: flex; align-items: center; gap: 8px; }
.cp-year-row input {
  width: 120px; padding: 6px 10px; font-size: 14px; font-family: inherit;
  color: inherit; background: var(--card);
  border: 1px solid var(--border); border-radius: 8px;
}
.cp-year-row input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 124, 255, .12); }
.cp-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.cp-months .btn { width: 100%; }

/* ---------- 帮助支持 · 操作说明（iframe 内嵌手册） ---------- */
.hp-tip {
  font-size: 12px; line-height: 1.7; color: var(--text-sub);
  background: #f7faff; border: 1px solid #e6eefc; border-radius: 10px;
  padding: 9px 12px; margin: -2px 0 12px;
}
.hp-wrap { width: 100%; }
.hp-frame {
  width: 100%;
  /* 页面滚动由手册自己管：给 iframe 一个确定高度，避免出现「双层滚动条 + 底部留白」 */
  height: calc(100vh - 232px);
  min-height: 520px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 39, 64, .05);
}
@media (max-width: 760px) {
  .hp-frame { height: calc(100vh - 268px); min-height: 420px; }
}

/* ---------- 帮助支持 · 宣传海报（iframe 内嵌 /poster.html） ---------- */
.promo-wrap { width: 100%; }
.promo-frame {
  width: 100%;
  /* 没有说明文字，比手册页多留出那一行的空间；滚动交给海报页自己管 */
  height: calc(100vh - 132px);
  min-height: 560px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #eef1f8;
  box-shadow: 0 8px 24px rgba(31, 39, 64, .05);
}
@media (max-width: 760px) {
  .promo-frame { height: calc(100vh - 210px); min-height: 420px; }
}

/* ---------- 标签组 / 标签（通用）：待办筛选、物品历史、记账分类、家庭文件预设等都用它 ---------- */
/* 注意：这套类此前只有 .search-history 等局部作用域版本，页面上的 <span class="chip"> 一直是裸文字，会挤成一坨 */
.chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center;
  padding: 3px 11px; font-size: 12px; line-height: 1.6;
  color: var(--text-sub); background: var(--card, #fff);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; user-select: none; white-space: nowrap;
  transition: color .12s, border-color .12s, background .12s;
}
.chip:hover { color: var(--primary); border-color: var(--primary); }
.chip.chip-active {
  color: #fff; background: var(--primary, #4f7cff); border-color: var(--primary, #4f7cff);
  font-weight: 600;
}
.chip.ghost { background: transparent; }
#td-chips { margin: 0 0 12px; }

/* ---------- 待办任务 · 列表筛选栏 ---------- */
.td-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: -6px 0 10px; }
.td-bar-lb { font-size: 12px; color: var(--text-sub); }
.td-date {
  padding: 4px 8px; font-size: 12.5px; font-family: inherit;
  color: inherit; background: var(--card);
  border: 1px solid var(--border); border-radius: 8px;
}
.td-date:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 124, 255, .12); }
.td-bar-tip { font-size: 11.5px; color: var(--text-sub); }

/* ---------- 系统管理 · 词条管理（自定义自然语言词条） ---------- */
.cr-tip { margin: 0 0 10px; font-size: 12.5px; line-height: 1.75; color: var(--text-sub); }
.cr-tbl { min-width: 860px; }
.cr-ops { display: flex; gap: 6px; flex-wrap: wrap; }
.au-tbl { min-width: 780px; }
.au-user { display: flex; align-items: center; gap: 9px; }
.au-av { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.au-av-txt {
  display: inline-flex; align-items: center; justify-content: center;
  background: #eaf0ff; color: #4a6bb5; font-weight: 600; font-size: 13px;
}
.au-user-txt { display: flex; flex-direction: column; line-height: 1.35; }
.au-user-txt b { font-size: 13px; font-weight: 600; }
.au-acct { font-size: 11.5px; color: var(--text-sub); }
.au-me {
  font-style: normal; font-size: 10.5px; padding: 0 6px; border-radius: 999px;
  color: #4f7cff; background: #eef3ff;
}
.au-badge {
  display: inline-block; font-size: 11px; padding: 1px 7px;
  border-radius: 999px; background: #f0f2f7; color: var(--text-sub);
}
.au-badge-admin { background: #eaf1ff; color: #3f63b0; font-weight: 600; }
.au-badge-warn { background: #fff5e6; color: #a2691a; }
.au-num { font-size: 13px; font-variant-numeric: tabular-nums; }
.au-num-sub { font-size: 11.5px; color: var(--text-sub); }
.au-time { color: var(--text-sub); font-size: 12px; font-variant-numeric: tabular-nums; }
.au-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: #2fbf71; margin-right: 5px;
}
.au-foot { margin-top: 10px; font-size: 11.5px; line-height: 1.6; color: var(--text-sub); }

@media (max-width: 900px) {
  .au-stats { grid-template-columns: repeat(2, 1fr); }
  .au-search { width: 100%; }
}

/* ---------- 智能助手：我的自定义词条（说法 → 动作，可新增/编辑/启停/删除） ---------- */
.wc-learn-sec { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); }
.wc-learn-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.wc-learn-head b { font-size: 13px; }
.wc-learn-tools { display: inline-flex; align-items: center; gap: 6px; }
.wc-learn-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; }
.wc-learn-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; font-size: 12.5px;
  border: 1px solid var(--border); border-radius: 9px; background: #fafbff;
}
/* 已暂停的词条：灰掉，但仍可编辑/删除/重新启用 */
.wc-learn-row.off { opacity: .58; background: #f6f7fa; }
.wc-learn-phrase {
  font-weight: 600; color: var(--text); max-width: 40%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wc-learn-act {
  flex: 1; min-width: 0; color: var(--text-sub);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wc-learn-row .btn.sm { flex: 0 0 auto; }
.wc-learn-empty { margin: 0; font-size: 12px; line-height: 1.6; color: var(--text-sub); }

/* ---------- 系统管理 · App 发布 ---------- */
.ar-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.ar-row {
  display: flex; gap: 10px; align-items: baseline; padding: 6px 0;
  font-size: 13px; border-bottom: 1px dashed var(--border);
}
.ar-row > span:first-child { flex: none; min-width: 66px; color: var(--text-sub); }
.ar-row b { font-weight: 600; word-break: break-all; }
.ar-note {
  margin-top: 8px; padding: 8px 10px; border-radius: 9px;
  background: #f6f8fd; font-size: 12.5px; line-height: 1.6;
  color: var(--text); white-space: pre-wrap;
}
.ar-qr { display: flex; justify-content: center; padding: 12px 0 8px; }
.ar-qr img { width: 176px; height: 176px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.ar-link { display: flex; gap: 8px; align-items: center; }
.ar-link input {
  flex: 1; min-width: 0; padding: 7px 10px; font-size: 12.5px;
  color: var(--text); background: #fafbff;
  border: 1px solid var(--border); border-radius: 8px;
}
.ar-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ar-pick span { font-size: 12.5px; color: var(--text-sub); }

/* App 发布：下载方式（服务器保存 / 外部地址） */
.ar-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ar-mode-opt {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px;
  border: 1px solid var(--border); border-radius: 10px;
  background: #fafbff; cursor: pointer;
}
.ar-mode-opt input { margin: 2px 0 0; flex: 0 0 auto; }
.ar-mode-opt span { display: block; min-width: 0; }
.ar-mode-opt b { display: block; font-size: 13px; color: var(--text); }
.ar-mode-opt em {
  display: block; margin-top: 4px; font-style: normal;
  font-size: 11.5px; line-height: 1.6; color: var(--text-sub);
}
.ar-mode-opt.ar-mode-on { border-color: #4f7cff; background: #f2f6ff; }
.ar-ext { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ar-ext[hidden] { display: none; }
.ar-ext-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.ar-ext-now { font-size: 12px; color: var(--text-sub); }

@media (max-width: 900px) {
  .ar-grid { grid-template-columns: 1fr; }
  .ar-mode { grid-template-columns: 1fr; }
}

/* ---------- 登录页：扫码下载 App ---------- */
.auth-card { position: relative; }
.auth-app-row { display: flex; justify-content: center; margin-top: 2px; }
.auth-app {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12.5px; line-height: 1; cursor: pointer;
  color: var(--text-sub); background: #f3f6fd;
  border: 1px solid var(--border); transition: .15s;
}
.auth-app:hover { color: var(--primary); border-color: var(--primary); background: #eef3ff; }
.auth-app:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.dl-qr { display: flex; justify-content: center; padding: 4px 0 10px; }
.dl-qr img { width: 180px; height: 180px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.dl-tip { font-size: 12.5px; line-height: 1.7; color: var(--text-sub); margin: 0 0 10px; }
.dl-link { display: flex; gap: 8px; }
.dl-link input {
  flex: 1; min-width: 0; padding: 7px 10px; font-size: 12.5px;
  color: var(--text); background: #fafbff;
  border: 1px solid var(--border); border-radius: 8px;
}

/* 仅查看权限：顶部常驻提示 */
.role-tip {
  position: fixed; left: 50%; top: 12px; transform: translateX(-50%);
  z-index: 4000; display: flex; align-items: center; gap: 10px;
  max-width: min(760px, calc(100vw - 32px));
  padding: 9px 12px 9px 14px; border-radius: 10px;
  background: #fff7e6; border: 1px solid #f5d9a8; color: #8a5a00;
  font-size: 12.5px; line-height: 1.5; box-shadow: 0 6px 20px rgba(31, 39, 64, .12);
}
.role-tip-x {
  flex: none; border: 0; background: transparent; color: #b98b3d;
  font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.role-tip-x:hover { color: #8a5a00; }

/* ---------- 统一美化下拉框（原生的太粗糙，尤其家庭搜索里的角色选择） ---------- */
.sel {
  -webkit-appearance: none;
  appearance: none;
  height: 34px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background-color: #fff;
  /* 右侧箭头用内联 SVG，避免各浏览器原生箭头样式不一致 */
  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='%237a839c' 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 10px center;
  background-size: 12px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.sel:hover { border-color: #c3d2ff; background-color: #f7faff; }
.sel:focus {
  outline: none;
  border-color: var(--primary);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .15);
}
.sel:active { border-color: var(--primary-dark); }
.sel:disabled { color: var(--text-sub); background-color: #f6f7fb; cursor: not-allowed; }
/* Firefox 里的选中项内边距 */
.sel option { padding: 6px 8px; color: var(--text); }
/* 小号：用在家庭成员行这类紧凑列表里 */
.sel.sm {
  height: 28px; font-size: 12px; padding: 0 24px 0 9px;
  border-radius: 8px; background-position: right 7px center; background-size: 11px 11px;
}

/* 家庭「搜索用户」结果行：名字占满左侧，角色与按钮靠右对齐 */
.fm-search-row { padding: 9px 10px; gap: 10px; }
/* 下拉框与「申请加入」按钮等高对齐（btn.sm 默认 28px，这里统一抬到 30px） */
.fm-search-row .sel { height: 30px; font-size: 12.5px; padding: 0 28px 0 10px; background-position: right 8px center; }
.fm-search-row .btn.sm { height: 30px; display: inline-flex; align-items: center; }
.fm-search-row .fm-search-name {
  flex: 1; min-width: 0;
  display: flex; align-items: baseline; gap: 6px;
  overflow: hidden; white-space: nowrap;
}
.fm-search-row .fm-search-name .hint { font-size: 11.5px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; }
.sel-wrap { flex: none; display: inline-flex; }
.sel-wrap .sel { min-width: 96px; }

@media (max-width: 760px) {
  .fm-search-row { flex-wrap: wrap; }
  .fm-search-row .fm-search-name { flex-basis: 100%; }
  .sel-wrap .sel { min-width: 88px; }
}

/* ---------- 「仅查看」权限：隐藏管理 / 删除 / 新增类按钮（后端同样会拒绝） ---------- */
body.role-view .rw-only { display: none !important; }

/* ---------- 手工记账：线上支付已记账 复选框 ---------- */
.blm-chk {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: #fafbfe; font-size: 13px; line-height: 1.5; color: var(--text);
  cursor: pointer; transition: border-color .16s ease, background-color .16s ease;
}
.blm-chk:hover { border-color: #c9d8ff; background: #f7faff; }
.blm-chk input[type="checkbox"] {
  flex: none; width: 15px; height: 15px; margin-top: 2px;
  accent-color: var(--primary); cursor: pointer;
}
.blm-chk .blm-hint { display: block; font-size: 11.5px; color: var(--text-sub); margin-top: 2px; }
/* 导入来源的账单：这一项只读 */
.blm-chk.is-locked { opacity: .72; background: #f6f7fb; cursor: not-allowed; }
.blm-chk.is-locked:hover { border-color: var(--border); background: #f6f7fb; }
.blm-chk.is-locked input { cursor: not-allowed; }

/* ---------- 日记 ---------- */
.diary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.diary-card {
  display: flex; gap: 12px; padding: 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px; cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.diary-card:hover { border-color: #c9d8ff; box-shadow: 0 8px 22px rgba(45, 60, 110, .08); transform: translateY(-1px); }
.diary-date {
  flex: none; width: 58px; text-align: center; padding: 6px 0 8px;
  background: linear-gradient(160deg, #eef3ff, #f7faff); border-radius: 10px;
  border: 1px solid #e2eaff;
}
.diary-date b { display: block; font-size: 16px; color: var(--primary); letter-spacing: .5px; }
.diary-date span { display: block; font-size: 11px; color: var(--text-sub); margin-top: 2px; }
/* 日期栏：周几下面依次是天气图标、心情图标（各占一行） */
.diary-date .diary-date-wx { font-size: 15px; line-height: 1.3; margin-top: 5px; }
.diary-date .diary-date-mood { font-size: 16px; line-height: 1.3; margin-top: 2px; }
.diary-body { flex: 1; min-width: 0; }
.diary-title { font-size: 14.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diary-mood { margin-right: 2px; }
.diary-exc {
  margin: 6px 0 8px; font-size: 12.5px; line-height: 1.65; color: var(--text-sub);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.diary-thumbs { display: flex; gap: 6px; margin-bottom: 8px; }
.diary-thumb { width: 52px; height: 40px; border-radius: 7px; background-size: cover; background-position: center; border: 1px solid var(--border); }
.diary-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-sub); }
.diary-from { color: var(--text-sub); }

/* 详情弹窗 */
.diary-view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
/* 详情弹窗用标题块拖动（没有独立标题栏） */
.diary-view-head.draggable { cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; }
.diary-view-head.draggable:active { cursor: grabbing; }
/* 拖动提示：与其它弹窗标题栏的「⋮⋮ 拖动」保持一致；留出右上角圆形关闭按钮的位置 */
.diary-drag-hint {
  flex: none; margin-left: auto; margin-right: 26px; align-self: flex-start;
  font-size: 11px; color: var(--text-sub); opacity: .6; letter-spacing: 1px;
  white-space: nowrap; user-select: none; -webkit-user-select: none;
  cursor: grab; padding: 2px 4px; border-radius: 6px;
}
.diary-drag-hint:hover { opacity: .9; background: #f4f6fc; }
.diary-view-head.dragging .diary-drag-hint { opacity: .9; }
.diary-view-title { font-size: 16px; }
.diary-view-meta { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.diary-view-content { margin: 14px 0; font-size: 14px; line-height: 1.9; white-space: pre-wrap; word-break: break-word; max-height: 52vh; overflow-y: auto; }
.diary-photo-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.diary-photo {
  width: 108px; height: 108px; border-radius: 10px; background-size: cover; background-position: center;
  border: 1px solid var(--border); cursor: zoom-in; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.diary-photo:hover { border-color: #c9d8ff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(45, 60, 110, .14); }
.diary-photo:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
/* 图片查看弹窗 */
.modal.modal-img { max-width: 900px; }
.img-view-wrap {
  display: flex; align-items: center; justify-content: center;
  background: #f6f7fb; border: 1px solid var(--border); border-radius: 12px; padding: 8px; min-height: 120px;
}
.img-view-wrap img { max-width: 100%; max-height: calc(100vh - 260px); border-radius: 8px; display: block; cursor: zoom-in; }
.img-view-wrap img.zoom { max-height: none; width: auto; max-width: none; cursor: zoom-out; }
.img-view-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.img-view-foot .hint { color: var(--text-sub); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diary-view-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* 分享设置 */
.dy-vis { display: flex; flex-direction: column; gap: 8px; }
.dy-vis-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer; background: #fafbfe;
  transition: border-color .16s ease, background-color .16s ease;
}
.dy-vis-item:hover { border-color: #c9d8ff; background: #f7faff; }
.dy-vis-item input { margin-top: 3px; accent-color: var(--primary); }
.dy-vis-item span span { display: block; font-size: 11.5px; color: var(--text-sub); margin-top: 2px; }
.dy-pick { margin-top: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: #fafbfe; }
.dy-pick-label { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; }
.dy-family, .dy-picked { display: flex; flex-wrap: wrap; gap: 6px; }
.dy-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px;
  background: #eef3ff; color: var(--primary); font-size: 12px; border: 1px solid #dbe5ff;
}
.dy-chip.pick { cursor: pointer; background: #fff; color: var(--text); border-color: var(--border); }
.dy-chip.pick:hover { border-color: #b9cdff; color: var(--primary); background: #f7faff; }
.dy-chip button { border: 0; background: transparent; color: var(--text-sub); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 1px; }
.dy-chip button:hover { color: var(--danger); }
.dy-user-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 168px; overflow-y: auto; }
.dy-user { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; padding: 4px 2px; border-bottom: 1px dashed var(--border); }
.dy-user:last-child { border-bottom: 0; }

/* 编辑器 */
.dy-form { display: flex; flex-direction: column; gap: 12px; }
.dy-row { display: flex; gap: 12px; }
.dy-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.dy-field > span { color: var(--text-sub); font-size: 12.5px; }
.dy-field input, .dy-field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px;
  font-family: inherit; font-size: 13.5px; color: var(--text); background: #fff;
}
.dy-field textarea { resize: vertical; line-height: 1.75; }
.dy-field input:focus, .dy-field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 124, 255, .15);
}
.dy-moods { display: flex; gap: 6px; flex-wrap: wrap; }
.dy-mood-name { color: var(--primary); font-style: normal; font-weight: 600; margin-left: 6px; }
.dy-mood {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer;
  transition: all .15s ease;
}
.dy-mood:hover { border-color: #c9d8ff; background: #f7faff; }
.dy-mood.on { border-color: var(--primary); background: #eef3ff; box-shadow: 0 0 0 3px rgba(79, 124, 255, .12); }
.dy-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.dy-photo-item {
  position: relative; width: 84px; height: 84px; border-radius: 10px;
  background-size: cover; background-position: center; border: 1px solid var(--border);
}
.dy-photo-item button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid var(--border); background: #fff; color: var(--text-sub); cursor: pointer;
  font-size: 12px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.dy-photo-item button:hover { color: var(--danger); border-color: #f5c2c0; }

@media (max-width: 760px) {
  .diary-grid { grid-template-columns: 1fr; }
  .dy-row { flex-direction: column; }
}
/* 天气预设标签 */
.dy-weathers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.dy-weather {
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: #fff; font-size: 12px; color: var(--text-sub); cursor: pointer;
  user-select: none; transition: all .15s ease; white-space: nowrap;
}
.dy-weather:hover { border-color: #c9d8ff; color: var(--primary); background: #f7faff; }
.dy-weather.on { border-color: var(--primary); background: #eef3ff; color: var(--primary); font-weight: 600; }
/* 日记：富文本编辑器 */
.dy-editor { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; }
.dy-editor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 124, 255, .15); }
.dy-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 6px 8px; background: #f8faff; border-bottom: 1px solid var(--border);
}
.dy-tools button {
  min-width: 30px; height: 28px; padding: 0 7px; border-radius: 7px;
  border: 1px solid transparent; background: transparent; color: var(--text);
  font-size: 13px; font-family: inherit; cursor: pointer; line-height: 1;
  transition: all .14s ease;
}
.dy-tools button:hover { background: #eef3ff; border-color: #dbe5ff; color: var(--primary); }
.dy-tools button:active { transform: translateY(1px); }
.dy-tool-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
/* 工具条：字号下拉 + 文字颜色 / 背景色（原生取色器铺满按钮，点击即开） */
.dy-tools .dy-size {
  height: 26px; padding: 0 4px; border: 1px solid var(--border); border-radius: 7px;
  background: #fff; color: var(--text); font-family: inherit; font-size: 12px; cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease;
}
.dy-tools .dy-size:hover { border-color: #c9d8ff; background: #f7faff; }
.dy-color {
  position: relative; width: 30px; height: 28px; border-radius: 7px; border: 1px solid transparent;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--text); font-size: 13px; font-weight: 700; line-height: 1; user-select: none;
  transition: background-color .14s ease, border-color .14s ease, color .14s ease;
}
.dy-color:hover { background: #eef3ff; border-color: #dbe5ff; color: var(--primary); }
.dy-color .dy-color-ic { position: relative; z-index: 1; }
.dy-color .dy-color-bar {
  position: absolute; left: 6px; right: 6px; bottom: 4px; height: 4px; border-radius: 2px;
  background: #e2504a; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .07);
}
.dy-color.dy-color-bg .dy-color-bar { background: #fff3a3; }
.dy-field .dy-color input[type="color"],
.dy-color input[type="color"] {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0;
  opacity: 0; cursor: pointer; background: transparent; box-shadow: none;
}
.dy-rich {
  min-height: 220px; max-height: 46vh; overflow-y: auto;
  padding: 12px 14px; font-size: 14px; line-height: 1.85; color: var(--text);
  outline: none; word-break: break-word;
}
.dy-rich:empty:before {
  content: attr(data-ph); color: #b7c0d6; pointer-events: none;
}
.dy-rich p { margin: 0 0 8px; }
.dy-rich h2 { font-size: 17px; margin: 12px 0 8px; }
.dy-rich h3 { font-size: 15px; margin: 10px 0 6px; }
.dy-rich ul, .dy-rich ol { margin: 6px 0 10px; padding-left: 22px; }
.dy-rich li { margin: 3px 0; }
.dy-rich blockquote {
  margin: 8px 0; padding: 6px 12px; border-left: 3px solid #c9d8ff;
  background: #f7faff; color: var(--text-sub); border-radius: 0 8px 8px 0;
}
.dy-rich a { color: var(--primary); text-decoration: underline; }
.dy-rich img { max-width: 100%; border-radius: 8px; margin: 6px 0; display: block; }

/* 详情里的富文本正文 */
.diary-view-content.rich p { margin: 0 0 10px; }
.diary-view-content.rich h2 { font-size: 18px; margin: 14px 0 8px; }
.diary-view-content.rich h3 { font-size: 15.5px; margin: 12px 0 6px; }
.diary-view-content.rich ul, .diary-view-content.rich ol { margin: 8px 0 12px; padding-left: 24px; }
.diary-view-content.rich blockquote {
  margin: 10px 0; padding: 8px 14px; border-left: 3px solid #c9d8ff;
  background: #f7faff; color: var(--text-sub); border-radius: 0 8px 8px 0;
}
.diary-view-content.rich img { max-width: 100%; border-radius: 10px; margin: 10px 0; display: block; }
.diary-view-content.rich a { color: var(--primary); text-decoration: underline; }
/* 日记编辑器：宽版布局（尽量一屏放完，不出纵向滚动条） */
.modal.modal-diary { max-width: 960px; }
.modal.wide .dy-form { gap: 8px; }
.dy-row-top { align-items: flex-end; flex-wrap: wrap; row-gap: 8px; }
.dy-row-tags { align-items: flex-start; flex-wrap: wrap; row-gap: 8px; }
.dy-row-bottom { align-items: flex-start; flex-wrap: wrap; row-gap: 8px; }
.modal.wide .dy-rich { min-height: 150px; max-height: 32vh; }
.modal.wide .dy-tools { padding: 5px 8px; }
.modal.wide .dy-photos { min-height: 72px; align-content: flex-start; }
/* 标题 + 大脑生成按钮 */
.dy-title-row { display: flex; gap: 8px; align-items: center; }
.dy-title-row input { flex: 1; }
.dy-gen-title {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: #fff; font-size: 17px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s ease;
}
.dy-gen-title:hover { border-color: #c9d8ff; background: #f7faff; transform: translateY(-1px); }
.dy-gen-title:active { transform: scale(.96); }
.dy-field input.flash { animation: dyFlash .6s ease; }
@keyframes dyFlash {
  0% { background: #eef3ff; border-color: var(--primary); }
  100% { background: #fff; }
}
/* 主要事件：编辑器内的标签输入框 */
.dy-ev-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 9px; background: #fff;
  min-height: 38px; transition: border-color .16s ease, box-shadow .16s ease;
}
.dy-ev-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 124, 255, .15); }
.dy-ev-chips { display: contents; }
.dy-ev-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 5px 3px 10px; border-radius: 999px;
  background: #eef3ff; border: 1px solid #dbe5ff; color: var(--primary); font-size: 12px; white-space: nowrap;
}
.dy-ev-chip button {
  border: 0; background: transparent; color: var(--text-sub); cursor: pointer; font-size: 13px;
  line-height: 1; padding: 0 2px; border-radius: 50%;
}
.dy-ev-chip button:hover { color: var(--danger); }
/* 健康状况标签：青绿色，和主要事件（蓝）区分 */
.dy-ev-chip.hl { background: #e8f7f1; border-color: #cbeade; color: #1f8a63; }
.diary-hl-tag, .dy-hl-tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
  background: #e8f7f1; color: #1f8a63; border: 1px solid #cbeade; white-space: nowrap;
}
.dy-field .dy-ev-input,
.dy-ev-box input {
  flex: 1 1 160px; width: auto; min-width: 130px; border: 0; padding: 4px 2px;
  font-size: 13px; background: transparent; box-shadow: none; outline: none;
}
.dy-ev-box input:focus { border: 0; box-shadow: none; }
.dy-ev-box input:disabled { background: transparent; }
.dy-ev-box .btn.sm { flex: none; height: 26px; padding: 0 10px; font-size: 12px; }
/* 事件选择弹窗 */
.dy-ev-new { display: flex; gap: 8px; }
.dy-ev-new input {
  flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px;
  font-family: inherit; font-size: 13.5px; color: var(--text); background: #fff;
}
.dy-ev-new input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 124, 255, .15); }
.dy-ev-lab { font-size: 12px; color: var(--text-sub); margin: 10px 0 6px; }
.dy-ev-lab b { color: var(--primary); }
.dy-ev-sel { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.dy-ev-lib {
  display: flex; flex-direction: column; gap: 4px; max-height: 236px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: #fafbfe;
}
.dy-ev-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px;
  border: 1px solid transparent; cursor: pointer; font-size: 13px; background: #fff;
  transition: border-color .14s ease, background-color .14s ease;
}
.dy-ev-item:hover { border-color: #c9d8ff; background: #f7faff; }
.dy-ev-item.on { border-color: var(--primary); background: #eef3ff; color: var(--primary); font-weight: 600; }
.dy-ev-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dy-ev-used { flex: none; font-size: 11.5px; color: var(--text-sub); font-weight: 400; }
.dy-ev-del {
  flex: none; border: 0; background: transparent; color: var(--text-sub); font-size: 12px;
  cursor: pointer; padding: 2px 4px; border-radius: 6px;
}
.dy-ev-del:hover { color: var(--danger); background: #fdeceb; }
/* 列表卡片 / 详情里的事件标签 */
.diary-ev-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.diary-ev-tag, .dy-ev-tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
  background: #f2f5ff; color: #4f6fb3; border: 1px solid #e3eaff; white-space: nowrap;
}
.diary-ev-tag.more { background: #f6f7fb; color: var(--text-sub); border-color: var(--border); }
.diary-view-events { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

/* 心情日记：第二行筛选（天气 / 心情 / 主要事件 / 健康状况 / 状态） */
.dy-fbar { margin-top: -8px; gap: 6px; }
.dy-fbar-lab { font-size: 12px; color: var(--text-sub); margin-right: 2px; }
.dy-fbar .sel {
  height: 30px; font-size: 12.5px; padding: 0 26px 0 9px;
  background-position: right 8px center; background-size: 11px 11px; max-width: 190px;
}
.dy-fbar .sel.on { border-color: var(--primary); color: var(--primary-dark); font-weight: 600; background-color: #f2f6ff; }
.dy-fbar .sel:disabled { color: #aeb6c8; background-color: #f6f7fb; }
.dy-fbar .dy-freset { color: var(--text-sub); }
.dy-fbar .dy-freset:hover { color: var(--danger); border-color: #f0c8c8; }

/* 日记：关联待办（编辑区已选 chip + 详情里的标签） */
.dy-todo-box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.dy-todo-chips { display: contents; }
.dy-todo-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 5px 3px 10px; border-radius: 999px;
  background: #fff6e8; border: 1px solid #f4dfbe; color: #a4691a; font-size: 12px; white-space: nowrap;
}
.dy-todo-chip button {
  border: 0; background: transparent; color: var(--text-sub); cursor: pointer; font-size: 13px;
  line-height: 1; padding: 0 2px; border-radius: 50%;
}
.dy-todo-chip button:hover { color: var(--danger); }
.dy-todo-tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
  background: #fff6e8; color: #a4691a; border: 1px solid #f4dfbe; white-space: nowrap; cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease;
}
.dy-todo-tag:hover { border-color: #e7b96f; background: #fff2dd; }
.dy-todo-tag.done { background: #eef7ee; border-color: #cfe6cf; color: #3d7a42; }

/* 关联待办选择弹窗 */
.tdp-list {
  display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: #fafbfe;
}
.tdp-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 13px;
  border: 1px solid transparent; background: #fff; cursor: pointer;
  transition: border-color .14s ease, background-color .14s ease;
}
.tdp-row:hover { border-color: #c9d8ff; background: #f7faff; }
.tdp-row.on { border-color: var(--primary); background: #eef3ff; }
.tdp-check {
  flex: none; width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; color: #fff; background: #fff;
}
.tdp-row.on .tdp-check { background: var(--primary); border-color: var(--primary); }
.tdp-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tdp-rep { margin-right: 4px; font-size: 11px; opacity: .75; }
.tdp-date { flex: none; font-size: 11.5px; color: var(--text-sub); }
/* 一天写了多篇：对话里点消息后的选择列表 */
.dy-day-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; }
.dy-day-row {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfe;
  cursor: pointer; transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.dy-day-row:hover { border-color: #c9d8ff; background: #f7faff; transform: translateY(-1px); }
.dy-day-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.dy-day-meta { font-size: 11.5px; color: var(--text-sub); margin-top: 3px; }
.dy-day-exc { font-size: 12.5px; color: var(--text-sub); margin-top: 5px; line-height: 1.6; }
.dy-day-ev { font-size: 11.5px; color: #4f6fb3; margin-top: 4px; }
/* 日记页：对话指令带过来的「某一天」筛选条 */
.dy-date-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 999px;
  background: #eef3ff; border: 1px solid #dbe5ff; color: var(--primary); font-size: 12px; white-space: nowrap;
}
.dy-date-chip button {
  border: 0; background: transparent; color: var(--text-sub); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0 3px; border-radius: 50%;
}
.dy-date-chip button:hover { color: var(--danger); }

/* ---------- 提醒阈值设置弹窗 ---------- */
.rm-set { max-width: 430px; }
.rm-title { display: flex; align-items: center; gap: 9px; font-size: 16px; margin: 0 0 6px; }
.rm-title .rm-ico { width: 26px; height: 26px; font-size: 14px; }
.rm-sub { margin: 0 0 14px; font-size: 12.5px; color: var(--text-sub); line-height: 1.65; }
.rm-rows { display: flex; flex-direction: column; gap: 10px; }
.rm-row {
  display: flex; align-items: center; gap: 11px; cursor: pointer;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fafbfe;
  transition: border-color .15s ease, background-color .15s ease;
}
.rm-row:hover, .rm-row:focus-within { border-color: #c9d8ff; background: #f7faff; }
.rm-ico {
  flex: none; width: 30px; height: 30px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; background: #f3f7ff; border: 1px solid #e4ecff;
}
.rm-desc { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rm-desc b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.rm-desc em { font-style: normal; font-size: 11.5px; color: var(--text-sub); line-height: 1.5; }
.rm-field { flex: none; display: inline-flex; align-items: center; gap: 6px; }
.rm-field .rm-num {
  width: 74px; text-align: center; padding: 7px 8px; font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 9px; background: #fff; color: var(--text);
}
.rm-field .rm-num:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 124, 255, .15); }
.rm-field i { font-style: normal; font-size: 12.5px; color: var(--text-sub); }
.rm-quick { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.rm-quick > span { font-size: 12px; color: var(--text-sub); }
.rm-quick .btn.sm { min-width: 46px; }
.rm-tip {
  margin: 12px 0 0; font-size: 12px; color: #3d5680; line-height: 1.65;
  background: #f4f8ff; border: 1px solid #e2ecff; border-radius: 10px; padding: 9px 12px;
}

/* ---------- 影响因子页面 ---------- */
.inf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .inf-grid { grid-template-columns: 1fr; } }
.inf-card {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px 16px; box-shadow: 0 4px 14px rgba(45, 60, 110, .05);
}
.inf-card h3 { margin: 0 0 6px; font-size: 14.5px; display: flex; align-items: baseline; gap: 8px; }
.inf-sub { font-size: 12px; font-weight: 400; color: var(--text-sub); }
.inf-sub b { color: var(--primary); }
.inf-tip { margin: 0 0 10px; font-size: 12px; color: var(--text-sub); line-height: 1.65; }
.inf-profs { display: flex; flex-direction: column; gap: 10px; }
.inf-prof { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #fafbfe; }
.inf-prof-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inf-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-width: 108px; }
.inf-pick b { font-size: 13.5px; }
.inf-desc { flex: 1; min-width: 0; font-size: 12px; color: var(--text-sub); }
.inf-weights { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.inf-w { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-sub); }
.inf-w input, .inf-score {
  width: 74px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px;
  font-family: inherit; font-size: 13px; color: var(--text); background: #fff;
}
.inf-w input:focus, .inf-score:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,124,255,.15); }
.inf-sum { font-size: 12px; color: var(--text-sub); }
.inf-sum.warn { color: #c0392b; }
/* 六维权重一行放不下时按行折开，输入框略窄一点更紧凑 */
.inf-weights { gap: 10px 14px; }
.inf-w input { width: 66px; }
/* 鼠标移到某套模式上：把「保存我的权重」提亮，提示这里能改 */
.inf-prof { transition: border-color .15s ease, box-shadow .15s ease; }
.inf-prof:hover, .inf-prof:focus-within { border-color: #c9d8ff; box-shadow: 0 2px 10px rgba(79, 124, 255, .08); }
.inf-prof [data-save] { transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease; }
.inf-prof:hover [data-save], .inf-prof:focus-within [data-save] {
  color: var(--primary); border-color: #bcd0ff; background: #f2f6ff;
  box-shadow: 0 0 0 3px rgba(79, 124, 255, .10);
}
.inf-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px dashed var(--border);
}
.inf-item:last-child { border-bottom: 0; }
.inf-ic { width: 22px; text-align: center; font-size: 15px; flex: none; }
.inf-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inf-custom { margin-left: 6px; font-size: 10.5px; color: var(--primary); border: 1px solid #dbe5ff; background: #f2f6ff; border-radius: 999px; padding: 0 6px; }
.inf-sw { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-sub); flex: none; }
.inf-tags { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .inf-tags { grid-template-columns: 1fr; } }
.inf-taggroup { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: #fafbfe; }
.inf-tagtitle { font-size: 12.5px; color: var(--text-sub); margin-bottom: 6px; }
.inf-tag { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
.inf-tag .inf-name { flex: 1; font-size: 13px; }

/* 日记卡片 / 详情里的影响指数 */
.diary-score {
  display: inline-block; min-width: 34px; text-align: center; padding: 0 6px; border-radius: 999px;
  font-size: 11px; font-weight: 600; line-height: 17px;
  background: #f2f5ff; color: #4f6fb3; border: 1px solid #e3eaff;
}
.diary-score.up { background: #eafaf1; color: #1c8b5c; border-color: #c9ecdb; }
.diary-score.down { background: #fdeeee; color: #c0392b; border-color: #f6d3d0; }
.diary-an {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 10px;
  padding: 7px 10px; border-radius: 10px; background: #f6f8ff; border: 1px solid #e3eaff;
}
.diary-an.up { background: #effaf4; border-color: #cfeadd; }
.diary-an.down { background: #fdf1f0; border-color: #f6d7d4; }
.diary-an-score { font-size: 14px; font-weight: 700; color: #4f6fb3; }
.diary-an.up .diary-an-score { color: #1c8b5c; }
.diary-an.down .diary-an-score { color: #c0392b; }
.diary-an-level { font-size: 12.5px; font-weight: 600; }
.diary-an-prof { font-size: 11.5px; color: var(--text-sub); }
.diary-an-parts { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.diary-an-part {
  font-size: 11px; color: var(--text-sub); background: #fff; border: 1px solid var(--border);
  border-radius: 999px; padding: 0 8px; line-height: 18px;
}
/* 影响因子：当前使用中的标记 */
.inf-pick { display: inline-flex; align-items: center; gap: 8px; }
.inf-pick.on b { color: var(--primary); }
.inf-badge {
  font-size: 11px; color: #1c8b5c; background: #eafaf1; border: 1px solid #c9ecdb;
  border-radius: 999px; padding: 0 7px; line-height: 17px; font-weight: 600;
}
/* 日记页：平均影响指数 */
.dy-avg {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-sub);
  background: #f6f8ff; border: 1px solid #e3eaff; border-radius: 999px; padding: 2px 10px;
}
.dy-avg b { font-size: 13px; color: #4f6fb3; }
.dy-avg.up { background: #effaf4; border-color: #cfeadd; }
.dy-avg.up b { color: #1c8b5c; }
.dy-avg.down { background: #fdf1f0; border-color: #f6d7d4; }
.dy-avg.down b { color: #c0392b; }
.dy-avg span { font-size: 11.5px; }

/* 影响因子：最近日记评分 */
.inf-recent { display: flex; flex-direction: column; gap: 4px; }
.inf-recent-row {
  display: grid; grid-template-columns: 54px 1fr auto auto; align-items: center; gap: 10px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: #fafbfe;
  cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
.inf-recent-row:hover { border-color: #c9d8ff; background: #f7faff; }
.inf-recent-date { font-size: 12px; color: var(--text-sub); }
.inf-recent-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inf-recent-parts { font-size: 11.5px; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inf-recent-row .diary-score { min-width: 92px; }
/* 日期栏里的状态得分：窄栏里的小药丸，正绿负红 */
.diary-date .diary-date-score {
  display: inline-block; min-width: 0; margin-top: 4px; padding: 0 6px;
  font-size: 11px; line-height: 16px; font-weight: 700; letter-spacing: .2px;
}
/* 正文为空时的占位文案 */
.diary-empty-text { color: var(--text-sub); margin: 0; }
/* 日记详情：改善建议 */
.diary-advice {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: #fffbf2; border: 1px solid #f6e6c9;
}
.diary-advice-title { font-size: 12.5px; font-weight: 600; color: #a9701a; margin-bottom: 6px; }
.diary-advice-title span { font-weight: 400; color: var(--text-sub); font-size: 11.5px; }
.diary-advice ul { margin: 0; padding-left: 18px; }
.diary-advice li { font-size: 12.5px; line-height: 1.75; color: var(--text); }

/* 影响因子：改善建议管理 */
.inf-advice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .inf-advice { grid-template-columns: 1fr; } }
.inf-adv-group { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; background: #fafbfe; }
.inf-adv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.inf-adv-head b { font-size: 13px; }
.inf-adv-range { font-size: 11.5px; color: var(--text-sub); }
.inf-adv-head .btn.sm { margin-left: auto; }
.inf-adv { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-top: 1px dashed var(--border); }
.inf-adv-group .inf-adv:first-of-type { border-top: 0; }
.inf-adv-text { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.6; }
.inf-adv-tag {
  flex: none; font-size: 10.5px; color: var(--text-sub); border: 1px solid var(--border);
  background: #fff; border-radius: 999px; padding: 0 6px; line-height: 16px;
}
.inf-adv-tag.mine { color: var(--primary); border-color: #dbe5ff; background: #f2f6ff; }

/* ---------- 影响因子：区块折叠 ---------- */
.inf-card.collapsible .inf-head {
  cursor: pointer; user-select: none; -webkit-user-select: none;
  align-items: center; padding: 2px 0; border-radius: 6px;
  transition: color .15s ease;
}
.inf-card.collapsible .inf-head:hover { color: var(--primary); }
.inf-card.collapsible .inf-head:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.inf-card.collapsible .inf-head > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.inf-caret {
  margin-left: auto; flex: none; font-size: 11px; line-height: 1;
  color: var(--text-sub); transition: transform .18s ease;
}
.inf-card.collapsed .inf-caret { transform: rotate(-90deg); }
.inf-card.collapsed .inf-body { display: none; }
.inf-card.collapsed { padding-bottom: 12px; }
/* 影响因子/健康因子：标题前的小图标（圆角浅底，与标题垂直居中） */
.inf-card.collapsible .inf-ico {
  flex: none; width: 22px; height: 22px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; line-height: 1;
  background: #f3f7ff; border: 1px solid #e4ecff;
}

/* 健康因子：收支因子卡片 */
.inf-fin-top { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13px; color: var(--text-sub); margin-bottom: 8px; }
.inf-fin-top b { color: var(--text); font-weight: 600; }
.inf-fin-today { font-size: 14px; margin-bottom: 10px; }
.inf-fin-today b { font-weight: 600; }
.inf-fin-list { display: flex; flex-direction: column; }
.inf-fin-row { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed #eef1f7; }
.inf-fin-row:last-child { border-bottom: 0; }
.inf-fin-date { width: 52px; color: var(--text-sub); flex: none; }
.inf-fin-delta { flex: 1; min-width: 0; }

/* 存款目标页：节俭计划 / 消费建议 可折叠（收起时只留标题行） */
.sv-card[data-fold] > .sv-card-head { cursor: pointer; user-select: none; }
.sv-card[data-fold] > .sv-card-head::after {
  content: '▾'; margin-left: 8px; color: var(--text-sub); font-size: 12px; transition: transform .15s;
}
.sv-card[data-fold].collapsed > .sv-card-head::after { content: '▸'; }
.sv-card[data-fold].collapsed > *:not(.sv-card-head) { display: none; }
.sv-card[data-fold].collapsed > .sv-card-head { border-bottom: 0; }

/* ============================================================ 健康管理 */
.hl-sum { display: grid; grid-template-columns: 320px 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .hl-sum { grid-template-columns: 1fr; } }

.hl-score { padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.hl-score-top { display: flex; align-items: center; justify-content: space-between; }
.hl-score-num { font-size: 40px; font-weight: 800; line-height: 1.05; letter-spacing: -1px; }
.hl-score-grade { font-size: 13px; font-weight: 700; margin-top: 2px; }
.hl-score-emoji { font-size: 34px; line-height: 1; }
.hl-meter { height: 7px; border-radius: 999px; background: #eef2fb; overflow: hidden; }
.hl-meter > i { display: block; height: 100%; border-radius: 999px; transition: width .35s ease; }
.hl-score-sub { font-size: 12.5px; color: var(--text-sub); }
.hl-score-meta { font-size: 11.5px; color: var(--text-sub); opacity: .9; }

.hl-body { padding: 18px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.hl-body-row { display: flex; align-items: center; gap: 12px; }
.hl-body-row .hl-lab { width: 42px; flex: none; font-size: 13px; color: var(--text-sub); }
.hl-body-row b { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; }
.hl-body-row b small { font-size: 12px; font-weight: 500; color: var(--text-sub); margin-left: 2px; }
.hl-body-row em { font-style: normal; font-size: 12px; color: var(--text-sub); }
.hl-body-hint { font-size: 11.5px; color: var(--text-sub); border-top: 1px dashed var(--border); padding-top: 9px; }

.hl-empty { color: var(--text-sub); font-weight: 500; font-size: 15px; }
.hl-st.ok { color: var(--success); }
.hl-st.warn { color: var(--warn); }
.hl-st.bad { color: var(--danger); }

.hl-tipbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #f4f8ff; border: 1px solid #e2ecff; color: #3d5680;
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px;
}

.hl-sec-title { display: flex; align-items: baseline; gap: 10px; font-size: 15px; font-weight: 700; margin: 4px 0 10px; }
.hl-sec-title span { font-size: 12px; font-weight: 400; color: var(--text-sub); }

.hl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.hl-m { padding: 13px 14px; display: flex; flex-direction: column; gap: 7px; }
.hl-m.off { opacity: .55; }
.hl-m-top { display: flex; align-items: center; gap: 6px; }
.hl-m-top b { font-size: 14px; flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.hl-tag {
  font-size: 10px; padding: 1px 6px; border-radius: 999px; flex: none;
  background: #eef3ff; color: #4f6fb3; border: 1px solid #e0e9fb;
}
.hl-tag.custom { background: #f3f0ff; color: #6d5bd0; border-color: #e7e1ff; }
.hl-tag.auto { background: #eafaf1; color: #1c8b5c; border-color: #c9ecdb; }
.hl-tag.off { background: #f4f5f8; color: #8a93a8; border-color: #e8eaf0; }
.hl-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: #cfd6e6; }
.hl-dot.ok { background: #2f9e6e; }
.hl-dot.warn { background: #f39c12; }
.hl-dot.bad { background: #e74c3c; }
.hl-dot.stale { background: #b0b8c9; }
.hl-dot.record { background: #4f7cff; }

.hl-m-val { font-size: 22px; font-weight: 700; line-height: 1.1; }
.hl-m-val small { font-size: 11px; font-weight: 500; color: var(--text-sub); margin-left: 3px; }
.hl-m-sub { font-size: 11.5px; color: var(--text-sub); line-height: 1.5; min-height: 17px; }
.hl-m-foot { display: flex; gap: 8px; align-items: center; margin-top: 2px; }
.hl-m-tip { font-size: 11px; color: var(--text-sub); }

.hl-trend { padding: 16px; }
.hl-trend-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hl-trend-head b { font-size: 15px; }
.hl-trend-head select { padding: 5px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); }
.hl-trend-note { font-size: 12px; color: var(--text-sub); }

.hl-form { display: flex; flex-direction: column; gap: 12px; min-width: 380px; }
@media (max-width: 520px) {
  .hl-form { min-width: 0; }
  .modal-body { padding: 12px 14px 16px; }
  .modal-foot, .hl-form-foot { flex-wrap: wrap; }
  .modal-foot .btn, .hl-form-foot .btn { flex: 1 1 auto; }
}
.hl-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--text-sub); }
.hl-form input, .hl-form select {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; color: var(--text); background: var(--card);
}
.hl-form-hint { font-size: 11.5px; color: var(--text-sub); line-height: 1.6; }
.hl-form-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.hl-e-range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hl-e-lvhead { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--text-sub); margin-bottom: 6px; }
.hl-e-lvrow { display: grid; grid-template-columns: 1fr 90px 46px; gap: 8px; margin-bottom: 6px; }

.hl-mg { display: flex; flex-direction: column; gap: 10px; min-width: 620px; }
.hl-mg-hint { font-size: 12px; color: var(--text-sub); line-height: 1.6; }
.hl-mg-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow: auto; }
.hl-mg-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
}
.hl-mg-row.off { opacity: .6; }
.hl-mg-name { display: flex; align-items: center; gap: 6px; width: clamp(190px, 24vw, 300px); flex: none; }
.hl-mg-name b { flex: 1; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.hl-mg-meta { flex: 1; min-width: 0; font-size: 12px; color: var(--text-sub); }
.hl-mg-ops { display: flex; gap: 6px; flex: none; }
.hl-empty-box { padding: 30px; text-align: center; color: var(--text-sub); }

/* ============================================================ 健康报告 */
.rp-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 14px; }
.rp-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: #fff;
  font-family: inherit; font-size: 13px; color: var(--text-sub);
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.rp-tab:hover { border-color: #c9d8ff; color: var(--primary); }
.rp-tab.on { border-color: #bcd0ff; background: #f2f6ff; color: var(--primary); font-weight: 600; }
.rp-tab b {
  font-size: 11px; font-weight: 700; line-height: 16px; padding: 0 6px;
  border-radius: 999px; background: #eef3ff; color: #4f7cff;
}
.rp-tab.on b { background: #fff; }

.rp-hero {
  display: flex; align-items: center; gap: 20px;
  padding: 18px 22px; margin-bottom: 14px; border-left: 4px solid #c3c9d8;
}
.rp-hero.good { border-left-color: #2f9e6e; }
.rp-hero.steady { border-left-color: #4f7cff; }
.rp-hero.watch { border-left-color: #e08b00; }
.rp-hero-left { flex: none; text-align: center; min-width: 92px; }
.rp-score { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: -1.5px; color: var(--text); }
.rp-score small { font-size: 13px; font-weight: 600; color: var(--text-sub); margin-left: 3px; letter-spacing: 0; }
.rp-score-none { color: #c3c9d8; }
.rp-grade { font-size: 12.5px; color: var(--text-sub); margin-top: 8px; }
.rp-hero-main { flex: 1; min-width: 0; }
.rp-headline { font-size: 17px; font-weight: 700; line-height: 1.55; }
.rp-subline { font-size: 13px; color: var(--text-sub); margin-top: 6px; line-height: 1.7; }
.rp-meta { font-size: 11.5px; color: var(--text-sub); opacity: .85; margin-top: 6px; }
.rp-hero-empty { border-left-color: #e3e8f5; gap: 14px; }
.rp-hero-empty-ico { font-size: 30px; }
.rp-hero-empty b { font-size: 15px; }
.rp-hero-empty p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-sub); line-height: 1.7; }
.rp-hero-empty .btn { margin-left: auto; flex: none; }

.rp-dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 900px) { .rp-dims { grid-template-columns: 1fr; } }
.rp-dim { padding: 14px 16px; }
.rp-dim-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.rp-dim-head b { font-size: 14px; }
.rp-dim-ico {
  width: 24px; height: 24px; border-radius: 8px; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f3f7ff; border: 1px solid #e4ecff; flex: none;
}
.rp-dim-score { margin-left: auto; font-size: 21px; font-weight: 800; letter-spacing: -.5px; }
.rp-dim-none { color: #c3c9d8; }
.rp-bar { height: 6px; border-radius: 999px; background: #eef2fb; overflow: hidden; margin: 10px 0 8px; }
.rp-bar > i { display: block; height: 100%; border-radius: 999px; transition: width .4s ease; }
.rp-dim-text { font-size: 12.5px; line-height: 1.7; margin: 0; color: var(--text); }
.rp-dim-hint { font-size: 11.5px; color: var(--text-sub); margin-top: 7px; }

.rp-cols { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 980px) { .rp-cols { grid-template-columns: 1fr; } }
.rp-trend, .rp-advice { padding: 16px 18px; }
.rp-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.rp-card-head b { font-size: 14.5px; }
.rp-card-head span { font-size: 11.5px; color: var(--text-sub); }
.rp-trend-note { font-size: 11.5px; color: var(--text-sub); margin-top: 8px; }
.rp-advice ul { margin: 0; padding-left: 18px; }
.rp-advice li { font-size: 13px; line-height: 2; color: var(--text); }
.rp-notes { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.rp-note { font-size: 12.5px; padding: 8px 10px; border-radius: 9px; line-height: 1.65; }
.rp-note.good { background: #effaf4; border: 1px solid #cfeadd; color: #1c8b5c; }
.rp-note.care { background: #fffbf2; border: 1px solid #f6e6c9; color: #a9701a; }
.rp-foot { margin: 2px 0 30px; font-size: 12px; line-height: 1.8; }

/* 页头问候（放在右上角用户名左边）：图标 + 一句话 + 分数，点一下进健康报告 */
.greet-inline {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 340px; padding: 4px 10px 4px 6px; margin-right: 8px;
  border: 1px solid #e3eaff; border-radius: 999px; background: #f7faff;
  font-family: inherit; font-size: 12.5px; color: #4f6fb3; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.greet-inline:empty { display: none; }
.greet-inline:hover { border-color: #bcd0ff; background: #eef3ff; box-shadow: 0 2px 8px rgba(79, 124, 255, .12); }
.greet-inline:focus-visible { outline: 2px solid rgba(79, 124, 255, .45); outline-offset: 2px; }
.gi-ico { flex: none; font-size: 13px; line-height: 1; }
.gi-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gi-score { flex: none; font-size: 11px; font-weight: 700; color: #4f7cff; background: #fff; border-radius: 999px; padding: 0 6px; line-height: 16px; }
@media (max-width: 1100px) { .greet-inline { max-width: 210px; } }
@media (max-width: 820px) { .greet-inline { display: none; } }

/* ---------- App 发布：上传进度条 ---------- */
.ap-prog { margin-top: 14px; }
.ap-prog[hidden] { display: none; }
.ap-prog-bar { height: 8px; border-radius: 999px; background: #eef2fb; overflow: hidden; }
.ap-prog-bar > i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, #4f7cff, #6ea8ff);
  transition: width .18s ease;
}
.ap-prog-bar > i.ok { background: linear-gradient(90deg, #2f9e6e, #4cc38a); }
.ap-prog-bar > i.bad { background: #d9534f; }
.ap-prog-txt { margin-top: 6px; font-size: 11.5px; color: var(--text-sub); }

/* ---------- 备份与恢复：三张方式卡片 ---------- */
.bk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.bk-item {
  display: flex; flex-direction: column; gap: 10px;
  border: 1px solid var(--border, #d5dcec); border-radius: 12px;
  padding: 14px 15px; background: var(--bg-sub, #f7f9fd);
}
.bk-title { font-size: 14px; font-weight: 700; color: var(--text); }
.bk-desc { flex: 1; font-size: 12px; line-height: 1.65; color: var(--text-sub); }
.bk-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.bk-actions .btn { min-width: 116px; }
@media (max-width: 720px) {
  .bk-grid { grid-template-columns: 1fr; }
  .bk-actions .btn { flex: 1; min-width: 0; }
}

/* ---------- 自动备份设置面板 ---------- */
.bk-auto {
  margin-top: 16px; padding: 14px 16px;
  border: 1px solid var(--border, #d5dcec); border-radius: 12px;
  background: var(--bg-sub, #f7f9fd);
}
.bk-auto-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 12px;
}
.bk-auto-head .bk-title { font-size: 14px; }
.bk-auto-switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-sub); }
.bk-auto-fields {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px 18px; margin-bottom: 10px;
}
.bk-auto-field { display: flex; flex-direction: column; gap: 7px; font-size: 12px; color: var(--text-sub); }
.bk-auto-field input, .bk-auto-field select {
  height: 34px; padding: 0 10px; border: 1px solid var(--border, #d5dcec);
  border-radius: 8px; background: #fff; color: var(--text); font-size: 13px;
}
.bk-auto-status { font-size: 12px; line-height: 1.8; color: var(--text-sub); margin: 2px 0 12px; }
.bk-auto-status b { color: var(--text); }
.bk-auto-status .bad { color: #d9534f; }
.bk-auto-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.bk-auto-actions select {
  height: 34px; padding: 0 10px; border: 1px solid var(--border, #d5dcec);
  border-radius: 8px; background: #fff; color: var(--text); font-size: 13px;
}
@media (max-width: 720px) {
  .bk-auto-fields { grid-template-columns: 1fr; }
  .bk-auto-actions .btn { flex: 1; min-width: 0; }
}


