/* 回顾。类名前缀 v2-close-、v2-bill。层次靠字号、字重和灰度；回顾是一页纸，里面用细线分段，不再套卡。 */

.v2-close, .v2-close-read { container: v2-close / inline-size; display: flex; flex-direction: column; gap: var(--gap-section); outline: none; }
.v2-close-read .v2-section + .v2-section { margin-top: 0; }

/* 纸上下的东西和纸同宽：一页从上读到下，边线对齐 */
.v2-close-sheet { width: 100%; max-width: 680px; margin-inline: 0; }

.v2-close-text { font-size: var(--t-md); color: var(--text-2); line-height: 1.6; text-wrap: pretty; }
.v2-close-skel { display: flex; flex-direction: column; gap: 12px; }

/* ── 顶上一行：核对、补记 ────────────────────────────────────────── */

.v2-close-top { display: flex; flex-direction: column; gap: 8px; }
.v2-close-check { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; padding: 12px var(--card-pad); background: var(--surface); border-radius: var(--r-card); }
.v2-close-check__text { flex: 1 1 18em; min-width: 0; font-size: var(--t-md); line-height: 1.6; color: var(--text-1); text-wrap: pretty; overflow-wrap: anywhere; }
.v2-close-fix__body { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; padding: 4px var(--card-pad) var(--card-pad); background: var(--surface); border-radius: var(--r-card); }
.v2-close-fix__items { margin-inline: calc(var(--card-pad) * -1); }

.v2-close-item {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; row-gap: 8px;
  padding: 12px var(--card-pad);
}
.v2-close-item + .v2-close-item::before {
  content: ""; position: absolute; top: 0; left: var(--card-pad); right: 0;
  border-top: 0.5px solid var(--line);
}
.v2-close-item__main { flex: 1 1 14em; min-width: 0; }
.v2-close-item__title { font-size: var(--t-md); font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; text-wrap: pretty; }
.v2-close-item__body { font-size: var(--t-xs); color: var(--text-3); line-height: 1.5; margin-top: 2px; text-wrap: pretty; }
.v2-close-item__actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex: none; margin-left: auto; }
.v2-close-item__dismiss {
  position: relative;
  height: var(--ctl-compact); padding: 0 10px;
  border: 0; border-radius: 999px; background: transparent;
  font-size: var(--t-sm); color: var(--text-3); cursor: pointer;
}
.v2-close-item__dismiss::after { content: ""; position: absolute; inset: calc((var(--ctl-compact) - max(var(--hit), var(--ctl-compact))) / 2) 0; }
.v2-close-item__dismiss:hover { background: var(--fill-2); color: var(--text-1); }

.v2-close-ask { display: flex; flex-wrap: wrap; gap: 8px; }
.v2-close-flows__list { margin-top: 8px; }
.v2-close-flow {
  display: grid; grid-template-columns: 5.5em minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline;
  padding: 8px 0; font-size: var(--t-sm); line-height: 1.4;
}
.v2-close-flow + .v2-close-flow { border-top: 0.5px solid var(--line); }
.v2-close-flow__date { color: var(--text-3); white-space: nowrap; }
.v2-close-flow__name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.v2-close-flow__type { font-size: var(--t-xs); font-weight: 400; color: var(--text-3); }
.v2-close-flow__amount { text-align: right; white-space: nowrap; }

/* ── 回顾：一页纸 ────────────────────────────────────────────────────
 * 这是正式记录，和其余页面的卡片不是一种东西：单栏窄幅（标签和数字离得近，视线沿右边一列往下走）、
 * 直角边的纸、表格数字、只有合计线一道重线。以后打开也是这个样子。 */

.v2-bill {
  width: 100%; max-width: 680px;
  padding: 28px 36px 24px;
  background: var(--surface); border-radius: 3px;
  box-shadow: 0 0 0 0.5px var(--line-strong);
  font-variant-numeric: tabular-nums;
}
/* 纸和页面标题左对齐：窄幅的纸居中放在宽页面里，和左上角的标题对不上 */
.v2-close-read > .v2-bill { margin-inline: 0; }
/* 手机：屏幕本身就是这张纸（开发指南 6.1「页面的容器」）。纸的边框和内边距在手机上占掉左右各 16 像素，
   月末比例那张四列的表最缺这点宽度。纸的开头用一道细线和上面的核对提示分开 */
@media (max-width: 699px) {
  .v2-bill { padding: 16px 0 0; background: none; border-radius: 0; box-shadow: none; border-top: 0.5px solid var(--line-strong); }
  /* 一句话加一个动作的提示、差额说明、翻页：不包卡片，直接铺在页面上 */
  .v2-close-check, .v2-close-diff, .v2-close-prev { padding: 0; background: none; border-radius: 0; }
}

.v2-bill__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; font-size: var(--t-sm); color: var(--text-3); line-height: 1.5; }
.v2-bill__lead { margin-top: 12px; }
.v2-bill__detail { margin-top: 4px; }

