/* 在线练字（P3-1 · 2026-11-12）
   画布自带格线，不叠 DOM：回放与导出的都是同一张 canvas，
   「屏幕上看到的」和「存下来的图」天然一致 —— 用 SVG 叠范字的话，
   导出 PNG 时那层会掉，得再合成一遍，两套绘制逻辑迟早分叉。 */

.wr-main { padding-bottom: 48px; }
.wr-layout { display: grid; grid-template-columns: minmax(320px, 1fr) 320px; gap: 18px; align-items: start; }
@media (max-width: 900px) { .wr-layout { grid-template-columns: 1fr; } }

.wr-stage-card { padding: 18px; }
.wr-stage {
  position: relative; display: flex; justify-content: center;
  /* 触屏上必须禁掉默认手势：不禁的话手指一划页面就滚，一个字也写不成 */
  touch-action: none;
}
#wrCanvas {
  width: 100%; max-width: 420px; height: auto; aspect-ratio: 1 / 1;
  border-radius: var(--radius-card);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
  cursor: crosshair;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}
/* 回放中盖一层，告诉用户"现在别写"—— 不然他会以为笔迹被吃了 */
.wr-overlay {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  margin: 0; padding: 6px 14px;
  background: rgba(0, 0, 0, .62); color: #fff;
  border-radius: var(--radius-pill);
  font-size: var(--font-xs); font-weight: 700;
  pointer-events: none;
}
.wr-overlay[hidden] { display: none; }

.wr-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.wr-actions .btn-primary { min-width: 132px; justify-content: center; }
.wr-switch { margin-top: 12px; }

.wr-side { padding: 18px; }
.wr-chars {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 0; padding: 0; list-style: none;
}
.wr-chars li { margin: 0; }
.wr-char {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-soft); border: 1px solid var(--border-light);
  border-radius: var(--radius-input);
  font-family: inherit; font-size: 22px; color: var(--text-h1);
  cursor: pointer;
}
.wr-char.is-on { background: var(--primary-light); border-color: var(--primary); color: var(--primary-hover); font-weight: 800; }
/* 写过一笔的标一下：写到第几个字心里有数，比"从头再数"可靠 */
.wr-chars li { position: relative; }
.wr-chars li.is-done::after {
  content: ""; position: absolute; right: 3px; bottom: 3px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--success-text);
}
.wr-typing { display: flex; gap: 8px; }
.wr-typing .input { flex: 1; min-width: 0; }

@media print {
  /* 这一页是"在屏幕上写"的，打印无意义；避免用户误按 Ctrl+P 得到一张空白格 */
  .topbar, .wr-side, .wr-actions, .pk-note, .page-head p { display: none !important; }
}
