/* ============ EucaMoney 全局样式 ============ */

:root {
  --bg: #f5f7f6;
  --surface: #ffffff;
  --text: #1f2933;
  --text-muted: #6b7280;
  --border: #e3e8e6;
  --primary: #16a34a;
  --primary-hover: #15803d;
  --primary-soft: #e7f6ec;
  --income: #16a34a;
  --expense: #dc2626;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --transfer: #0284c7;
  --transfer-soft: #e0f2fe;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --radius: 12px;
}

html[data-theme="dark"] {
  --bg: #111714;
  --surface: #1a221e;
  --text: #e5e9e7;
  --text-muted: #94a39b;
  --border: #2c3833;
  --primary: #22c55e;
  --primary-hover: #4ade80;
  --primary-soft: #16301f;
  --income: #4ade80;
  --expense: #f87171;
  --danger: #f87171;
  --danger-soft: #3a1d1d;
  --transfer: #38bdf8;
  --transfer-soft: #0c2a3d;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

/* 始终预留滚动条槽位,避免原生弹层(日期选择器等)开关时滚动条显隐导致布局位移 */
html {
  scrollbar-gutter: stable;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--text-muted); }

/* ============ 通用组件 ============ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
  user-select: none;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover:not(:disabled) { background: var(--primary-soft); }

.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); background: rgba(127, 127, 127, 0.08); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { opacity: 0.9; }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover { background: rgba(127, 127, 127, 0.12); }

/* 分段选择器 */
.seg {
  display: flex;
  background: rgba(127, 127, 127, 0.1);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
}
.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg-type .seg-btn.expense.active { color: var(--expense); font-weight: 600; }
.seg-type .seg-btn.income.active { color: var(--income); font-weight: 600; }
.seg-type .seg-btn.transfer.active { color: var(--transfer); font-weight: 600; }

/* 表单 */
.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

input, select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
  color-scheme: light dark;
}
input:focus, select:focus { border-color: var(--primary); }

.form-error {
  color: var(--danger);
  font-size: 13px;
  margin: 0 0 12px;
  min-height: 1em;
}

/* 分类快捷选择 */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* ============ 登录页 ============ */

.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-logo {
  margin: 0;
  font-size: 26px;
  color: var(--primary);
  text-align: center;
}
.auth-sub {
  margin: 4px 0 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}
#auth-mode { margin-bottom: 20px; }

/* ============ 主界面骨架 ============ */

.app-shell { min-height: 100vh; min-height: 100dvh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar-brand { font-weight: 700; font-size: 17px; color: var(--primary); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-user { font-size: 13px; color: var(--text-muted); }

.theme-icon::before { content: "🌙"; }
html[data-theme="dark"] .theme-icon::before { content: "☀️"; }

.main-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px calc(84px + env(safe-area-inset-bottom));
}

.panel-title { margin: 0 0 18px; font-size: 17px; }

/* 底部标签栏(移动优先) */
.main-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 8px 4px 6px;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.nav-icon {
  font-size: 19px;
  line-height: 1.2;
  /* 图标字形宽度不一,固定宽度居中保证文字对齐 */
  width: 1.4em;
  flex: none;
  text-align: center;
}
.nav-btn.active { color: var(--primary); font-weight: 600; }

/* 桌面端:侧边栏 */
@media (min-width: 769px) {
  .app-shell {
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-rows: 52px 1fr;
    grid-template-areas: "nav topbar" "nav main";
    min-height: 100vh;
  }
  .topbar { grid-area: topbar; }
  .main-nav {
    grid-area: nav;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-direction: column;
    gap: 4px;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 16px 10px;
  }
  .nav-btn {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 14px;
    font-size: 14px;
    border-radius: 8px;
  }
  .nav-btn.active { background: var(--primary-soft); }
  .nav-icon { font-size: 16px; }
  .main-content {
    grid-area: main;
    width: 100%;
    padding-bottom: 40px;
  }
}

/* ============ 流水列表 ============ */

.filter-card { margin-bottom: 14px; padding: 14px; }
.filter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (min-width: 769px) {
  /* 桌面端 10 列网格:第一排 备注3/分类3/类型2/钱包2,第二排 金额2+2/日期6 */
  .filter-grid { grid-template-columns: repeat(10, 1fr); }
  .filter-grid > #flt-q { grid-column: span 3; }
  .filter-grid > #flt-category { grid-column: span 3; }
  .filter-grid > #flt-type { grid-column: span 2; }
  .filter-grid > #flt-wallet { grid-column: span 2; }
  .filter-grid > #flt-min,
  .filter-grid > #flt-max { grid-column: span 2; }
  .filter-grid > .flt-dates { grid-column: span 6; }
}
.filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.tx-list { display: flex; flex-direction: column; gap: 10px; }

.tx-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
}
.tx-badge {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
}
.tx-badge.expense { background: var(--danger-soft); color: var(--expense); }
.tx-badge.income { background: var(--primary-soft); color: var(--income); }
.tx-badge.transfer { background: var(--transfer-soft); color: var(--transfer); }

