/* 刷题与批改中（v2 专注阅读） */

body.focus-mode .tabbar { display: none !important; }
body.focus-mode .sidebar { display: none; }
body.focus-mode .shell { grid-template-columns: minmax(0, 1fr); }
body.focus-mode .view {
    padding-bottom: 32px;
    max-width: 1040px;
}
body.focus-mode .topbar { border-bottom-color: var(--line); }

.focus-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 18px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--line);
    flex-wrap: wrap;
}

.focus-head .back-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    flex: none;
    transition: background var(--dur-2), color var(--dur-2);
}

.focus-head .back-btn:hover {
    color: var(--ink);
    background: var(--surface-2);
}

.focus-head .back-btn svg { width: 18px; height: 18px; }

.focus-head .fh-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.02em;
    line-height: 1.3;
    min-width: 0;
}

.focus-head .fh-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted-2);
    margin-top: 2px;
    flex-wrap: wrap;
}

.focus-head .fh-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.timer-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: auto;
    padding: 0;
    border-radius: 0;
    border: 0;
    background: transparent;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

.timer-chip svg { width: 14px; height: 14px; color: var(--muted-2); }

.practice-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
    align-items: start;
    max-width: 860px;
    margin: 0 auto;
}

.passage-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    position: static;
}

.passage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--line);
    background: transparent;
}

.passage-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: var(--weight-semibold);
    color: var(--muted);
    letter-spacing: 0.03em;
}

.passage-label svg { width: 15px; height: 15px; color: var(--brand); }

.passage-body {
    padding: 26px 0 30px;
    max-height: none;
    overflow: visible;
}

.passage-text {
    font-size: 18px;
    line-height: 2;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.passage-text p + p { margin-top: 16px; }

.passage-sentence {
    display: flex;
    gap: 12px;
    padding: 4px 0;
    border-radius: 0;
    transition: background var(--dur-2);
}

.passage-sentence .ps-num {
    flex: none;
    width: 20px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--brand);
    opacity: 0.65;
    padding-top: 8px;
    text-align: right;
}

.passage-sentence .ps-text { flex: 1; }

.passage-sentence:hover { background: var(--surface-2); }

.passage-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0 0;
    border-top: 1px solid var(--line);
    background: transparent;
    font-size: 12px;
    color: var(--muted-2);
}

.answer-card {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    padding-top: 24px;
}

.answer-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 0;
    border-bottom: 0;
}

.answer-body { padding: 18px 0 0; }

.answer-hint {
    font-size: 12.5px;
    color: var(--muted-2);
    line-height: 1.7;
    margin-bottom: 14px;
}

.upload-mini {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 200px;
    padding: 24px;
    border-radius: 12px;
    border: 1.5px dashed var(--line-strong);
    background: var(--surface-2);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--dur-2), background var(--dur-2);
}

.upload-mini:hover,
.upload-mini.is-drag {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.upload-mini .um-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand);
    box-shadow: none;
}

.upload-mini .um-icon svg { width: 20px; height: 20px; }
.upload-mini .um-title { font-size: 15px; font-weight: var(--weight-semibold); color: var(--ink-2); }
.upload-mini .um-desc { font-size: 12px; color: var(--muted-2); }

.mini-thumbs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.mini-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface-3);
    animation: scale-in var(--dur-3) var(--ease-out);
}

.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }

.mini-thumb button {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(10, 12, 14, 0.62);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-thumb button:hover { background: var(--danger); }

.mini-thumb.is-uploaded::after {
    content: "已上传";
    position: absolute;
    left: 5px;
    bottom: 5px;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(10, 12, 14, 0.62);
    color: #fff;
    font-size: 10px;
    line-height: 1.6;
    pointer-events: none;
}

.answer-textarea {
    min-height: 220px;
    font-family: var(--font-en);
    font-size: 16px;
    line-height: 1.9;
    border-radius: 10px;
    background: var(--surface);
}

.practice-foot {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: var(--bg);
    box-shadow: none;
}

.practice-foot .pf-info {
    font-size: 12px;
    color: var(--muted-2);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.5;
}

.practice-foot .btn { margin-left: auto; }

@media (max-width: 900px) {
    body.focus-mode .view { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
    .practice-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .passage-body { padding: 18px 0 22px; }
    .passage-text { font-size: 17px; line-height: 1.95; }
    .focus-head { gap: 10px; margin-bottom: 22px; }
    .focus-head .fh-actions { width: 100%; margin-left: 0; }
    .practice-foot {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        margin: 0;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
        background: var(--surface);
        border-top: 1px solid var(--line);
    }
    .practice-foot .pf-info { display: none; }
    .practice-foot .btn { width: 100%; margin-left: 0; }
}

/* ------------------------------ 批改中 ------------------------------ */

.grading-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--bg);
    animation: fade-in var(--dur-3) var(--ease);
}

