/**
 * Chilish v3.0 · 心流刷题（Phase 5.2）
 * 配色一律引用 theme.css 的 --zc-* token，无硬编码色值。
 * 页面底色用 --zc-bg（浅灰），卡片用 --zc-surface（白）。
 */

/* ========== 布局壳 ========== */
.chilish-app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 60vh;
  padding: 0 12px calc(76px + env(safe-area-inset-bottom, 0px));
}

.chilish-view {
  animation: cl-fade-in var(--zc-tr);
}

@keyframes cl-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ========== 底部一级导航 ========== */
.cl-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  justify-content: center;
  background: var(--zc-surface);
  border-top: 1px solid var(--zc-border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cl-tabbar-inner {
  display: flex;
  width: 100%;
  max-width: 480px;
}
.cl-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0 6px;
  border: none;
  background: transparent;
  color: var(--zc-text-3);
  font-size: 0.72rem;
  transition: color var(--zc-tr-fast);
}
.cl-tab i { font-size: 1.25rem; line-height: 1; }
.cl-tab.active { color: var(--zc-accent-solid, var(--zc-accent)); font-weight: 600; }
.cl-tab:focus-visible { outline: 2px solid var(--zc-accent); outline-offset: -2px; }

/* ========== 通用卡片 ========== */
.cl-card {
  background: var(--zc-surface);
  border: 1px solid var(--zc-border);
  border-radius: 16px;
  box-shadow: var(--zc-shadow-sm);
  padding: 16px;
  margin-bottom: 12px;
}
.cl-card h2,
.cl-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--zc-text);
}
.cl-muted { color: var(--zc-text-3); }
.cl-small { font-size: 0.85rem; }

/* ========== 首页卡（开始今日一局） ========== */
.cl-home-hero {
  text-align: center;
  padding: 36px 20px 28px;
}
.cl-home-hero .cl-hero-icon {
  font-size: 2.6rem;
  color: var(--zc-accent);
}
.cl-home-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin: 18px 0 22px;
}
.cl-home-stats .num {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--zc-text);
}
.cl-home-stats .lbl {
  font-size: 0.78rem;
  color: var(--zc-text-3);
}
.cl-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 320px;
  padding: 16px 24px;
  border: none;
  border-radius: 999px;
  background: var(--zc-accent);
  color: var(--zc-accent-fg);
  font-size: 1.1rem;
  font-weight: 600;
  box-shadow: var(--zc-shadow-md);
  transition: background var(--zc-tr-fast), transform var(--zc-tr-fast);
}
.cl-start-btn:hover { background: var(--zc-accent-hover); transform: translateY(-1px); }
.cl-start-btn:active { background: var(--zc-accent-active); transform: translateY(0); }
.cl-start-btn:disabled { opacity: .55; transform: none; }

/* ========== 刷题流：顶部细条 ========== */
.cl-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
}
.cl-progress {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cl-progress-track {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--zc-surface-2);
  overflow: hidden;
}
.cl-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--zc-accent);
  transition: width var(--zc-tr);
}
.cl-progress-fill.bump { animation: cl-progress-bump .4s ease; }
@keyframes cl-progress-bump {
  0% { transform: scaleY(1); }
  40% { transform: scaleY(2.2); }
  100% { transform: scaleY(1); }
}
.cl-progress-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--zc-text-2);
  white-space: nowrap;
}
.cl-combo {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--zc-warning);
  white-space: nowrap;
}
.cl-exit-btn {
  border: none;
  background: transparent;
  color: var(--zc-text-3);
  font-size: 1.1rem;
  padding: 4px 6px;
  border-radius: var(--zc-radius-sm);
  transition: color var(--zc-tr-fast), background var(--zc-tr-fast);
}
.cl-exit-btn:hover { color: var(--zc-text); background: var(--zc-surface-2); }

/* ========== 刷题流：题卡（一屏一题，滑入滑出） ========== */
.cl-stage {
  position: relative;
  overflow: hidden;
}
.cl-qcard {
  background: var(--zc-surface);
  border: 1px solid var(--zc-border);
  border-radius: 16px;
  box-shadow: var(--zc-shadow-md);
  padding: 28px 20px 20px;
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), opacity .35s cubic-bezier(.4, 0, .2, 1);
  will-change: transform, opacity;
}
.cl-qcard.enter-from { transform: translateY(60px); opacity: 0; }
.cl-qcard.leave-to { transform: translateY(-60px); opacity: 0; }

