/* 私用区 E100–E13A：同目录 Untitled14.woff2；CSS 族名 Untitled14PUA 与 zigenbiao.html 一致；woff2 须二进制上传否则浏览器无法解码 */
@font-face {
  font-family: "Untitled14PUA";
  src: url("../Untitled14.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

#videoCard .card-head {
  margin-bottom: 6px;
}
#videoCard #videoBody > .tip {
  margin-top: 0.45rem;
}

/* 教材图尺寸见 home.css `.jiaocai-pages img.textbook-image` */

.unicode-box {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.88rem;
}

.roots-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 6px;
  margin-bottom: 10px;
}

.root-btn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 8px 10px;
  font-size: 1.2rem;
  min-width: 48px;
  font-family: "Untitled14PUA", "WubiCustom", "Microsoft YaHei", sans-serif;
}

.root-btn.active {
  border-color: rgba(61, 139, 253, 0.8);
  background: rgba(61, 139, 253, 0.22);
}

.trace-layout {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.trace-main {
  flex: 1;
  min-width: 0;
}

.canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.page-scroll-strip {
  flex-shrink: 0;
  width: 42px;
  min-height: 120px;
  align-self: stretch;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  touch-action: pan-y;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.page-scroll-strip__grip {
  width: 6px;
  height: 44px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.45) 0 4px,
    transparent 4px 8px
  );
  pointer-events: none;
}

/* A 键字根辨认测试（打乱 + 干扰项） */
.root-quiz-intro {
  margin: 0 0 10px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.root-quiz-intro__ok {
  color: rgba(130, 235, 190, 0.95);
}

.root-quiz-intro__bad {
  color: rgba(255, 170, 170, 0.92);
}

.root-quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.75rem, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.root-quiz-tile {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font: inherit;
  min-height: 5.5rem;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.root-quiz-tile:focus-visible {
  outline: 2px solid rgba(61, 139, 253, 0.85);
  outline-offset: 2px;
}

.root-quiz-tile__char {
  font-size: 1.85rem;
  line-height: 1.2;
  font-family: "Untitled14PUA", "WubiCustom", "Microsoft YaHei", sans-serif;
}

.root-quiz-tile__tag {
  font-size: 0.74rem;
  font-weight: 800;
  min-height: 1.35em;
  line-height: 1.35;
  text-align: center;
  color: var(--muted);
}

.root-quiz-tile.is-revealed {
  cursor: default;
}

.root-quiz-tile.is-revealed.root-quiz-tile--yes {
  border-color: rgba(72, 199, 142, 0.85);
  background: rgba(72, 199, 142, 0.16);
  box-shadow: 0 0 0 1px rgba(72, 199, 142, 0.25) inset;
}

.root-quiz-tile.is-revealed.root-quiz-tile--yes .root-quiz-tile__tag {
  color: rgba(130, 235, 190, 0.98);
}

.root-quiz-tile.is-revealed.root-quiz-tile--no {
  border-color: rgba(255, 130, 130, 0.75);
  background: rgba(255, 100, 100, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 130, 130, 0.2) inset;
}

.root-quiz-tile.is-revealed.root-quiz-tile--no .root-quiz-tile__tag {
  color: rgba(255, 170, 170, 0.95);
}

#templateCanvas,
#traceCanvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  touch-action: none;
}

#templateCanvas {
  display: block;
  background: #fff;
}

#traceCanvas {
  position: absolute;
  inset: 0;
  background: transparent;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.dictation-canvas {
  width: 100%;
  max-width: 420px;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #fff;
  touch-action: none;
}

.dictation-list {
  margin-top: 10px;
  min-height: 40px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dictation-item {
  font-size: 1rem;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  font-family: "Untitled14PUA", "WubiCustom", "Microsoft YaHei", sans-serif;
  display: grid;
  gap: 6px;
  user-select: none;
  touch-action: none;
}

.dictation-item.active {
  border-color: rgba(61, 139, 253, 0.85);
  box-shadow: 0 0 0 2px rgba(61, 139, 253, 0.22) inset;
}

.dictation-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  object-fit: cover;
  background: #fff;
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

.dictation-del {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.76rem;
  padding: 3px 6px;
}

.dictation-item.dragging {
  opacity: 0.55;
  transform: scale(0.96);
}

.dictation-item.drop-target {
  border-color: rgba(96, 214, 120, 0.85);
  box-shadow: 0 0 0 2px rgba(96, 214, 120, 0.22) inset;
}

.text-area,
.line-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  padding: 10px;
}

/* 原生 select 易被系统改成白底浅字；强制深色面板与可读文字 */
select.line-input {
  color-scheme: dark;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--card);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.22);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24'%3E%3Cpath fill='%23c8d4f0' d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 38px;
}

select.line-input:focus {
  outline: none;
  border-color: rgba(61, 139, 253, 0.75);
  box-shadow: 0 0 0 2px rgba(61, 139, 253, 0.22);
}

select.line-input option {
  background-color: var(--card);
  color: var(--text);
}

.saved-articles {
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 10px;
  line-height: 1.6;
}

.saved-item {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.16);
  padding: 8px 0;
}

.saved-item:last-child {
  border-bottom: none;
}

.saved-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}
