/* ============================================================
   每日课程样式
   今日 Day 大卡片 + 阶段卡片 + 进度条 + 每日计划网格
   全部用 CSS 变量，自动跟随亮/暗主题
   ============================================================ */

/* ---------- 今日 Day 大卡片（Hero 下方） ---------- */
.today-day-card {
  margin: 0 auto 36px;
  max-width: 720px;
  background: var(--card);
  border: 2px solid var(--red);
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: 0 4px 16px rgba(200, 50, 50, 0.08);
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.today-day-card .tdc-left {
  flex: 0 0 auto;
  text-align: center;
  min-width: 90px;
}
.today-day-card .tdc-day {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  color: var(--red);
  letter-spacing: -0.02em;
}
.today-day-card .tdc-day-label {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
  letter-spacing: 0.08em;
}
.today-day-card .tdc-body {
  flex: 1 1 280px;
  min-width: 0;
}
.today-day-card .tdc-phase {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}
.today-day-card .tdc-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  line-height: 1.3;
}
.today-day-card .tdc-meta {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
}
.today-day-card .tdc-meta strong {
  color: var(--red);
  font-weight: 600;
}
.today-day-card .tdc-right {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.today-day-card .tdc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.12s;
}
.today-day-card .tdc-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(200, 50, 50, 0.3);
}
.today-day-card .tdc-btn.ghost {
  background: transparent;
  color: var(--red);
  border: 1.5px solid var(--red);
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
}
.today-day-card .tdc-btn.ghost:hover {
  background: rgba(200, 50, 50, 0.06);
  transform: none;
  box-shadow: none;
}

/* 卡片底部的整体进度条 */
.today-day-card .tdc-progress-wrap {
  flex: 1 1 100%;
  margin-top: 4px;
}
.today-day-card .tdc-progress {
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.today-day-card .tdc-progress i {
  display: block;
  height: 100%;
  background: var(--red);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.today-day-card .tdc-progress-text {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}

/* 窄屏自适应 */
@media (max-width: 560px) {
  .today-day-card {
    padding: 20px;
    gap: 16px;
  }
  .today-day-card .tdc-day {
    font-size: 2.2rem;
  }
  .today-day-card .tdc-title {
    font-size: 1rem;
  }
  .today-day-card .tdc-right {
    flex-direction: row;
    width: 100%;
  }
  .today-day-card .tdc-btn {
    flex: 1;
    justify-content: center;
  }
}

/* ---------- 阶段卡片（/account 页 + 首页路径卡状态） ---------- */
.phase-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 18px 22px;
  margin-bottom: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.phase-card.is-current {
  border-color: var(--red);
  box-shadow: 0 2px 12px rgba(200, 50, 50, 0.1);
}
.phase-card.is-done {
  border-color: var(--green);
  opacity: 0.95;
}
.phase-card.is-locked {
  opacity: 0.55;
  background: var(--bg);
}
.phase-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.phase-card-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.phase-card.is-current .phase-card-num {
  background: var(--red);
  color: #fff;
}
.phase-card.is-done .phase-card-num {
  background: var(--green);
  color: #fff;
}
.phase-card.is-locked .phase-card-num {
  background: var(--line);
  color: var(--muted);
}
.phase-card-title {
  flex: 1 1 auto;
  min-width: 0;
}
.phase-card-title h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}
.phase-card-title p {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 2px 0 0;
}
.phase-card-pct {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.phase-card.is-current .phase-card-pct {
  color: var(--red);
}
.phase-card.is-done .phase-card-pct {
  color: var(--green);
}
.phase-card-track {
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 14px;
}
.phase-card-track i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--muted);
  transition: width 0.4s ease;
}
.phase-card.is-current .phase-card-track i { background: var(--red); }
.phase-card.is-done .phase-card-track i { background: var(--green); }
.phase-card.is-locked .phase-card-track i { background: var(--line); }