.cl-qcard-meta {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.cl-chip {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--zc-accent-soft);
  color: var(--zc-accent-active);
  font-size: 0.72rem;
  font-weight: 600;
}
.cl-chip.neutral { background: var(--zc-surface-2); color: var(--zc-text-2); }

.cl-stem-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}
.cl-stem {
  font-size: 1.3rem; /* ≥20px */
  line-height: 1.6;
  font-weight: 600;
  text-align: center;
  color: var(--zc-text);
  margin: 0 0 22px;
  word-break: break-word;
}
/* 中文导语 + 英文例句：导语稍淡、例句单独一行更醒目 */
.cl-stem--split .cl-stem-lead {
  display: block;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--zc-text-muted, #64748b);
  line-height: 1.45;
  margin-bottom: 0.45em;
}
.cl-stem--split .cl-stem-body {
  display: block;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--zc-text);
  line-height: 1.55;
}
.cl-tts-btn {
  flex: none;
  border: none;
  background: var(--zc-accent-soft);
  color: var(--zc-accent-active);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--zc-tr-fast);
}
.cl-tts-btn:hover { background: var(--zc-accent); color: var(--zc-accent-fg); }

/* 选项：纵向铺满大按钮 */
.cl-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cl-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  border: 2px solid var(--zc-border);
  border-radius: 16px;
  background: var(--zc-surface);
  color: var(--zc-text);
  font-size: 1.06rem; /* ≥17px */
  line-height: 1.45;
  text-align: left;
  transition: border-color var(--zc-tr-fast), background var(--zc-tr-fast), transform var(--zc-tr-fast);
}
.cl-opt:hover:not(:disabled) { border-color: var(--zc-accent); background: var(--zc-accent-soft); }
.cl-opt:disabled { cursor: default; }
.cl-opt .cl-opt-letter {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: var(--zc-surface-2);
  color: var(--zc-text-2);
  font-size: 0.8rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cl-opt.is-correct {
  border-color: var(--zc-success);
  background: color-mix(in srgb, var(--zc-success) 12%, var(--zc-surface));
  color: var(--zc-success);
  font-weight: 600;
}
.cl-opt.is-correct .cl-opt-letter { background: var(--zc-success); color: var(--zc-accent-fg); }
.cl-opt.is-correct.is-pulse { animation: cl-correct-pulse .5s ease; }
@keyframes cl-correct-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--zc-success) 45%, transparent); }
  100% { box-shadow: 0 0 0 16px transparent; }
}
.cl-opt.is-wrong {
  border-color: var(--zc-danger);
  background: color-mix(in srgb, var(--zc-danger) 10%, var(--zc-surface));
  color: var(--zc-danger);
  font-weight: 600;
}
.cl-opt.is-wrong .cl-opt-letter { background: var(--zc-danger); color: var(--zc-accent-fg); }
/* 答错：红框闪烁两次 + 轻微抖动（配合 is-wrong 的常驻红框） */
.cl-opt.is-wrong.is-flash { animation: cl-wrong-flash .65s ease, cl-wrong-shake .4s ease; }
@keyframes cl-wrong-flash {
  0%, 50%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--zc-danger) 0%, transparent); }
  25%, 75% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--zc-danger) 55%, transparent); }
}
@keyframes cl-wrong-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.cl-opt.is-dim { opacity: .55; }

