/* ===========================================================================
   Mr.Wang Chinese — "How the vocabulary changed" (2026-11-02, Yi)
   ---------------------------------------------------------------------------
   Yi's comparison of the old HSK (HSK 2.0) word list with the 2021 standard,
   from D:\教材研发\HSK\hsk-vocabulary-old-vs-new.html, set inside the
   Exam Guide's "Old HSK vs New HSK" section (hsk-exam-guide.html#old-vs-new).
   Her layout is kept; the type, lines and surfaces are the site's, and the
   charts take the page's colour: grey for the old list, the colour for the new.
   Tooltips and the labels that do not fit: assets/hsk-vocab-compare.js.
   Load after hsk-pages.css.
   =========================================================================== */

.hskc {
  --c-ink: var(--t-ink); --c-ink2: var(--t-ink-2); --c-muted: var(--t-muted);
  --c-hair: var(--t-line); --c-card: var(--t-white); --c-accent: var(--t-area-hsk-ink);
  /* chart 1: the three lists */
  --old: #c9c3b3; --std: var(--t-area-hsk-ink); --syl: var(--t-ink-2);
  /* charts 2 and 3: light to deep, in the page's colour, elementary to advanced */
  --el: rgba(var(--t-area-hsk-rgb), .32); --im: var(--t-area-hsk-ink); --ad: color-mix(in srgb, var(--t-area-hsk-ink) 68%, #000); --no: var(--t-line);
  --on-el: var(--t-ink); --on-im: #fff; --on-ad: #fff; --on-no: var(--t-ink-2);
  --new: var(--t-area-hsk-ink); --kept: var(--t-line); --on-new: #fff; --on-kept: var(--t-ink-2);
  /* chart 4 */
  --h1: var(--t-area-hsk-tint); --h2: var(--t-area-hsk-tint2); --h3: rgba(var(--t-area-hsk-rgb), .5); --h4: var(--t-area-hsk-ink); --h5: color-mix(in srgb, var(--t-area-hsk-ink) 68%, #000);
  --on-h1: var(--t-ink); --on-h2: var(--t-ink); --on-h3: var(--t-ink); --on-h4: #fff; --on-h5: #fff;
  margin-top: 3.5rem; color: var(--c-ink);
}
.hskc * { box-sizing: border-box; }
.hskc .kicker { margin: 0 0 .6rem; font-size: .8125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--c-accent); }
.hskc h3 { margin: 0 0 .75rem; font-family: var(--ap-display); font-size: 1.75rem; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; color: var(--c-ink); }
.hskc .dek { margin: 0 0 .4rem; color: var(--ap-body); font-size: 1.0625rem; font-weight: 300; line-height: 1.75; }
.hskc .date { margin: 0 0 1.5rem; font-size: .82rem; color: var(--c-muted); }
.hskc h4 { margin: 3rem 0 .4rem; font-family: var(--ap-display); font-size: 1.375rem; font-weight: 600; line-height: 1.3; color: var(--c-ink); }
.hskc h4 .n { margin-right: .5rem; color: var(--c-accent); }
.hskc p { margin: 0 0 .9rem; }
.hskc .take { margin-bottom: 1.25rem; color: var(--ap-body); font-size: 1.0625rem; font-weight: 300; line-height: 1.75; }
.hskc .zh { font-weight: 500; color: var(--c-ink); }
.hskc strong { font-weight: 600; color: var(--c-ink); }

/* the four numbers at the top */
.hskc .tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin: 0 0 .5rem; }
.hskc .tile { padding: .9rem .9rem .8rem; border: 1px solid var(--c-hair); border-radius: var(--t-r-sm); background: var(--c-card); }
.hskc .tile .val { font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.hskc .tile .lbl { margin-top: .4rem; font-size: .875rem; line-height: 1.35; color: var(--c-ink2); }
.hskc .tile .lbl small { display: block; margin-top: .15rem; font-size: .8125rem; color: var(--c-muted); }
@media (max-width: 640px) { .hskc .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* every chart sits on a white card, like the guide's tables */
.hskc figure { margin: 0 0 .4rem; padding: 1.1rem 1.1rem .75rem; border: 1px solid var(--c-hair); border-radius: var(--t-r-md); background: var(--c-card); }
.hskc .ftitle { margin: 0 0 .1rem; font-size: .9375rem; font-weight: 600; color: var(--c-ink); }
.hskc .fsub { margin: 0 0 .75rem; font-size: .8125rem; color: var(--c-muted); }
.hskc .legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin: 0 0 .9rem; font-size: .8125rem; color: var(--c-ink2); }
.hskc .legend span { display: inline-flex; align-items: center; gap: .4rem; }
.hskc .legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.hskc .lab { flex: 0 0 104px; width: 104px; font-size: .875rem; font-weight: 600; line-height: 1.2; color: var(--c-ink); }
.hskc .lab .sub { display: block; margin-top: 2px; font-size: .75rem; font-weight: 400; color: var(--c-muted); }

/* chart 1: words needed for each level */
.hskc .c1 { position: relative; }
.hskc .g1 { display: flex; align-items: center; padding: 7px 0; }
.hskc .g1 + .g1 { border-top: 1px solid var(--t-line-soft); }
.hskc .track { position: relative; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.hskc .b1 { display: flex; align-items: center; height: 11px; outline: none; cursor: default; }
.hskc .b1 .mk { display: block; height: 11px; min-width: 2px; border-radius: 0 4px 4px 0; }
.hskc .b1 .v { padding-left: 6px; font-size: .75rem; color: var(--c-ink2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hskc .b1:hover .mk, .hskc .b1:focus-visible .mk { filter: brightness(1.12); }
.hskc .b1:focus-visible .v { font-weight: 700; color: var(--c-ink); }
.hskc .s-old { background: var(--old); } .hskc .s-std { background: var(--std); } .hskc .s-syl { background: var(--syl); }
.hskc .axis { position: relative; height: 18px; margin-left: 104px; font-size: .6875rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.hskc .axis span { position: absolute; top: 2px; transform: translateX(-50%); }
.hskc .axis span:first-child { transform: none; }
.hskc .gridw { position: absolute; top: 0; right: 0; bottom: 18px; left: 104px; pointer-events: none; }
.hskc .gridw i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--t-line-soft); }
.hskc .gridw i:first-child { background: var(--c-hair); }
.hskc .note { margin: .6rem 0 0; font-size: .8125rem; color: var(--c-muted); }

/* charts 2 and 3: one stacked bar per level */
.hskc .r2 { display: flex; align-items: center; padding: 6px 0; }
.hskc .stack { flex: 1; display: flex; gap: 2px; height: 24px; min-width: 0; }
.hskc .seg { display: flex; align-items: center; min-width: 0; overflow: hidden; border-radius: 4px; outline: none; cursor: default; }
.hskc .seg b { padding: 0 6px; font-size: .75rem; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hskc .seg.nofit b { visibility: hidden; }
.hskc .seg:hover, .hskc .seg:focus-visible { filter: brightness(1.08); }
.hskc .seg:focus-visible { box-shadow: 0 0 0 2px var(--c-card), 0 0 0 4px var(--c-ink); }
.hskc .q-el { background: var(--el); color: var(--on-el); } .hskc .q-im { background: var(--im); color: var(--on-im); }
.hskc .q-ad { background: var(--ad); color: var(--on-ad); } .hskc .q-no { background: var(--no); color: var(--on-no); }
.hskc .q-new { background: var(--new); color: var(--on-new); } .hskc .q-kept { background: var(--kept); color: var(--on-kept); }

/* chart 4: what an old level covers */
.hskc table.heat { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
.hskc table.heat th { padding: 4px 6px; font-size: .8125rem; font-weight: 600; line-height: 1.2; text-align: left; vertical-align: bottom; color: var(--c-ink); }
.hskc table.heat th .sub { display: block; margin-top: 2px; font-size: .75rem; font-weight: 400; color: var(--c-muted); }
.hskc table.heat thead th { text-align: center; }
.hskc table.heat col.rh { width: 112px; }
.hskc table.heat tbody th { white-space: nowrap; }
.hskc td.hm { height: 52px; border-radius: 6px; outline: none; font-size: 1.0625rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.hskc td.hm:focus-visible { box-shadow: 0 0 0 2px var(--c-card), 0 0 0 4px var(--c-ink); }
.hskc .h1 { background: var(--h1); color: var(--on-h1); } .hskc .h2 { background: var(--h2); color: var(--on-h2); }
.hskc .h3 { background: var(--h3); color: var(--on-h3); } .hskc .h4 { background: var(--h4); color: var(--on-h4); }
.hskc .h5 { background: var(--h5); color: var(--on-h5); }
.hskc .scale { display: flex; align-items: center; gap: .5rem; margin: .6rem 0 0; font-size: .75rem; color: var(--c-muted); }
.hskc .scale i { display: inline-block; width: 22px; height: 10px; border-radius: 2px; }

/* "Show data table" under each chart */
.hskc details { margin: .6rem 0 0; font-size: .8125rem; }
.hskc summary { width: max-content; cursor: pointer; color: var(--c-ink2); }
.hskc summary:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; border-radius: 3px; }
.hskc table.data { width: 100%; margin-top: .5rem; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.hskc table.data th, .hskc table.data td { padding: 6px; border-bottom: 1px solid var(--t-line-soft); text-align: right; color: var(--c-ink2); }
.hskc table.data th:first-child { text-align: left; }
.hskc table.data thead th { font-weight: 600; color: var(--c-muted); }
.hskc table.data small { color: var(--c-muted); }

/* example words */
.hskc .chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: .9rem 0 0; padding: 0; list-style: none; }
.hskc .chips li { padding: 6px 10px; border: 1px solid var(--c-hair); border-radius: var(--t-r-sm); background: var(--t-cream); font-size: .8125rem; line-height: 1.3; color: var(--c-ink2); }
.hskc .chips li b { margin-right: 6px; font-size: 1rem; font-weight: 600; color: var(--c-ink); }
.hskc .chips li em { margin-left: 6px; font-size: .75rem; font-style: normal; color: var(--c-muted); }

/* beyond the word count, and what this means */
.hskc .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.hskc .facts > div { padding-top: .5rem; border-top: 2px solid var(--t-area-hsk-mark); }
.hskc .facts .val { font-size: 1.375rem; font-weight: 700; line-height: 1.2; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.hskc .facts .lbl { margin-top: .25rem; font-size: .8125rem; line-height: 1.45; color: var(--c-ink2); }
.hskc ul.points { margin: 0; padding: 0; list-style: none; }
.hskc ul.points li { position: relative; margin: 0 0 .8rem; padding-left: 22px; color: var(--ap-body); font-size: 1.0625rem; font-weight: 300; line-height: 1.75; }
.hskc ul.points li::before { content: ""; position: absolute; top: .72em; left: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--t-area-hsk-mark); }
.hskc .about { margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--c-hair); font-size: .82rem; line-height: 1.55; color: var(--c-muted); }
.hskc .about p { margin: 0 0 .5rem; }
.hskc .about strong { color: var(--c-ink2); }

@media (max-width: 640px) {
  .hskc h3 { font-size: 1.5rem; }
  .hskc .facts { grid-template-columns: 1fr; }
  .hskc .lab { flex-basis: 88px; width: 88px; }
  .hskc .gridw { left: 88px; }
  .hskc .axis { margin-left: 88px; }
  .hskc table.heat col.rh { width: 86px; }
  .hskc table.heat th { padding: 4px 3px; font-size: .75rem; }
  .hskc td.hm { font-size: .9375rem; }
}

/* the tooltip */
.hskc .tip {
  position: fixed; z-index: 50; max-width: 260px; padding: 8px 10px; pointer-events: none;
  border-radius: var(--t-r-sm); background: var(--t-ink); color: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
  font-size: .8125rem; line-height: 1.35; opacity: 0; transition: opacity .08s;
}
.hskc .tip strong { display: block; font-size: .9375rem; color: #fff; }
.hskc .tip span { color: #c9d3cd; }

@media (prefers-reduced-motion: reduce) { .hskc .tip { transition: none; } }
@media print {
  .hskc .tip { display: none; }
  .hskc figure { break-inside: avoid; }
}
