:root {
    --bg: #f7f2e8;
    --paper: #fffdf8;
    --ink: #1f1a14;
    --muted: #6c6356;
    --line: #dbcdb9;
    --accent: #d8612d;
    --accent-dark: #a9481e;
    --secondary: #1f5f8b;
    --danger: #b23a2e;
    --shadow: rgba(25, 20, 15, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Avenir Next", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(216, 97, 45, 0.16), transparent 28%),
        radial-gradient(circle at right 18%, rgba(31, 95, 139, 0.13), transparent 22%),
        linear-gradient(180deg, #fbf7ef 0%, var(--bg) 100%);
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 64px;
}

.hero {
    margin-bottom: 28px;
}

.eyebrow {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(31, 95, 139, 0.1);
    color: var(--secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1 {
    margin: 14px 0 10px;
    font-size: clamp(2.3rem, 6vw, 4.4rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

h2 {
    margin: 0 0 12px;
    font-size: 1.35rem;
}

.lead,
.muted,
.status,
label span,
td,
th {
    line-height: 1.55;
}

.lead,
.muted {
    color: var(--muted);
}

.tips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.tips span {
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.9);
}

.workspace {
    display: grid;
    grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.panel {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 253, 248, 0.96);
    box-shadow: 0 20px 45px var(--shadow);
}

.upload-panel {
    position: sticky;
    top: 20px;
}

.list-panel {
    min-width: 0;
}

.stack {
    display: grid;
    gap: 14px;
}

.teacher-shell {
    margin-top: 18px;
}

.teacher-auth-wrap {
    max-width: 420px;
    margin-bottom: 12px;
}

label {
    display: grid;
    gap: 8px;
}

input,
textarea,
button {
    font: inherit;
}

input,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ccbba4;
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
}

textarea {
    resize: vertical;
}

button {
    border: 0;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    transition: transform 140ms ease, background 140ms ease;
}

button:hover {
    transform: translateY(-1px);
    background: var(--accent-dark);
}

.button-secondary {
    background: #ebdfd0;
    color: var(--ink);
}

.button-secondary:hover {
    background: #dfcfbb;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 12px;
}

.panel-header.compact {
    margin-bottom: 14px;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
    background: #fff;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid #efe6d8;
    text-align: left;
    vertical-align: top;
}

thead th {
    background: #f7efe4;
    font-size: 0.92rem;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.empty {
    text-align: center;
    color: var(--muted);
}

.status {
    min-height: 24px;
    margin: 14px 0 0;
    color: var(--secondary);
}

.status.error {
    color: var(--danger);
}

.status.success {
    color: #237548;
}

.hidden {
    display: none;
}

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

.link-button,
.delete-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
}

.file-link {
    color: var(--secondary);
    font-weight: 700;
    text-decoration: none;
}

.file-link:hover {
    text-decoration: underline;
}

.link-button {
    background: rgba(31, 95, 139, 0.12);
    color: var(--secondary);
}

.delete-button {
    border: 0;
    background: rgba(178, 58, 46, 0.12);
    color: var(--danger);
}

code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #f1e8d9;
}

@media (max-width: 720px) {
    .page {
        padding-top: 24px;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .upload-panel {
        position: static;
    }

    .panel-header {
        flex-direction: column;
    }
}