/* ========== 解析 bottom sheet ========== */
.cl-sheet-mask {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  transition: opacity var(--zc-tr);
}
.cl-sheet-mask.open { opacity: 1; }
.cl-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1051;
  display: flex;
  justify-content: center;
  transform: translateY(102%);
  transition: transform .32s cubic-bezier(.32, .72, 0, 1);
  will-change: transform;
}
.cl-sheet.open { transform: translateY(0); }
.cl-sheet-inner {
  width: 100%;
  max-width: 480px;
  max-height: 72vh;
  overflow-y: auto;
  background: var(--zc-surface);
  border-radius: 20px 20px 0 0;
  box-shadow: var(--zc-shadow-lg);
  padding: 12px 20px calc(20px + env(safe-area-inset-bottom, 0px));
}
.cl-sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--zc-border-strong);
  margin: 0 auto 14px;
}
.cl-sheet-verdict {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 10px;
}
.cl-sheet-verdict.wrong { color: var(--zc-danger); }
.cl-sheet-verdict.right { color: var(--zc-success); }
.cl-sheet-answer {
  background: var(--zc-surface-2);
  border-radius: var(--zc-radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 1rem;
  line-height: 1.55;
  word-break: break-word;
}
.cl-sheet-answer strong {
  color: var(--zc-accent-active);
  white-space: pre-wrap;
  word-break: break-word;
}
.cl-opt .cl-opt-text {
  flex: 1;
  min-width: 0;
  text-align: left;
  word-break: break-word;
}
.cl-sheet-explain {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--zc-text-2);
  margin-bottom: 16px;
  white-space: pre-wrap;
}
.cl-sheet-actions {
  display: flex;
  gap: 10px;
}
.cl-sheet-actions .cl-ghost-btn { flex: none; }
.cl-sheet-actions .cl-primary-btn { flex: 1; }

/* ========== 通用按钮 ========== */
.cl-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 20px;
  border: none;
  border-radius: 14px;
  background: var(--zc-accent);
  color: var(--zc-accent-fg);
  font-size: 1rem;
  font-weight: 600;
  transition: background var(--zc-tr-fast);
}
.cl-primary-btn:hover { background: var(--zc-accent-hover); }
.cl-primary-btn:disabled { opacity: .55; }
.cl-ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 13px 18px;
  border: 1px solid var(--zc-border-strong);
  border-radius: 14px;
  background: var(--zc-surface);
  color: var(--zc-text-2);
  font-size: 0.95rem;
  font-weight: 500;
  transition: background var(--zc-tr-fast), color var(--zc-tr-fast);
}
.cl-ghost-btn:hover { background: var(--zc-surface-2); color: var(--zc-text); }

/* ========== 局末结算 ========== */
.cl-result {
  text-align: center;
  animation: cl-fade-in var(--zc-tr);
}
.cl-result-acc {
  font-size: 3.4rem;
  font-weight: 800;
  color: var(--zc-accent);
  line-height: 1.1;
  margin: 8px 0 2px;
}
.cl-result-sub { color: var(--zc-text-3); font-size: 0.9rem; margin-bottom: 18px; }
.cl-result-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 18px;
}
.cl-result-row .num { font-size: 1.3rem; font-weight: 700; color: var(--zc-text); }
.cl-result-row .lbl { font-size: 0.78rem; color: var(--zc-text-3); }
.cl-mix-bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--zc-surface-2);
  margin: 0 8px 6px;
}
.cl-mix-bar .seg-new { background: var(--zc-accent); }
.cl-mix-bar .seg-review { background: var(--zc-info); }
.cl-mix-legend {
  display: flex;
  justify-content: center;
  gap: 18px;
  font-size: 0.78rem;
  color: var(--zc-text-3);
  margin-bottom: 18px;
}
.cl-mix-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  margin-right: 4px;
}
.cl-mix-legend .dot.new { background: var(--zc-accent); }
.cl-mix-legend .dot.review { background: var(--zc-info); }

/* 打卡进度环 */
.cl-goal-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 6px 0 20px;
}
.cl-goal-ring svg { display: block; }
.cl-goal-ring .ring-bg {
  fill: none;
  stroke: var(--zc-surface-2);
  stroke-width: 8;
}
.cl-goal-ring .ring-fg {
  fill: none;
  stroke: var(--zc-accent);
  stroke-width: 8;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 1s cubic-bezier(.4, 0, .2, 1);
}
.cl-goal-ring.lit .ring-fg { stroke: var(--zc-success); }
.cl-goal-ring.lit { animation: cl-ring-lit .6s ease .9s both; }
@keyframes cl-ring-lit {
  0% { filter: none; }
  50% { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--zc-success) 55%, transparent)); }
  100% { filter: none; }
}
.cl-goal-ring .ring-text {
  font-size: 0.8rem;
  color: var(--zc-text-2);
  margin-top: 8px;
}
.cl-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

