/* plan 页面样式。类名用 v2-plan- 前缀，只放本页特有的规则。 */

.v2-plan-lead { font-size: var(--t-md); color: var(--text-1); margin-bottom: 4px; }
.v2-plan-dash { color: var(--text-mute); }
.v2-plan-skel { display: grid; gap: 8px; }

/* ── 退休推演入口的小图 ────────────────────────────────────────────── */

.v2-plan-editband { margin-top: 16px; padding-top: 16px; border-top: 0.5px solid var(--line); }

/* ── 目标比例：配置行（components.css），买卖金额在下面的折叠里 ───────── */

/* 「目标 54% · 少 16.7 个百分点」要放得下，不能叠在一起 */
.v2-plan-alloc { --alloc-name: 7em; --alloc-sub: 20em; }
.v2-plan-alloc__foot { padding: 8px var(--card-pad) 12px; max-width: none; }
.v2-plan-alloc__note { margin-top: 8px; }
.v2-plan-crisis__note { margin-top: 8px; }
.v2-plan-crisis__fold { margin-top: 8px; }
.v2-plan-known__note { margin-top: 8px; }
[data-key="cashflow"] .v2-kv__k, [data-key="crisis"] .v2-kv__k { text-wrap: balance; }
.v2-plan-principles__entry .v2-entry { align-items: center; }

/* ── 目标编辑小窗 ─────────────────────────────────────────────────── */

/* 五档模板：两列，手机一列（见下面的媒体查询）。目标日期基金选中后两个输入框跟在下面，再下面是投资理念页的链接 */
.v2-plan-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.v2-plan-presets__why { margin: 0 0 16px; }
.v2-plan-preset[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); }
.v2-plan-tdf { margin: 0 0 8px; padding: 12px; border-radius: var(--r-item); box-shadow: inset 0 0 0 1px var(--line); }
.v2-plan-tdf__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.v2-plan-tdf .v2-note { margin-top: 8px; }
.v2-plan-tdf .v2-note:empty { display: none; }
.v2-plan-presets-fold { margin-bottom: 16px; }
.v2-plan-presets-fold > summary { margin-bottom: 8px; }
.v2-plan-preset {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
  padding: 10px 12px; min-height: 44px; border-radius: var(--r-item);
  background: var(--accent-lt); color: var(--accent); cursor: pointer;
  transition: background var(--motion) var(--ease);
}
.v2-plan-preset:hover { background: var(--accent-lt-2); }
.v2-plan-preset:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.v2-plan-preset__title { font-size: var(--t-md); font-weight: 500; }
.v2-plan-preset__detail { font-size: var(--t-xs); line-height: 1.4; color: var(--text-3); }
.v2-plan-preset__detail span { white-space: nowrap; }
.v2-plan-preset__desc { font-size: var(--t-xs); line-height: 1.4; color: var(--text-2); text-wrap: pretty; }

.v2-plan-editrows { display: grid; }
.v2-plan-editrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; min-height: 44px; }
.v2-plan-editrow + .v2-plan-editrow { border-top: 0.5px solid var(--line); }
/* 大类的名字（股票、另类）和它下面缩进的小项 */
.v2-plan-editgroup { margin: 0; padding: 12px 0 2px; border-top: 0.5px solid var(--line); font-size: var(--t-sm); font-weight: 600; color: var(--text-2); }
.v2-plan-editgroup + .v2-plan-editrow { border-top: 0; }
.v2-plan-editrow.is-sub { padding-left: 16px; }
.v2-plan-editrow__label { display: flex; flex-direction: column; min-width: 0; }
.v2-plan-editrow__name { font-size: var(--t-md); }
.v2-plan-editrow__input { display: flex; align-items: center; gap: 6px; flex: none; }
.v2-plan-editrow__input .v2-input { width: 5.5em; padding-right: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.v2-plan-editrow__unit { font-size: var(--t-sm); color: var(--text-3); }
.v2-plan-sum { margin-right: auto; align-self: center; font-size: var(--t-sm); color: var(--text-2); font-variant-numeric: tabular-nums; }
.v2-plan-sum.is-bad { color: var(--warn); font-weight: 500; }

@media (max-width: 699px) {
  .v2-plan-presets { grid-template-columns: 1fr; }
  .v2-sheet__foot:has(.v2-plan-sum) { flex-wrap: wrap; }
  .v2-plan-sum { flex: 1 0 100%; margin: 0 0 4px; }
}

/* ── 新增资金分配 ─────────────────────────────────────────────────────── */

.v2-plan-next__input { padding: 16px var(--card-pad) 12px; display: grid; gap: 6px; }
/* 一句填空：下一笔投 [金额]，这样放： */
.v2-plan-next__say { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--t-section); font-weight: 600; }
.v2-plan-next__money { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.v2-plan-next__say .v2-input { width: 9em; font-size: var(--t-md); font-variant-numeric: tabular-nums; }
@media (pointer: coarse) { .v2-plan-next__say .v2-input { font-size: 16px; } }
.v2-plan-next__error { margin: 0; }
.v2-plan-next__aside { min-width: 0; }
.v2-plan-next__rows { border-top: 0.5px solid var(--line); }
.v2-plan-next__rows .v2-lrow__sub { text-wrap: pretty; }
.v2-plan-next__lead { padding: 0; font-size: var(--t-md); line-height: 1.5; color: var(--text-2); text-wrap: pretty; }

.v2-plan-crisis__lead { margin-bottom: 8px; font-size: var(--t-md); line-height: 1.6; color: var(--text-2); text-wrap: pretty; }

/* ── 卖出前提醒自己：多行保留换行，长文字完整显示 ─────────────────── */

.v2-plan-principles__intro { font-size: var(--t-md); line-height: 1.5; color: var(--text-2); }
.v2-plan-principles__examples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.v2-plan-principles__note { margin-bottom: var(--gap-title); }
.v2-plan-principles .v2-lrow__title { white-space: pre-wrap; text-wrap: pretty; line-height: 1.5; }
.v2-plan-principles .v2-lrow { padding-right: calc(var(--card-pad) - 8px); }
.v2-plan-principles .v2-lrow:first-child { border-top-left-radius: var(--r-card); border-top-right-radius: var(--r-card); }
.v2-plan-principles .v2-lrow:last-child { border-bottom-left-radius: var(--r-card); border-bottom-right-radius: var(--r-card); }

.v2-plan-next__note { padding: 4px var(--card-pad) 8px; }
