/* 数字镜像挑战 */
.main {
    grid-template-columns: minmax(0, 1fr) 400px;
}
@media (max-width: 900px) {
    .main {
        grid-template-columns: 1fr;
    }
}

.main .extra-panel {
    grid-column: 1 / -1;
    margin-top: 0;
}

/* ---- 挑战区 ---- */
.m-zone {
    /* 几何尺寸由变量驱动，随断点整体缩放 */
    --mglyph: 128px;
    --mframe: 230px;
    --mzone-min: 420px;
    border-radius: 14px;
    min-height: var(--mzone-min);
    padding: 24px 20px;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    transition: background .25s ease, box-shadow .25s ease;
}
.m-zone.idle {
    background: #f1f2f4;
    border: 2px dashed #d1d5db;
    color: #6b7280;
}
.m-zone.play {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: #334155;
}
.m-zone.ok {
    background: linear-gradient(135deg, #10b981 0%, #a7f3d0 160%);
    border: 2px solid #34d399;
    color: #064e3b;
}
.m-zone.bad {
    background: linear-gradient(135deg, #ef4444 0%, #fecaca 160%);
    border: 2px solid #f87171;
    color: #7f1d1d;
}
.m-zone.over {
    background: linear-gradient(135deg, #0ea5e9 0%, #22c55e 160%);
    border: 2px solid #10b981;
    color: #083344;
}
.m-zone .z-big {
    font-size: 44px;
    font-weight: 800;
    line-height: 1.2;
}
.m-zone .z-sub {
    font-size: 16px;
    opacity: .9;
    max-width: 520px;
}

.glyph-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}
.glyph-box.hidden {
    display: none;
}
.glyph-frame {
    width: var(--mframe);
    height: var(--mframe);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .08);
}
.glyph {
    font-size: var(--mglyph);
    font-weight: 800;
    line-height: 1;
    color: #1e293b;
    font-family: 'DIN Alternate', 'Helvetica Neue', Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    transition: transform .42s cubic-bezier(.34, 1.16, .64, 1);
    will-change: transform;
}
.glyph.peeking {
    color: #4338ca;
}

.q-progress {
    width: min(320px, 100%);
    height: 7px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
}
.q-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 999px;
    transition: width .1s linear, background .2s ease;
}
.q-bar.warn {
    background: linear-gradient(90deg, #f59e0b 0%, #f97316 100%);
}
.q-bar.danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
}
.glyph-timer {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

/* ---- 判定反馈 ---- */
.feedback {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: #fff;
    border: 1px solid #eef0f4;
    border-radius: 10px;
    padding: 8px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    animation: fb-pop .2s ease;
}
.feedback.hidden {
    display: none;
}
.feedback b {
    font-size: 16px;
}
.feedback span {
    font-size: 13px;
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}
.feedback.ok b { color: #16a34a; }
.feedback.bad b { color: #dc2626; }
.feedback.timeout b { color: #b45309; }
@keyframes fb-pop {
    from { opacity: 0; transform: translateY(4px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- 作答按钮 ---- */
.ans-btns {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.ans-btns.hidden {
    display: none;
}
.ans-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 168px;
    padding: 12px 22px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .14);
    transition: transform .15s ease, box-shadow .2s ease, filter .2s ease;
}
.ans-btn b {
    font-size: 17px;
    font-weight: 700;
}
.ans-btn i {
    font-style: normal;
    font-size: 12px;
    opacity: .85;
}
.ans-btn:hover {
    transform: translateY(-2px);
}
.ans-btn:active {
    transform: translateY(0);
}
.mirror-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
}
.mirror-btn:hover {
    filter: brightness(1.07);
}
.rotate-btn {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}
.rotate-btn:hover {
    filter: brightness(1.07);
}

.zone-btn {
    padding: 11px 28px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    background: #10b981;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 0, 0, .15);
    transition: background .2s ease, transform .15s ease;
}
.zone-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}
.zone-btn.hidden {
    display: none;
}
.zone-btn.ghost-btn {
    background: #fff;
    color: #475569;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}
.zone-btn.ghost-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}
.zone-btn.restart {
    background: #0ea5e9;
}
.zone-btn.restart:hover {
    background: #0284c7;
}
.zone-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.progress-chip {
    background: #eef2ff;
    color: #4338ca;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.mode-note {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.7;
    background: #f9fafb;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 10px 12px;
}
.mode-note b {
    color: #374151;
    font-size: 14px;
}

/* ---- 设置面板 ---- */
.mode-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.mode-options .radio-card {
    justify-content: flex-start;
    gap: 6px;
}
.mode-options .radio-card i {
    font-style: normal;
    font-size: 12px;
    color: #9ca3af;
    white-space: nowrap;
}

.mode-desc {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.7;
    color: #6b7280;
    background: #f9fafb;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 8px 10px;
    font-variant-numeric: tabular-nums;
}

/* 挑战区：设置说明位于「开始挑战」按钮上方 */
.m-zone .mode-desc {
    margin-top: 2px;
    max-width: 100%;
    text-align: center;
    background: rgba(255, 255, 255, .75);
    border-color: #e2e8f0;
}
.m-zone.play .mode-desc,
.m-zone.ok .mode-desc,
.m-zone.bad .mode-desc,
.m-zone.over .mode-desc {
    background: rgba(255, 255, 255, .8);
}

.rank-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 14px;
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: border-color .25s ease;
}
.rank-box .rank-icon {
    font-size: 26px;
}
.rank-box .rank-txt {
    font-size: 14px;
    font-weight: 700;
    color: #374151;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}
.stat {
    background: #f9fafb;
    border: 1px solid #eef0f4;
    border-radius: 8px;
    padding: 12px 8px;
    text-align: center;
}
.stat b {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #4338ca;
    font-variant-numeric: tabular-nums;
    line-height: 1.3;
}
.stat span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #6b7280;
}

.record-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 16px 0 8px;
}
.record-title .link-btn {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 12px;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.record-title .link-btn:hover {
    background: #eef2ff;
    border-color: #c7d2fe;
    color: #4338ca;
}
.record-title .link-btn.danger:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
.record-ops {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #374151;
    background: #fff;
    border: 1px solid #f1f3f7;
    border-radius: 8px;
    padding: 7px 10px;
    margin-bottom: 6px;
}
.record-item.best {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.record-item .rec-date {
    color: #9ca3af;
    font-size: 12px;
}
.record-item .rec-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.record-item .rec-time {
    flex: 0 0 auto;
    margin-left: 8px;
    font-weight: 700;
    color: #10b981;
    font-variant-numeric: tabular-nums;
}

/* ---- 单条记录删除 ---- */
.record-item .rec-del {
    flex: 0 0 auto;
    margin-left: 6px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 6px;
    background: #f3f4f6;
    color: #9ca3af;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.record-item .rec-del:hover {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}
.record-item .rec-del:focus-visible {
    outline: none;
    border-color: #fca5a5;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, .15);
}

/* ---- 说明文案补充 ---- */
.seo-article code {
    background: #eef2ff;
    color: #4338ca;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 12px;
    font-family: Consolas, Monaco, monospace;
}
.seo-article ol {
    margin: 6px 0 0 18px;
    font-size: 13px;
    line-height: 2;
    color: #4b5563;
}
.seo-article ol li::marker {
    color: #667eea;
    font-weight: 700;
}
.seo-article b {
    color: #374151;
}

/* ---- 小屏适配：字号与元素几何随断点整体缩小 ---- */
@media (max-width: 900px) {
    .m-zone {
        --mglyph: 104px;
        --mframe: 200px;
        --mzone-min: 380px;
    }
    .m-zone .z-big { font-size: 36px; }
    .m-zone .z-sub { font-size: 14px; }
        .ans-btn { min-width: 150px; padding: 10px 18px; }
    .ans-btn b { font-size: 16px; }
    .mode-note { font-size: 12px; }
    .m-zone .mode-desc { font-size: 11px; padding: 6px 9px; }
}

@media (max-width: 600px) {
    .m-zone {
        --mglyph: 74px;
        --mframe: 164px;
        --mzone-min: 340px;
        padding: 18px 12px;
        gap: 11px;
    }
    .m-zone .z-big { font-size: 28px; }
    .m-zone .z-sub { font-size: 13px; }
        .q-progress { width: min(240px, 100%); height: 6px; }
    .glyph-timer { font-size: 12px; }
    .feedback { padding: 7px 12px; }
    .feedback b { font-size: 14px; }
    .feedback span { font-size: 12px; }
    .ans-btns { flex-direction: column; width: 100%; }
    .ans-btn { width: 100%; padding: 10px 14px; }
    .ans-btn b { font-size: 15px; }
    .zone-btn { font-size: 14px; padding: 9px 18px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .mode-note { font-size: 11px; }
    .m-zone .mode-desc { font-size: 11px; padding: 6px 8px; border-radius: 6px; }
}
