.math-result-page {
    min-height: 100vh;
    margin: 0;
    background: var(--bg, #0f172a);
    color: var(--text-main, #e5e7eb);
}

.math-result-page [hidden],
.math-result-page .theme-selector-btn {
    display: none !important;
}

.math-result-page-shell {
    width: min(1040px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.math-result-page-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.math-result-page-top h1 {
    margin: 0;
    font-size: 24px;
}

.math-result-page-top p {
    margin: 4px 0 0;
    color: var(--text-sub, #94a3b8);
    font-size: 14px;
}

.math-result-page-status,
.math-result-login-card {
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    border-radius: 12px;
    background: var(--card-bg, rgba(15, 23, 42, 0.82));
    padding: 18px;
}

.math-result-login-card {
    display: grid;
    gap: 12px;
    max-width: 520px;
}

.math-result-login-card label {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.math-result-login-card input {
    min-height: 42px;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    background: var(--input-bg, rgba(15, 23, 42, 0.95));
    color: inherit;
    padding: 0 12px;
    font-size: 16px;
}

.math-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.math-result-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    color: inherit;
    background: var(--card-bg, rgba(15, 23, 42, 0.78));
    text-decoration: none;
    font-weight: 800;
    cursor: pointer;
}

.math-result-btn.is-primary {
    border-color: rgba(59, 130, 246, 0.45);
    background: #2563eb;
    color: white;
}

.math-result-report {
    display: grid;
    gap: 18px;
}

.math-result-report.is-compact {
    gap: 14px;
}

.math-result-header,
.math-result-metrics,
.math-result-section {
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    border-radius: 12px;
    background: var(--card-bg, rgba(15, 23, 42, 0.82));
}

.math-result-header {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 18px;
    padding: 20px;
}

.math-result-eyebrow {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 800;
    color: #60a5fa;
}

.math-result-header h1 {
    margin: 0;
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.2;
}

.math-result-header p:last-child {
    margin: 8px 0 0;
    color: var(--text-sub, #94a3b8);
}

.math-result-score {
    display: grid;
    place-items: center;
    min-width: 118px;
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}

.math-result-score b {
    font-size: 42px;
    line-height: 1;
}

.math-result-score span {
    font-size: 13px;
    font-weight: 800;
}

.math-result-score.is-excellent,
.math-result-score.is-good {
    background: rgba(34, 197, 94, 0.13);
    color: #86efac;
}

.math-result-score.is-watch {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
}

.math-result-score.is-support {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
}

.math-result-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
}

.math-result-metrics div {
    min-height: 78px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.025);
}

.math-result-metrics b {
    font-size: 20px;
}

.math-result-metrics span,
.math-result-question-head span,
.math-result-answer-grid span,
.math-result-question footer {
    color: var(--text-sub, #94a3b8);
    font-size: 13px;
}

.math-result-section {
    padding: 18px;
}

.math-result-section h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.math-result-analysis {
    margin: 0 0 12px;
    line-height: 1.6;
}

.math-result-weak-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.math-result-weak-list li,
.math-result-weak-empty,
.math-result-empty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.math-result-learning-materials {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-color: rgba(59, 130, 246, 0.34);
    background: rgba(37, 99, 235, 0.12);
}

.math-result-learning-materials p {
    margin: 0;
    color: var(--text-sub, #94a3b8);
    line-height: 1.55;
}

.math-result-learning-materials .math-learning-material-link {
    flex: none;
}

.math-result-question-list {
    display: grid;
    gap: 12px;
}

.math-result-question {
    display: grid;
    gap: 12px;
    padding: 14px;
    border-radius: 10px;
    border: 1px solid var(--border, rgba(148, 163, 184, 0.22));
    background: rgba(255, 255, 255, 0.03);
}

.math-result-question.is-correct {
    border-color: rgba(34, 197, 94, 0.24);
}

.math-result-question.is-wrong {
    border-color: rgba(239, 68, 68, 0.3);
}

.math-result-question-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.math-result-question-head b {
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    font-size: 12px;
}

.math-result-question.is-correct .math-result-question-head b {
    background: rgba(34, 197, 94, 0.16);
    color: #86efac;
}

.math-result-question.is-wrong .math-result-question-head b {
    background: rgba(239, 68, 68, 0.16);
    color: #fca5a5;
}

.math-result-problem-label {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 5px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 11px;
    font-weight: 800;
}

.math-result-problem p {
    margin: 0;
    font-weight: 800;
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.math-result-problem small {
    display: block;
    margin-top: 6px;
    color: var(--text-sub, #94a3b8);
    line-height: 1.45;
}

.math-result-visual-wrap {
    width: min(520px, 100%);
    margin-top: 10px;
}

.math-result-report .math-visual {
    width: min(520px, 100%);
    min-width: 0;
}

.math-result-report .math-visual-table {
    width: 100%;
    margin: 0 0 8px;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 8px;
    background: #fff;
    color: #243044;
    font-size: 12px;
    font-weight: 800;
}

.math-result-report .math-visual-table caption {
    padding: 5px 7px;
    color: #475569;
    text-align: left;
}

.math-result-report .math-visual-table th,
.math-result-report .math-visual-table td {
    border: 1px solid #dfeaf6;
    padding: 6px 7px;
    text-align: center;
}

.math-result-report .math-visual-table th {
    background: #eef6ff;
    color: #1d4f86;
}

.math-result-report .math-polygon-svg,
.math-result-report .math-line-graph-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.math-result-report .math-polygon-bg,
.math-result-report .math-line-graph-bg {
    fill: #ffffff;
    stroke: #dce8f5;
    stroke-width: 2;
}

.math-result-report .math-polygon-shape {
    stroke-width: 4;
    stroke-linejoin: round;
}

.math-result-report .math-polygon-segment {
    stroke-width: 4;
    stroke-linecap: round;
}

.math-result-report .math-polygon-segment.is-dashed {
    stroke-dasharray: 8 7;
}

.math-result-report .math-polygon-grid-shade {
    fill: #dbeafe;
}

.math-result-report .math-polygon-grid-line {
    stroke: #9fb6d8;
    stroke-width: 1.5;
}

.math-result-report .math-polygon-title,
.math-result-report .math-polygon-label,
.math-result-report .math-line-graph-title,
.math-result-report .math-line-graph-y-name,
.math-result-report .math-line-graph-x-label,
.math-result-report .math-line-graph-grid-row text {
    fill: #334155;
    font-weight: 900;
}

.math-result-report .math-polygon-title,
.math-result-report .math-line-graph-title {
    font-size: 16px;
}

.math-result-report .math-polygon-label {
    font-size: 15px;
}

.math-result-report .math-polygon-label.is-note,
.math-result-report .math-polygon-label.is-unit,
.math-result-report .math-line-graph-y-name,
.math-result-report .math-line-graph-x-label,
.math-result-report .math-line-graph-grid-row text {
    font-size: 12px;
}

.math-result-report .math-polygon-label.is-height,
.math-result-report .math-line-graph-point.is-missing text,
.math-result-report .math-line-graph-wave {
    fill: #f97316;
}

.math-result-report .math-line-graph-grid-row line {
    stroke: #e7eef7;
    stroke-width: 1;
}

.math-result-report .math-line-graph-axis {
    stroke: #64748b;
    stroke-width: 2;
}

.math-result-report .math-line-graph-segment {
    stroke: #2563eb;
    stroke-linecap: round;
    stroke-width: 4;
}

.math-result-report .math-line-graph-segment.is-highlight {
    stroke: #f59e0b;
    stroke-width: 6;
}

.math-result-report .math-line-graph-segment.is-locked {
    stroke: #60a5fa;
    stroke-width: 4;
}

.math-result-report .math-line-graph-point circle {
    fill: #2563eb;
    stroke: #fff;
    stroke-width: 3;
}

.math-result-report .math-line-graph-point text {
    fill: #172033;
    font-size: 12px;
    font-weight: 900;
}

.math-result-report .math-line-graph-point.is-highlight circle {
    fill: #f59e0b;
}

.math-result-report .math-line-graph-point.is-locked circle {
    fill: #dbeafe;
    stroke: #2563eb;
}

.math-result-report .math-line-graph-point.is-missing circle,
.math-result-report .math-line-graph-candidate circle {
    fill: #fff7ed;
    stroke: #f59e0b;
    stroke-width: 3;
}

.math-result-report .math-line-graph-point.is-missing circle {
    stroke-dasharray: 4 3;
}

.math-result-report .math-line-graph-candidate text {
    fill: #9a3412;
    font-size: 12px;
    font-weight: 900;
}

.math-result-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.math-result-choices li {
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.45);
}

.math-result-choices li.is-selected {
    border-color: rgba(59, 130, 246, 0.55);
}

.math-result-choices li.is-answer {
    border-color: rgba(34, 197, 94, 0.55);
}

.math-result-answer-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.math-result-answer-grid div {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.math-result-question footer {
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    padding-top: 10px;
}

@media (max-width: 720px) {
    .math-result-page-shell {
        width: min(100vw - 20px, 1040px);
        padding-top: 16px;
    }

    .math-result-page-top,
    .math-result-header,
    .math-result-learning-materials {
        flex-direction: column;
        align-items: stretch;
    }

    .math-result-metrics,
    .math-result-answer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .math-result-score {
        min-height: 96px;
    }
}
