/*
 * 谷仓：尾款页、统计页、账本（详情里的每一笔）的样式。颜色都用 themes.css 里的变量。
 */

/* ---------- 超预算 ---------- */
.sum.over { background: var(--over-bg, #ffd2d2); }
.sum.over .l b { color: #c62828; }
.sum.over .meter i { background: linear-gradient(90deg, #ff9a7a, #e53935); }

/* ---------- 尾款：压力条 ---------- */
.pressure { position: relative; margin: 12px 18px 0; padding: 14px; border-radius: var(--r); background: var(--card); border: var(--card-border, 0); box-shadow: var(--card-shadow, none); }
.pressure .h { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; }
.pressure .h b { font-size: 24px; color: #d64545; font-family: var(--num-font, inherit); }
.pbar { position: relative; height: 14px; border-radius: 7px; background: var(--meter-bg); margin-top: 10px; overflow: hidden; }
.pbar i { position: absolute; top: 0; bottom: 0; left: 0; }
.pbar i.spent { background: var(--meter); }
.pbar i.due { background: repeating-linear-gradient(45deg, #fbbf24 0 6px, #f59e0b 6px 12px); }
.pbar .mark { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); }
.plegend { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--soft); margin-top: 6px; }
.plegend .ok { color: #10a36a; font-weight: 700; }
.plegend .bad { color: #c62828; font-weight: 700; }

/* ---------- 尾款：月历 ---------- */
.cal { position: relative; margin: 12px 18px 0; padding: 10px 12px; border-radius: var(--r); background: var(--card); border: var(--card-border, 0); box-shadow: var(--card-shadow, none); }
.cal-head { display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.cal-head .link { font-size: 20px; padding: 0 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin-top: 6px; text-align: center; }
.cal-grid .wk { font-size: 11px; color: var(--soft); }
.cal-grid .d { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 38px; border-radius: 10px; font-size: 12px; }
.cal-grid .d b { font-weight: 500; }
.cal-grid .d i { font-style: normal; font-size: 9px; font-weight: 800; color: #b45309; line-height: 1; }
.cal-grid .d.has { background: #fff1d6; }
.cal-grid .d.over { background: #fee2e2; }
.cal-grid .d.over i { color: #c62828; }
.cal-grid .d.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-grid .d.today b { font-weight: 800; color: var(--accent); }

/* ---------- 尾款：列表 ---------- */
.tl { margin: 12px 18px 0; display: flex; flex-direction: column; gap: 10px; }
.due { display: flex; gap: 10px; align-items: stretch; }
.due > .d { width: 50px; flex: 0 0 auto; border-radius: 14px; background: var(--card); border: var(--card-border, 0); text-align: center; padding-top: 6px; }
.due > .d b { display: block; font-size: 18px; }
.due > .d span { font-size: 10px; color: var(--soft); }
.due > .d.hot { background: #fee2e2; color: #b91c1c; }
.due .body { position: relative; flex: 1; min-width: 0; background: var(--card); border-radius: calc(var(--r) - 4px); border: var(--card-border, 0); box-shadow: var(--card-shadow, none); padding: 10px 12px; }
.due .r1 { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.due .r1 .link.plain { color: var(--ink); font-size: 13px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due small { display: block; font-size: 11px; color: var(--soft); }
.due .r2 { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 6px; }
.due .mini { margin-top: 8px; }
.cnt { flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 8px; background: rgba(0,0,0,.05); color: var(--soft); }
.cnt.hot { background: #fee2e2; color: #b91c1c; }
.cnt.mid { background: #fef3c7; color: #92400e; }
.cnt.ok { background: #e0f2fe; color: #075985; }
.note.center { text-align: center; margin: 14px 18px 0; }

/* 小按钮（补上了 / 删掉一笔） */
.mini { flex: 0 0 auto; padding: 3px 10px; border-radius: 10px; border: 1.5px solid var(--accent); background: transparent; color: var(--accent); font-size: 12px; font-weight: 700; }
.mini.soft { border-color: transparent; color: var(--soft); font-size: 16px; padding: 0 6px; }

/* ---------- 详情里的账本 ---------- */
.pays-head { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 13px; }
.pays-head .link { font-size: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* ---------- 统计 ---------- */
.seg { display: flex; margin: 12px 18px 0; background: var(--card); border-radius: 14px; padding: 4px; border: var(--card-border, 0); }
.seg button { flex: 1; border: 0; background: none; font-size: 12px; padding: 6px 0; border-radius: 10px; color: var(--soft); }
.seg button.on { background: var(--chip-on); color: var(--chip-on-ink); font-weight: 700; }
.bigs { margin: 12px 18px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bigs > div { background: var(--card); border-radius: calc(var(--r) - 4px); border: var(--card-border, 0); box-shadow: var(--card-shadow, none); padding: 10px; min-width: 0; }
.bigs small { display: block; font-size: 11px; color: var(--soft); }
.bigs b { display: block; font-size: 17px; font-family: var(--num-font, inherit); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bigs b.good { color: #10a36a; }
.rank { position: relative; margin: 12px 18px 0; background: var(--card); border-radius: var(--r); padding: 12px 14px; border: var(--card-border, 0); box-shadow: var(--card-shadow, none); }
.rank h3 { margin: 0 0 8px; font-size: 14px; font-family: var(--title-font, inherit); }
.rk { display: flex; align-items: center; gap: 8px; margin: 9px 0; }
.rk .no { width: 18px; font-weight: 800; color: var(--accent); }
.rk .nm { width: 56px; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rk .pile { flex: 1; position: relative; height: 28px; overflow: hidden; }
.rk .pile .n { position: absolute; top: 3px; width: 46px; height: 22px; border-radius: 2px; background-size: cover; box-shadow: 0 0 0 .5px rgba(0,0,0,.25), 1px 2px 3px rgba(0,0,0,.18); }
.rk .v { width: 64px; text-align: right; font-size: 13px; font-weight: 800; white-space: nowrap; }
.bars { display: flex; align-items: stretch; gap: 4px; height: 120px; }
.bar { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar i { display: block; width: 70%; border-radius: 4px 4px 0 0; background: var(--meter); }
.bar em { font-style: normal; font-size: 9px; color: var(--soft); white-space: nowrap; }
.bar span { font-size: 10px; color: var(--soft); margin-top: 3px; white-space: nowrap; }
.bar.now span { color: var(--accent); font-weight: 800; }
.donut { display: flex; align-items: center; gap: 14px; }
.donut svg { flex: 0 0 auto; }
.dl { font-size: 12px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dl i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.rank .li { padding: 0; border: 0; }

/* 手账主题：这些卡片顶上也贴胶带 */
:root[data-skin="journal"] .pressure::before, :root[data-skin="journal"] .cal::before, :root[data-skin="journal"] .rank::before {
  content: ""; position: absolute; top: -8px; left: 50%; width: 60px; height: 16px; margin-left: -30px; transform: rotate(-3deg); pointer-events: none;
  background: repeating-linear-gradient(90deg, rgba(233,161,120,.75) 0 8px, rgba(242,192,158,.75) 8px 16px);
}
