/* 英打／中打練習共用樣式（螢幕鍵盤、課程列表、成績） */
.tp-note { background: #fff7ed; border-left: 4px solid #ea580c; padding: 10px 14px; border-radius: 6px; font-size: 1rem; margin: 10px 0; }
.tp-h3 { font-size: 1.05rem; margin: 1rem 0 .4rem; }
.tp-lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 6px 0 4px; }
.tp-lesson { display: block; text-align: left; min-height: 56px; padding: 8px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: .98rem; cursor: pointer; line-height: 1.35; }
.tp-lesson:hover { border-color: var(--brand); }
.tp-lesson[aria-pressed="true"] { border-color: var(--brand); background: #eff4ff; }
.tp-lesson small { display: block; color: var(--muted); font-size: .85rem; }
.tp-lesson .tp-done { color: var(--ok); font-weight: 700; }
.tp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0 8px; text-align: center; }
.tp-stats > div { background: #eff4ff; border: 1px solid var(--brand); border-radius: 10px; padding: 6px 4px; min-width: 0; }
.tp-stats dt { font-size: .9rem; color: var(--muted); }
.tp-stats dd { margin: 0; font-size: 1.4rem; font-weight: 800; color: var(--brand-dark); overflow-wrap: anywhere; }
.tp-pad { border: 2px solid var(--brand); border-radius: 12px; padding: 12px 14px; background: #fff; outline: none; cursor: text; }
.tp-pad:focus { box-shadow: 0 0 0 4px #bfdbfe; }
.tp-pad-hint { font-size: .95rem; color: var(--muted); margin: 0 0 6px; }
.tp-line { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.3rem; line-height: 2; overflow-wrap: anywhere; word-break: break-all; }
.tp-line span { border-radius: 3px; padding: 0 1px; }
.tp-line .ok { color: #15803d; }
.tp-line .bad { color: #b91c1c; background: #fee2e2; text-decoration: underline wavy #b91c1c; }
.tp-line .cur { background: #fde68a; box-shadow: 0 2px 0 var(--brand); }
.tp-line .sp { color: #9ca3af; }
.tp-big { text-align: center; font-size: 4.2rem; line-height: 1.3; font-weight: 800; color: var(--brand-dark); min-height: 1.3em; }
.tp-big small { display: block; font-size: 1rem; font-weight: 600; color: var(--muted); }
.tp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.tp-actions .btn { flex: 1 1 150px; min-height: 48px; }
.tp-chk { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-weight: 600; cursor: pointer; }
.tp-chk input { width: 22px; height: 22px; flex: none; }
.tp-result { margin-top: 12px; background: #ecfdf5; border: 2px solid var(--ok); border-radius: 12px; padding: 4px 14px 14px; }
.tp-result dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin: 0; }
.tp-result dl > div { min-width: 0; }
.tp-result dt { color: var(--muted); font-size: .95rem; }
.tp-result dd { margin: 0; font-weight: 700; font-size: 1.15rem; overflow-wrap: anywhere; }
.tp-result .tp-main dd { font-size: 1.8rem; color: var(--brand-dark); }
.tp-result ul { margin: .3rem 0 0; padding-left: 1.2em; }

/* 螢幕鍵盤：容器自己橫向捲動，整頁不捲 */
.tpk { overflow-x: auto; margin: 10px 0 4px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.tpk-in { min-width: 600px; display: flex; flex-direction: column; gap: 4px; }
.tpk-row { display: flex; gap: 4px; }
.tpk-key { position: relative; flex: var(--w, 1) 1 0; min-width: 0; height: 44px; border: 1px solid #9ca3af; border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .85rem; line-height: 1.1; background: #f3f4f6; color: #111; overflow: hidden; }
.tpk-key .k-s { font-size: .7rem; color: #374151; }
.tpk-key .k-b { font-size: .95rem; font-weight: 700; }
.tpk-key .k-z { font-size: 1.05rem; font-weight: 800; }
.tpk-key .k-e { font-size: .65rem; color: #374151; }
.tpk-key .k-m { font-size: .72rem; font-weight: 600; }
.tpk-key.home::after { content: ""; position: absolute; left: 30%; right: 30%; bottom: 3px; height: 3px; background: #111; border-radius: 2px; }
.tpk-key.home-all { border-width: 2px; border-color: #111; }
.tpk-key.f-lp { background: #fecaca; }
.tpk-key.f-lr { background: #fed7aa; }
.tpk-key.f-lm { background: #fef08a; }
.tpk-key.f-li { background: #bbf7d0; }
.tpk-key.f-th { background: #e5e7eb; }
.tpk-key.f-ri { background: #a5f3fc; }
.tpk-key.f-rm { background: #bfdbfe; }
.tpk-key.f-rr { background: #ddd6fe; }
.tpk-key.f-rp { background: #fbcfe8; }
.tpk-key.is-target { outline: 4px solid #1d4ed8; outline-offset: -1px; z-index: 2; box-shadow: 0 0 10px #1d4ed8; }
.tpk-key.is-bad { outline: 4px solid #dc2626; outline-offset: -1px; background: #fecaca; }
.tpk-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; list-style: none; margin: 6px 0 0; padding: 0; font-size: .9rem; }
.tpk-legend li { display: flex; align-items: center; gap: 5px; }
.tpk-legend i { width: 16px; height: 16px; border: 1px solid #6b7280; border-radius: 4px; display: inline-block; }
.tpk-legend i.f-lp { background: #fecaca; } .tpk-legend i.f-lr { background: #fed7aa; } .tpk-legend i.f-lm { background: #fef08a; }
.tpk-legend i.f-li { background: #bbf7d0; } .tpk-legend i.f-th { background: #e5e7eb; } .tpk-legend i.f-ri { background: #a5f3fc; }
.tpk-legend i.f-rm { background: #bfdbfe; } .tpk-legend i.f-rr { background: #ddd6fe; } .tpk-legend i.f-rp { background: #fbcfe8; }
.tpk-cap { font-size: .9rem; color: var(--muted); margin: 4px 0 0; }

/* 詞句練習 */
.tp-phrase { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tp-cell { min-width: 64px; border: 2px solid var(--line); border-radius: 10px; padding: 4px 6px; text-align: center; background: #fff; }
.tp-cell .c-ch { font-size: 1.9rem; line-height: 1.3; }
.tp-cell .c-zy { font-size: 1rem; color: var(--brand-dark); font-weight: 700; min-height: 1.3em; }
.tp-cell .c-ky { font-size: .85rem; color: var(--muted); font-family: ui-monospace, Consolas, monospace; min-height: 1.2em; }
.tp-cell.ok { border-color: #15803d; background: #f0fdf4; }
.tp-cell.bad { border-color: #b91c1c; background: #fee2e2; }
.tp-cell.cur { border-color: var(--brand); background: #fde68a; }
.tp-cell.nohint .c-zy, .tp-cell.nohint .c-ky { visibility: hidden; }
.tp-input { width: 100%; box-sizing: border-box; min-height: 56px; margin-top: 8px; padding: 10px 12px; font-size: 1.3rem; border: 2px solid var(--brand); border-radius: 12px; font-family: inherit; }
.tp-input:disabled { background: #f3f4f6; }
@media (max-width: 480px) { .tp-big { font-size: 3.4rem; } .tp-stats dd { font-size: 1.15rem; } .tp-line { font-size: 1.15rem; } }