/* ========== 词表页 ========== */
.cl-seg {
  display: flex;
  background: var(--zc-surface-2);
  border-radius: 999px;
  padding: 3px;
  margin-bottom: 14px;
}
.cl-seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--zc-text-2);
  transition: background var(--zc-tr-fast), color var(--zc-tr-fast);
}
.cl-seg-btn.active {
  background: var(--zc-surface);
  color: var(--zc-accent-active);
  font-weight: 600;
  box-shadow: var(--zc-shadow-sm);
}

.cl-wrong-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--zc-border);
}
.cl-wrong-item:last-child { border-bottom: none; }
.cl-wrong-stem {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--zc-text);
}
.cl-wrong-meta {
  flex: none;
  text-align: right;
  font-size: 0.75rem;
  color: var(--zc-text-3);
}
.cl-lapses-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--zc-danger) 12%, var(--zc-surface));
  color: var(--zc-danger);
  font-weight: 600;
}

/* 阶梯进度 */
.cl-ladder-row { margin-bottom: 14px; }
.cl-ladder-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--zc-text-2);
  margin-bottom: 5px;
}
.cl-ladder-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--zc-surface-2);
}
.cl-ladder-bar .seg-grad { background: var(--zc-accent); }
.cl-ladder-bar .seg-ladder { background: color-mix(in srgb, var(--zc-accent) 40%, var(--zc-surface)); }
.cl-ladder-bar .seg-unseen { background: var(--zc-surface-2); }
.cl-ladder-legend {
  display: flex;
  gap: 16px;
  font-size: 0.75rem;
  color: var(--zc-text-3);
  margin-top: 4px;
}
.cl-ladder-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
}
.cl-ladder-legend .dot.grad { background: var(--zc-accent); }
.cl-ladder-legend .dot.ladder { background: color-mix(in srgb, var(--zc-accent) 40%, var(--zc-surface)); }
.cl-ladder-legend .dot.unseen { background: var(--zc-surface-2); }

/* 介词地图 */
.cl-prep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}
.cl-prep-cell {
  border: 1px solid var(--zc-border);
  border-radius: var(--zc-radius-md);
  background: var(--zc-surface);
  padding: 10px 4px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--zc-text);
  transition: transform var(--zc-tr-fast), box-shadow var(--zc-tr-fast);
}
.cl-prep-cell:hover { transform: translateY(-1px); box-shadow: var(--zc-shadow-sm); }
.cl-prep-cell .pct {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--zc-text-3);
  margin-top: 2px;
}
/* 正确率色阶：--zc-accent 透明度阶（color-mix，无硬编码色值） */
.cl-prep-cell.lv0 { background: var(--zc-surface-2); }
.cl-prep-cell.lv1 { background: color-mix(in srgb, var(--zc-accent) 18%, var(--zc-surface)); }
.cl-prep-cell.lv2 { background: color-mix(in srgb, var(--zc-accent) 38%, var(--zc-surface)); }
.cl-prep-cell.lv3 { background: color-mix(in srgb, var(--zc-accent) 62%, var(--zc-surface)); }
.cl-prep-cell.lv4 { background: color-mix(in srgb, var(--zc-accent) 85%, var(--zc-surface)); color: var(--zc-accent-active); }

/* ========== 我的页 ========== */
.cl-me-stats {
  display: flex;
  text-align: center;
}
.cl-me-stats > div { flex: 1; }
.cl-me-stats .num { font-size: 1.4rem; font-weight: 700; color: var(--zc-text); }
.cl-me-stats .lbl { font-size: 0.75rem; color: var(--zc-text-3); }

/* 热力图：--zc-accent 透明度阶 */
.cl-heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.cl-heatmap-cell {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  background: var(--zc-surface-2);
}
.cl-heatmap-cell.lv1 { background: color-mix(in srgb, var(--zc-accent) 25%, var(--zc-surface)); }
.cl-heatmap-cell.lv2 { background: color-mix(in srgb, var(--zc-accent) 48%, var(--zc-surface)); }
.cl-heatmap-cell.lv3 { background: color-mix(in srgb, var(--zc-accent) 72%, var(--zc-surface)); }
.cl-heatmap-cell.lv4 { background: var(--zc-accent); }
.cl-heatmap-legend-box {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  vertical-align: middle;
}

