/* Production student shell. Keep every selector scoped to .student-shell. */
.student-shell {
    --student-bg: #f5f7fb;
    --student-surface: #ffffff;
    --student-surface-soft: #f7f9fd;
    --student-border: #dfe7f3;
    --student-text: #172033;
    --student-muted: #526071;
    --student-blue: #2457d6;
    --student-blue-dark: #1f4fd8;
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    overflow-wrap: anywhere;
    color: var(--student-text);
    background: var(--student-bg);
    font-family: "Microsoft YaHei", "PingFang SC", system-ui, -apple-system, sans-serif;
    line-height: 1.6;
}

.student-shell *,
.student-shell *::before,
.student-shell *::after {
    box-sizing: border-box;
}

.student-shell a {
    color: inherit;
}

.student-shell button,
.student-shell input,
.student-shell select,
.student-shell textarea {
    font: inherit;
}

.student-shell :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid rgba(36, 87, 214, .32);
    outline-offset: 3px;
}

.student-shell__skip-link {
    position: fixed;
    z-index: 100;
    top: 10px;
    left: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    color: #ffffff;
    background: var(--student-blue-dark);
    transform: translateY(-180%);
}

.student-shell__skip-link:focus {
    transform: translateY(0);
}

.student-shell__header {
    position: sticky;
    z-index: 20;
    top: 0;
    border-bottom: 1px solid rgba(223, 231, 243, .92);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 8px 24px rgba(36, 50, 74, .06);
    backdrop-filter: blur(16px);
}

.student-shell__header-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    width: min(1180px, calc(100% - 40px));
    min-height: 72px;
    margin: 0 auto;
}

.student-shell__brand {
    display: inline-flex;
    gap: 11px;
    align-items: center;
    min-height: 44px;
    text-decoration: none;
}

.student-shell__brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    color: #ffffff;
    background: var(--student-blue);
    box-shadow: 0 7px 18px rgba(36, 50, 74, .14);
    font-weight: 800;
}

.student-shell__brand strong,
.student-shell__brand small {
    display: block;
}

.student-shell__brand small {
    color: var(--student-muted);
    font-size: 12px;
}

.student-shell__nav {
    display: flex;
    gap: 4px;
    justify-content: center;
    min-width: 0;
}

.student-shell__nav a,
.student-shell__account-link,
.student-shell__logout {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    padding: 8px 12px;
    text-decoration: none;
    white-space: nowrap;
}

.student-shell__nav a {
    color: var(--student-muted);
    font-weight: 650;
}

.student-shell__nav a:hover,
.student-shell__nav a[aria-current="page"] {
    color: var(--student-blue-dark);
    background: #edf3ff;
}

.student-shell__account {
    display: flex;
    gap: 6px;
    align-items: center;
}

.student-shell__account form {
    margin: 0;
}

.student-shell__handle {
    max-width: 156px;
    overflow: hidden;
    color: var(--student-muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.student-shell__account-link {
    color: var(--student-blue-dark);
}

.student-shell__logout {
    border: 1px solid var(--student-border);
    color: var(--student-text);
    background: var(--student-surface);
    cursor: pointer;
}

.student-shell__logout:hover {
    border-color: #c5d3e8;
    background: var(--student-surface-soft);
}

.student-shell__session-notice,
.student-shell__messages,
.student-shell__main,
.student-shell__footer {
    width: min(1120px, calc(100% - 40px));
    margin-right: auto;
    margin-left: auto;
}

.student-shell__session-notice {
    margin-top: 18px;
    padding: 13px 16px;
    border: 1px solid #f3c7c2;
    border-radius: 10px;
    color: #8f2118;
    background: #fff6f5;
}

.student-shell__main {
    min-height: calc(100vh - 170px);
    padding-top: 32px;
    padding-bottom: 64px;
}

.student-shell__main:focus-visible {
    outline: 3px solid rgba(36, 87, 214, .32);
    outline-offset: 6px;
}

.student-shell__messages {
    width: 100%;
    margin-bottom: 18px;
}

.student-shell__message {
    padding: 13px 15px;
    border: 1px solid var(--student-border);
    border-radius: 10px;
    background: var(--student-surface);
}

.student-shell__message + .student-shell__message {
    margin-top: 8px;
}

.student-shell__message--success {
    border-color: #b9dcc2;
    color: #135f2a;
    background: #f2fbf4;
}

.student-shell__message--warning {
    border-color: #f0d295;
    color: #784d00;
    background: #fffaf0;
}

.student-shell__message--error {
    border-color: #f3c7c2;
    color: #8f2118;
    background: #fff6f5;
}

.student-shell__footer {
    display: flex;
    gap: 18px;
    justify-content: space-between;
    padding: 22px 0 34px;
    border-top: 1px solid var(--student-border);
    color: #526071;
    font-size: 13px;
}

@media (max-width: 768px) {
    .student-shell__header-inner {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px;
        width: min(100% - 28px, 720px);
        padding: 10px 0;
    }

    .student-shell__nav {
        grid-column: 1 / -1;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: thin;
    }

    .student-shell__handle {
        display: none;
    }

    .student-shell__session-notice,
    .student-shell__messages,
    .student-shell__main,
    .student-shell__footer {
        width: min(100% - 28px, 720px);
    }

    .student-shell__main {
        padding-top: 24px;
        padding-bottom: 48px;
    }
}

@media (max-width: 430px) {
    .student-shell__brand small {
        display: none;
    }

    .student-shell__header-inner,
    .student-shell__session-notice,
    .student-shell__messages,
    .student-shell__main,
    .student-shell__footer {
        width: calc(100% - 24px);
    }

    .student-shell__footer {
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 360px) {
    .student-shell__brand-mark {
        width: 36px;
        height: 36px;
    }

    .student-shell__brand {
        gap: 8px;
    }

    .student-shell__logout {
        padding-right: 10px;
        padding-left: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .student-shell *,
    .student-shell *::before,
    .student-shell *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}
