/* 手写范字字体（John 9/8 拍板要硬笔、工整、开源）：主字体 猫啃硬笔楷书 子集（SIL OFL，fonts/OFL-MaokenYingBiKaiShu.txt，GB2312 6763 字）；
   它没有的生僻字落到 霞鹜文楷 子集（SIL OFL，fonts/OFL-LXGWWenKai.txt，仅作网页字体分发）。换字体只改这里。 */
@font-face { font-family: "XWH Hand"; src: url("fonts/xwh-hand-maoken.woff2?v=1") format("woff2"); font-display: swap; }
@font-face { font-family: "XWH Hand Fallback"; src: url("fonts/xwh-hand-wenkai.woff2?v=1") format("woff2"); font-display: swap; }
/* 写字积木 WritingPad（2026-09-06）：田字格 + 逐笔 + 释义；弹窗与板书内嵌共用 */
.wp-row { display: flex; flex-wrap: nowrap; gap: 18px; justify-content: center; align-items: flex-start; }
.wp-cell { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1 1 0; min-width: 0; max-width: 40vh; }
.wp-row:has(.wp-cell:only-child) .wp-cell { flex-basis: min(100%, 40vh); }
.wp-svg { width: 100%; aspect-ratio: 1; border: 1.5px solid #d8cfae; border-radius: 10px; background: #fffdf6; box-shadow: inset 0 1px 0 #fff, 0 8px 18px -12px rgba(60,40,10,.35); }
.wp-py { font: 600 clamp(15px, 2.4vw, 24px)/1.2 "Helvetica Neue", "PingFang SC", system-ui, sans-serif; color: #1a1a1a; letter-spacing: .03em; min-height: 1.2em; white-space: nowrap; }
.wp-tag { font: 600 13px/1.4 "IBM Plex Mono", ui-monospace, monospace; color: #b8860b; letter-spacing: .04em; white-space: nowrap; }
.wp-info { margin: 14px auto 0; max-width: 640px; border-top: 1px solid #e7dcc0; padding-top: 12px; }
.wp-line { font-size: 15px; line-height: 1.8; color: #3c4351; }
.wp-line b { font-size: 17px; color: #1a1a1a; letter-spacing: .08em; }
.wp-k { display: inline-block; min-width: 1.6em; margin-right: 8px; font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; font-size: 18px; color: #1a1a1a; }
.wp-s { color: #7b6a45; font-size: 13px; }
.wp-credit { margin-top: 6px; font-size: 11px; color: #a8adb6; letter-spacing: .02em; }
.wp-credit a { color: #a8adb6; text-decoration: underline; }

/* 弹窗（不进辅导台、不开语音房） */
.wp-modal { position: fixed; inset: 0; z-index: 60; background: rgba(20, 28, 40, .38); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 18px; }
.wp-modal[hidden] { display: none; }
.wp-panel { width: min(880px, 100%); max-height: 92vh; overflow: auto; border-radius: 22px; padding: 20px 24px 22px; background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(255,253,246,.94)); border: 1px solid #fff; box-shadow: 0 30px 60px -30px rgba(0,0,0,.45); }
.wp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.wp-head h2 { font-family: "Songti SC", "STSong", serif; font-weight: 400; font-size: 24px; margin: 0; flex: 1; color: #1b2436; }
.wp-pg { font-size: 12.5px; color: #6b7280; }
.wp-mode { display: inline-flex; border: 1px solid #d8cfae; border-radius: 10px; overflow: hidden; background: #fffdf6; }
.wp-mode-b { font: inherit; font-size: 13px; font-weight: 600; padding: 5px 11px; border: 0; background: transparent; color: #7b6a45; cursor: pointer; }
.wp-mode-b.on { background: #1b2436; color: #fff; }
.wp-mode-b:focus-visible { outline: 2px solid #b8860b; outline-offset: -2px; }
.wp-sub { color: #4a5566; margin: 0 0 10px; }
.wp-host { padding: 6px 0; }
.wp-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; align-items: center; }
.wp-btn { font: inherit; font-size: 15px; font-weight: 600; padding: 10px 18px; border-radius: 14px; border: 0; cursor: pointer; color: #fff; letter-spacing: .02em; text-shadow: 0 1px 1px rgba(0,0,0,.3);
  background: radial-gradient(120% 80% at 50% -20%, rgba(255,255,255,.55), rgba(255,255,255,0) 60%), linear-gradient(180deg, #d9a54a, #b8860b 55%, #9c6f06);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -3px 6px rgba(80,50,0,.35), 0 10px 20px -10px rgba(120,80,0,.8), 0 2px 0 #7a5605; transition: transform .15s, filter .15s; }
.wp-btn:hover { transform: translateY(-1.5px); filter: brightness(1.05); }
.wp-btn:active { transform: translateY(1px); }
.wp-btn:disabled { opacity: .5; cursor: not-allowed; }
.wp-btn.ghost { color: #1b2436; text-shadow: 0 1px 0 #fff; background: radial-gradient(120% 80% at 50% -20%, rgba(255,255,255,.9), rgba(255,255,255,0) 60%), linear-gradient(180deg, #fff, #f5efdc 55%, #eadfc2);
  box-shadow: inset 0 1px 0 #fff, inset 0 -2px 5px rgba(150,120,60,.35), inset 0 0 0 1px rgba(200,180,130,.6), 0 8px 16px -10px rgba(100,80,30,.5), 0 2px 0 #d8cfae; }
.wp-btn.sm { font-size: 13px; padding: 7px 13px; border-radius: 11px; }
@media (max-width: 640px) {
  .wp-panel { padding: 14px; border-radius: 16px; }
  .wp-row { gap: 10px; flex-wrap: wrap; }
  .wp-cell { flex-basis: calc(50% - 6px); max-width: none; }
  .wp-head h2 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) { .wp-btn { transition: none; } }

/* 字的来历（2026-09-21）：入口是一块龟甲，点开是四档演变。图即按钮，界面上不出现「字源」这种词。 */
.wp-gate { position: relative; width: 62px; height: 62px; margin-top: 2px; padding: 0; overflow: hidden; cursor: pointer;
  border: 1px solid #cdbd99; border-radius: 12px; background: linear-gradient(160deg, #efe4c8, #ddcdaa 60%, #d3c199);
  box-shadow: 0 8px 18px -12px rgba(80,60,20,.7), inset 0 1px 0 rgba(255,255,255,.6); transition: transform .25s, box-shadow .25s; }
.wp-gate:hover { transform: translateY(-2px); box-shadow: 0 14px 24px -12px rgba(80,60,20,.75); }
.wp-gate:focus-visible { outline: 2px solid #b8860b; outline-offset: 2px; }
.wp-gate svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wp-gate-crack path { stroke: #b9a577; stroke-width: 3; fill: none; opacity: .55; }
.wp-gate-glyph { stroke: #2a2118; stroke-width: 52; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wp-gate-seal { fill: #2a2118; }
.wp-gate::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%); animation: wp-sheen 4.2s ease-in-out infinite;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); }
@keyframes wp-sheen { 0%, 68% { transform: translateX(-120%); } 82%, 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .wp-gate::after { animation: none; } }

.wp-origin { margin: 16px auto 0; max-width: 680px; border-top: 1px dashed #e7dcc0; overflow: hidden;
  max-height: 0; opacity: 0; transition: max-height .7s cubic-bezier(.22,1,.36,1), opacity .5s; }
.wp-origin.on { max-height: 620px; opacity: 1; }
.wp-origin-evo { display: flex; align-items: flex-start; padding: 20px 0 4px; }
.wp-origin-stage { flex: 1; min-width: 0; text-align: center; }
.wp-origin-stage svg { width: 100%; max-width: 128px; height: auto; display: block; margin: 0 auto; }
.wp-origin-era { margin-top: 8px; font-size: 13px; letter-spacing: .1em; color: #1b2436; opacity: 0; transform: translateY(6px); transition: .5s; }
.wp-origin-when { font-size: 11px; color: #7b6a45; opacity: 0; transform: translateY(6px); transition: .5s .08s; }
.wp-origin-stage.lit .wp-origin-era, .wp-origin-stage.lit .wp-origin-when { opacity: 1; transform: none; }
.wp-origin-link { flex: 0 0 34px; height: 128px; display: flex; align-items: center; }
.wp-origin-link svg { width: 34px; height: 10px; overflow: visible; }
.wp-origin-link path { stroke: #b08b4f; stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; fill: none; opacity: 0; transition: opacity .45s; }
.wp-origin-bone { fill: #efe6d0; }
.wp-origin-ink { stroke: #1f1b16; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.wp-origin-outline { fill: none; stroke: #1f1b16; stroke-width: 9; stroke-linejoin: round; }
.wp-origin-fill { fill: #1f1b16; opacity: 0; transition: opacity .5s; }
.wp-origin-note { display: flex; gap: 10px; align-items: flex-start; padding-top: 12px; border-top: 1px dashed #e7dcc0; margin-top: 12px; }
.wp-origin-tag:not(:empty) { flex: 0 0 auto; font-size: 12px; letter-spacing: .16em; color: #a63a2b; border: 1px solid #e0bdb4; border-radius: 4px; padding: 3px 9px; background: #fbf1ee; }
.wp-origin-lines { flex: 1; min-width: 0; }
.wp-origin-lines p { margin: 0 0 6px; font-size: 15px; line-height: 1.8; color: #3c4351; opacity: 0; transform: translateY(8px); transition: .6s; }
.wp-origin-lines p.on { opacity: 1; transform: none; }
.wp-origin-tools { display: flex; gap: 10px; margin-top: 10px; }
@media (max-width: 720px) {
  .wp-origin-link { flex-basis: 12px; height: 96px; }
  .wp-origin-link svg { width: 12px; }
  .wp-origin-stage svg { max-width: 88px; }
  .wp-gate { width: 52px; height: 52px; }
}

/* 板书里展开「字的来历」：#board-notes 本来是定高 overflow:hidden（board-pages.css），
   抽屉会被裁掉。开着的时候放开滚动、田字格收小给演变条腾地方；关掉自动还原。 */
.board-paged #board-notes.wp-origin-open,
#board-notes.wp-origin-open { overflow: auto !important; overscroll-behavior: contain; }
#board-notes.wp-origin-open .wp-cell { max-width: min(300px, 26vh); }
#board-notes.wp-origin-open .wp-origin.on { max-height: 520px; }
#board-notes.wp-origin-open .wp-origin-stage svg { max-width: 104px; }
.wp-gate-split { stroke: #b9a577; stroke-width: 10; opacity: .5; }
.wp-origin-sign { font: 600 20px/1 "Songti SC", serif; color: #b08b4f; display: block; text-align: center; width: 100%; }
