.exam-subpage {
    min-height: 100vh;
    min-height: 100dvh;
}

.sub-shell {
    max-width: 640px;
    margin: 0 auto;
    padding: 1rem 0.85rem 2rem;
    position: relative;
    z-index: 1;
}

.sub-header {
    margin-bottom: 1.25rem;
}

.sub-nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.sub-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.75rem 0.45rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: 1.2;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.sub-nav-link:hover {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(30, 41, 59, 0.95);
    transform: translateY(-1px);
}

.sub-nav-link.is-active {
    border-color: rgba(245, 158, 11, 0.55);
    background: rgba(245, 158, 11, 0.14);
    color: #fde68a;
}

.sub-nav-link .nav-back-icon {
    width: 1.2rem;
    height: 1.2rem;
    font-size: 0.85rem;
}

.nav-back,
.sub-back,
.mode-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem 0.5rem 0.75rem;
    margin-bottom: 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.82);
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.2;
    box-shadow: 0 2px 10px rgba(2, 6, 23, 0.25);
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.nav-back:hover,
.sub-back:hover,
.mode-back:hover {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(30, 41, 59, 0.95);
    transform: translateY(-1px);
}

.nav-back:active,
.sub-back:active,
.mode-back:active {
    transform: translateY(0);
}

.nav-back-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
}

.sub-header-body {
    min-width: 0;
}

.sub-kicker {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sub-header h1 {
    margin: 0.2rem 0 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.sub-subtitle {
    margin: 0.35rem 0 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.detail-hero {
    background: linear-gradient(145deg, rgba(24, 34, 54, 0.95), rgba(15, 23, 42, 0.88));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.detail-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 0.85rem;
}

.detail-stat {
    text-align: center;
    padding: 0.65rem 0.4rem;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.detail-stat-value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    color: #e2e8f0;
    line-height: 1.2;
}

.detail-stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

.detail-summary-box {
    margin-top: 0.85rem;
    padding: 0.75rem 0.8rem;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.15);
}

.detail-summary-title {
    margin: 0 0 0.55rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #94a3b8;
    text-align: right;
}

.detail-summary-empty {
    margin: 0;
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.5;
    text-align: center;
}

.detail-attempt-summary {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.detail-summary-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 0.65rem;
}

.detail-summary-item {
    flex: 1 1 7.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.detail-summary-item-wide {
    flex: 1 1 100%;
}

.detail-summary-item-highlight .detail-summary-value {
    color: #fbbf24;
    font-size: 1.15rem;
}

.detail-summary-label {
    font-size: 0.7rem;
    color: #94a3b8;
}

.detail-summary-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: #e2e8f0;
    line-height: 1.35;
    word-break: break-word;
}

.detail-summary-date {
    font-weight: 500;
    font-size: 0.82rem;
}

.detail-summary-elapsed {
    color: #7dd3fc;
    font-weight: 600;
}

.detail-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.detail-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--border);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.detail-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(59, 130, 246, 0.45);
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.35);
}

.detail-btn.primary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(59, 130, 246, 0.2));
    border-color: rgba(59, 130, 246, 0.4);
}

.detail-btn.secondary {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(16, 185, 129, 0.08));
    border-color: rgba(34, 197, 94, 0.35);
}

.detail-btn.tertiary {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.16), rgba(139, 92, 246, 0.08));
    border-color: rgba(168, 85, 247, 0.35);
}

.detail-btn-icon {
    font-size: 1.25rem;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.detail-btn strong {
    display: block;
    font-size: 0.95rem;
}

.detail-btn small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.detail-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}

.detail-panel h2 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
}

.mode-stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.mode-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    font-size: 0.8rem;
}

.mode-stat-label {
    color: #e2e8f0;
    font-weight: 500;
}

.mode-stat-value {
    color: var(--text-muted);
    text-align: left;
}

.muted {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin: 0;
}
