/* "How many Chinese characters do I know?" test — /chinese/reading-level-test/
   Loaded after /css/styles.css; uses its tokens (--primary, --ink, --border …). */

.ct-page { padding-top: 28px; }
.ct-eyebrow { color: var(--primary-dark); font-weight: 800; font-size: .85rem; letter-spacing: .06em;
  text-transform: uppercase; margin: 0 0 6px; }
.ct-page h1 { margin-bottom: 12px; }
.ct-lede { font-size: 1.12rem; color: var(--ink); margin-bottom: 22px; }
.ct-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ct-note { color: var(--muted); font-size: .9rem; }

/* card */
.ct-app { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px 24px; margin: 0 auto 40px; max-width: 620px; }
.ct-panel[hidden] { display: none; }
.ct-app button { font-family: inherit; }

/* intro */
.ct-script { display: flex; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px;
  padding: 4px; gap: 4px; margin-bottom: 18px; }
.ct-seg { flex: 1; border: 0; background: transparent; border-radius: 999px; padding: 10px 12px; font-weight: 700;
  font-size: 1rem; color: var(--muted); cursor: pointer; min-height: 44px; }
.ct-seg[aria-pressed="true"] { background: var(--card); color: var(--primary-dark); box-shadow: var(--shadow-sm); }
.ct-rules { list-style: none; margin: 0 0 20px; padding: 0; }
.ct-rules li { position: relative; padding-left: 26px; margin-bottom: 10px; line-height: 1.5; }
.ct-rules li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 9px; height: 9px;
  border-radius: 50%; background: var(--primary); }
.ct-app kbd { font: 700 .8em/1 inherit; background: var(--bg-soft); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 6px; padding: 2px 6px; }

/* buttons */
.ct-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px;
  font-weight: 800; font-size: 1.08rem; padding: 14px 22px; min-height: 56px; cursor: pointer;
  border: 2px solid var(--border); background: var(--card); color: var(--ink);
  transition: transform .08s ease, background .15s ease, border-color .15s ease; }
.ct-btn:active { transform: scale(.98); }
.ct-btn:focus-visible, .ct-seg:focus-visible, .ct-opt:focus-visible, .ct-link:focus-visible {
  outline: 3px solid rgba(52, 168, 83, .45); outline-offset: 2px; }
.ct-btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.ct-btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.ct-btn-no:hover { border-color: var(--muted); }
.ct-btn[disabled] { opacity: .6; cursor: progress; }
.ct-start { width: 100%; }
.ct-link { border: 0; background: none; color: var(--primary-dark); font-weight: 700; cursor: pointer;
  padding: 6px 2px; font-size: .95rem; text-decoration: underline; text-underline-offset: 3px; }
.ct-link[disabled] { color: var(--muted); opacity: .5; cursor: default; text-decoration: none; }
.ct-k { font-size: .72rem; font-weight: 700; opacity: .7; border: 1px solid currentColor; border-radius: 5px;
  padding: 1px 5px; }

/* question */
.ct-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted);
  font-weight: 700; font-size: .95rem; }
.ct-progress { height: 8px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.ct-progress span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 99px;
  transition: width .25s ease; }
.ct-char { font-family: "Songti SC", "Noto Serif SC", "Noto Serif TC", "PingFang SC", "Microsoft YaHei", serif;
  font-size: clamp(96px, 26vw, 148px); line-height: 1.2; text-align: center; margin: 14px 0 18px; color: var(--ink);
  user-select: none; }
.ct-char-sm { font-size: clamp(72px, 20vw, 104px); margin: 6px 0 14px; }
.ct-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ct-btns .ct-btn { flex-direction: column; gap: 2px; min-height: 76px; }
.ct-prev { color: var(--muted); font-size: .92rem; text-align: center; margin: 14px 0 0; min-height: 1.5em; }
.ct-prev-hz { font-size: 1.15rem; color: var(--ink); }
.ct-prev-note { color: var(--primary-dark); font-weight: 700; }

