/* 小记 PC 网页 · 设计令牌与全局样式（依据 DESIGN.md 设计契约）
   中性色约 88% / accent ≤ 每屏 2 处 / 支出不染色，收入绿+加号，删除才红 */

:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-sunken: #edeff2;
  --fg: #16191d;
  --fg-2: #3a4149;
  --muted: #5a6270;
  --meta: #6e7684;
  --border: #e3e6ea;
  --border-soft: #eff1f4;
  --accent: #1f5673;
  --accent-hover: #17475f;
  --accent-soft: #e9eff3;
  --income: #0e7c5a;
  --warn: #a15c07;
  --danger: #c3352b;
  --mod-note: #1f5673;
  --mod-ledger: #0e7c5a;
  --mod-todo: #8a5a2b;
  --font-body: -apple-system, 'PingFang SC', 'HarmonyOS Sans SC', 'Source Han Sans CN',
    'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
  --font-numeric: 'DIN Alternate', 'SF Pro Display', 'Bahnschrift', -apple-system, 'PingFang SC', sans-serif;
  --radius-md: 8px;
  --radius-lg: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  font-size: 14px;
}

#root { min-height: 100vh; }

.num {
  font-family: var(--font-numeric);
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: 0.01em;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; color: var(--fg); }
a { color: inherit; text-decoration: none; }

/* ---------- 布局骨架 ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px;
  flex: 0 0 216px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 20px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.brand-ic {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
}

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 80ms;
}
.nav a:hover { background: var(--surface-sunken); color: var(--fg-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid var(--border-soft);
  color: var(--meta);
  font-size: 12px;
}
.side-user b { color: var(--fg-2); font-weight: 500; font-size: 13px; }

.content { flex: 1; min-width: 0; padding: 0 32px 64px; max-width: 1080px; margin: 0 auto; }

.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 28px 0 4px;
}

/* ---------- 速记捕捉条（输入优先） ---------- */
.capture {
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 8px 8px 8px 18px;
  box-shadow: 0 2px 8px rgba(22, 25, 29, 0.04);
}
.capture:focus-within { border-color: var(--accent); }
.capture input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 15px;
  background: transparent;
  min-width: 0;
}
.capture input::placeholder { color: var(--meta); }
.capture .submit {
  height: 38px;
  padding: 0 22px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 80ms, transform 80ms;
}
.capture .submit:hover { background: var(--accent-hover); }
.capture .submit:active { transform: scale(0.98); }
.capture .submit:disabled { opacity: 0.35; cursor: default; }
/* 输入为空时 ➕ 只剩图标（点击弹新建面板） */
.capture .submit.icon-only { padding: 0 11px; }

/* 新建面板：输入为空时点 ➕ 弹出（记一笔 / 新建待办 / 写笔记） */
.add-panel {
  display: flex;
  gap: 10px;
  padding: 10px 4px 0;
}
.add-panel .add-item {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg-2);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: border-color 80ms, background 80ms, color 80ms;
}
.add-panel .add-item:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface-sunken);
  color: var(--muted);
  flex: 0 0 auto;
  white-space: nowrap;
}
.type-chip.on { background: var(--accent-soft); color: var(--accent); }

.capture-hint { padding: 8px 4px 0; font-size: 12px; color: var(--meta); min-height: 26px; }

