/* review 页面样式。类名用 v2-review- 前缀，只放本页特有的规则。 */

/* ── 版面：很宽时两列，其余一条线读下来 ─────────────────────────────
 * 两列在一个宽 1240 以上的容器里才有（1920 屏）。窄时两个 col 退成 contents，靠 order 排成重要性顺序。 */

.v2-review { container: v2-review / inline-size; }
.v2-review__stack { display: flex; flex-direction: column; gap: var(--gap-section); margin-top: 20px; }
.v2-review__stack .v2-section + .v2-section, .v2-review__stack .v2-section { margin-top: 0; }
.v2-review__grid { display: flex; flex-direction: column; gap: var(--gap-section); }
.v2-review__col { display: contents; }
.v2-review__col > [data-key="sources"] { order: 1; }
.v2-review__col > [data-key="cash"] { order: 2; }
.v2-review__col > [data-key="whatif"] { order: 3; }
.v2-review__col > [data-key="decisions"], .v2-review__col > [data-key="aftersale"] { order: 4; }
@container v2-review (min-width: 1240px) {
  .v2-review__grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
  .v2-review__col { display: flex; flex-direction: column; gap: var(--gap-section); min-width: 0; }
}

/* ── 期间选择 ─────────────────────────────────────────────────────── */

.v2-review-uncounted { margin-bottom: 10px; color: var(--text-2); text-wrap: pretty; }
.v2-review-uncounted .v2-link { display: inline-flex; margin-left: 6px; vertical-align: baseline; }
.v2-review-uncounted .v2-link::after { top: calc(50% - var(--hit) / 2); bottom: calc(50% - var(--hit) / 2); }
/* 整页的数都跟着这里走，所以比别处的分段大一号 */
.v2-review-period { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.v2-review-period .v2-seg { height: 40px; }
.v2-review-period .v2-seg__item { height: 32px; line-height: 32px; padding: 0 16px; font-size: var(--t-md); }
.v2-review-period .v2-select { height: 40px; font-size: var(--t-md); }
@media (max-width: 480px) { .v2-review-period .v2-seg__item { padding: 0 12px; } }
@media (pointer: coarse) { .v2-review-period .v2-select { height: 44px; } }
.v2-review-older .v2-select { font-weight: 500; }
.v2-review-older.is-on .v2-select { background-color: var(--accent-lt); color: var(--accent); font-weight: 600; }
.v2-review-range { font-size: var(--t-sm); color: var(--text-2); }

/* ── 结论句：页面主角，不进卡 ─────────────────────────────────────── */

.v2-review-verdict { margin: 20px 0 var(--gap-section); max-width: 44em; display: grid; gap: 4px; }

/* ── 收益：一排数 ───────────────────────────────────────────────────── */

.v2-review-kpi .v2-stat__value { font-size: var(--t-lead); }
.v2-review-kpi__more .v2-stat__value { font-size: var(--t-lg); }
.v2-review-kpi .v2-stat__sub { text-wrap: balance; }
.v2-review-parts { margin-top: 12px; padding-top: 12px; border-top: 0.5px solid var(--line); font-size: var(--t-sm); color: var(--text-2); line-height: 1.6; }
.v2-review-parts__item { white-space: nowrap; }

.v2-review-pagehow { margin-top: var(--gap-section); }
.v2-review-pagehow .v2-review-note + .v2-review-note { margin-top: 8px; }
.v2-review-decs .v2-how { margin-top: 8px; }

/* ── 资产变化：横向瀑布。标签、弹性轨道、金额三列，行间连接线把上一步的终点接到下一步的起点 ── */

/* 金额列随最长的数字变宽（subgrid 让各行共用列宽），大金额不折行、不溢出卡片 */
/* 轴被截断的总额柱：左端留一道缺口，表示前面还有一段没有画 */
/* 从本行柱子底部接到下一行柱子顶部；略长一点也压在下一根柱子下面（z-index），行高不同时不会断开 */
@media (max-width: 699px) {
}


/* ── 脚注 ─────────────────────────────────────────────────────────── */

.v2-review-note { margin-top: var(--gap-title); }

/* ── 收益来源：卡宽够时盈亏两栏并排，亏损不用滚动就看得到 ─────────── */

.v2-review-src { container-type: inline-size; }
.v2-review-src__groups { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px 32px; }
@container (min-width: 760px) {
  .v2-review-src__groups:has(> :nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.v2-review-src__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 6px; border-bottom: 0.5px solid var(--line); font-size: var(--t-md); font-weight: 500; color: var(--text-2); }
.v2-review-src__count { font-size: var(--t-xs); font-weight: 400; color: var(--text-3); }
.v2-review-src__row {
  position: relative;
  display: grid; align-items: center; column-gap: 12px; row-gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto 3.8em;
  grid-template-areas: "name amount rate" "bar bar bar";
  padding: 8px 0; color: inherit; text-decoration: none;
  transition: background var(--motion) var(--ease);
}
.v2-review-src__row:hover { background: var(--fill-1); box-shadow: -6px 0 0 var(--fill-1), 6px 0 0 var(--fill-1); }
.v2-review-src__row + .v2-review-src__row { border-top: 0.5px solid var(--line); }
.v2-review-src__name { grid-area: name; display: grid; min-width: 0; }
.v2-review-src__title { font-size: var(--t-md); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-review-src__sub { font-size: var(--t-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-review-src__bar { grid-area: bar; min-width: 0; }
.v2-review-src__amount { grid-area: amount; font-size: var(--t-md); text-align: right; white-space: nowrap; }
.v2-review-src__rate { grid-area: rate; font-size: var(--t-xs); color: var(--text-3); text-align: right; white-space: nowrap; }
/* 整行宽时名称、横条、数值连成一行（F.10 排行） */
@container (min-width: 460px) {
  .v2-review-src__row {
    grid-template-columns: minmax(0, 11em) minmax(40px, 1fr) 6.5em 3.8em;
    grid-template-areas: "name bar amount rate";
  }
}
/* 两栏并排时每栏只有约一半宽，退回两行 */
@container (min-width: 760px) and (max-width: 1040px) {
  .v2-review-src__groups:has(> :nth-child(2)) .v2-review-src__row {
    grid-template-columns: minmax(0, 1fr) auto 3.8em;
    grid-template-areas: "name amount rate" "bar bar bar";
  }
}

/* ── 分红与现金流 ─────────────────────────────────────────────────── */

/* 卡宽够时月度柱和最近记录并排，记录行不必拉到一千多像素宽 */
.v2-review-cash__detail { container-type: inline-size; }
.v2-review-cash__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; }
.v2-review-cash__chart { min-width: 0; }
.v2-review-cash__chart .v2-chart { height: 180px; }
.v2-review-recs { margin-top: 16px; min-width: 0; }
.v2-review-rec {
  display: grid; align-items: center; column-gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name amount" "name date";
  padding: 8px 0; color: inherit; text-decoration: none; min-height: 44px;
  border-top: 0.5px solid var(--line);
  transition: background var(--motion) var(--ease);
}
.v2-review-rec:hover { background: var(--fill-1); box-shadow: -6px 0 0 var(--fill-1), 6px 0 0 var(--fill-1); }
.v2-review-rec__name { grid-area: name; display: grid; min-width: 0; }
.v2-review-rec__title { font-size: var(--t-md); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-review-rec__sub { font-size: var(--t-xs); color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-review-rec__amount { grid-area: amount; font-size: var(--t-md); text-align: right; white-space: nowrap; }
.v2-review-rec__date { grid-area: date; font-size: var(--t-xs); color: var(--text-3); text-align: right; white-space: nowrap; }
@container (min-width: 860px) {
  .v2-review-cash__layout:has(.v2-review-cash__chart):has(.v2-review-recs) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .v2-review-cash__layout:has(.v2-review-recs) .v2-review-cash__chart .v2-chart { height: 280px; }
  .v2-review-cash__layout:has(.v2-review-cash__chart) .v2-review-recs { margin-top: 0; }
}

/* ── 如果不调仓 ───────────────────────────────────────────────────── */

.v2-review-whatif__lead { font-size: var(--t-md); line-height: 1.5; text-wrap: pretty; max-width: 44em; }
.v2-review-solds { margin-top: 16px; container-type: inline-size; }
.v2-review-sold {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 7em; align-items: center; column-gap: 12px;
  padding: 8px 0; color: inherit; text-decoration: none; min-height: 44px;
  border-top: 0.5px solid var(--line);
  transition: background var(--motion) var(--ease);
}
.v2-review-sold:hover { background: var(--fill-1); box-shadow: -6px 0 0 var(--fill-1), 6px 0 0 var(--fill-1); }
.v2-review-sold .v2-review-src__name { grid-area: auto; }
.v2-review-sold__nums { font-size: var(--t-xs); color: var(--text-3); white-space: nowrap; }
.v2-review-sold__diff { font-size: var(--t-md); text-align: right; white-space: nowrap; }
@container (max-width: 480px) {
  .v2-review-sold { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .v2-review-sold__nums { grid-column: 1 / -1; grid-row: 2; }
}

/* ── 一年前的决定 ─────────────────────────────────────────────────── */

.v2-review-decs { container-type: inline-size; padding-top: 8px; padding-bottom: 8px; }
.v2-review-aftersale { margin-top: 12px; padding: 12px 0 8px; border-top: 1px solid var(--line); }
.v2-review-aftersale__title { font-size: var(--t-md); font-weight: 500; line-height: 1.5; margin-bottom: 4px; }
.v2-review-dec { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 0; }
.v2-review-dec + .v2-review-dec { border-top: 0.5px solid var(--line); }
.v2-review-dec__main { display: grid; gap: 4px; min-width: 0; }
.v2-review-dec__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.v2-review-dec__link { position: relative; font-size: var(--t-md); font-weight: 500; color: inherit; text-decoration: none; }
.v2-review-dec__link::after { content: ""; position: absolute; inset: calc((1.6em - max(var(--hit), 1.6em)) / 2) 0; }
.v2-review-dec__link:hover { text-decoration: underline; text-underline-offset: 2px; }
.v2-review-dec__date { font-size: var(--t-xs); color: var(--text-3); }
.v2-review-dec__note { font-size: var(--t-md); line-height: 1.6; color: var(--text-1); text-wrap: pretty; max-width: 44em; }
.v2-review-dec__price { font-size: var(--t-xs); color: var(--text-3); }
.v2-review-dec__action { justify-self: start; }
@container (min-width: 560px) {
  .v2-review-dec { grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 24px; }
  .v2-review-dec__action { justify-self: end; }
}

/* 每月回顾页签最上面：做到哪了 */
.v2-reports-status { display: grid; gap: 6px; }
.v2-reports-what { margin: 0; }
