.main {
    grid-template-columns: 400px minmax(0, 1fr);
}

.main .extra-panel {
    grid-column: 1 / -1;
    margin-top: 0;
}

/* ---- 设置表单 ---- */
.train-form .form-row + .form-row {
    margin-top: 14px;
}

.btn-row {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
    padding: 12px;
    background: linear-gradient(135deg, #fdf8f3 0%, #f5ebe0 100%);
    border: 1px solid #d4c4b0;
    border-radius: 10px;
}

.btn-row .btn {
    flex: 1;
    min-width: 100px;
    height: 44px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-row .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-row .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-row .btn-primary:active {
    transform: translateY(0);
}

.btn-row .btn-secondary {
    background: #fff;
    border: 2px solid #d4c4b0;
    color: #5d4e3d;
}

.btn-row .btn-secondary:hover:not(:disabled) {
    border-color: #8b6f47;
    background: #fdf8f3;
    transform: translateY(-1px);
}

.btn-row .btn-secondary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: #e8dcc8;
    color: #9a8a7a;
}

.btn-row .btn-secondary:disabled:hover {
    transform: none;
    background: #fff;
}

/* ---- 拼图网格 ---- */
.puzzle-grid {
    display: grid;
    gap: 3px;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    aspect-ratio: 1 / 1;
}

.puzzle-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border: 2px solid #8b6f47;
    border-radius: 6px;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(139, 111, 71, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(101, 76, 45, 0.12) 0%, transparent 50%),
        linear-gradient(90deg, 
            #d4a574 0%, #c99663 8%, #d4a574 15%, #c18a5a 22%, #d4a574 30%, 
            #b8804f 38%, #d4a574 45%, #c99663 52%, #d4a574 60%, #b8804f 68%, 
            #d4a574 75%, #c18a5a 82%, #d4a574 90%, #c99663 100%
        );
    background-size: 200% 100%;
    color: #4a3728;
    font-weight: 700;
    font-size: 2.5rem;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
    user-select: none;
    position: relative;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.1),
        0 2px 4px rgba(0,0,0,0.1);
}

.puzzle-cell:hover {
    border-color: #a67c4f;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.4),
        inset 0 -1px 0 rgba(0,0,0,0.15),
        0 4px 12px rgba(101, 76, 45, 0.25);
}

.puzzle-cell:active {
    transform: scale(0.96);
    box-shadow: 
        inset 0 2px 4px rgba(0,0,0,0.2),
        inset 0 -1px 0 rgba(255,255,255,0.1);
}

.puzzle-cell.empty {
    background: 
        radial-gradient(ellipse at 50% 50%, rgba(101, 76, 45, 0.08) 0%, transparent 70%),
        linear-gradient(90deg, 
            #c49564 0%, #b88a5a 10%, #c49564 20%, #b07f50 30%, #c49564 40%, 
            #a67548 50%, #c49564 60%, #b88a5a 70%, #c49564 80%, #b07f50 90%, #c49564 100%
        );
    background-size: 200% 100%;
    border-style: dashed;
    border-color: #9a7a4f;
    cursor: default;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.15);
}

.puzzle-cell.hint {
    animation: hintPulse 0.5s ease infinite;
    border-color: #f59e0b;
    box-shadow: 
        inset 0 1px 0 rgba(255,255,255,0.3),
        inset 0 -1px 0 rgba(0,0,0,0.1),
        0 0 0 3px rgba(245, 158, 11, 0.4),
        0 4px 12px rgba(245, 158, 11, 0.2);
}

@keyframes hintPulse {
    0%, 100% { 
        filter: brightness(1) saturate(1); 
    }
    50% { 
        filter: brightness(1.15) saturate(1.3); 
    }
}

/* ---- 记忆舞台 ---- */
.stage-box {
    border: 2px solid #8b6f47;
    border-radius: 10px;
    min-height: 360px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 20px;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(212, 165, 116, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 111, 71, 0.06) 0%, transparent 60%),
        linear-gradient(135deg, #fdf8f3 0%, #f5ebe0 100%);
}

.stage-hint {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    max-width: 420px;
}

/* ---- 成绩统计 ---- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.stat {
    background: linear-gradient(135deg, #fdf8f3 0%, #f5ebe0 100%);
    border: 1px solid #d4c4b0;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
}

.stat b {
    display: block;
    font-size: 20px;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
}

.stat span {
    font-size: 12px;
    color: #6b7280;
}

/* ---- 本局记录 ---- */
.record-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 6px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed #e8dcc8;
    font-size: 13px;
    color: #5d4e3d;
}

.record-item .tick {
    font-weight: 600;
    color: #8b6f47;
}

/* ---- 响应式 ---- */
@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }
    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .btn-row .btn {
        min-width: 80px;
    }
}

@media (max-width: 520px) {
    .puzzle-grid {
        gap: 2px;
        max-width: 100%;
    }
    .puzzle-cell {
        font-size: 1.5rem !important;
    }
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .btn-row {
        flex-direction: column;
    }
    .btn-row .btn {
        width: 100%;
    }
}