.sm-card {
  --sm-ink: #232947;
  --sm-muted: #5b6480;
  --sm-brand: #5057be;
  --sm-line: #dee2f0;
  background: #fff;
  color: var(--sm-ink);
  border: 1px solid var(--sm-line);
  border-radius: 22px;
  padding: clamp(18px, 3vw, 34px);
}
.sm-card button, .sm-mistake-dialog button, .sm-dialog-tools button {
  font: inherit;
  cursor: pointer;
}
.sm-icon { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.sm-heading, .sm-actions, .sm-caption, .sm-source, .sm-dialog-tools, .sm-char-list,
.sm-reading-tools, .sm-recital-nav, .sm-select-label, .sm-progress {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.sm-heading { align-items: flex-start; gap: .85rem; }
.sm-heading > .sm-icon {
  width: 2.8rem;
  height: 2.8rem;
  background: #eceefa;
  color: #5057be;
  border-radius: 13px;
}
.sm-heading h2 { margin: 0 0 .35rem; color: #252b46; }
.sm-heading h2 { font-size: clamp(1.35rem, 2.5vw, 1.75rem); line-height: 1.35; }
.sm-heading p, .sm-dialog-hint { color: #5b6480; margin: 0; line-height: 1.65; }
.sm-sheet {
  padding: clamp(16px, 2.7vw, 28px);
  margin-top: 1.5rem;
  border: 1px solid #dfe2f2;
  border-radius: 16px;
  background: linear-gradient(140deg, #f7f8ff, #fcfcff);
}
.sm-caption, .sm-recital-nav { justify-content: space-between; flex-wrap: wrap; gap: .6rem 1rem; }
.sm-caption strong { color: #484fa8; font-size: 1rem; }
.sm-source { flex-wrap: wrap; gap: .65rem; }
.sm-card > .sm-source { margin-top: 1rem; }
.sm-source-label { border-radius: 7px; padding: .28rem .58rem; background: #eaedf8; color: #505b77; font-size: .875rem; line-height: 1.3; }
.sm-card .sm-link {
  background: transparent;
  border: 0;
  padding: .4rem 0;
  color: #474fb4;
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: .23em;
}
.sm-reading {
  margin: 1rem 0;
  color: #273050;
  font-size: clamp(1.2rem, 2.1vw, 1.52rem);
  font-weight: 500;
  line-height: 2.25;
  letter-spacing: .035em;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.sm-card .sm-blank, .sm-card .sm-mask {
  width: calc(var(--word-length) * 1.27em);
  max-width: 100%;
  height: 1.7em;
  min-height: 37px;
  min-width: 44px;
  margin: 0 .12em;
  padding: 0;
  vertical-align: baseline;
  color: #484fa8;
}
.sm-card .sm-blank {
  position: relative;
  vertical-align: -.2em;
  border: 0;
  border-bottom: 2px solid #737ac4;
  border-radius: 5px 5px 0 0;
  background: #ebedfb;
}
.sm-blank::before {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: .3em;
  background: repeating-linear-gradient(to right, transparent 0, transparent calc(1.27em - 1px), #b2b7e6 calc(1.27em - 1px), #b2b7e6 1.27em);
}
.sm-filled { display: inline; margin: 0 .1em; color: #226c58; border-bottom: 2px solid #8ecbb6; }
.sm-card .sm-mask {
  border: 1px dashed #a7acd9;
  border-radius: 7px;
  background-color: #e9ebfa;
  font-size: 1em;
  font-weight: 650;
  color: #60679c;
  letter-spacing: .16em;
  line-height: 1;
}
.sm-card .sm-mask.sm-visible { background: #fff; color: #454cab; border-style: solid; letter-spacing: .025em; }
.sm-progress { color: #505b77; font-size: .9rem; flex-wrap: wrap; gap: .65rem; }
.sm-progress progress {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: min(108px, 55%);
  height: 7px;
  border: 0;
  background: #dde0f0;
  border-radius: 9px;
  overflow: hidden;
}
.sm-progress progress::-webkit-progress-bar { background: #dde0f0; }
.sm-progress progress::-webkit-progress-value { background: #7176d0; border-radius: 9px; }
.sm-progress progress::-moz-progress-bar { background: #7176d0; border-radius: 9px; }
.sm-actions, .sm-reading-tools, .sm-dialog-tools, .sm-char-list { flex-wrap: wrap; }
.sm-actions { margin-top: 1.15rem; }
.sm-button, .sm-char {
  font: inherit;
  border: 1px solid #d7daed;
  border-radius: 10px;
  background: #fff;
  color: #3b4369;
  min-height: 44px;
  padding: .62rem .95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  line-height: 1.45;
  cursor: pointer;
}
.sm-primary, .sm-char[aria-pressed=true] { border-color: #5057be; background: #5057be; color: #fff; }
@media (hover: hover) {
  .sm-button:hover, .sm-char:hover, .sm-card .sm-mask:hover, .sm-card .sm-blank:hover, .sm-error-row:hover {
    box-shadow: 0 0 0 2px #b7bce766;
    border-color: #939bdb;
  }
}
.sm-card :focus-visible, .sm-mistake-dialog :focus-visible, .sm-dialog-tools :focus-visible {
  outline: 3px solid #6373d3;
  outline-offset: 3px;
}
.sm-message {
  background: #f3f4fb;
  border: 1px solid #dfe2f1;
  border-radius: 12px;
  color: #46506d;
  margin-top: 1rem;
  padding: .8rem 1rem;
  line-height: 1.6;
}
.sm-message.sm-good { border-color: #c4dfd3; background: #eef8f2; color: #256247; }
.sm-study-characters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 24px;
}
.sm-study-character {
  display: grid;
  gap: 2px;
  place-items: center;
  min-width: 0;
  padding: 7px 2px;
  border: 1px solid #deddee;
  border-radius: 10px;
  color: #39395d;
  background: #f7f6fd;
}
.sm-study-character:hover { background: #efecfc; border-color: #aca4d9; }
.sm-study-pinyin { font-size: .8125rem; color: #666280; }
.sm-study-character strong { font-size: 1.7rem; line-height: 1.45; font-weight: 550; }
.sm-error-title { border-top: 1px solid var(--sm-line); padding-top: 16px; font-size: 1.12rem; margin: 0; }
.sm-error-title + .sm-count { margin: 6px 0 12px; }
.sm-count { color: #5b6480; font-size: .9rem; }
.sm-error-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: .6rem; }
.sm-error-row {
  display: flex;
  gap: .7rem;
  align-items: center;
  padding: .85rem;
  border-radius: 12px;
  border: 1px solid #dfe2ee;
  background: #fbfbfe;
  color: #414b70;
  text-align: left;
}
.sm-error-row > .sm-icon:first-child { width: 38px; height: 38px; border-radius: 10px; color: #646bb1; background: #eceefa; }
.sm-error-row > .sm-icon:last-child { margin-left: auto; }
.sm-error-label { display: grid; gap: .2rem; }
.sm-error-label strong { color: #28304c; font-size: 1.12rem; letter-spacing: .05em; }
.sm-error-label > span { color: #646d85; font-size: .875rem; }
.sm-char-list { margin: .8rem 0; }
.sm-char { min-width: 45px; font-size: 1.25rem !important; }
.sm-anim-stage { display: grid; justify-items: center; padding: .75rem 0; min-width: 0; }
.sm-anim-stage > * { max-width: 100%; }
.sm-dialog-tools { margin-bottom: .8rem; }
.sm-pad { min-width: 0; }
.sm-mistake-dialog .sm-message + .sm-button { margin-top: .75rem; }
.sm-recital-nav { margin-top: 1.3rem; }
.sm-select-label { color: #525c78; font-size: .9rem; }
.sm-select {
  min-height: 44px;
  max-width: 100%;
  font: inherit;
  color: #394265;
  background-color: #fff;
  border: 1px solid #d7daed;
  border-radius: 8px;
  padding: .5rem 2rem .5rem .7rem;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6a7190 50%), linear-gradient(135deg, #6a7190 50%, transparent 50%);
  background-position: calc(100% - 16px) 52%, calc(100% - 11px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.sm-recital-nav + .sm-sheet { margin-top: .7rem; }
.sm-reading-tools { border-top: 1px solid #dfe2f2; padding-top: .9rem; }
.sm-recited { color: #2a6b50; font-weight: 650; }
@media (max-width: 480px) {
  .sm-card { padding: 17px 14px; border-radius: 16px; }
  .sm-heading { gap: .6rem; }
  .sm-heading > .sm-icon { width: 36px; height: 36px; }
  .sm-sheet { padding: 14px 12px; }
  .sm-caption { align-items: flex-start; }
  .sm-source { gap: .35rem; }
  .sm-actions, .sm-reading-tools { gap: .5rem; }
  .sm-button { padding: .55rem .75rem; }
}