/* ---------- 概览条（全屏唯一卡片） ---------- */
.overview {
  margin-top: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  gap: 24px;
}
.ov-col { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ov-col + .ov-col { border-left: 1px solid var(--border-soft); padding-left: 24px; }
.ov-col .l { font-size: 12px; color: var(--meta); }
.ov-col .v { font-size: 24px; font-weight: 600; color: var(--fg); letter-spacing: -0.01em; }
.ov-col .v.s { font-size: 20px; }
.ov-col .n { font-size: 12px; margin-top: 2px; color: var(--meta); }
.n-income { color: var(--income); }
.n-warn { color: var(--warn); }

/* ---------- 分组标题 + 区块 ---------- */
.gt {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 24px 4px 8px;
}
.gt .name { font-size: 16px; font-weight: 600; color: var(--fg); }
.gt .name.warn { color: var(--warn); }
.gt .sum { font-size: 12px; color: var(--meta); }

.block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

/* ---------- 记录行（主力组件） ---------- */
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  min-height: 56px;
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  cursor: pointer;
  transition: background 80ms;
}
.row:last-child { border-bottom: none; }
.row:hover { background: var(--surface-sunken); }
.row .mod { position: absolute; left: 0; top: 0; bottom: 0; width: 2px; }
.row .ric { width: 24px; flex: 0 0 24px; display: flex; align-items: center; justify-content: center; color: var(--fg-2); }
.rmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rtitle {
  font-size: 15px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rsub {
  font-size: 12px;
  color: var(--meta);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ramt { font-size: 16px; font-weight: 600; color: var(--fg); flex: 0 0 auto; }
.row.done .rtitle { color: var(--meta); text-decoration: line-through; }
.row.done .rsub { color: var(--meta); }
.chk {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-2);
  cursor: pointer;
}
.chk.warn { color: var(--warn); }
.chk.done { color: var(--meta); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); flex: 0 0 8px; margin-right: 6px; display: inline-block; }
.sub-ic { color: var(--meta); margin-right: 4px; display: inline-flex; vertical-align: -2px; }

/* ---------- 表单/弹窗 ---------- */
.dialog-mask {
  position: fixed;
  inset: 0;
  background: rgba(22, 25, 29, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
}
.dialog {
  width: min(920px, calc(100vw - 48px));
  max-height: 92vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.dialog > * { flex: 0 0 auto; }
/* 笔记正文行撑满弹窗剩余高度（大屏尽量大；小屏保底 280px 后弹窗内滚动） */
.dialog > .body-row { flex: 1 1 auto; min-height: 280px; }
.body-row { align-items: stretch; }
.dialog h3 { font-size: 17px; font-weight: 600; margin-bottom: 16px; }
.form-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border-soft); font-size: 14px; }
.form-row .k { color: var(--muted); flex: 0 0 auto; }
.form-row input[type='text'], .form-row input[type='number'], .form-row textarea, .form-row select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: var(--surface);
  outline: none;
  max-width: 320px;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--accent); }
