/* 坐标训练器 —— 对齐 chess-user 卡片/弹层风格；棋盘配色 classic（浅 f0d9b5 / 深 b58863） */
.ct-page { max-width: 620px; margin: 0 auto; padding: 14px 12px 30px; }

/* 头部 */
.ct-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.ct-back { flex-shrink: 0; font-size: 13px; color: #6b21a8; text-decoration: none; padding: 6px 10px; border-radius: 8px; background: #f3e8ff; }
.ct-back:hover { background: #e9d5ff; }
.ct-header-main { flex: 1; min-width: 0; }
.ct-header-main h2 { margin: 0; font-size: 20px; color: #1f2937; }
.ct-sub { margin: 2px 0 0; font-size: 12px; color: #6b7280; }
.ct-intro-link { color: #7c3aed; cursor: pointer; }
.ct-intro-link:hover { text-decoration: underline; }
.ct-gear { flex-shrink: 0; border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; font-size: 16px; padding: 5px 9px; cursor: pointer; }
.ct-gear:hover { background: #f9fafb; }

/* 统计条 */
.ct-stats { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.ct-pill { display: inline-flex; align-items: baseline; gap: 3px; background: #fff; border: 1px solid #e5e7eb; border-radius: 999px; padding: 4px 10px; font-size: 12px; color: #6b7280; }
.ct-pill b { font-size: 15px; color: #1f2937; }
.ct-pill-score b { color: #7c3aed; }
.ct-pill-combo { background: #fef3c7; border-color: #fcd34d; }
.ct-pill-combo b { color: #b45309; }
.ct-pill-ok b { color: #16a34a; }
.ct-pill-bad b { color: #dc2626; }
.ct-pill-time b { color: #2563eb; }
.ct-pill-view { background: #ede9fe; border-color: #c4b5fd; }
.ct-highscore { text-align: center; font-size: 13px; color: #92400e; background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 8px; padding: 5px; margin: 6px 0; }

/* 坐标大字徽章（find 模式题目 / 开始入口） */
.ct-badge { display: flex; align-items: center; justify-content: center; min-height: 64px; margin: 10px 0; border-radius: 14px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; cursor: pointer; user-select: none; box-shadow: 0 4px 14px rgba(118, 75, 162, .35); }
.ct-badge-coord { font-size: 40px; font-weight: 700; letter-spacing: 2px; font-family: 'Segoe UI', system-ui, sans-serif; }
.ct-badge-hint { font-size: 16px; opacity: .92; }
.ct-badge.ct-flash-ok { background: linear-gradient(135deg, #16a34a, #15803d); }
.ct-badge.ct-flash-bad { background: linear-gradient(135deg, #ef4444, #b91c1c); }

/* name 模式 4 选项 */
.ct-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 0 10px; }
.ct-opt-btn { border: 2px solid #e5e7eb; background: #fff; border-radius: 10px; padding: 10px 0; font-size: 18px; font-weight: 600; color: #1f2937; cursor: pointer; }
.ct-opt-btn:active { transform: scale(.97); }
.ct-opt-btn.ct-opt-correct { border-color: #16a34a; background: #dcfce7; color: #15803d; }
.ct-opt-btn.ct-opt-wrong { border-color: #dc2626; background: #fee2e2; color: #b91c1c; }

/* 棋盘 */
.ct-board-wrap { display: flex; justify-content: center; margin: 4px 0 12px; }
.ct-board { position: relative; width: 100%; max-width: 460px; aspect-ratio: 1 / 1; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr); border-radius: 8px; overflow: hidden; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }
.ct-cell { position: relative; }
.ct-light { background: #f0d9b5; }
.ct-dark { background: #b58863; }
@media (hover: hover) { .ct-cell:hover::after { content: ''; position: absolute; inset: 0; background: rgba(124, 58, 237, .25); } }
.ct-lab { position: absolute; font-size: 11px; font-weight: 700; opacity: .85; pointer-events: none; }
.ct-lab-rank { top: 2px; left: 3px; }
.ct-lab-file { bottom: 1px; right: 3px; }
.ct-light .ct-lab { color: #b58863; }
.ct-dark .ct-lab { color: #f0d9b5; }
.ct-piece { position: absolute; inset: 6%; width: 88%; height: 88%; pointer-events: none; }
.ct-cell.ct-hl-active::before { content: ''; position: absolute; inset: 0; background: rgba(250, 204, 21, .55); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .8); }
.ct-cell.ct-hl-ok::before { content: ''; position: absolute; inset: 0; background: rgba(34, 197, 94, .55); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .8); }
.ct-cell.ct-hl-bad::before { content: ''; position: absolute; inset: 0; background: rgba(239, 68, 68, .55); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .8); }

/* 主按钮 */
.ct-actions { display: flex; justify-content: center; }
.ct-btn { border: 1px solid #e5e7eb; background: #fff; color: #374151; border-radius: 10px; padding: 10px 18px; font-size: 14px; cursor: pointer; }
.ct-btn:hover { background: #f9fafb; }
.ct-btn-primary { background: linear-gradient(135deg, #667eea, #764ba2); border: none; color: #fff; font-weight: 600; min-width: 180px; box-shadow: 0 3px 10px rgba(118, 75, 162, .3); }
.ct-btn-primary:hover { opacity: .92; background: linear-gradient(135deg, #667eea, #764ba2); }
.ct-btn-stop { background: linear-gradient(135deg, #f97316, #ea580c); box-shadow: 0 3px 10px rgba(234, 88, 12, .3); }

/* 弹层 */
.ct-mask { position: fixed; inset: 0; background: rgba(30, 20, 60, .5); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.ct-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 400px; max-height: 86vh; overflow-y: auto; padding: 16px 16px 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.ct-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ct-modal-title { font-size: 17px; font-weight: 700; color: #1f2937; }
.ct-close { cursor: pointer; color: #9ca3af; font-size: 15px; padding: 2px 6px; }
.ct-close:hover { color: #374151; }
.ct-modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
.ct-modal-actions .ct-btn { flex: 1; max-width: 160px; }

/* 玩法说明 */
.ct-intro-sec { margin-bottom: 10px; }
.ct-intro-title { font-size: 14px; font-weight: 700; color: #374151; margin-bottom: 6px; }
.ct-intro-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: #4b5563; margin-bottom: 5px; line-height: 1.5; }
.ct-intro-item b { color: #1f2937; }
.ct-tip { background: #fffbeb; border: 1px dashed #fcd34d; border-radius: 8px; padding: 8px 10px; font-size: 13px; color: #92400e; }

/* 配置 */
.ct-cfg-sec { margin-bottom: 12px; }
.ct-cfg-title { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 6px; }
.ct-btn-row { display: flex; flex-wrap: wrap; gap: 6px; }
.ct-opt { border: 1.5px solid #e5e7eb; background: #fff; border-radius: 8px; padding: 6px 12px; font-size: 13px; color: #374151; cursor: pointer; user-select: none; }
.ct-opt.active { border-color: #7c3aed; background: #f3e8ff; color: #6b21a8; font-weight: 600; }
.ct-mark { margin-right: 3px; color: #7c3aed; font-weight: 700; }

/* 结果 */
.ct-modal-result { text-align: center; }
.ct-result-icon { font-size: 44px; line-height: 1; margin: 4px 0 6px; }
.ct-result-title { font-size: 20px; font-weight: 700; color: #1f2937; }
.ct-result-sub { font-size: 13px; color: #6b7280; margin: 2px 0 12px; }
.ct-result-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 10px; }
.ct-result-item { display: flex; flex-direction: column; min-width: 64px; }
.ct-result-item b { font-size: 24px; color: #7c3aed; }
.ct-result-item span { font-size: 12px; color: #6b7280; }
.ct-result-divider { width: 1px; height: 34px; background: #e5e7eb; }
.ct-result-stats { display: flex; justify-content: center; gap: 10px; margin-bottom: 6px; }
.ct-rstat { border-radius: 8px; padding: 5px 14px; font-size: 13px; font-weight: 600; }
.ct-rstat.ok { background: #dcfce7; color: #15803d; }
.ct-rstat.bad { background: #fee2e2; color: #b91c1c; }
.ct-result-sub2 { font-size: 12px; color: #9ca3af; }

@media (max-width: 420px) {
    .ct-badge-coord { font-size: 32px; }
    .ct-pill { padding: 3px 8px; font-size: 11px; }
    .ct-pill b { font-size: 13px; }
    .ct-lab { font-size: 9px; }
}