.tx-main { flex: 1; min-width: 0; }
.tx-cat { font-weight: 600; font-size: 14px; }
.tx-note {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-date { color: var(--text-muted); font-size: 12px; }

.tx-right { text-align: right; flex: none; }
.tx-amount { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.tx-amount.expense { color: var(--expense); }
.tx-amount.income { color: var(--income); }
.tx-amount.transfer { color: var(--transfer); }
.tx-ops { margin-top: 2px; }
.tx-ops button {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 4px;
}
.tx-ops button:hover { color: var(--primary); }
.tx-ops button.tx-del:hover { color: var(--danger); }

.list-more { text-align: center; margin: 16px 0 4px; }
.list-end { font-size: 13px; margin: 8px 0; }

.empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 0;
  font-size: 14px;
}

/* ============ 统计 ============ */

.stats-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
}
.stats-controls .seg { flex: 1; min-width: 240px; }
.stats-controls .stats-date-anchor { flex: none; }
.stats-controls .stats-date-anchor input { width: 140px; }
.stats-controls .stats-wallet-sel { flex: none; max-width: 160px; }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card { padding: 14px; text-align: center; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}
.stat-value.income { color: var(--income); }
.stat-value.expense { color: var(--expense); }
.stat-value.transfer { color: var(--transfer); }
@media (min-width: 769px) {
  .stat-value { font-size: 22px; }
}

.chart-card { margin-bottom: 14px; }
.chart-title { margin: 0 0 12px; font-size: 15px; }
.chart-box { position: relative; height: 260px; }
.chart-box-pie { height: 280px; max-width: 420px; margin: 0 auto; }
.empty-hint { text-align: center; color: var(--text-muted); font-size: 13px; margin: 8px 0 0; }

/* ============ 弹窗 ============ */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
}
.modal-title { margin: 0 0 16px; font-size: 16px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}
.modal-text { margin: 0 0 8px; font-size: 14px; }

/* ============ Toast ============ */

.toast-wrap {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: var(--bg);
  border-radius: 999px;
  padding: 8px 20px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toast-in 0.2s ease-out;
  max-width: 80vw;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 邀请码管理 */
.invite-tip { font-size: 13px; margin: 0 0 12px; }
.invite-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.invite-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.invite-used { opacity: 0.65; }
.inv-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.inv-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 2px;
}
.inv-status { font-size: 12px; border-radius: 999px; padding: 2px 10px; }
.inv-status.unused { background: var(--primary-soft); color: var(--income); }
.inv-status.used { background: var(--border); color: var(--text-muted); }
.inv-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inv-time { font-size: 12px; }
.inv-actions { display: inline-flex; gap: 4px; }

