* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #f0f4f8; display: flex; justify-content: center; align-items: center; min-height: 100vh; font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif; padding: 8px; }
[v-cloak] { display: none !important; }
#app { position: relative; background: #fff; padding: 16px; border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.06); max-width: 580px; width: 100%; text-align: center; max-height: 95vh; overflow-y: auto; }

.btn { padding: 6px 20px; border-radius: 20px; border: none; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: background 0.2s; }
.btn-primary { background: #6366f1; color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-secondary { background: #f3f4f6; color: #374151; }
.btn-secondary:hover { background: #e5e7eb; }

.config-panel { padding: 8px 0; }
.config-panel h2 { margin-bottom: 16px; color: #2d3748; font-size: 1.2rem; }
.config-item { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; gap: 4px; }
.config-item label { font-size: 0.85rem; font-weight: 600; color: #374151; }
.config-item .input-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.config-item input, .config-item select { padding: 4px 8px; border-radius: 6px; border: 1px solid #d1d5db; font-size: 0.9rem; width: 70px; }
.config-item select { width: 100%; max-width: 200px; }
.config-item .hint { font-size: 0.8rem; color: #6b7280; }
.btn-block { width: 100%; padding: 12px; margin-top: 12px; }

.status-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.status-bar h2 { margin: 0; font-size: 1rem; color: #2d3748; }
.status-right { display: flex; align-items: center; gap: 12px; }
.error-count { font-size: 0.9rem; color: #dc2626; font-weight: 600; }

.board-scroll-container { width: 100%; max-height: 60vh; overflow: auto; border: 1px solid #e5e7eb; border-radius: 4px; scrollbar-width: auto; }
.board-scroll-container::-webkit-scrollbar { width: 8px; height: 8px; display: block; background: #f1f5f9; }
.board-scroll-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 6px; }
.board-scroll-container::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
.board-wrapper { display: flex; justify-content: flex-start; width: 100%; height: 100%; touch-action: none; }

.board-canvas { display: block; width: 100%; height: auto; background: #fff; border: 3px solid #9ca3af; border-radius: 4px; box-shadow: inset 0 0 0 1px #e5e7eb; touch-action: none; }

.num-pad-wrapper { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 10px; margin-bottom: 10px; }
.num-grid { display: grid; gap: 4px; width: fit-content; margin: 0 auto; }
.num-btn, .action-btn, .zoom-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #d1d5db; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.15s; color: #374151; }
.num-btn, .action-btn { font-size: 0.8rem; padding: 0; }
.num-btn:hover, .action-btn:hover, .zoom-btn:hover { background: #eef2ff; border-color: #6366f1; }
.num-btn.clear-btn { font-size: 1rem; line-height: 1; }
.action-row { display: flex; justify-content: center; gap: 6px; width: 100%; }
.action-btn:disabled, .zoom-btn:disabled { opacity: 0.3; cursor: not-allowed; background: #f9fafb; }

.history-steps-container { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; width: 100%; padding: 4px 0; scrollbar-width: thin; }
.history-steps-container::-webkit-scrollbar { height: 6px; background: #f1f5f9; }
.history-steps-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }
.step-block { flex: 0 0 auto; min-width: 32px; height: 32px; border-radius: 6px; border: 1px solid #e2e8f0; background: #f8fafc; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: #475569; cursor: pointer; transition: all 0.15s; padding: 0 6px; }
.step-block:hover { background: #eef2ff; border-color: #a5b4fc; }
.step-block.active { background: #6366f1; border-color: #4f46e5; color: #fff; font-weight: 600; }

.zoom-controls { display: flex; align-items: center; gap: 10px; }
.zoom-btn { border-color: #d1d5db; background: #f9fafb; font-size: 1.2rem; }
.zoom-text { font-size: 0.9rem; font-weight: 600; color: #374151; min-width: 40px; text-align: center; }

.conflict-box, .hint-box { margin: 10px 0; font-size: 0.75rem; padding: 6px 10px; border-radius: 8px; }
.conflict-box { color: #b91c1c; text-align: left; background: #fee2e2; }
.conflict-box ul { margin: 4px 0 0 16px; padding: 0; }
.hint-box { color: #4f46e5; text-align: center; background: #eef2ff; border: 1px solid #c7d2fe; font-size: 0.9rem; }

.victory-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 100; }
.victory-dialog { background: #fff; padding: 28px 24px; border-radius: 16px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.victory-dialog h3 { color: #16a34a; margin-bottom: 10px; }
.victory-dialog button { margin-top: 14px; padding: 10px 26px; border-radius: 20px; border: none; background: #16a34a; color: #fff; font-size: 1rem; cursor: pointer; }

@media (max-width: 500px) {
    .status-bar { flex-direction: column; align-items: center; gap: 8px; }
    .zoom-controls { width: 100%; justify-content: center; }
    .status-right { width: 100%; justify-content: center; }
}