.task.not-required {
  opacity: .58;
}

.task.not-required span {
  text-decoration: line-through;
}

.task .mini,
.row .mini {
  flex: 0 0 auto;
  font-size: 12px;
  white-space: nowrap;
}

@media (max-width: 520px) {
  .task {
    flex-wrap: wrap;
  }

  .task > span {
    flex: 1;
    min-width: 170px;
  }
}

.daily-record {
  background: linear-gradient(180deg, #fff, #f8faff);
}

.record-grid {
  margin-top: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.gauge {
  --value: 0;
  --gauge: var(--blue);
  width: 132px;
  aspect-ratio: 1;
  border-radius: 50%;
  margin: 0 auto;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--gauge) calc(var(--value) * 1%), #e9ecf5 0);
  position: relative;
}

.gauge::after {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: inherit;
  background: white;
}

.gauge > div {
  position: relative;
  z-index: 1;
  text-align: center;
}

.gauge b,
.gauge span {
  display: block;
}

.gauge b {
  color: var(--ink);
  font-size: 22px;
}

.gauge span {
  color: var(--muted);
  font-size: 12px;
}

.metric.big {
  min-height: 86px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.progress-row {
  display: grid;
  grid-template-columns: 58px 1fr 44px;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.progress-row b {
  text-align: right;
  color: var(--blue);
}

.feeling-chart > div {
  display: grid;
  grid-template-columns: 48px 1fr 38px;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.feeling-chart i {
  height: 12px;
  width: max(6px, var(--w));
  border-radius: 99px;
  background: var(--blue);
}

.feeling-chart > div:nth-child(1) i { background: var(--green); }
.feeling-chart > div:nth-child(3) i { background: var(--orange); }

.dual-chart {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.dual-chart .chart {
  height: 105px;
}

.weak-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.weak {
  padding: 12px 6px;
  border-radius: 12px;
  text-align: center;
  background: #f3f4f8;
}

.weak b,
.weak span {
  display: block;
}

.weak b { font-size: 24px; }
.weak span { font-size: 12px; color: var(--muted); }
.weak.repeat b { color: var(--star); }
.weak.forgotten b { color: var(--red); }
.weak.familiar b { color: var(--orange); }
.weak.mastered b { color: var(--green); }

.knowledge-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.knowledge-switch button {
  background: #eef0f7;
  color: var(--ink);
  text-align: left;
}

.knowledge-switch button.active {
  color: white;
  background: var(--blue);
  box-shadow: 0 5px 14px #3b5ccc33;
}

.knowledge-switch small {
  display: block;
  margin-top: 4px;
  opacity: .75;
}

.knowledge-group {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px;
  margin-top: 12px;
}

.knowledge-group.status-group:nth-of-type(2) { border-left: 5px solid var(--star); }
.knowledge-group.status-group:nth-of-type(3) { border-left: 5px solid var(--red); }
.knowledge-group.status-group:nth-of-type(4) { border-left: 5px solid var(--orange); }
.knowledge-group.status-group:nth-of-type(5) { border-left: 5px solid var(--green); }
.knowledge-group:not(.status-group):nth-of-type(4n+2) { border-top: 4px solid #3b5ccc; }
.knowledge-group:not(.status-group):nth-of-type(4n+3) { border-top: 4px solid #1b9c77; }
.knowledge-group:not(.status-group):nth-of-type(4n+4) { border-top: 4px solid #ed9634; }
.knowledge-group:not(.status-group):nth-of-type(4n+5) { border-top: 4px solid #8160d6; }
.knowledge-repeat_error { border-left: 4px solid var(--star); }
.knowledge-forgotten { border-left: 4px solid var(--red); }
.knowledge-familiar { border-left: 4px solid var(--orange); }
.knowledge-mastered { border-left: 4px solid var(--green); }

button.danger {
  background: #fff0f1;
  color: var(--red);
}

.undo {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.undo small {
  margin-right: 8px;
  color: var(--muted);
  white-space: nowrap;
}

.latest-exam,
.reward-tier {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.latest-exam {
  margin-top: 15px;
  flex-direction: column;
  align-items: flex-start;
}

.reward-tier > div {
  flex: 1;
}

.reward-tier b,
.reward-tier span {
  display: block;
}

.reward-tier span {
  color: var(--muted);
  margin-top: 3px;
}

.reward-hero {
  background: linear-gradient(135deg, #fff8e8, #fff);
}

.subject-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.subject-toggle span {
  flex: 1;
}

.subject-toggle b,
.subject-toggle small {
  display: block;
}

.subject-toggle small {
  color: var(--muted);
  margin-top: 3px;
}

.subject-toggle input {
  width: 24px;
  height: 24px;
  accent-color: var(--blue);
}

@media (min-width: 650px) {
  .dashboard-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 480px) {
  .dual-chart { grid-template-columns: 1fr; }
  .gauge { width: 116px; }
  .weak-grid { grid-template-columns: repeat(2, 1fr); }
  .knowledge-switch { grid-template-columns: 1fr; }
}

/* v18: clearer knowledge reviews, true-value charts and unified spacing */
.content {
  padding-bottom: 110px;
}

.content > .card {
  margin-bottom: 16px;
  border: 1px solid #e8ebf4;
  box-shadow: 0 8px 24px rgba(46, 57, 110, .07);
}

.card h2 {
  margin-bottom: 16px;
}

.form-grid {
  gap: 14px;
  align-items: end;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: #4f566b;
  font-size: 13px;
  font-weight: 650;
}

.form-grid input,
.form-grid select {
  margin: 0;
}

.knowledge-entry {
  background: linear-gradient(150deg, #ffffff 0%, #f7f9ff 100%);
}

.knowledge-entry .status {
  padding: 12px;
  border-radius: 14px;
  background: #f1f3fa;
}

.knowledge-entry > button {
  margin-top: 14px;
}

.knowledge-group,
.knowledge-group.status-group,
.knowledge-repeat_error,
.knowledge-forgotten,
.knowledge-familiar,
.knowledge-mastered {
  border-left: 1px solid var(--line);
}

.knowledge-repeat_error {
  background: linear-gradient(135deg, #fbf6ff, #f4ebff);
  border-color: #e2cdf8;
}

.knowledge-forgotten {
  background: linear-gradient(135deg, #fff8f8, #ffeded);
  border-color: #f5cccc;
}

.knowledge-familiar {
  background: linear-gradient(135deg, #fffaf2, #fff1d9);
  border-color: #f4d7a3;
}

.knowledge-mastered {
  background: linear-gradient(135deg, #f5fcf8, #e8f8ef);
  border-color: #bfe6cf;
}

.knowledge-group.status-group:nth-of-type(2) { background: #faf6ff; border-left: 1px solid #e4d9f2; }
.knowledge-group.status-group:nth-of-type(3) { background: #fff7f7; border-left: 1px solid #f0d4d4; }
.knowledge-group.status-group:nth-of-type(4) { background: #fffaf1; border-left: 1px solid #f0dfbd; }
.knowledge-group.status-group:nth-of-type(5) { background: #f4fbf7; border-left: 1px solid #cfe7d8; }

.knowledge-group .kitem {
  padding: 15px;
  margin-top: 11px;
  border-radius: 14px;
}

.group-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 750;
}

.group-title small {
  padding: 3px 9px;
  border-radius: 99px;
  background: rgba(255,255,255,.78);
  color: var(--muted);
}

.review-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.review-actions span {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}

.review-history {
  margin-top: 11px;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  overflow: hidden;
}

.review-history summary {
  padding: 10px 12px;
  cursor: pointer;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}

.review-history > div {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 12px;
  border-top: 1px solid rgba(90,100,140,.1);
  font-size: 12px;
}

.review-history > div span,
.review-history > div small {
  color: var(--muted);
}

.gauge-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.metric-row .metric {
  border-radius: 14px;
  background: #f5f7fc;
}

.value-chart {
  height: 145px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  padding: 28px 8px 20px;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8f9fd, #f1f4fa);
}

.value-bar-wrap {
  height: 100%;
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  position: relative;
}

.value-bar {
  width: min(28px, 78%);
  min-height: 6px;
  position: relative;
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, #647de3, var(--blue));
}

.dual-chart > div:nth-child(2) .value-bar {
  background: linear-gradient(180deg, #f7ae5d, var(--orange));
}

.value-bar span {
  position: absolute;
  left: 50%;
  top: -20px;
  transform: translateX(-50%);
  color: var(--ink);
  font-size: 10px;
  white-space: nowrap;
}

.value-bar-wrap small {
  position: absolute;
  bottom: -18px;
  color: var(--muted);
  font-size: 10px;
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.badge-card {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #f6f7fa;
}

.badge-card i {
  font-size: 30px;
  font-style: normal;
  filter: grayscale(1);
  opacity: .55;
}

.badge-card div,
.badge-card b,
.badge-card span,
.badge-card small {
  min-width: 0;
  display: block;
}

.badge-card span,
.badge-card small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.badge-card.earned {
  border-color: #efd38d;
  background: linear-gradient(135deg, #fff9e9, #fff2c9);
}

.badge-card.earned i {
  filter: none;
  opacity: 1;
}

@media (max-width: 600px) {
  .gauge-row .gauge { width: 92px; }
  .gauge-row .gauge::after { inset: 10px; }
  .gauge-row .gauge b { font-size: 18px; }
  .metric-row { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .metric-row .metric { min-height: 76px; padding: 8px 3px; }
  .metric-row .metric b { font-size: 18px; }
  .metric-row .metric span { font-size: 10px; }
  .badge-grid { grid-template-columns: 1fr; }
}

@media (max-width: 360px) {
  .gauge-row .gauge { width: 82px; }
  .gauge-row .gauge span { font-size: 10px; }
}
