* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: #f6f8fa;
    color: #24292f;
    min-height: 100vh;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: #ffffff;
    border-bottom: 1px solid #e1e4e8;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    color: #1f2328;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.teacher-greeting {
    margin-right: 8px;
    font-size: 0.95rem;
}

.container {
    max-width: 1080px;
    margin: 40px auto;
    padding: 0 20px;
}

.hero-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
}

.hero-card {
    background: #ffffff;
    padding: 50px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    max-width: 680px;
}

.hero-card h2 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    color: #0969da;
}

.hero-card p {
    color: #57606a;
    margin-bottom: 28px;
    line-height: 1.6;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.subtitle {
    color: #57606a;
    font-size: 0.9rem;
    margin-top: 4px;
}

.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.student-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e1e4e8;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.student-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08);
}

.student-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.student-badge {
    background: #ddf4ff;
    color: #0969da;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.student-notes {
    color: #57606a;
    font-size: 0.9rem;
    margin-bottom: 20px;
    line-height: 1.5;
    min-height: 40px;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background: #0969da;
    color: #ffffff;
}

.btn-primary:hover {
    background: #0858b9;
}

.btn-secondary {
    background: #f3f4f6;
    color: #24292f;
    border: 1px solid #d0d7de;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-outline {
    background: transparent;
    border: 1px solid #d0d7de;
    color: #24292f;
}

.btn-outline:hover {
    background: #f3f4f6;
}

.btn-ghost {
    background: transparent;
    color: #cf222e;
}

.btn-ghost:hover {
    background: #ffebe9;
}

.btn-danger {
    background: #cf222e;
    color: #ffffff;
}

.btn-danger:hover {
    background: #a40e26;
}

.btn-block {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
}

.btn-large {
    padding: 12px 28px;
    font-size: 1rem;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
}

.modal-card {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 440px;
    padding: 28px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.modal-large {
    max-width: 680px;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: #8c959f;
    cursor: pointer;
}

.tab-header {
    display: flex;
    border-bottom: 2px solid #eaecef;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 0.95rem;
    color: #57606a;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: #0969da;
    border-bottom: 2px solid #0969da;
    font-weight: 600;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: #24292f;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #d0d7de;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: #0969da;
    box-shadow: 0 0 0 3px rgba(9,105,218,0.15);
}

.input-with-btn {
    display: flex;
    gap: 8px;
}

.input-with-btn input {
    flex: 1;
}

.form-footer-links {
    text-align: right;
    margin-bottom: 14px;
}

.form-footer-links a {
    color: #0969da;
    font-size: 0.85rem;
    text-decoration: none;
}

.profile-info-box {
    background: #f6f8fa;
    padding: 14px 18px;
    border-radius: 8px;
    margin-top: 14px;
    font-size: 0.9rem;
    line-height: 1.8;
}

.table-container {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
}

.data-table th, .data-table td {
    padding: 10px 14px;
    border-bottom: 1px solid #e1e4e8;
}

.data-table th {
    background: #f6f8fa;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #24292f;
    color: #ffffff;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    transition: opacity 0.3s;
}

/* ================= 专属学习台 ================= */
.learning-desk {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e1e4e8;
    padding: 24px 30px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.desk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f2f5;
    margin-bottom: 24px;
}

.desk-header h3 {
    font-size: 1.15rem;
    color: #1f2328;
    display: flex;
    align-items: center;
    gap: 8px;
}

.student-tag {
    background: #ddf4ff;
    color: #0969da;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
}

.desk-row {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 10px 0;
}

.dashed-divider-box {
    position: relative;
    text-align: center;
    margin: 25px 0;
}

.dashed-divider {
    border: none;
    border-top: 2px dashed #d0d7de;
}

.divider-label {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    padding: 0 14px;
    font-size: 0.8rem;
    color: #8c959f;
    font-weight: 500;
}

/* ================= 立体书本卡片 ================= */
.book-card {
    width: 140px;
    height: 210px;
    border-radius: 4px 12px 12px 4px;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 16px 12px;
    box-shadow: 4px 6px 15px rgba(0,0,0,0.08), inset 5px 0 0 rgba(0,0,0,0.15);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
    user-select: none;
}

.book-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 6px 12px 22px rgba(0,0,0,0.15), inset 5px 0 0 rgba(0,0,0,0.2);
}