/* 备注/正文撑满剩余宽度；正文（笔记）加高 */
.form-row textarea { flex: 1; width: auto; max-width: none; min-height: 110px; resize: vertical; }
.form-row textarea.tall { min-height: 280px; }
.seg2 { display: inline-flex; background: var(--surface-sunken); border-radius: 10px; padding: 3px; }
.seg2 .opt { font-size: 13px; padding: 7px 18px; color: var(--muted); border-radius: 8px; }
.seg2 .opt.on { color: var(--fg); font-weight: 500; background: var(--surface); box-shadow: 0 1px 3px rgba(22, 25, 29, 0.1); }
.catgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; padding: 12px 0; }
.cat {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  border-radius: 10px;
  background: var(--surface-sunken);
  font-size: 12px;
  color: var(--muted);
}
.cat.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.dialog-actions { display: flex; gap: 12px; margin-top: 20px; }
.btn {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn:hover { background: var(--accent-hover); }
.btn.danger {
  flex: 0 0 110px;
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
}
.btn.ghost { background: transparent; border: 1px solid var(--border); color: var(--fg-2); }
.btn:disabled { opacity: 0.4; cursor: default; }

/* ---------- 撤销提示 ---------- */
.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: var(--fg);
  color: #fff;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(22, 25, 29, 0.24);
}
.undo-toast button { color: #9fc3d8; font-weight: 500; }

/* ---------- 空状态 ---------- */
.empty {
  padding: 56px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}
.empty .ghost-btn {
  margin-top: 6px;
  border: 1px solid var(--border);
  color: var(--fg-2);
  border-radius: 10px;
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 500;
  background: var(--surface);
}
.empty .ghost-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 统计（账本页） ---------- */
.month-nav { display: flex; align-items: center; gap: 12px; padding: 20px 0 8px; }
.month-nav select {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
}
.msum { padding: 6px 4px 0; font-size: 12px; color: var(--meta); display: flex; gap: 18px; flex-wrap: wrap; }
.msum b { color: var(--fg); font-weight: 500; }
.cat-bar-row { display: flex; align-items: center; gap: 12px; padding: 8px 18px; border-bottom: 1px solid var(--border-soft); font-size: 13px; }
.cat-bar-row:last-child { border-bottom: none; }
.cat-bar-track { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-sunken); overflow: hidden; }
.cat-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- 登录页 ---------- */
.signin {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.signin-card {
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.signin-card h1 { font-size: 22px; font-weight: 600; display: flex; align-items: center; gap: 12px; }
.signin-card .sub { color: var(--meta); font-size: 13px; margin-top: -8px; }
.signin-card input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  outline: none;
}
.signin-card input:focus { border-color: var(--accent); }
.sso-btn {
  height: 46px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.sso-btn:hover { background: var(--accent-hover); }
.divider { text-align: center; color: var(--meta); font-size: 12px; }
.form-error { color: var(--danger); font-size: 12px; min-height: 16px; }

/* ---------- 未登录浮窗：主页透出（弱化 + 模糊），浮窗内为登录卡片 ---------- */
.login-mask {
  background: rgba(22, 25, 29, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.login-mask .signin-card {
  border: none;
  box-shadow: 0 24px 64px rgba(22, 25, 29, 0.35);
}

/* ---------- 搜索框 ---------- */
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 12px;
  height: 36px;
  margin-bottom: 4px;
}
.search-box input { border: none; outline: none; background: transparent; font-size: 13px; width: 130px; }

.loading-skel { padding: 16px 4px; }
.skel-row { height: 52px; border-radius: 10px; background: var(--surface-sunken); margin-bottom: 10px; opacity: 0.7; }

/* ---------- 产品介绍落地页 /about（公开，外部渠道投放用） ---------- */
.about { min-height: 100vh; background: var(--bg); color: var(--fg); }
.about-nav {
  max-width: 960px; margin: 0 auto; padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.about-brand { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 600; }
.about-open {
  border: 1px solid var(--border); border-radius: 999px; padding: 8px 18px;
  font-size: 13px; font-weight: 500; color: var(--fg-2); background: var(--surface);
}
.about-open:hover { border-color: var(--accent); color: var(--accent); }

.about-hero {
  max-width: 960px; margin: 0 auto; padding: 56px 24px 48px;
  display: flex; gap: 48px; align-items: center; justify-content: center;
}
.hero-txt { flex: 1; max-width: 600px; text-align: center; }
.hero-qr {
  flex: 0 0 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: 0 12px 36px rgba(22, 25, 29, 0.1);
}
.hero-qr img { border-radius: 10px; }
.hero-qr b { font-size: 15px; font-weight: 600; }
.hero-qr span { font-size: 12px; color: var(--meta); }
.about-search { margin-top: 18px; font-size: 14px; color: var(--muted); }
.about-search b { color: var(--accent); font-weight: 600; }
.about-hero h1 { font-size: clamp(24px, 3.6vw, 34px); font-weight: 700; letter-spacing: 0.5px; text-wrap: balance; }
.about-sub { margin: 18px auto 28px; max-width: 560px; color: var(--muted); font-size: 15px; line-height: 1.8; }
.about-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.about-cta .sso-btn { width: 180px; }
.about-cta-ghost { background: transparent; border: 1px solid var(--border); color: var(--fg-2); }
.about-cta-ghost:hover { background: var(--surface); }

/* 双端截图对照：桌面 + 手机 CSS 样机（真实界面结构） */
.about-shots {
  max-width: 960px; margin: 0 auto; padding: 12px 24px 48px;
  display: flex; gap: 32px; align-items: flex-end; justify-content: center;
}
.shot { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; box-shadow: 0 12px 40px rgba(22, 25, 29, 0.1); }
.shot-desktop { width: min(620px, 100%); }
.shot-phone { width: 200px; border-radius: 22px; padding: 10px 8px; }
.shot-bar { display: flex; gap: 5px; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
.shot-bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); }
.shot-body { display: flex; }
.shot-side { flex: 0 0 108px; width: 108px; border-right: 1px solid var(--border-soft); padding: 12px; }
.shot-brand { font-weight: 600; font-size: 13px; margin-bottom: 12px; }
.shot-nav { font-size: 12px; color: var(--muted); padding: 6px 8px; border-radius: 7px; }
.shot-nav.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.shot-phone .shot-body { display: block; }
.shot-main { flex: 1; padding: 12px; }
.shot-capture {
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-sunken);
  padding: 9px 12px; font-size: 12px; color: var(--meta); margin-bottom: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shot-tag { font-size: 11px; color: var(--accent); margin: -4px 0 10px 4px; }
.shot-ovs { display: flex; gap: 8px; margin-bottom: 12px; }
.shot-ov { flex: 1; background: var(--surface-sunken); border-radius: 9px; padding: 8px 10px; }
.shot-ov span { display: block; font-size: 10px; color: var(--meta); }
.shot-ov b { font-size: 14px; font-weight: 600; }
.shot-row {
  display: flex; align-items: center; gap: 8px; padding: 8px 4px;
  border-bottom: 1px solid var(--border-soft); font-size: 12px;
}
.shot-row:last-child { border-bottom: none; }
.shot-row em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--meta); }
.rd { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.rd-cost { background: var(--accent); }
.rd-todo { background: var(--warn); }
.rd-note { background: var(--mod-note); }

/* 功能列表 */
.about-features {
  max-width: 960px; margin: 0 auto; padding: 8px 24px 56px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.about-feat { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 22px 20px; }
.about-feat svg { color: var(--accent); }
.about-feat h3 { font-size: 15px; font-weight: 600; margin: 10px 0 6px; }
.about-feat p { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* 小程序码 */
.about-qr { text-align: center; padding: 48px 24px 64px; border-top: 1px solid var(--border-soft); }
.about-qr img { border-radius: 12px; box-shadow: 0 8px 28px rgba(22, 25, 29, 0.14); }
.about-qr h2 { font-size: 20px; font-weight: 600; margin-top: 20px; }
.about-qr p { margin-top: 8px; color: var(--muted); font-size: 13px; }

.about-foot { text-align: center; padding: 24px; color: var(--meta); font-size: 12px; border-top: 1px solid var(--border-soft); }
.about-foot a { color: var(--accent); }

@media (max-width: 760px) {
  .about-hero { flex-direction: column; gap: 26px; padding-top: 36px; }
  .hero-qr { flex: none; width: min(300px, 100%); }
  .about-shots { flex-direction: column; align-items: center; }
  .shot-phone { display: none; }
  .about-features { grid-template-columns: 1fr; }
}

.signin-about { text-align: center; font-size: 12px; color: var(--meta); }
.signin-about:hover { color: var(--accent); }

/* ---------- Java 版补充 ---------- */
[x-cloak] { display: none !important; }
/* 速记条容器（捕获条 + 面板 + 提示 + 撤销浮层） */
.capture-zone { position: relative; }
.capture .submit { display: inline-flex; }
.capture .type-chip { display: inline-flex; }
.add-panel { display: flex; }
.add-panel[style*="display: none"] { display: none; }
.undo-toast { display: flex; }
/* 弹窗表单里隐藏 Alpine 状态输入不需要样式；金额输入右对齐 */
input.num { text-align: right; }
/* 下拉年月选择与日期输入使用系统控件色 */