/* 周报卡 */
.cl-report-item {
  border: 1px solid var(--zc-border);
  border-radius: var(--zc-radius-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.cl-report-item:last-child { margin-bottom: 0; }
.cl-report-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
}
.cl-report-delta.up { color: var(--zc-success); }
.cl-report-delta.flat { color: var(--zc-text-3); }
.cl-report-line { font-size: 0.8rem; color: var(--zc-text-3); margin-top: 4px; }

/* 设置行 */
.cl-setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 0;
}
.cl-setting-row + .cl-setting-row { border-top: 1px solid var(--zc-border); }
.cl-setting-row .cl-setting-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--zc-text);
  min-width: 96px;
}
.cl-switch {
  position: relative;
  width: 44px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: var(--zc-border-strong);
  transition: background var(--zc-tr-fast);
  flex: none;
}
.cl-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--zc-surface);
  box-shadow: var(--zc-shadow-sm);
  transition: left var(--zc-tr-fast);
}
.cl-switch[aria-checked="true"] { background: var(--zc-accent); }
.cl-switch[aria-checked="true"]::after { left: 23px; }
.cl-select,
.cl-time {
  border: 1px solid var(--zc-border-strong);
  border-radius: var(--zc-radius-sm);
  background: var(--zc-surface);
  color: var(--zc-text);
  padding: 6px 10px;
  font-size: 0.9rem;
}
.cl-select:focus,
.cl-time:focus {
  border-color: var(--zc-accent-solid, var(--zc-accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--zc-accent-solid, var(--zc-accent)) 18%, transparent);
}
.cl-select:focus-visible,
.cl-time:focus-visible {
  outline: 2px solid var(--zc-accent-solid, var(--zc-accent));
  outline-offset: 2px;
}

/* ========== 空态 / 加载 ========== */
.cl-empty {
  text-align: center;
  padding: 40px 16px;
  color: var(--zc-text-3);
}
.cl-empty i { font-size: 2.4rem; display: block; margin-bottom: 10px; }
.cl-loading {
  text-align: center;
  padding: 48px 0;
  color: var(--zc-text-3);
}
.cl-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--zc-surface-2);
  border-top-color: var(--zc-accent);
  border-radius: 999px;
  animation: cl-spin .8s linear infinite;
}
@keyframes cl-spin { to { transform: rotate(360deg); } }

/* ========== Toast ========== */
.cl-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  z-index: 1080;
  max-width: min(90vw, 420px);
  padding: 10px 18px;
  border-radius: var(--zc-radius-md);
  background: var(--zc-text);
  color: var(--zc-accent-fg);
  font-size: 0.875rem;
  box-shadow: var(--zc-shadow-lg);
  opacity: 0;
  transition: opacity var(--zc-tr-fast), transform var(--zc-tr-fast);
  pointer-events: none;
}
.cl-toast.show { opacity: 1; }
.cl-toast.error { background: var(--zc-danger); }

/* ========== 确认弹层 ========== */
.cl-confirm-mask {
  position: fixed;
  inset: 0;
  z-index: 1070;
  background: rgba(0, 0, 0, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: cl-fade-in var(--zc-tr-fast);
}
.cl-confirm-box {
  width: 100%;
  max-width: 340px;
  background: var(--zc-surface);
  border-radius: 16px;
  box-shadow: var(--zc-shadow-lg);
  padding: 22px 20px 16px;
  text-align: center;
}
.cl-confirm-box .cl-confirm-msg {
  font-size: 0.98rem;
  color: var(--zc-text);
  line-height: 1.6;
  margin-bottom: 18px;
  white-space: pre-wrap;
}
.cl-confirm-actions { display: flex; gap: 10px; }
.cl-confirm-actions > button { flex: 1; }
.cl-danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border: none;
  border-radius: 14px;
  background: var(--zc-danger);
  color: var(--zc-accent-fg);
  font-size: 0.95rem;
  font-weight: 600;
  transition: filter var(--zc-tr-fast);
}
.cl-danger-btn:hover { filter: brightness(1.08); }