.book-theme-blue { background: linear-gradient(135deg, #e8f3ff 0%, #cbe4ff 100%); border: 1px solid #a5cfff; }
.book-theme-orange { background: linear-gradient(135deg, #fff4e5 0%, #ffe0b2 100%); border: 1px solid #ffd08a; }
.book-theme-green { background: linear-gradient(135deg, #e6f9f0 0%, #c3f2db 100%); border: 1px solid #9ce8c3; }
.book-theme-red { background: linear-gradient(135deg, #ffeef0 0%, #ffcdd2 100%); border: 1px solid #ffa8b0; }

.book-card.disabled {
    background: #f1f3f5;
    border: 1px solid #d0d7de;
    box-shadow: 2px 4px 8px rgba(0,0,0,0.03), inset 5px 0 0 #d0d7de;
    cursor: not-allowed;
    opacity: 0.75;
}

.book-card.disabled:hover {
    transform: none;
    box-shadow: 2px 4px 8px rgba(0,0,0,0.03), inset 5px 0 0 #d0d7de;
}

.book-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: #57606a;
    background: rgba(255,255,255,0.7);
    padding: 2px 6px;
    border-radius: 4px;
}

.book-title-vertical {
    writing-mode: vertical-lr;
    letter-spacing: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #1f2328;
    margin: auto 0;
}

.book-card.disabled .book-title-vertical {
    color: #8c959f;
}

.book-status-tip {
    font-size: 0.72rem;
    color: #8c959f;
}

/* ================= 悬浮遮罩 ================= */
.book-actions-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    border-radius: 4px 12px 12px 4px;
}

.book-card:not(.disabled):hover .book-actions-overlay {
    opacity: 1;
    pointer-events: auto;
}

.book-btn {
    width: 80%;
    padding: 6px 0;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    text-align: center;
}

.book-btn-white {
    background: #ffffff;
    color: #0969da;
}

.book-btn-white:hover {
    background: #f0f6ff;
}

.book-btn-primary {
    background: #0969da;
    color: #ffffff;
}

.book-btn-primary:hover {
    background: #0858b9;
}

/* ================= 选书弹窗网格 ================= */
.book-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px;
    max-height: 380px;
    overflow-y: auto;
    padding: 10px 4px;
}

.book-picker-item {
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    background: #ffffff;
    transition: all 0.2s ease;
}

.book-picker-item:hover {
    border-color: #0969da;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(9,105,218,0.15);
}

.book-picker-cover {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
}

.book-picker-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ================= 全屏教学阅读器 ================= */
.reader-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #1e242b;
    z-index: 10000;
    display: flex;
    flex-direction: column;
}

.reader-navbar {
    height: 54px;
    background: #0d1117;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    color: #c9d1d9;
}

.reader-title {
    font-size: 1rem;
    font-weight: 600;
    color: #f0f6fc;
}

.reader-body {
    flex: 1;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 24px;
    background: #161b22;
}

.reader-page-img {
    max-width: 900px;
    width: 100%;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    border-radius: 4px;
}

.reader-toolbar {
    height: 60px;
    background: #0d1117;
    border-top: 1px solid #30363d;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.page-indicator {
    color: #c9d1d9;
    font-size: 0.95rem;
    min-width: 100px;
    text-align: center;
}

/* ================= 错题画廊与时间轴 ================= */
.mistake-gallery-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 6px;
}

.mistake-date-group {
    margin-bottom: 24px;
}

.mistake-date-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0969da;
    background: #f1f8ff;
    padding: 6px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.mistake-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.mistake-card {
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.mistake-img-wrap {
    width: 100%;
    height: 140px;
    background: #f6f8fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.mistake-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.mistake-img-wrap:hover img {
    transform: scale(1.05);
}

.mistake-card-info {
    padding: 8px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mistake-card-notes {
    font-size: 0.8rem;
    color: #24292f;
    line-height: 1.4;
    margin-bottom: 8px;
    word-break: break-all;
}

.mistake-card-delete-btn {
    align-self: flex-end;
    background: none;
    border: none;
    color: #cf222e;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 4px;
}
.mistake-card-delete-btn:hover {
    text-decoration: underline;
}

/* ================= 多书本书架画廊网格 ================= */
.bookshelf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.bookshelf-card {
    background: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    gap: 14px;
    align-items: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bookshelf-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.bookshelf-cover {
    width: 75px;
    height: 105px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.bookshelf-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.bookshelf-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2328;
    line-height: 1.3;
    margin-bottom: 4px;
}

.bookshelf-meta {
    font-size: 0.8rem;
    color: #57606a;
    margin-bottom: 8px;
}

.bookshelf-actions {
    display: flex;
    gap: 8px;
}