/* 复利子页面（compounders/）：左侧是一摞文件夹（每家公司一个，按市场分组），右侧是选中公司的商业模式档案。
   只在这个页面加载；通用变量与 .sub / .sub-head / .sub-foot 来自 style.css。
   注意：分节容器用 div，不用 section（style.css 的 section:not(.hero) 会加 14vh 内边距和上边线）。 */

.cp { display: grid; grid-template-columns: 264px minmax(0, 880px); gap: 64px; align-items: start; }

/* ---------- 左侧：文件夹堆 ---------- */
.cp-side { position: sticky; top: 92px; max-height: calc(100vh - 112px); overflow: auto; padding-right: 10px; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.cp-side-sum { display: flex; justify-content: space-between; align-items: baseline; padding: 0 0 14px; border-bottom: 1px solid var(--ink); color: var(--muted); cursor: default; list-style: none; }
.cp-side-sum::-webkit-details-marker { display: none; }
.cp-side-count { color: var(--ink); }
.cp-loading { padding: 16px 0; color: var(--muted); }

.cp-group { margin-top: 28px; }
.cp-group-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 22px; color: var(--muted); }
.cp-group-h b { font-weight: 500; color: var(--ink); letter-spacing: .08em; }
.cp-pile { display: grid; gap: 22px; }

/* 文件夹：左上角一个标签耳（代码），下面是夹体；耳朵占 18px，夹子之间留 22px */
.folder { position: relative; display: block; padding: 11px 14px 12px; background: var(--card); border: 1px solid var(--line-strong); border-radius: 0 10px 10px 10px; box-shadow: 0 1px 0 var(--line); transition: border-color .2s, background .2s, transform .25s var(--ease); }
.folder::before { content: attr(data-tab); position: absolute; left: -1px; top: -18px; height: 18px; padding: 0 10px; border: 1px solid var(--line-strong); border-bottom: 0; border-radius: 7px 7px 0 0; background: var(--card); font-family: var(--mono); font-size: 10px; line-height: 17px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.folder-name { display: block; font-size: 15px; font-weight: 500; line-height: 1.3; }
.folder-ind { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.folder:hover { border-color: var(--ink); transform: translateX(4px); }
.folder:hover::before { border-color: var(--ink); color: var(--ink); }
.folder.is-active { border-color: var(--ink); background: var(--sun-soft); }
.folder.is-active::before { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.folder.is-overview { margin-top: 18px; }

/* ---------- 右侧：档案 ---------- */
.cp-main { min-width: 0; scroll-margin-top: 92px; }
/* 切换档案后把焦点放到标题上（读屏用），但不画焦点环 */
.cp-main h1:focus { outline: 0; }
.cp-main .sub-head { margin-bottom: 36px; }
.cp-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; color: var(--muted); }
.cp-meta span b { font-weight: 400; color: var(--ink); }
.cp-industry { font-size: clamp(17px, 1.4vw, 20px); color: var(--muted); }
.cp-lead { max-width: 36em; font-size: clamp(18px, 1.5vw, 22px); line-height: 1.6; font-weight: 500; letter-spacing: -.005em; }
.cp-lead p { margin: 0; }
.cp-sec { margin-top: 48px; }
.cp-sec-h { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; padding-top: 16px; border-top: 1px solid var(--ink); font-size: clamp(20px, 1.8vw, 24px); font-weight: 600; letter-spacing: .04em; }
.cp-sec-h .mono { color: var(--muted); }
.cp-body { font-size: 15.5px; line-height: 1.75; }
.cp-body > p { max-width: 44em; margin: 0 0 1em; }
.cp-body h3 { margin: 1.6em 0 .6em; font-size: 17px; font-weight: 600; }
.cp-body ul, .cp-body ol { max-width: 44em; margin: 0 0 1em; padding-left: 1.4em; }
.cp-body li { margin-bottom: .35em; }
.cp-body ul ul, .cp-body ol ul { margin: .3em 0 .2em; }
.cp-body code { font-family: var(--mono); font-size: .9em; }
.cp-body strong { font-weight: 600; }
.cp-table { margin: 0 0 1.2em; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.cp-body table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.cp-body th, .cp-body td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cp-body tr:last-child td { border-bottom: 0; }
.cp-body th { background: var(--paper-2); font-weight: 500; white-space: nowrap; }
.cp-body td:first-child { width: 11em; min-width: 8em; color: var(--muted); }
.cp-body .is-data td:first-child { width: auto; min-width: 0; color: var(--ink); }
.cp-body .is-data th, .cp-body .is-data td { text-align: right; }
.cp-body .is-data th:first-child, .cp-body .is-data td:first-child { text-align: left; }
.cp-note { max-width: 44em; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.7; }
.cp-empty { padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); }

/* 总纲页的在档公司清单 */
.cp-overview-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px 20px; margin: 0 0 1em; padding: 0; list-style: none; font-size: 15px; }
.cp-overview-list a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.cp-overview-list a:hover { color: var(--sun); }
.cp-overview-list .mono { color: var(--muted); }

@media (max-width: 960px) {
  .cp { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .cp-side { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .cp-side-sum { cursor: pointer; }
  .cp-side-sum::after { content: "+"; margin-left: 12px; }
  .cp-side[open] .cp-side-sum::after { content: "−"; }
  .cp-pile { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
  .folder:hover { transform: none; }
}
@media (max-width: 600px) {
  .cp-pile { grid-template-columns: minmax(0, 1fr); }
  .cp-body td:first-child { width: auto; min-width: 7em; }
}
