/* The learning loop (js/v2-plan.js): 今日任务, teaching rounds, quick checks, tested review cards, the word
   states and the three-shade bars. Fox den tokens only (design-system/fox-den.md); the shared pieces are in
   css/v2-base.css. */

/* ---------- the states: one dot and one colour each (fox-den.md §5) ---------- */
.st-dot {
  position: relative; display: inline-block; width: 12px; height: 12px; flex: none; border-radius: 50%;
  border: 2px solid var(--ink-faint); background: transparent; vertical-align: -1px;
}
.st-learning { border-color: var(--caramel); background: linear-gradient(90deg, var(--caramel) 50%, transparent 50%); }
.st-learned { border-color: var(--green); background: linear-gradient(90deg, var(--green) 50%, transparent 50%); }
.st-mastered { border-color: var(--green); background: var(--green); }
.st-known { width: 14px; height: 14px; border-color: var(--green); background: var(--green); }
.st-known::after {
  content: ""; position: absolute; left: 3px; top: 0; width: 3px; height: 6px;
  border: solid var(--card); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.st-hard { border-color: var(--wrong); background: var(--wrong); }
.st-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--paper-deep); color: var(--ink-soft); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.st-chip-learning { background: var(--blue-soft); color: var(--blue); }
.st-chip-learned, .st-chip-mastered, .st-chip-known { background: var(--green-soft); color: var(--green); }
.st-chip-hard { background: var(--wrong-soft); color: var(--wrong); }
.st-label { font-size: 12px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.st-label-learning { color: var(--blue); }
.st-label-learned, .st-label-mastered, .st-label-known { color: var(--green); }
.st-label-hard { color: var(--wrong); }
.learn-unit-link .st-dot { margin-right: 2px; }
.learn-wp-head .st-chip { margin-top: 6px; }

/* ---------- one bar in three shades (§11) ---------- */
.pbar { display: flex; height: 8px; margin: 4px 0; overflow: hidden; border-radius: 999px; background: var(--paper-deep); }
.pbar > span { display: block; height: 100%; }
.pbar-top { background: var(--green); }
.pbar-learned { background: var(--green); opacity: .5; }
.pbar-learning { background: var(--caramel); }
.pbar-small { height: 5px; margin: 6px 0 2px; }
.pbar-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; color: var(--ink-soft); font-size: 13px; }
.pbar-legend span { display: inline-flex; align-items: center; gap: 6px; }
.pbar-legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pbar-key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.pbar-legend .pbar-of { color: var(--ink-faint); }
.learn-unit .pbar { margin-top: 0; }
.learn-unit .pbar-legend { margin-bottom: 12px; }
.plan-unit .unit-count { margin-top: 2px; }
.learn-bookpage .pbar-legend { margin-bottom: 8px; }

/* ---------- one line on what to do next ---------- */
.plan-next-line { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }

/* ---------- Home: 今日任务 ---------- */
.lib-today.plan-today-card { display: flex; flex-direction: column; gap: 12px; }
.plan-today-title { margin: 0; font-size: 22px; font-weight: 800; }
.plan-ring { width: 52px; height: 52px; }
.plan-ring > span b { font-size: 15px; }
.plan-ring > span small { margin: 0; font-size: 10px; }
.plan-ring > span svg { width: 22px; height: 22px; color: var(--green); }
.plan-blocks { background: var(--paper); }
html.night .plan-blocks { background: var(--paper-deep); }
.plan-block { min-height: 64px; padding: 8px 12px; }
.plan-block-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--card); color: var(--blue); }
.plan-block-cover { width: 64px; height: 40px; flex: none; object-fit: cover; border-radius: 8px; background: var(--paper-deep); }
.plan-block .v2-li-title { display: flex; align-items: baseline; gap: 8px; }
.lib-block-book { font-size: 12px; font-weight: 600; color: var(--ink-faint); }
.plan-block .v2-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-block-done { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.plan-block-done svg { width: 16px; height: 16px; }
.plan-block-finished .v2-li-title { color: var(--ink-soft); }
.lib-today .lib-today-go { min-height: 56px; font-size: 17px; font-weight: 700; }
.lib-today-line { text-align: center; }

/* the review count on My words' tab: a plain number, never a red badge (§5) */
.nav-badge { background: var(--paper-deep); color: var(--ink); box-shadow: 0 0 0 2px var(--card); }

/* ---------- a round: the top, the steps, the card ---------- */
.plan-learn { display: flex; flex-direction: column; gap: 12px; }
.plan-top { margin-bottom: 0; }
.plan-steps { flex: 1; display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.plan-step {
  flex: 1; min-width: 0; padding: 4px 0 0; border-top: 4px solid var(--line); color: var(--ink-faint);
  font-size: 12px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-step-done { border-top-color: var(--green); color: var(--green); }
.plan-step-now { border-top-color: var(--ink); color: var(--ink); }
.plan-card { display: flex; flex-direction: column; gap: 14px; padding: 20px 16px; background: var(--card); border-radius: var(--radius); }
.plan-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; text-align: center; }
.plan-word { width: 100%; margin: 0; font-size: 34px; font-weight: 800; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.plan-ph { margin: 0; font-size: 16px; }
.plan-card .word-sound-big, .plan-card .acct-sound {
  display: grid; place-items: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%;
  background: var(--paper-deep); color: var(--ink);
}
.plan-card .word-sound-big svg, .plan-card .acct-sound svg { width: 24px; height: 24px; }
.plan-card .word-sound-big.is-playing { background: var(--ink); color: var(--on-ink); }
.plan-card .acct-sound { align-self: center; }
.plan-meanings { display: flex; flex-direction: column; gap: 8px; }
.plan-meanings .learn-mean-row { display: flex; align-items: baseline; gap: 8px; font-size: 16px; line-height: 1.5; }
.plan-example, .plan-film { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border-radius: var(--radius-c); background: var(--paper); }
html.night .plan-example, html.night .plan-film { background: var(--paper-deep); }
.plan-example-text, .plan-film-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.plan-ex-en { margin: 0; font-size: 16px; line-height: 1.5; }
.plan-ex-zh { margin: 0; color: var(--ink-soft); font-size: 14px; }
.plan-film-title { color: var(--blue); font-size: 12px; font-weight: 700; }
.plan-film-play { background: var(--card); }
.plan-check-label { font-weight: 700; color: var(--ink); }

/* the four meanings */
.plan-options { display: flex; flex-direction: column; gap: 8px; }
.plan-option {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px;
  border: 2px solid transparent; border-radius: var(--radius-c); background: var(--paper-deep); color: var(--ink);
  text-align: left; font-size: 16px; line-height: 1.4;
}
.plan-option:hover:not(:disabled) { background: var(--fill-h); }
.plan-option:disabled { cursor: default; }
.plan-option-key {
  display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: var(--card); color: var(--ink-soft); font-size: 13px; font-weight: 700;
}
.plan-option-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.plan-option-right { border-color: var(--green); background: var(--green-soft); color: var(--ink); }
.plan-option-right svg { color: var(--green); }
.plan-option-wrong { border-color: var(--wrong); background: var(--wrong-soft); }
.plan-option:disabled:not(.plan-option-right):not(.plan-option-wrong) { opacity: .6; }

/* typing a word: one dash per letter, the box, the meaning as a prompt */
.plan-dashes { margin: 0; text-align: center; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 24px; letter-spacing: .18em; color: var(--ink-soft); }
.plan-dashes b { color: var(--ink); }
.plan-dash-word { display: inline-block; margin: 0 .4em; }
.plan-dashes-full { color: var(--ink); font-family: var(--sans); letter-spacing: 0; font-weight: 700; }
.plan-field { width: 100%; min-height: 52px; font-size: 20px; text-align: center; }
.plan-recall { margin: 0; text-align: center; font-size: 20px; font-weight: 700; line-height: 1.4; }

/* a wrong answer is plum; red stays for the main button alone (fox-den.md §3) */
.plan-learn .verdict-line .verdict-stamp.fox-verdict-low,
.acct-review .verdict-line .verdict-stamp.fox-verdict-low { color: var(--wrong); background: var(--wrong-soft); }
.plan-learn .verdict-line, .acct-review .verdict-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acct-review .verdict-line .acct-zhan { margin-left: auto; }

/* the bar of a round */
.plan-bar-note { flex: 1; text-align: center; }
.plan-bar .btn { min-height: 56px; }
.plan-bar .btn svg { width: 18px; height: 18px; }

/* a round's end, the day's summary, an empty block */
.plan-end h1, .plan-sum h1 { margin: 4px 0 6px; font-size: 26px; font-weight: 800; }
.plan-sum { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--card); border-radius: var(--radius); }
.plan-sum-tiles { margin-top: 12px; }
.plan-sum-words { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.plan-sum-word { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; background: var(--paper-deep); font-weight: 600; }
.plan-today .popfox { height: 236px; margin: 8px 0 0; }
.plan-today .popfox img { height: 262px; }
.plan-empty .btn { margin-top: 8px; }

/* a review card's meaning prompt and stamp */
.plan-review-card .plan-options { width: 100%; max-width: 520px; align-self: center; }
.plan-review-card .plan-dashes { font-size: 22px; }

/* 快速筛查 on a unit; the plan's pace in Settings; a dictation part's way back to the plan */
.plan-screen-offer { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 14px; padding: 14px; border-radius: var(--radius); background: var(--card); }
.plan-screen-offer .btn { min-height: 52px; }
.acct-estimate { min-height: 48px; }
.learn-done-plan { margin-top: 6px; padding: 0; min-height: 36px; color: var(--blue); }
.learn-done-plan svg { width: 16px; height: 16px; }

@media (min-width: 760px) {
  .plan-card { padding: 28px 28px; }
  .plan-word { font-size: 40px; }
}