/* check */
.ct-check-prompt { text-align: center; font-weight: 800; color: var(--primary-dark); margin: 0; }
.ct-options { display: grid; gap: 10px; }
.ct-opt { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; min-height: 54px;
  padding: 12px 14px; border: 2px solid var(--border); border-radius: 14px; background: var(--card);
  font-size: 1.02rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.ct-opt:hover { border-color: var(--primary); background: var(--primary-tint); }
.ct-key { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--bg-soft);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: var(--muted); }
.ct-unsure { display: block; margin: 12px auto 0; }

/* result */
.ct-result { text-align: center; }
.ct-result h3 { font-size: 1.05rem; margin: 26px 0 10px; text-align: left; }
.ct-result-label { color: var(--muted); font-weight: 700; margin: 0; }
.ct-num { font-size: clamp(3rem, 14vw, 4.4rem); font-weight: 800; color: var(--primary-dark); line-height: 1.05;
  margin: 4px 0; letter-spacing: -.02em; }
.ct-range { color: var(--muted); margin: 0 0 18px; }
.ct-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; text-align: left; }
.ct-cards div { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.ct-cards b { display: block; font-size: 1.35rem; color: var(--ink); line-height: 1.2; }
.ct-cards span { font-size: .86rem; color: var(--muted); line-height: 1.35; display: block; }
.ct-advice { text-align: left; margin: 18px 0 0; background: var(--primary-tint); border-radius: var(--radius-sm);
  padding: 12px 16px; }
.ct-bars { list-style: none; padding: 0; margin: 0; text-align: left; }
.ct-bars li { display: grid; grid-template-columns: 72px 1fr 44px; align-items: center; gap: 10px; margin-bottom: 6px;
  font-size: .92rem; }
.ct-bar-track { height: 10px; background: var(--bg-soft); border-radius: 99px; overflow: hidden; }
.ct-bar-fill { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.ct-bar-val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.ct-next, .ct-sug { text-align: left; padding-left: 20px; margin: 0; }
.ct-next li, .ct-sug li { margin-bottom: 6px; }
.ct-tag { font-size: .78rem; color: var(--muted); background: var(--bg-soft); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.ct-study { list-style: none; padding: 0; margin: 6px 0 4px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; text-align: left; }
.ct-study li { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: baseline;
  border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: .85rem; }
.ct-study-hz { grid-row: span 2; font-size: 1.6rem; line-height: 1.1; }
.ct-study-py { font-weight: 700; }
.ct-study-gl { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 20px; }
.ct-result .ct-note { text-align: left; }

/* content below */
.ct-table-wrap { overflow-x: auto; margin: 10px 0 18px; }
.ct-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ct-table th, .ct-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; }
.ct-table th { background: var(--bg-soft); font-weight: 800; }
.ct-table td { font-variant-numeric: tabular-nums; }
.ct-method li { margin-bottom: 12px; }

@media (max-width: 520px) {
  .ct-app { padding: 18px 14px; border-radius: 16px; margin-left: -4px; margin-right: -4px; }
  .ct-cards b { font-size: 1.15rem; }
  .ct-table { font-size: .85rem; }
  .ct-table th, .ct-table td { padding: 7px 6px; }
  .ct-actions .ct-btn, .ct-actions > div, .ct-actions > div .ct-btn { width: 100%; }
}

/* second pass */
.ct-app { scroll-margin-top: 12px; }
.ct-study li[hidden] { display: none; }
.ct-study-actions { display: flex; gap: 16px; justify-content: center; margin: 6px 0 0; }
.ct-diff { padding-left: 20px; }
.ct-diff li { margin-bottom: 10px; }
@media (hover: none) { .ct-k { display: none; } }
@media (max-width: 520px) {
  .ct-lede { font-size: 1.02rem; }
  .ct-study { grid-template-columns: 1fr 1fr; }
  .ct-study li { padding: 5px 8px; font-size: .8rem; }
  .ct-study-hz { font-size: 1.35rem; }
}
.ct-app [hidden] { display: none !important; }
