/* horizontal.one/apps: 热门 App 拆解 · Top Apps (tools/apps/build.mjs makes the pages), and its block on the home page.
   On top of site.css (and cases.css on the apps pages): the same tokens, type scale, spacing steps and easing. The bars
   are SVG (the CSP allows no inline style): the world's in the amber, China's in the logo's blue. */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sub { margin: 0; color: var(--muted); font-size: 14px; line-height: 20px; }
.chip.need.core { color: var(--text); background: var(--raised); border-color: var(--raised); }
.chip.draft { color: var(--accent); border-style: dashed; border-color: rgb(242 180 90 / 0.6); }
.app-icon { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--raised); object-fit: cover; }
.app-icon.xs { width: 24px; height: 24px; border-radius: 6px; }
.app-icon.big { width: 96px; height: 96px; border-radius: 22px; }
.app-icon.ph { display: inline-block; }
.meter { display: block; width: 100%; height: 8px; }
.meter .track { fill: var(--raised); }
.meter rect + rect { fill: var(--accent); }
.meter.c rect + rect { fill: var(--sky); }
.meter.d rect + rect { fill: var(--soft); }

/* ---------------------------------------------------------------- the needs, and what keeps them ahead */
.apps-needs { padding: 16px 0 48px; }
.needs-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel { display: grid; gap: 12px; padding: 32px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.panel h2 { font-size: 24px; line-height: 32px; }
.need-head, .need-list li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: center; }
.need-head { margin-top: 12px; color: var(--faint); font-size: 12px; line-height: 16px; font-weight: 600; }
.need-list, .driver-list { list-style: none; margin: 0; padding: 0; display: grid; }
.need-list li { padding: 12px 0; border-top: 1px solid var(--rule); }
.need-name { display: grid; gap: 4px; justify-items: start; }
.need-name small { color: var(--muted); font-size: 12px; line-height: 16px; }
.need-col { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 4px 8px; align-items: center; }
.need-col .n, .driver-list .n { font-weight: 600; font-variant-numeric: tabular-nums; }
.need-col .icons { grid-column: 2; display: flex; gap: 4px; min-height: 24px; }
.driver-list li { display: grid; grid-template-columns: 7em minmax(0, 1fr) 24px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--rule); font-size: 14px; line-height: 20px; }
.driver-list .n { text-align: right; }

/* ---------------------------------------------------------------- the lists */
.apps-lists { padding: 16px 0 64px; }
.block-title { font-size: 30px; line-height: 36px; letter-spacing: -0.02em; margin-bottom: 24px; }
.apps-lists .note { margin-bottom: 16px; }
.chart-tabs { display: flex; flex-wrap: wrap; gap: 12px 24px; margin-bottom: 24px; }
.chart-tabs[hidden] { display: none; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg button { font: inherit; font-size: 14px; line-height: 20px; min-height: 40px; padding: 8px 12px; border-radius: 9999px; border: 1px solid var(--line); background: var(--surface); color: var(--soft); cursor: pointer; transition: background-color 300ms var(--ease), color 300ms var(--ease); }
.seg button:hover { background: var(--raised); color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); font-weight: 600; }
.chart { scroll-margin-top: 112px; }
.chart[hidden] { display: none; }
.chart + .chart { margin-top: 48px; }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; padding-bottom: 12px; }
.chart-head h3 { font-size: 24px; line-height: 32px; }
.chart-head p { margin: 0; color: var(--faint); font-size: 14px; line-height: 20px; }
.app-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.app-row { display: grid; grid-template-columns: 32px 40px 48px minmax(0, 1fr) minmax(0, 280px); gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.app-row:not(:has(.mv)) { grid-template-columns: 32px 48px minmax(0, 1fr) minmax(0, 280px); }
.rk { font-size: 18px; line-height: 28px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; color: var(--soft); }
.mv { font-size: 12px; line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--faint); }
.mv.up { color: var(--live); }
.mv.new { color: var(--sky); }
.app-main { min-width: 0; display: grid; gap: 4px; }
.app-main h3 { font-size: 16px; line-height: 24px; }
.app-main h3 a { text-decoration: none; }
.app-main h3 a:hover { color: var(--accent); }
.app-meta { margin: 0; color: var(--faint); font-size: 13px; line-height: 20px; }
.app-principle { margin: 0; color: var(--soft); font-size: 15px; line-height: 24px; }
.app-pending { margin: 0; color: var(--faint); font-size: 13px; line-height: 20px; }
.app-side { display: grid; gap: 8px; justify-items: end; text-align: right; }
.app-side .chips { justify-content: flex-end; }
.reach { color: var(--faint); font-size: 12px; line-height: 16px; }
.app-row.bare .app-main h3 { font-weight: 500; color: var(--soft); }

/* ---------------------------------------------------------------- how it works */
.apps-method { padding: 32px 0 64px; border-top: 1px solid var(--rule); }
.apps-method .wrap { display: grid; gap: 16px; }
.apps-method h3 { margin-top: 16px; font-size: 20px; line-height: 28px; }
.apps-method .facts dd { color: var(--soft); }

/* ---------------------------------------------------------------- an app */
.app-head { display: flex; gap: 24px; align-items: center; }
.app-head > div { display: grid; gap: 8px; }
.principle { padding: 24px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.principle h2 { font-size: 14px !important; line-height: 20px !important; color: var(--accent); }
.principle p { font-size: 20px; line-height: 32px !important; font-weight: 500; }
.app-page dt small { display: block; margin-top: 4px; color: var(--faint); font-size: 12px; line-height: 16px; }
.ranks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ranks li { display: grid; gap: 2px; }
.ranks span { color: var(--muted); font-size: 14px; line-height: 20px; }

/* ---------------------------------------------------------------- the home page's block */
.apps-home { margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.apps-card { display: flex; flex-direction: column; gap: 16px; padding: 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.apps-card h3 { font-size: 18px; line-height: 28px; }
.mini, .need-mini { list-style: none; margin: 0; padding: 0; display: grid; }
.mini li { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--rule); }
.mini .nm { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mini .app-icon { width: 40px; height: 40px; border-radius: 10px; }
.mini .t { min-width: 0; display: grid; gap: 2px; }
.mini b { font-size: 14px; line-height: 20px; font-weight: 600; }
.mini b a { text-decoration: none; }
.mini b a:hover { color: var(--accent); }
.mini small { color: var(--muted); font-size: 12px; line-height: 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.need-mini li { display: grid; grid-template-columns: 7em minmax(0, 1fr) 24px; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--rule); font-size: 14px; line-height: 20px; }
.need-mini .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- narrow screens */
@media (max-width: 1000px) {
  .needs-grid { grid-template-columns: 1fr; }
  .apps-home { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apps-home .apps-card:last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .app-row, .app-row:not(:has(.mv)) { grid-template-columns: 28px 48px minmax(0, 1fr); gap: 4px 12px; align-items: start; }
  .app-row .mv { grid-column: 1; grid-row: 2; text-align: right; }
  .app-row .app-icon { grid-column: 2; grid-row: 1 / span 2; }
  .app-row .app-main { grid-column: 3; }
  .app-row .app-side { grid-column: 3; justify-items: start; text-align: left; }
  .app-side .chips { justify-content: flex-start; }
  .rk { font-size: 16px; line-height: 24px; }
  .panel { padding: 24px; }
  .need-head { display: none; }
  .need-list li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .need-name { grid-column: 1 / -1; }
  .apps-home { grid-template-columns: 1fr; }
  .app-head { flex-direction: column; align-items: flex-start; gap: 16px; }
}