/* 阶段卡片里的子模块细分 */
.phase-card-modules {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pcm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
}
.pcm-row a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 500;
  min-width: 80px;
}
.pcm-row a:hover { color: var(--red); }
.pcm-row-track {
  flex: 1 1 auto;
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.pcm-row-track i {
  display: block;
  height: 100%;
  background: var(--muted);
  border-radius: 3px;
}
.pcm-row-pct {
  font-size: 0.72rem;
  color: var(--muted);
  min-width: 56px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 锁定的"即将推出"占位 */
.phase-card.is-locked .phase-card-title h3 {
  color: var(--muted);
}
.phase-card .phase-coming {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
}

/* ---------- 首页路径卡片状态（六步路径联动） ---------- */
.path-item.is-current .path-num {
  background: var(--red);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(200, 50, 50, 0.18);
}
.path-item.is-done .path-num {
  background: var(--green);
  color: #fff;
}
.path-item.is-locked {
  opacity: 0.45;
  pointer-events: none;
}
.path-item.is-locked .path-num {
  background: var(--line);
  color: var(--muted);
}
.path-item.is-locked .path-body h3::after {
  content: '（即将推出）';
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 500;
}
.path-item.is-current .path-body::after {
  content: attr(data-progress);
  display: block;
  font-size: 0.75rem;
  color: var(--red);
  font-weight: 600;
  margin-top: 4px;
}

/* ---------- 暗色模式覆盖 ---------- */
:root[data-theme="dark"] .today-day-card {
  background: #26221c;
  border-color: var(--red);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
:root[data-theme="dark"] .phase-card {
  background: #26221c;
  border-color: #3a3328;
}
:root[data-theme="dark"] .phase-card.is-current {
  border-color: var(--red);
}
:root[data-theme="dark"] .phase-card.is-done {
  border-color: #2d5a3f;
}
:root[data-theme="dark"] .phase-card.is-locked {
  background: #1d1a15;
}

/* ---- 今日三线：每日一字 / 每日一词 ---- */
.tdc-side { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.tdc-side-row { flex: 1 1 240px; display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.tdc-side-tag { font-size: .72rem; color: var(--muted); white-space: nowrap; font-weight: 600; }
.tdc-side-char { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.tdc-side-word { font-size: 1.2rem; }
.tdc-side-info { font-size: .82rem; color: var(--muted); flex: 1; }
.tdc-speak, .tdc-mark { border: 1px solid var(--line); background: var(--card); border-radius: 8px;
  padding: 4px 8px; font-size: .78rem; cursor: pointer; color: var(--ink); white-space: nowrap; }
.tdc-speak:hover, .tdc-mark:hover { border-color: var(--red); color: var(--red); }
.tdc-side-row.done { opacity: .6; }
.tdc-side-row.done .tdc-mark { color: var(--green); border-color: var(--green); cursor: default; }

/* ---- 每日一字一词：首页独立区块 + /daily 专页 ---- */
.daily-spot-head { display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; }
.daily-more { font-size: .88rem; white-space: nowrap; }
.daily-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px; margin-top: 16px; }
.daily-card { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.daily-card-tag { font-size: .75rem; font-weight: 600; color: var(--muted); }
.daily-card-char { font-size: 2.8rem; font-weight: 700; line-height: 1.15; }
.daily-card-word .daily-card-char { font-size: 2.1rem; }
.daily-card-info { color: var(--muted); font-size: .92rem; }
.daily-card-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.daily-card.done { opacity: .68; }
.daily-card.done .tdc-mark { color: var(--green); border-color: var(--green); cursor: default; }
.daily-day-label { font-size: 1.02rem; color: var(--muted); margin: 6px 0 14px; }
.daily-list-title { font-size: 1.05rem; margin-bottom: 10px; }
.daily-list { display: flex; flex-direction: column; gap: 8px; }
.daily-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.daily-row-day { font-size: .76rem; font-weight: 700; color: var(--muted); min-width: 46px; }

/* ============================================================
   每日复习（/daily）状态卡 + 10 题复习
   ============================================================ */
.dr-status {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin: 22px 0 26px;
}
.dr-stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.dr-stat strong { font-size: 1.35rem; line-height: 1.1; color: var(--ink); }
.dr-stat span { font-size: .74rem; color: var(--muted); line-height: 1.3; }

.dr-runner { max-width: 720px; }
.dr-start, .dr-qcard, .dr-result {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 28px;
}
.dr-kicker {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 8px;
}
.dr-start h2, .dr-result h2 { font-size: 1.5rem; margin: 0 0 10px; }
.dr-sub { color: var(--muted); font-size: .95rem; line-height: 1.65; margin: 0 0 16px; }
.dr-note { color: var(--muted); font-size: .85rem; line-height: 1.6; margin: 0 0 16px; }

.dr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.dr-btn:hover { border-color: var(--red); transform: translateY(-1px); }
.dr-btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.dr-btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); }

.dr-qhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.dr-cat {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--red);
  background: rgba(200, 16, 46, .08);
  border-radius: 999px;
  padding: 4px 10px;
}
.dr-progress { font-size: .82rem; color: var(--muted); }
.dr-char {
  font-family: var(--font-kai);
  font-weight: 400;
  font-size: 3.6rem;
  line-height: 1.15;
  text-align: center;
  margin: 4px 0 10px;
}
.dr-prompt { font-size: 1.05rem; line-height: 1.6; margin: 0 0 18px; }
.dr-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.dr-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 10px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 500;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
  word-break: break-word;
}
.dr-opt:hover:not(:disabled) { border-color: var(--red); transform: translateY(-1px); }
.dr-opt:disabled { cursor: default; }
.dr-opt.right { border-color: var(--green); background: #f0f9f3; color: var(--green); font-weight: 700; }
.dr-opt.wrong { border-color: var(--red); background: #fdecec; color: var(--red); font-weight: 700; }
[data-theme="dark"] .dr-opt.right { background: #1e3327; }
[data-theme="dark"] .dr-opt.wrong { background: #3a1f1f; }

.dr-feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}
.dr-feedback[hidden] { display: none; }
.dr-feedback strong { font-size: 1rem; }
.dr-feedback.is-right strong { color: var(--green); }
.dr-feedback.is-wrong strong { color: var(--red); }
.dr-explain { color: var(--muted); font-size: .9rem; }
.dr-retry-note { width: 100%; font-size: .8rem; color: var(--muted); }
.dr-feedback .dr-btn { margin-left: auto; }
.dr-listen {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: .82rem;
  cursor: pointer;
}

.dr-empty[hidden] { display: none; }
.dr-empty {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 28px;
  max-width: 720px;
}
.dr-empty h2 { font-size: 1.35rem; margin: 0 0 10px; }
.dr-empty p { color: var(--muted); font-size: .95rem; line-height: 1.65; margin: 0 0 16px; }

.dr-mistakes-title { font-size: 1rem; margin: 18px 0 10px; }
.dr-mistakes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.dr-mi {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--font-kai);
  font-size: 1.5rem;
}
.dr-mi em {
  font-family: var(--font-latin);
  font-style: normal;
  font-size: .86rem;
  color: var(--muted);
}
.dr-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* 看板 / 历史 / 错题本 */
.dr-panel[hidden] { display: none; }
.dr-panel {
  margin-top: 22px;
  padding: 22px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: 720px;
}
.dr-panel-head h2 { font-size: 1.15rem; margin: 0 0 6px; }
.dr-subhead { color: var(--muted); font-size: .88rem; line-height: 1.6; margin: 0 0 14px; }
.dr-empty-line { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }

.dr-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 130px;
  margin-bottom: 20px;
}
.dr-bar-wrap {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  height: 100%;
}
.dr-bar {
  width: 100%;
  max-width: 34px;
  min-height: 2px;
  border-radius: 6px 6px 0 0;
  background: var(--red);
  opacity: .85;
}
.dr-bar-label { font-size: .68rem; color: var(--muted); white-space: nowrap; }

.dr-level-row {
  display: flex;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 5px;
}
.dr-level-row span:last-child { color: var(--ink); font-weight: 600; }
.dr-level-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 12px;
}
.dr-level-track i { display: block; height: 100%; border-radius: 999px; }
.dr-level-track .is-mastered { background: var(--green); }
.dr-level-track .is-learning { background: #d99a2b; }
.dr-level-track .is-new { background: var(--line); }

.dr-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dr-history-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  font-size: .86rem;
}
.dr-history-when { color: var(--muted); min-width: 96px; }
.dr-history-score { flex: 1; color: var(--ink); }
.dr-history-rate { font-weight: 700; color: var(--red); }

.dr-mistake-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dr-mistake-item {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  flex-wrap: wrap;
}
.dr-mistake-main { font-family: var(--font-kai); font-size: 1.35rem; line-height: 1.2; }
.dr-mistake-sub { color: var(--muted); font-size: .82rem; min-width: 48px; }
.dr-mistake-count { margin-left: auto; color: var(--muted); font-size: .76rem; }

[data-theme="dark"] .dr-level-track .is-learning { background: #d9a441; }

@media (max-width: 900px) {
  .dr-status { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .dr-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dr-start, .dr-qcard, .dr-result { padding: 20px 18px; }
  .dr-options { grid-template-columns: 1fr; }
  .dr-char { font-size: 3rem; }
  .dr-feedback .dr-btn { margin-left: 0; }
  .dr-panel { padding: 18px 16px; }
  .dr-chart { height: 108px; gap: 5px; }
  .dr-bar-label { font-size: .62rem; }
  .dr-history-item { flex-wrap: wrap; gap: 4px 10px; }
  .dr-history-when { min-width: 0; }
}
.daily-row-item { display: flex; align-items: center; gap: 8px; flex: 1 1 250px; min-width: 0; }
.daily-row-char { font-weight: 700; font-size: 1.18rem; white-space: nowrap; }
.daily-row-info { font-size: .8rem; color: var(--muted); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.daily-row-item.done { opacity: .6; }
.daily-row-item.done .tdc-mark { color: var(--green); border-color: var(--green); cursor: default; }
.daily-expand { margin-top: 12px; border: 1px solid var(--line); background: var(--card);
  color: var(--ink); border-radius: 10px; padding: 8px 16px; font-size: .85rem; cursor: pointer; }
.daily-expand:hover { border-color: var(--red); color: var(--red); }
