/* 日常集 · 账本原型 —— 暖米色主题补充样式 */

/* 系统无衬线字体栈（含中文回退），正文清晰；Inter 优先（本机装有则西文/数字受益，无则回退系统中文字体） */
body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
}

/* 文艺衬线标题（"今天，慢慢来"等）使用 Noto Serif SC；字体规范：宋体粗 700 + 字距（参考站纳入） */
.font-serifcn {
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* 数字使用等宽感字体 + 表格数字对齐，金额/统计更清晰 */
.num {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* 顶栏小操作按钮：浅米色描边 pill（圆角很多），小巧 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  line-height: 1;
  padding: 0.4rem 0.7rem;
  border-radius: 9999px;
  background: #FCFCFB;
  border: 1px solid #E7E7E3;
  color: #6C7075;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  cursor: pointer;
  white-space: nowrap;
}
.pill:hover {
  background: #fff;
  border-color: #dcdcd8;
  color: #384049;
}
.pill svg {
  width: 14px;
  height: 14px;
}

/* 日期/数字输入在移动端留足点按区域 */
input[type="date"],
input[type="month"] {
  min-height: 40px;
}

/* 移动端底部 Tab 避让 iOS 安全区（配合 viewport-fit=cover） */
nav.fixed.bottom-0 {
  padding-bottom: env(safe-area-inset-bottom);
}

/* 隐藏滚动条但保留滚动（列表横向滚动时更干净） */
.overflow-x-auto::-webkit-scrollbar {
  height: 0;
}

/* 侧边栏/抽屉在内容上滚动时 narrower 滚动条 */
aside nav::-webkit-scrollbar,
#mobile-drawer nav::-webkit-scrollbar {
  width: 0;
}