.grading-box {
    width: min(430px, 100%);
    text-align: center;
}

.grading-orbit {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    position: relative;
}

.grading-orbit .core {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-strong);
    box-shadow: none;
}

[data-theme="dark"] .grading-orbit .core { color: var(--brand); }

.grading-orbit .core svg { width: 22px; height: 22px; }

.grading-orbit .ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid var(--brand-line);
    border-top-color: var(--brand);
    animation: spin 1.8s linear infinite;
}

.grading-orbit .ring.r2 { display: none; }

.grading-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: var(--weight-semibold);
    letter-spacing: -0.02em;
}

.grading-sub {
    margin-top: 8px;
    font-size: 13px;
    color: var(--muted);
}

.grading-steps {
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
    border-top: 1px solid var(--line);
}

.grading-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    border-radius: 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    font-size: 13px;
    color: var(--muted-2);
    transition: color var(--dur-3);
}

.grading-step .gs-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted-2);
    flex: none;
    transition: border-color var(--dur-3), color var(--dur-3);
}

.grading-step .gs-icon svg { width: 11px; height: 11px; }

.grading-step.is-active {
    background: transparent;
    border-color: var(--line);
    color: var(--ink-2);
    box-shadow: none;
}

.grading-step.is-active .gs-icon {
    background: transparent;
    border-color: var(--brand);
    color: var(--brand-strong);
}

[data-theme="dark"] .grading-step.is-active .gs-icon { color: var(--brand); }

.grading-step.is-done { color: var(--muted); }
.grading-step.is-done .gs-icon { border-color: var(--success); color: var(--success); }

.grading-tip {
    margin-top: 24px;
    font-size: 12px;
    color: var(--muted-2);
    line-height: 1.7;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
}

/* ------------------------------ 倒计时状态 ------------------------------ */

.timer-chip.is-warn {
    color: var(--warn);
}

.timer-chip.is-over {
    color: var(--danger);
    font-family: var(--font-ui);
    font-weight: var(--weight-semibold);
}

.practice-foot.is-hidden {
    display: none !important;
}

/* ------------------------------ 识别结果确认 ------------------------------ */

.ocr-review {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ocr-review-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.ocr-review-head .hint {
    margin-top: 3px;
}

.ocr-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.ocr-thumbs img {
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--line);
    flex: none;
}

.ocr-rows {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 56vh;
    overflow-y: auto;
    padding-right: 4px;
    border-top: 1px solid var(--line);
}

.ocr-row {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 18px;
    align-items: start;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    padding: 16px 0;
    transition: background var(--dur-2);
}

.ocr-row:focus-within {
    background: var(--surface-2);
}

.ocr-zh {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 13px;
    line-height: 1.75;
    color: var(--muted);
    padding-left: 10px;
    border-left: 2px solid var(--brand-line);
    margin-bottom: 0;
}

.ocr-zh svg {
    width: 13px;
    height: 13px;
    margin-top: 3px;
    color: var(--brand);
    flex: none;
}

.ocr-row .textarea {
    min-height: 88px;
    font-family: var(--font-en);
    font-size: 14.5px;
    line-height: 1.8;
    background: var(--surface);
}

.ocr-review-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 4px;
}

@media (max-width: 900px) {
    .ocr-rows { max-height: none; }
    .ocr-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .ocr-review-actions { flex-direction: column-reverse; }
    .ocr-review-actions .btn { width: 100%; }
}
