/* public/assets/css/tools/game/typing.css */
.tp-wrapper { background: var(--bg-surface); border-radius: 24px; padding: 24px; border: 1px solid var(--border-color); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); font-family: system-ui, -apple-system, sans-serif; }
.tp-header-main { font-size: 1.6rem; font-weight: 800; color: var(--text-main); margin-bottom: 8px; text-align: center; }
.tp-subtitle { color: var(--text-muted); font-size: 0.95rem; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 24px; text-align: center; }

/* 状态控制栏 */
.tp-dashboard { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.tp-stats-group { display: flex; gap: 16px; flex-wrap: wrap; }
.tp-stat-card { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px 20px; display: flex; align-items: center; gap: 12px; transition: 0.3s; }
.tp-stat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,102,204,0.1); border-color: var(--primary-color); }
.tp-stat-val { font-size: 1.5rem; font-weight: 800; color: var(--text-main); }
.tp-stat-lbl { font-size: 0.8rem; color: var(--text-muted); }

.tp-actions { display: flex; gap: 12px; }
.tp-btn { background: var(--primary-color); color: #fff; border: none; padding: 12px 24px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.tp-btn:hover { background: var(--primary-hover); transform: scale(1.05); }
.tp-btn-sec { background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border-color); }
.tp-btn-sec:hover { border-color: var(--primary-color); color: var(--primary-color); }

/* 打字核心区 */
.tp-game-area { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 16px; padding: 30px; margin-bottom: 24px; position: relative; overflow: hidden; }
.tp-progress-bar { width: 100%; height: 6px; background: rgba(0,102,204,0.1); border-radius: 3px; margin-bottom: 20px; overflow: hidden; }
.tp-progress-fill { height: 100%; background: var(--primary-color); width: 0%; transition: width 1s linear, background-color 0.3s; }

.tp-text-container { font-size: 1.5rem; line-height: 1.8; color: var(--text-main); max-height: 160px; overflow-y: auto; margin-bottom: 24px; padding-right: 10px; }
.tp-text-container::-webkit-scrollbar { width: 6px; }
.tp-text-container::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

.tp-char-correct { color: #10B981; }
.tp-char-wrong { color: #EF4444; text-decoration: underline; background: rgba(239, 68, 68, 0.1); }
.tp-cursor { position: relative; }
.tp-cursor::after { content: ''; position: absolute; right: -2px; top: 10%; height: 80%; width: 2px; background: var(--primary-color); animation: blink 1s infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.tp-input { width: 100%; background: var(--bg-surface); border: 2px solid var(--border-color); padding: 16px 20px; border-radius: 12px; font-size: 1.2rem; color: var(--text-main); outline: none; transition: 0.3s; }
.tp-input:focus { border-color: var(--primary-color); box-shadow: 0 0 0 4px rgba(0,102,204,0.1); }
.tp-input:disabled { opacity: 0.6; cursor: not-allowed; }

/* 虚拟键盘 */
.tp-keyboard { background: var(--bg-body); padding: 20px; border-radius: 16px; border: 1px solid var(--border-color); overflow-x: auto; }
.tp-kb-row { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.tp-key { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: 6px; color: var(--text-main); display: flex; justify-content: center; align-items: center; font-size: 0.85rem; font-weight: 600; transition: 0.1s; height: 45px; user-select: none; }
.tp-key.active { background: var(--primary-color); color: #fff; transform: scale(0.95); box-shadow: 0 0 15px rgba(0,102,204,0.4); border-color: var(--primary-color); }

/* 难度与结果面板 */
.tp-diff-grid, .tp-res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.tp-diff-card { background: var(--bg-body); border: 2px solid var(--border-color); padding: 16px; border-radius: 12px; cursor: pointer; transition: 0.3s; text-align: center; }
.tp-diff-card:hover, .tp-diff-card.selected { border-color: var(--primary-color); background: rgba(0,102,204,0.02); }
.tp-diff-title { font-weight: 700; font-size: 1.1rem; color: var(--text-main); margin-bottom: 4px; }
.tp-diff-desc { font-size: 0.85rem; color: var(--text-muted); }

.tp-result-modal { display: none; padding: 30px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 16px; margin-bottom: 24px; text-align: center; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from{opacity:0; transform:translateY(10px)} to{opacity:1; transform:translateY(0)} }

/* 暗黑模式适配 */
[data-theme="dark"] .tp-wrapper { background: #1e293b; border-color: #334155; }
[data-theme="dark"] .tp-stat-card, [data-theme="dark"] .tp-game-area, [data-theme="dark"] .tp-keyboard, [data-theme="dark"] .tp-diff-card, [data-theme="dark"] .tp-result-modal { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .tp-input, [data-theme="dark"] .tp-key { background: #1e293b; border-color: #475569; color: #f8fafc; }
[data-theme="dark"] .tp-btn-sec { background: #1e293b; border-color: #475569; color: #f8fafc; }