/* ===== 首页顶部问候卡：日期 / 天气 / 动态欢迎 / 每日箴言（文艺 · 生活感） ===== */
.greet-card {
  position: relative;
  border-radius: 26px;
  border: 1px solid #E7E7E3;
  background: radial-gradient(120% 140% at 0% 0%, #EFF0F1 0%, #EDEDEA 48%, #E7E7E3 100%);
  box-shadow: 0 12px 32px -20px rgba(56, 64, 73, 0.4);
  padding: 1.5rem 1.5rem 1.35rem;
  overflow: hidden;
}
.greet-card::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -55px;
  width: 190px;
  height: 190px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
.greet-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.greet-hi {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 1.6rem;
  line-height: 1.2;
  color: #384049;
  letter-spacing: 0.5px;
}
.greet-date {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #6C7075;
}
.greet-wx {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  background: rgba(251, 248, 244, 0.7);
  border: 1px solid rgba(236, 227, 217, 0.9);
  border-radius: 9999px;
  padding: 0.45rem 0.8rem;
  color: #384049;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.15s, border-color 0.15s;
}
.greet-wx:hover {
  background: #fff;
  border-color: #dcdcd8;
}
.greet-wx-loc {
  color: #6C7075;
  font-size: 0.8rem;
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.greet-wx-text {
  color: #55585c;
  font-size: 0.8rem;
  white-space: nowrap;
}
.greet-welcome {
  margin-top: 1.1rem;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #26282B;
  letter-spacing: 0.5px;
}
/* 每日金句（中英对照，学英语；替代旧"每日箴言"位置） */
.greet-quote {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(122, 110, 115, 0.3);
}
.greet-quote-en {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.6;
  color: #384049;
}
.greet-quote-cn {
  margin-top: 0.35rem;
  font-size: 0.85rem;
  color: #6C7075;
}
.greet-quote-src {
  color: #9A9A96;
}

/* ===== 记一笔 · 表单元素（v1.1 起融入右侧抽屉面板，不再用 .rec-card 渐变卡） ===== */
.rec-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: #9A9A96;
  margin-bottom: 0.55rem;
}
.rec-label::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #B6BCC0;
  flex-shrink: 0;
}
.rec-input {
  width: 100%;
  border: 1px solid #E7E7E3;
  border-radius: 14px;
  padding: 0.8rem 0.9rem;
  min-height: 50px;
  font-size: 0.95rem;
  color: #26282B;
  background: #FFFFFF;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.rec-input:focus {
  border-color: rgba(56, 64, 73, 0.45);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(56, 64, 73, 0.08);
}
.rec-input::placeholder { color: #A9AEB2; }
.rec-amount {
  font-size: 1.6rem;
  font-weight: 600;
  padding: 0.6rem 0.9rem;
}
.rec-hint {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: #9A9A96;
}
.rec-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border-radius: 9999px;
  background: rgba(251, 248, 244, 0.75);
  border: 1px solid #E7E7E3;
  color: #6C7075;
  font-size: 0.8rem;
  white-space: nowrap;
}
/* 顶部内联类型切换条（同页切类型，不跳页） */
.rec-typebar {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: #E7E7E3;
  border: 1px solid #E7DDD0;
}
.rec-tb {
  flex: 1 1 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #6C7075;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.rec-tb:hover { background: rgba(255, 255, 255, 0.6); }
.rec-tb-on {
  background: #384049;
  color: #fff;
  box-shadow: 0 1px 3px rgba(56, 64, 73, 0.25);
}
.rec-tb-on:hover { background: #384049; }
/* 分类网格（4 列，正方形等边格） */
.rec-cat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  aspect-ratio: 1 / 1;
  padding: 0.5rem 0.3rem;
  border-radius: 16px;
  border: 1px solid #E7E7E3;
  background: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  transition: background 0.15s, border-color 0.15s;
  overflow: hidden;
}
.rec-cat:hover { background: #fff; border-color: #dcdcd8; }
.rec-cat-on {
  border-color: #384049;
  background: rgba(56, 64, 73, 0.06);
  box-shadow: 0 0 0 1px #384049;
}
.rec-cat-dot { width: 14px; height: 14px; border-radius: 9999px; flex-shrink: 0; }
.rec-cat-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; }
.rec-cat-name { font-weight: 500; color: #3A3D40; line-height: 1.3; }
.rec-cat-on .rec-cat-name { color: #384049; }
/* 刚性三色段 */
.rec-rig {
  display: block;
  text-align: left;
  padding: 0.75rem 0.8rem;
  border-radius: 16px;
  border: 1px solid #E7E7E3;
  background: rgba(255, 255, 255, 0.7);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  min-height: 74px;
}
.rec-rig:hover { background: #fff; border-color: #dcdcd8; }
.rec-rig-dot { width: 12px; height: 12px; border-radius: 9999px; display: inline-block; }
.rec-rig-label { display: block; margin-top: 0.3rem; font-weight: 600; font-size: 0.9rem; color: #3A3D40; }
.rec-rig-desc { display: block; margin-top: 0.15rem; font-size: 0.68rem; color: #6C7075; line-height: 1.45; }
.rec-rig-on .rec-rig-dot { box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9); }
.rec-rig-on .rec-rig-label { color: #fff; }
.rec-rig-on .rec-rig-desc { color: rgba(255, 255, 255, 0.85); }
/* 底部操作：保存（主）/ 取消（次） */
.rec-btn-save {
  flex: 1;
  min-height: 52px;
  border-radius: 16px;
  background: #384049;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  box-shadow: 0 8px 20px -12px rgba(56, 64, 73, 0.7);
  transition: background 0.15s, transform 0.1s;
}
.rec-btn-save:hover { background: #2B333B; }
.rec-btn-save:active { transform: scale(0.99); }
.rec-btn-cancel {
  flex: 1;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid #E7E7E3;
  background: rgba(251, 248, 244, 0.9);
  color: #6C7075;
  font-size: 0.95rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rec-btn-cancel:hover { background: #fff; border-color: #dcdcd8; color: #384049; }
.rec-btn-del {
  flex: 1;
  min-height: 52px;
  border-radius: 16px;
  border: 1px solid #E8D0CD;
  background: rgba(255, 255, 255, 0.6);
  color: #B23A2E;
  font-size: 0.95rem;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.rec-btn-del:hover { background: #FBEDEB; border-color: #D9B0AB; color: #9A3025; }

/* 流水 · 筛选区折叠（默认收起，点击「筛选」滑动展开） */
.flow-filter {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  transition: max-height 0.3s ease, opacity 0.22s ease, transform 0.22s ease;
}
.flow-filter.is-open {
  max-height: 420px;
  opacity: 1;
  transform: translateY(0);
}
.flow-filter.is-collapsed { max-height: 0; opacity: 0; }

/* ===== 记一笔 · 右侧滑出抽屉（v1.1：从右侧滑入，本页滑出，非整页跳转） ===== */
.rec-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(38, 40, 43, 0.32);
  backdrop-filter: blur(1px);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.rec-drawer-overlay.show { opacity: 1; }

.rec-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(500px, 100vw);
  z-index: 51;
  display: flex;
  flex-direction: column;
  background: #FCFCFB;
  border-left: 1px solid #E7E7E3;
  box-shadow: -16px 0 48px -24px rgba(38, 40, 43, 0.35);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.rec-drawer.open { transform: translateX(0); }

.rec-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #E7E7E3;
  flex-shrink: 0;
}
.rec-drawer-head .title {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #384049;
  letter-spacing: 0.02em;
}
.rec-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #6C7075;
  transition: background 0.15s, color 0.15s;
}
.rec-drawer-close:hover { background: #EDEDEA; color: #384049; }

.rec-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.rec-drawer-foot {
  display: flex;
  gap: 0.6rem;
  padding: 0.9rem 1.25rem calc(env(safe-area-inset-bottom, 0px) + 0.9rem);
  border-top: 1px solid #E7E7E3;
  flex-shrink: 0;
  background: #FCFCFB;
}

/* ===== 全局 12 栅栏布局系统（底座 PRD §1.5 v1.1） =====
 * 约定：模块页内容区统一 .grid-layout（12 栅栏网格，gap 1rem，items-start），
 *       每个信息块用 .col-N 声明占 N 栅栏（N=1..12）；移动端（<1024px）所有块自动折叠为整行全宽。
 * 维护：重排 = 只改各块的 .col-N 数字，不动结构、不动样式。 */
.grid-layout {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
/* 首页专用：行间距放宽（阴影卡片之间更透气；仅首页容器加 .home-gap） */
.grid-layout.home-gap { row-gap: 1.6rem; }
.grid-layout > * { grid-column: span 12 / span 12; } /* 默认整行（移动端 / 未声明 .col-N 时） */
@media (min-width: 1024px) {
  .col-1  { grid-column: span 1  / span 1;  }
  .col-2  { grid-column: span 2  / span 2;  }
  .col-3  { grid-column: span 3  / span 3;  }
  .col-4  { grid-column: span 4  / span 4;  }
  .col-5  { grid-column: span 5  / span 5;  }
  .col-6  { grid-column: span 6  / span 6;  }
  .col-7  { grid-column: span 7  / span 7;  }
  .col-8  { grid-column: span 8  / span 8;  }
  .col-9  { grid-column: span 9  / span 9;  }
  .col-10 { grid-column: span 10 / span 10; }
  .col-11 { grid-column: span 11 / span 11; }
  .col-12 { grid-column: span 12 / span 12; }
}

/* ===== 桌面左侧导航（参考站侧栏优化，2026-08-20，详见导航文档 §10） ===== */
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-item {
  font-family: "Noto Serif SC", "Songti SC", serif;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border-radius: 12px;
  color: #6C7075;
  font-size: 15px;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.side-item:hover { background: rgba(255, 255, 255, 0.5); color: #26282B; }
.side-item.active {
  background: #FCFCFB;
  color: #384049;
  font-weight: 700;
  box-shadow: 0 5px 16px rgba(56, 64, 73, 0.07);
}
.side-item-ic { display: inline-flex; flex-shrink: 0; opacity: 0.85; }
.side-item.active .side-item-ic { opacity: 1; }
.side-label {
  font-family: "Noto Serif SC", "Songti SC", serif;
  margin: 16px 13px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #9A9186;
}
.side-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 20px 8px;
}
.side-brand .mark {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #384049;
  color: #fff;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 19px;
  line-height: 1;
  box-shadow: 0 7px 18px rgba(56, 64, 73, 0.2);
}
.side-brand .name {
  display: block;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0.05em;
  color: #26282B;
}
.side-brand .tag {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #6C7075;
}

/* ===== 全局列表规范（2026-08-20 固化：以近况「最近支出」为基准，见首页文档变更记录） ===== */
/* 行列表：分隔线式、行高 48px、hover 淡背景；列 = .ld 日期/首列 + .lc 标签 + .lt 说明 + .la 金额 */
.list-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0 0.25rem;
  border-bottom: 1px solid rgba(231, 231, 227, 0.7);
  transition: background 0.15s;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: rgba(246, 246, 244, 0.6); }
.list-row .ld {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: #6C7075;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.list-row .lc { flex-shrink: 0; }
.list-row .lt {
  flex: 1;
  min-width: 0;
  font-size: 0.8rem;
  color: #6C7075;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-row .la {
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  font-weight: 600;
}

/* 表格：表头 11px 字距右对齐（首列左）、行高≈48px 与行列表对齐、hover 淡背景、td.num 等宽右对齐、分隔线 line/60 */
.tbl { width: 100%; font-size: 0.875rem; }
.tbl thead th {
  font-weight: 400;
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: #6C7075;
  padding: 0.5rem 0.25rem;
  text-align: right;
  border-bottom: 1px solid #E7E7E3;
  white-space: nowrap;
}
.tbl thead th:first-child { text-align: left; padding-left: 0.25rem; }
.tbl tbody td { padding: 0.75rem 0.25rem; border-bottom: 1px solid rgba(231, 231, 227, 0.6); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background 0.15s; }
.tbl tbody tr:hover { background: rgba(246, 246, 244, 0.6); }
.tbl td.num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

/* ===== 顶栏「数据管理」下拉菜单（2026-08-20，收敛调试/数据按钮，见第二轮评估文档） ===== */
.data-menu {
  position: fixed;
  top: 3.75rem; /* 顶栏 h-14 之下 */
  right: 1rem;
  z-index: 45;
  width: 12.5rem;
  background: #FCFCFB;
  border: 1px solid #E7E7E3;
  border-radius: 16px;
  box-shadow: 0 16px 40px -16px rgba(56, 64, 73, 0.25);
  padding: 0.4rem;
}
.data-menu.hidden { display: none; }
.data-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  font-size: 0.875rem;
  color: #26282B;
  text-align: left;
  transition: background 0.15s;
}
.data-menu-item:hover { background: #EDEDEA; }
.data-menu-sep { height: 1px; background: #E7E7E3; margin: 0.3rem 0.5rem; }


/* ===== 首页资产速览 Box：纯叙事便笺（2026-08-21 傍晚四轮，容器同款问候卡） ===== */
/* 容器：问候卡同源水墨径向渐变 + 26px 大圆角 + 柔阴影 + 右上淡光晕 */
.amt-box {
  position: relative;
  border-radius: 26px;
  border: 1px solid #E7E7E3;
  background: radial-gradient(120% 140% at 0% 0%, #EFF0F1 0%, #EDEDEA 48%, #E7E7E3 100%);
  box-shadow: 0 12px 32px -20px rgba(56, 64, 73, 0.4);
  padding: 1.5rem 1.5rem 1.4rem;
  overflow: hidden;
}
.amt-box::after {
  content: "";
  position: absolute;
  right: -40px; top: -55px;
  width: 190px; height: 190px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}
/* 标题：宋体 700 黛色，字距拉宽（印章/书签感），无链接 */
.amt-box-title {
  position: relative;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.22em;
  color: #384049;
}

/* 句子正文：宋体灰字，与欢迎词（金句）同族——手账正文质感；上方虚线分隔（信纸抬头线） */
.amt-narrative {
  position: relative;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px dashed rgba(122, 110, 115, 0.3);
  max-width: 70ch; /* 全宽 Box 下控制行宽，阅读更舒适 */
}
.amt-narrative .amt-sentence {
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 1.02rem;
  line-height: 1.9;
  color: #6C7075;
  letter-spacing: 0.02em;
}
.amt-narrative .amt-sentence + .amt-sentence { margin-top: 0.45rem; }

/* 数字强调：衬线粗体黛色大一号，像手账里重描的数字；超支转朱红 */
.amt-num {
  font-family: Georgia, "Noto Serif SC", "Songti SC", serif;
  font-weight: 700;
  font-size: 1.45em;
  line-height: 1.25;
  color: #384049;
  padding: 0 0.05em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.amt-num-over { color: #B23A2E; }
