/* ============================================================
   坐标迷航（Coordinate Navigation / 空间记忆训练）
   私有样式表 —— 与 common.css 配套
   ============================================================ */

/* ================= 设置区（沿用站内 .form-group/.form-control） ================= */
.btn-row {
    display: flex;
    gap: 10px;
}

.btn-row .btn {
    flex: 1;
}

/* ================= 答题舞台区 ================= */
.stage-box {
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    min-height: 230px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px;
    background: #fbfcfe;
}

.board-stage {
    padding: 16px;
}

.stage-hint {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    line-height: 1.7;
    padding: 0 12px;
}

/* ================= 棋盘区 ================= */
.board {
    display: grid;
    grid-template-columns: repeat(var(--n), 52px);
    grid-template-rows:    repeat(var(--n), 52px);
    gap: 10px;
    width: max-content;
    max-width: none;
    margin: 0 auto;
    background: transparent;
}

.cell {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    line-height: 1;
    background: #f8fafc;
    border: 1.5px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    box-shadow: inset 0 0 0 0.5px rgba(148, 163, 184, 0.35);
    transition: transform 0.12s, border-color 0.12s, box-shadow 0.12s;
}

.cell:hover {
    border-color: #667eea;
}

.cell.ship {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    color: #fff;
    box-shadow: 0 6px 14px -8px rgba(102, 126, 234, 0.6);
    animation: pop 0.18s ease;
}

.cell.marked {
    background: #ede9fe;
    border-color: #667eea;
    color: #4338ca;
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.35);
    font-weight: 800;
    animation: pop 0.18s ease;
}

.cell.marked.correct {
    background: #ecfdf5;
    border-color: #34d399;
    color: #059669;
    box-shadow: inset 0 0 0 1px rgba(52,211,153,.4);
}

.cell.marked.wrong {
    background: #fef2f2;
    border-color: #f87171;
    color: #dc2626;
    box-shadow: inset 0 0 0 1px rgba(248,113,113,.4);
}

/* ================= 箭头提示行 ================= */
.arrow-row {
    min-height: 54px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: 1px dashed #d8dce4;
    border-radius: 10px;
    background: #fbfcfe;
}

.arrow-idle {
    font-size: 13px;
    color: #9ca3af;
}

.arrow-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #4338ca;
    animation: pop 0.12s ease;
}

.arr-ico {
    font-size: 30px;
    line-height: 1;
}

.arr-txt {
    font-size: 18px;
    font-weight: 700;
}

.arrow-progress {
    font-size: 12px;
    color: #6b7280;
}

/* ================= 越界规则提示 ================= */
.rule-note {
    font-size: 12.5px;
    line-height: 1.8;
    color: #6b7280;
    background: #f9fafb;
    border: 1px dashed #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
}

/* ================= 统计区 ================= */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
}

.stat-grid.two {
    grid-template-columns: repeat(4, 1fr);
}

.stat {
    background: #f9fafb;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 11px 6px;
    text-align: center;
}

.stat b {
    display: block;
    font-size: 21px;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.stat span {
    display: block;
    font-size: 12px;
    color: #6b7280;
    margin-top: 3px;
}

/* ================= 记录区 ================= */
.record-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.record-title {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}

.record-clear {
    padding: 4px 10px;
    font-size: 12px;
}

.record-box {
    border: 1px solid #f0f1f3;
    border-radius: 9px;
    background: #fff;
    min-height: 96px;
    max-height: 280px;
    overflow: auto;
}

.record-box .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 84px;
    padding: 20px;
    color: #9ca3af;
    font-size: 13px;
    text-align: center;
}

.record-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.record-table th {
    position: sticky;
    top: 0;
    background: #f9fafb;
    color: #6b7280;
    font-weight: 600;
    padding: 8px 6px;
    border-bottom: 1px solid #eef0f4;
    white-space: nowrap;
    z-index: 1;
}

.record-table td {
    padding: 8px 6px;
    text-align: center;
    color: #4b5563;
    border-bottom: 1px solid #f3f4f6;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.record-table tr:last-child td {
    border-bottom: none;
}

.record-table tbody tr:hover td {
    background: #fafbff;
}

.record-table .row-ok .res { color: #16a34a; }
.record-table .row-fail .res { color: #ef4444; }

@keyframes pop {
    0%   { transform: scale(0.6); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

/* ================= 状态栏 ================= */
.status-bar {
    border: 1px dashed #d8dce4;
    background: #fbfcfe;
}

/* ================= 响应式 ================= */
@media (max-width: 600px) {
    .stat-grid,
    .stat-grid.two {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 420px) {
    .arr-ico {
        font-size: 24px;
    }

    .arr-txt {
        font-size: 16px;
    }

    .board-stage {
        padding: 12px;
    }
}

/* ================= 底部 SEO 文案卡片 ================= */
.seo-article {
    display: block;
    margin-top: 28px;
    padding: 22px 26px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 10px 30px -18px rgba(51, 65, 85, 0.18);
    color: #374151;
    font-size: 15.5px;
    line-height: 1.85;
}

.seo-article > h2 {
    margin: 18px 0 10px;
    padding-left: 12px;
    border-left: 4px solid #667eea;
    background: linear-gradient(90deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 19px;
    line-height: 1.4;
}

.seo-article > h2:first-child {
    margin-top: 2px;
}

.seo-article p:first-of-type {
    margin-top: 6px;
}

.seo-article ul {
    padding-left: 20px;
}

.seo-article li {
    position: relative;
    list-style: none;
    margin: 9px 0;
    padding-left: 22px;
}

.seo-article li::before {
    content: '◆';
    position: absolute;
    left: 0;
    top: 1px;
    color: #667eea;
    font-size: 0.7em;
}

.seo-article strong {
    color: #4c5bd4;
    font-weight: 700;
}

@media (max-width: 420px) {
    .seo-article {
        padding: 16px 14px;
        font-size: 14.5px;
    }
}