/* 钱包管理 */
.wallet-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.wallet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.wal-main { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.wal-name { font-weight: 600; font-size: 15px; }
.wal-balance {
  font-weight: 700;
  font-size: 15px;
  color: var(--transfer);
  font-variant-numeric: tabular-nums;
}
.wal-actions { display: inline-flex; gap: 4px; }

/* ============ 共享开关 / 公共页 / 评论 / 通知 ============ */

/* 自绘 switch 开关 */
.switch-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.switch-label { margin-bottom: 0; }
.switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  inset: 0;
  background: rgba(127, 127, 127, 0.25);
  border-radius: 999px;
  transition: background 0.15s;
}
.switch-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: var(--surface);
  border-radius: 50%;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* 个人流水"已共享"标记 */
.tx-shared-tag {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 400;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 1px 8px;
  vertical-align: 1px;
}

/* 通知铃铛 */
.bell-wrap { position: relative; }
.bell-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  pointer-events: none;
}

/* 通知下拉面板 */
.notif-panel {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 40;
  width: 320px;
  max-width: calc(100vw - 24px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.14);
  overflow: hidden;
}
.notif-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.notif-title { font-weight: 600; font-size: 14px; }
.notif-list { max-height: 60vh; overflow-y: auto; }
.notif-item {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: rgba(127, 127, 127, 0.06); }
.notif-item.unread { background: var(--primary-soft); }
.notif-text { font-size: 13px; line-height: 1.5; word-break: break-all; }
.notif-excerpt { color: var(--text-muted); }
.notif-time { font-size: 11px; margin-top: 2px; }
.notif-empty { text-align: center; padding: 24px 0; margin: 0; font-size: 13px; }

/* 公共页列表 */
.pub-list-title { margin: 4px 0 12px; font-size: 15px; }
.pub-list { display: flex; flex-direction: column; gap: 10px; }
.pub-card { padding: 14px 16px; }

.avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
}
.avatar-sm { width: 24px; height: 24px; font-size: 12px; }

.pub-head { display: flex; align-items: center; gap: 10px; }
.pub-user { font-weight: 600; font-size: 14px; }
.pub-time { margin-left: auto; font-size: 12px; flex: none; }

.pub-body {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}
.pub-main { min-width: 0; }
.pub-cat { font-weight: 600; font-size: 14px; }
.pub-note { font-size: 13px; word-break: break-all; }
.pub-amount {
  flex: none;
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.pub-amount.expense { color: var(--expense); }
.pub-amount.income { color: var(--income); }

.pub-foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
}
.pub-cmt-btn { padding: 4px 10px; font-size: 13px; }

/* 评论区 */
.cmt-area { margin-top: 10px; }
.cmt-box { border-top: 1px dashed var(--border); padding-top: 10px; }
.cmt-list { display: flex; flex-direction: column; gap: 10px; }
.cmt-empty { margin: 0; font-size: 13px; text-align: center; }

.cmt-item { display: flex; gap: 8px; align-items: flex-start; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: baseline; gap: 8px; }
.cmt-user { font-weight: 600; font-size: 13px; }
.cmt-time { font-size: 11px; }
.cmt-text { font-size: 13px; word-break: break-word; white-space: pre-wrap; }
.cmt-reply-tag { color: var(--primary); }
.cmt-img {
  margin-top: 6px;
  max-width: 140px;
  max-height: 140px;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
}
.cmt-reply-btn {
  flex: none;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 2px 4px;
}
.cmt-reply-btn:hover { color: var(--primary); }

/* 评论输入区 */
.cmt-composer { margin-top: 12px; }
.cmt-reply-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
  padding: 4px 10px;
  margin-bottom: 8px;
}
.cmt-reply-cancel {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.cmt-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  resize: vertical;
  min-height: 44px;
}
.cmt-input:focus { border-color: var(--primary); }