.v2-bill__sec { margin-top: 24px; break-inside: avoid; }
.v2-bill__label { padding-bottom: 6px; border-bottom: 0.5px solid var(--line-strong); font-size: var(--t-sm); font-weight: 600; line-height: 1.4; color: var(--text-1); }
.v2-bill__rows { margin-top: 4px; }
/* 行之间不画线：这样合计线是这一段唯一的线，一眼能看到 */
.v2-bill__row { min-height: 30px; padding-block: 3px; border-top: 0; }
.v2-bill__row .v2-kv__k { font-size: var(--t-md); color: var(--text-1); }
.v2-bill__row .v2-kv__v { flex: none; font-weight: 400; white-space: nowrap; }
/* 长名字折行，金额不折：金额那一列是这张纸的右边线 */
.v2-bill__row .v2-kv__k { flex: 1 1 0; text-wrap: pretty; }
.v2-bill__row .v2-kv__sub { white-space: normal; }
.v2-bill__row .v2-warn { font-weight: 500; }
.v2-bill__row--sub .v2-kv__k { padding-left: 1em; font-size: var(--t-sm); color: var(--text-3); }
.v2-bill__row--sub .v2-kv__v { font-size: var(--t-sm); color: var(--text-3); }
.v2-bill__row.is-total { margin-top: 4px; padding-top: 6px; border-top: var(--rule-total); }
.v2-bill__row.is-total .v2-kv__k, .v2-bill__row.is-total .v2-kv__v { font-weight: 700; }
/* 金额和比例同一行，比例一列对齐 */
.v2-bill__pair { display: inline-grid; grid-template-columns: auto 4.6em; column-gap: 8px; align-items: baseline; justify-items: end; }
.v2-bill__pair .v2-kv__sub { display: inline; white-space: nowrap; }
.v2-bill__muted { font-size: var(--t-sm); font-weight: 400; color: var(--text-3); }

.v2-bill__table { width: 100%; margin-top: 4px; border-collapse: collapse; font-size: var(--t-md); }
.v2-bill__table th, .v2-bill__table td { padding: 4px 0; text-align: right; font-weight: 400; }
.v2-bill__table th:first-child { text-align: left; }
.v2-bill__table thead th { padding-block: 2px; font-size: var(--t-xs); color: var(--text-3); }
.v2-bill__table td + td, .v2-bill__table th + th { padding-left: 12px; width: 3.6em; white-space: nowrap; }
.v2-bill__table td.v2-bill__gap, .v2-bill__table th:last-child { width: 8em; }
@media (max-width: 699px) {
  .v2-bill__table { font-size: var(--t-sm); }
  .v2-bill__table td + td, .v2-bill__table th + th { padding-left: 8px; }
}
.v2-bill__table td.v2-warn { font-weight: 500; }

.v2-bill__foot { margin-top: 6px; }
.v2-bill__notes { display: flex; flex-direction: column; gap: 4px; margin-top: 24px; padding-top: 8px; border-top: 0.5px solid var(--line); }

.v2-close-note { margin-top: 20px; }
.v2-close-note .v2-textarea { display: block; width: 100%; margin-top: 6px; resize: vertical; }

/* ── 还没有过完的月 ──────────────────────────────────────────────── */

.v2-close-done { padding: 8px 0 24px; }
.v2-close-done__fact { margin-top: 8px; font-size: var(--t-md); color: var(--text-2); line-height: 1.6; text-wrap: pretty; }
.v2-close-done__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }

/* ── 差额、提示、翻页 ────────────────────────────────────────────── */

.v2-close-banner { font-size: var(--t-md); color: var(--text-2); line-height: 1.6; text-wrap: pretty; }
.v2-close-diff { background: var(--surface); border-radius: var(--r-card); padding: var(--card-pad); }
.v2-close-diff__head { font-size: var(--t-lg); font-weight: 500; line-height: 1.5; color: var(--warn); text-wrap: pretty; }
.v2-close-diff__detail { margin-top: 4px; font-size: var(--t-md); color: var(--text-2); line-height: 1.6; text-wrap: pretty; }
.v2-close-diff__label { margin-top: 16px; }
.v2-close-diff__acts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px; }

.v2-close-prev { background: var(--surface); border-radius: var(--r-card); padding: 8px var(--card-pad); }
.v2-close-pager { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; }
.v2-close-pager__side { min-width: 0; }
.v2-close-pager__side.is-end { text-align: right; }

/* ── 每月回顾 ────────────────────────────────────────────────────── */

.v2-close-arc__month { font-size: var(--t-md); font-weight: 500; }
.v2-close-arc__note { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text-2); font-size: var(--t-sm); overflow-wrap: anywhere; }
.v2-close-older + .v2-close-older { margin-top: 8px; padding-top: 8px; border-top: 0.5px solid var(--line); }
.v2-close-older__months { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.v2-close-older__month {
  position: relative;
  display: inline-flex; align-items: center; height: var(--ctl-compact); padding: 0 12px;
  border-radius: 999px; background: var(--accent-lt); color: var(--accent);
  font-size: var(--t-sm); text-decoration: none; font-variant-numeric: tabular-nums;
}
.v2-close-older__month::after { content: ""; position: absolute; inset: calc((var(--ctl-compact) - max(var(--hit), var(--ctl-compact))) / 2) 0; }
.v2-close-older__month:hover { background: var(--accent-lt-2); }

/* 标题行的短链接手指点击区不足 44 宽，向两侧补足 */
.v2-pagehead__actions .v2-link::after { left: -8px; right: -8px; }