/* ========== 自定义出题（上传文本 → AI 题集） ========== */
.cl-custom-card {
  margin-top: 12px;
  border: 1px solid color-mix(in srgb, var(--zc-accent) 28%, var(--zc-border));
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--zc-accent) 6%, var(--zc-surface)) 0%,
    var(--zc-surface) 48px
  );
}
.cl-custom-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}
.cl-custom-header-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--zc-accent) 14%, var(--zc-surface));
  color: var(--zc-accent-active);
  font-size: 1.25rem;
}
.cl-custom-header-text { flex: 1; min-width: 0; }
.cl-custom-title {
  margin: 0 0 4px;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--zc-text);
}
.cl-custom-header-text .cl-muted { margin: 0; }
.cl-custom-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.cl-custom-form.cl-is-collapsed { display: none; }
.cl-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.cl-input,
.cl-textarea {
  width: 100%;
  border: 1px solid var(--zc-border-strong);
  border-radius: var(--zc-radius-sm);
  background: var(--zc-surface);
  color: var(--zc-text);
  padding: 10px 12px;
  font-size: 0.95rem;
}
.cl-textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
.cl-input:focus,
.cl-textarea:focus {
  border-color: var(--zc-accent-solid, var(--zc-accent));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--zc-accent-solid, var(--zc-accent)) 18%, transparent);
}
.cl-input:focus-visible,
.cl-textarea:focus-visible {
  outline: 2px solid var(--zc-accent-solid, var(--zc-accent));
  outline-offset: 2px;
}
.cl-custom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cl-custom-actions .cl-primary-btn { flex: 1; min-width: 140px; }
.cl-custom-actions .cl-ghost-btn { flex: none; }
.cl-file-name { min-height: 1.2em; }
.cl-spinner-sm { width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }
.cl-set-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--zc-border);
}
.cl-set-item:last-child { border-bottom: none; }
.cl-set-info { min-width: 0; }
.cl-set-title {
  font-weight: 600;
  color: var(--zc-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-set-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ========== v3.1 今日剧本 / 错题再编码 / 阶梯可点 ========== */
.cl-plan-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0 16px;
  text-align: left;
}
.cl-plan-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--zc-bg-soft, var(--zc-bg));
  border-radius: 12px;
  font-size: 14px;
  color: var(--zc-text);
}
.cl-plan-idx {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--zc-primary, #0d9488);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cl-plan-text { line-height: 1.35; }

.cl-reencode {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cl-reencode-opt {
  text-align: left;
  width: 100%;
}
.cl-sheet-explain-plus {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--zc-primary-soft, #ccfbf1);
  color: var(--zc-text);
  font-size: 14px;
  line-height: 1.5;
}
.cl-usage {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--zc-primary-soft, #ccfbf1);
  border: 1px solid var(--zc-accent-solid, #0f766e);
}
.cl-usage-k {
  font-size: 12px;
  font-weight: 700;
  color: var(--zc-accent-solid, #0f766e);
  margin-bottom: 4px;
}
.cl-usage-en {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-weight: 600;
  line-height: 1.45;
}
.cl-usage-zh {
  margin-top: 4px;
  font-size: 13px;
  color: var(--zc-text-3, #5f6b7a);
}
.cl-usage-actions {
  margin-top: 10px;
}

button.cl-ladder-row-btn {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 10px 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
button.cl-ladder-row-btn:hover .cl-ladder-bar,
button.cl-ladder-row-btn:focus-visible .cl-ladder-bar {
  outline: 2px solid var(--zc-primary, #0d9488);
  outline-offset: 2px;
  border-radius: 6px;
}

.cl-journey-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--zc-primary-soft, #ccfbf1);
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  color: var(--zc-text);
}
.cl-journey-tag {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 12px;
  color: var(--zc-primary, #0d9488);
}
.cl-plan-hint {
  margin: 6px 0 0;
  color: var(--zc-text-muted, #64748b);
  text-align: left;
}

.cl-lemma-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 4px;
  border: none;
  border-bottom: 1px solid var(--zc-border);
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.cl-lemma-item:last-child { border-bottom: none; }
.cl-lemma-word {
  font-weight: 700;
  font-size: 16px;
  color: var(--zc-primary, #0d9488);
  min-width: 5em;
}
.cl-lemma-go {
  margin-left: auto;
  font-size: 13px;
  color: var(--zc-primary, #0d9488);
  font-weight: 600;
}

.cl-report-action {
  margin-top: 6px;
  font-size: 13px;
  color: var(--zc-text);
  line-height: 1.45;
}
.cl-read-line {
  font-size: 17px;
  line-height: 1.5;
  margin: 8px 0 12px;
  color: var(--zc-text);
  font-weight: 600;
}
.cl-sheet-compact .cl-sheet-inner { padding-bottom: 20px; }

.cl-rung-flash {
  font-size: 12px;
  font-weight: 700;
  color: var(--zc-primary, #0d9488);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.cl-rung-flash.show { opacity: 1; }

.cl-result-coach {
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--zc-primary-soft, #ccfbf1);
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
  color: var(--zc-text);
}

.cl-opt .cl-opt-letter::after {
  /* 桌面提示：键盘 1-4 */
  content: none;
}
@media (min-width: 768px) {
  .cl-opt .cl-opt-letter {
    position: relative;
  }
  .cl-stage::after {
    content: '快捷键 1–4 选选项';
    display: block;
    text-align: center;
    font-size: 11px;
    color: var(--zc-text-muted, #94a3b8);
    margin-top: 8px;
  }
}

.cl-mix-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 4px;
  justify-content: center;
}
.cl-mix-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--zc-bg-soft, #f1f5f9);
  color: var(--zc-text-muted, #475569);
  border: 1px solid var(--zc-border, #e2e8f0);
}

.cl-skill-list { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.cl-skill-row {
  display: grid;
  grid-template-columns: 3.5em 1fr 2.5em auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.cl-skill-name { font-weight: 600; color: var(--zc-text); }
.cl-skill-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--zc-bg-soft, #e2e8f0);
  overflow: hidden;
}
.cl-skill-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--zc-primary, #0d9488);
  transition: width 0.4s ease;
}
.cl-skill-bar-fill.weak { background: #f59e0b; }
.cl-skill-bar-fill.strong { background: var(--zc-primary, #0d9488); }
.cl-skill-pct { font-weight: 700; text-align: right; color: var(--zc-text); }

button.cl-skill-row-btn {
  width: 100%;
  border: none;
  background: transparent;
  padding: 4px 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
}
button.cl-skill-row-btn:hover .cl-skill-bar,
button.cl-skill-row-btn:focus-visible .cl-skill-bar {
  outline: 2px solid var(--zc-primary, #0d9488);
  outline-offset: 2px;
  border-radius: 999px;
}

.cl-set-mastery {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.cl-set-mastery-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: var(--zc-bg-soft, #e2e8f0);
  overflow: hidden;
  min-width: 60px;
}
.cl-set-mastery-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--zc-primary, #0d9488);
}

.cl-weak-cta {
  border-color: #f59e0b !important;
  color: #b45309 !important;
}

.cl-pwa-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  z-index: 1050;
  max-width: 456px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--zc-surface, #fff);
  border: 1px solid var(--zc-border, #e2e8f0);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.cl-pwa-text {
  flex: 1;
  font-size: 13px;
  line-height: 1.35;
  color: var(--zc-text);
}

/* 桌面端微调 */
@media (min-width: 768px) {
  .chilish-app { padding-left: 0; padding-right: 0; }
}

/* Phase 7.0 · 题反馈 / 库存提示 */
.cl-feedback-btn {
  margin: 8px 0 4px;
  font-size: 12px !important;
  opacity: 0.85;
  align-self: flex-start;
}
.cl-feedback-btn:hover { opacity: 1; }
.cl-inventory-notes {
  margin: 6px 0 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--zc-surface-2, #f8fafc);
  border: 1px dashed var(--zc-border, #e2e8f0);
}
.cl-inventory-notes p { margin: 2px 0; }

/* Phase 7.1 · 深度再编码 */
.cl-deep-encode {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--zc-surface-2, #f1f5f9);
  border: 1px solid var(--zc-border, #e2e8f0);
}
.cl-deep-encode:empty { display: none; }
.cl-deep-input {
  width: 100%;
  margin: 8px 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--zc-border, #cbd5e1);
  font-size: 15px;
  background: #fff;
}
.cl-deep-input.is-wrong {
  border-color: #ef4444;
  animation: cl-shake 0.35s ease;
}
.cl-deep-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cl-deep-stem {
  font-size: 15px;
  line-height: 1.45;
  margin: 6px 0 10px;
  font-weight: 600;
}

/* Phase 7.2 · Band 进度环 & 度量 */
.cl-band-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 4px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--zc-surface-2, #f8fafc);
  border: 1px solid var(--zc-border, #e2e8f0);
}
.cl-band-ring {
  --pct: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--zc-primary, #0d9488) calc(var(--pct) * 1%), #e2e8f0 0);
  position: relative;
}
.cl-band-ring::after {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--zc-surface, #fff);
}
.cl-band-ring-label {
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 700;
  color: var(--zc-text, #0f172a);
}
.cl-band-progress-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.cl-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cl-metric .num {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--zc-primary, #0d9488);
}
.cl-metric .lbl {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}
@media (min-width: 520px) {
  .cl-metrics-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ========== v4 灰区：信心门 / 对峙 / 迷雾 / 校准 ========== */
.cl-conf-hint {
  margin: 0 0 8px;
  font-size: 0.82rem;
  color: var(--zc-text-3);
  text-align: center;
}
.cl-conf {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.cl-conf-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  border: 1px solid var(--zc-border);
  border-radius: 12px;
  background: var(--zc-surface-2);
  color: var(--zc-text-2);
  font-size: 0.92rem;
}
.cl-conf-chip strong { font-weight: 650; color: var(--zc-text); }
.cl-conf-sub { font-size: 0.72rem; color: var(--zc-text-3); }
.cl-conf-chip.is-on {
  border-color: var(--zc-accent);
  background: var(--zc-accent-soft);
  color: var(--zc-accent-active);
}
.cl-options--locked {
  opacity: 0.38;
  filter: blur(2px);
  pointer-events: none;
}

.cl-confront {
  margin: 10px 0 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--zc-surface-2);
  border: 1px solid var(--zc-border);
}
.cl-confront-pred { font-size: 0.88rem; color: var(--zc-text-2); margin-bottom: 6px; }
.cl-confront-ev { font-size: 0.9rem; margin: 0 0 6px; color: var(--zc-text); }
.cl-confront-rule { font-size: 0.88rem; margin: 0 0 8px; color: var(--zc-accent-active); font-weight: 600; }

.cl-blinds { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cl-blind-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--zc-danger) 12%, var(--zc-surface));
  color: var(--zc-danger);
  font-size: 0.78rem;
}

.cl-calib-curve {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 80px;
  margin-top: 6px;
}
.cl-calib-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cl-calib-bar {
  width: 100%;
  max-width: 28px;
  background: var(--zc-accent);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}
.cl-calib-lbl { font-size: 0.62rem; color: var(--zc-text-3); }

.cl-fog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cl-fog-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-height: 72px;
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid var(--zc-border);
  background: var(--zc-surface-2);
  text-align: left;
  color: var(--zc-text);
}
.cl-fog-name { font-size: 0.82rem; font-weight: 650; }
.cl-fog-meta { font-size: 0.72rem; color: var(--zc-text-3); }
.cl-fog-cell.is-dark {
  background: var(--zc-text);
  color: var(--zc-surface);
  border-color: var(--zc-text);
}
.cl-fog-cell.is-dark .cl-fog-meta { color: var(--zc-border-strong); }
.cl-fog-cell.is-grey { background: #e5e7eb; }
.cl-fog-cell.is-bright {
  background: var(--zc-accent-soft);
  border-color: var(--zc-accent);
}
.cl-fog-cell.type-a { box-shadow: inset 3px 0 0 var(--zc-danger); }
.cl-fog-cell.type-b { box-shadow: inset 3px 0 0 var(--zc-warning); }
.cl-fog-cell.type-c { box-shadow: inset 3px 0 0 var(--zc-info); }
.cl-fog-cell.type-d { box-shadow: inset 3px 0 0 var(--zc-accent); }
.cl-fog-cell.type-e { box-shadow: inset 3px 0 0 var(--zc-success); }

.cl-chip-audit {
  background: color-mix(in srgb, var(--zc-warning) 16%, var(--zc-surface));
  color: var(--zc-warning);
  border-color: transparent;
}
.cl-bait {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--zc-border);
}
.cl-bait-q { font-size: 0.9rem; margin: 0 0 8px; color: var(--zc-text); }
.cl-bait-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-bait-verdict { margin: 8px 0 0; min-height: 1.2em; }
.cl-bait-verdict.is-trap { color: var(--zc-danger); }
.cl-bait-verdict.is-ok { color: var(--zc-success); }