.cmt-img-preview {
  position: relative;
  display: inline-block;
  margin-top: 8px;
}
.cmt-img-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}
.cmt-img-del {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--danger);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.cmt-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.cmt-toolbar-spacer { flex: 1; }
.cmt-tool-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cmt-tool-btn:hover { background: var(--primary-soft); border-color: var(--primary); }

/* emoji 面板(4 行 × 8 列) */
.emoji-panel {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  margin-top: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.emoji-panel button {
  border: none;
  background: none;
  font-size: 20px;
  padding: 4px 0;
  cursor: pointer;
  border-radius: 6px;
  line-height: 1.2;
}
.emoji-panel button:hover { background: var(--primary-soft); }

/* @ 用户列表面板 */
.mention-panel {
  margin-top: 8px;
  max-height: 180px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: none;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 7px 12px;
  cursor: pointer;
  text-align: left;
}
.mention-item:hover { background: var(--primary-soft); }
.mention-empty { margin: 0; padding: 12px; font-size: 13px; text-align: center; }

@media (max-width: 768px) {
  .notif-panel { position: fixed; top: 56px; right: 12px; left: 12px; width: auto; }
  .emoji-panel { grid-template-columns: repeat(8, 1fr); }
}

/* 分类管理 */
.field-label-row { display: flex; justify-content: space-between; align-items: center; }
.cat-add-row { display: flex; gap: 8px; margin-bottom: 12px; }
.cat-add-row input { flex: 1; min-width: 0; }
.cat-manage-list { display: flex; flex-direction: column; max-height: 50vh; overflow-y: auto; }
.cat-manage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.cat-manage-item:last-child { border-bottom: none; }
.cat-manage-name { font-size: 14px; }
.cat-manage-actions { display: inline-flex; gap: 2px; flex: none; }

/* 流水筛选:日期标签 */
.flt-field {
  position: relative;
  display: block;
}
.flt-field input { width: 100%; }
.flt-caption {
  position: absolute;
  top: -7px;
  left: 10px;
  padding: 0 5px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: 4px;
  pointer-events: none;
}
.filter-grid .flt-field { margin-top: 0; }
/* 两个日期框放同一排:移动端独占整行,桌面端与其余筛选同排 */
.flt-dates {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  grid-column: 1 / -1;
}
.flt-dates .flt-field { flex: 1; min-width: 0; }
@media (min-width: 769px) {
  .flt-dates { grid-column: auto; margin-top: 0; }
}

/* 自绘日期选择器(流水筛选) */
.dp-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 40;
  width: 252px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}
.flt-field:last-child .dp-panel { left: auto; right: 0; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dp-title { font-size: 14px; font-weight: 600; }
.dp-nav {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
}
.dp-nav:hover { background: var(--primary-soft); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week { margin-bottom: 2px; }
.dp-week span {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 0;
}
.dp-cell {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  text-align: center;
  padding: 6px 0;
  border-radius: 8px;
  cursor: pointer;
}
.dp-cell:hover { background: var(--primary-soft); }
.dp-cell.dp-empty { cursor: default; background: transparent; }
.dp-cell.dp-today { outline: 1px solid var(--primary); outline-offset: -1px; }
.dp-cell.dp-sel { background: var(--primary); color: #fff; }
.dp-cell.dp-sel:hover { background: var(--primary); }
.dp-foot { display: flex; justify-content: space-between; margin-top: 6px; }
.dp-link {
  border: none;
  background: transparent;
  color: var(--primary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.dp-link:hover { background: var(--primary-soft); }

/* 日期+时间组合控件 */
.dp-anchor { position: relative; display: inline-block; }
.dt-row { display: flex; gap: 8px; align-items: center; position: relative; }
.dt-row input { flex: 1; min-width: 0; }
.dt-row select { flex: none; width: 86px; }
.dt-row .dp-panel { top: calc(100% + 6px); left: 0; }
@media (max-width: 768px) {
  .dt-row select { width: 76px; }
}
