/* ===== 班级管理页 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f5f7fa;
    color: #333;
}
button { cursor: pointer; font-family: inherit; }

.page-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 24px 0; gap: 16px; flex-wrap: wrap;
}
.roster-head { justify-content: flex-start; }
.head-left h1 { font-size: 22px; color: #2c3e50; }
.head-left p { font-size: 13px; color: #8a94a6; margin-top: 4px; }
.head-right { display: flex; gap: 10px; }
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff; border: none; padding: 9px 18px; border-radius: 10px;
    font-size: 14px; box-shadow: 0 4px 12px rgba(102, 126, 234, .35);
    transition: transform .15s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }
.btn-ghost {
    background: #fff; color: #667eea; border: 1px solid #d9dff0;
    padding: 9px 18px; border-radius: 10px; font-size: 14px; transition: all .15s;
}
.btn-ghost:hover { border-color: #667eea; background: #f4f6ff; }

.stats-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px; padding: 18px 24px;
}
.stat-card {
    background: #fff; border-radius: 16px; padding: 18px 20px;
    display: flex; align-items: center; gap: 16px;
    box-shadow: 0 6px 18px rgba(44, 62, 80, .06);
}
.stat-icon { font-size: 30px; }
.stat-title { font-size: 13px; color: #8a94a6; }
.stat-value { font-size: 26px; font-weight: 700; color: #2c3e50; margin-top: 4px; }

.class-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px; padding: 0 24px 30px;
}
.class-card {
    background: #fff; border-radius: 18px; padding: 20px;
    box-shadow: 0 8px 24px rgba(44, 62, 80, .07);
    display: flex; flex-direction: column; gap: 14px;
    transition: transform .18s, box-shadow .18s;
}
.class-card:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(102, 126, 234, .18); }
.class-card-top { display: flex; align-items: center; gap: 12px; }
.class-avatar {
    width: 52px; height: 52px; border-radius: 16px; font-size: 26px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #eef1ff, #fdf0ff);
}
.class-name { font-size: 17px; font-weight: 700; color: #2c3e50; }
.class-master { font-size: 13px; color: #8a94a6; margin-top: 3px; }
.class-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    background: #f2f4fa; color: #5a6b8c; border-radius: 20px;
    padding: 4px 10px; font-size: 12px;
}
.pet-tag { background: #fff3e4; color: #c96a1d; }
.class-meta { font-size: 12px; color: #a0a9ba; }
.class-actions { display: flex; gap: 10px; margin-top: auto; }
.class-actions .btn-primary { flex: 1; }

.empty-state { text-align: center; padding: 80px 20px; color: #8a94a6; }
.empty-icon { font-size: 54px; margin-bottom: 12px; }

.students-section {
    margin: 18px 24px 30px; background: #fff; border-radius: 16px;
    box-shadow: 0 6px 18px rgba(44, 62, 80, .06); overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 16px; text-align: left; font-size: 14px; }
th { background: #fafbfe; color: #7a86a0; font-weight: 600; border-bottom: 1px solid #eef1f7; }
td { border-bottom: 1px solid #f2f4fa; }
tbody tr:hover { background: #fafbff; }
.stu-name { font-weight: 600; color: #2c3e50; }
.nick { color: #9aa5bb; font-weight: 400; }
.stu-sub { font-size: 12px; color: #a9b2c4; margin-top: 2px; }
.src-badge { padding: 3px 9px; border-radius: 12px; font-size: 12px; }
.src-auto { background: #eef3ff; color: #4c6fff; }
.src-manual { background: #e8f9ef; color: #189a56; }
.pet-badge { font-size: 13px; color: #8a94a6; }
.pet-badge.adopted { color: #d97b1d; background: #fff4e3; padding: 3px 9px; border-radius: 12px; }
.pos { color: #d97b1d; font-weight: 700; }
.muted { color: #c4cbd8; }
.btn-mini { border: none; background: transparent; color: #e05b5b; font-size: 13px; }
.btn-mini:hover { text-decoration: underline; }
.empty-cell { text-align: center; color: #a9b2c4; padding: 34px; }

/* modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(20, 24, 40, .5);
    display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal { background: #fff; border-radius: 18px; width: 520px; max-width: 100%; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid #eef1f7; }
.modal-head h3 { font-size: 17px; color: #2c3e50; }
.modal-close { border: none; background: transparent; font-size: 24px; color: #9aa5bb; line-height: 1; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 22px; border-top: 1px solid #eef1f7; }
.form-label { display: block; font-size: 13px; color: #6b7689; margin: 12px 0 6px; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid #dde3ee; border-radius: 10px; font-size: 14px; outline: none; }
.form-input:focus { border-color: #667eea; box-shadow: 0 0 0 3px rgba(102,126,234,.15); }
.member-pick-list { margin-top: 12px; border: 1px solid #e7ebf3; border-radius: 12px; max-height: 320px; overflow-y: auto; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; font-size: 14px; cursor: pointer; border-bottom: 1px solid #f4f6fb; }
.member-row:hover { background: #fafbff; }
.member-row:last-child { border-bottom: none; }
.member-row em { color: #9aa5bb; font-style: normal; font-size: 13px; }
.avatar-mini { font-size: 18px; }
.picked-info { color: #8a94a6; font-size: 13px; margin-right: auto; }

/* 添加学员弹窗：两种方式切换 */
.add-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.add-tab { flex: 1; padding: 9px 0; border: 1px solid #e2e7f1; background: #fff; color: #6b7689;
    border-radius: 10px; font-size: 14px; cursor: pointer; transition: all .15s; }
.add-tab:hover { border-color: #667eea; color: #667eea; }
.add-tab.on { background: linear-gradient(135deg, #667eea, #764ba2); border-color: transparent; color: #fff; }
.new-member-tip { background: #f6f8ff; border: 1px dashed #b9c6f2; color: #667eea;
    font-size: 13px; padding: 9px 12px; border-radius: 10px; margin-bottom: 6px; }
.new-member-tip .req, .form-label .req { color: #e05b5b; font-style: normal; }

.toast {
    position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
    background: #2c3e50; color: #fff; padding: 11px 22px; border-radius: 24px;
    font-size: 14px; z-index: 200; box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
.toast.err { background: #e05b5b; }

/* ---------- 老师筛选 + 分页 ---------- */
.list-toolbar { display: flex; align-items: center; gap: 12px; margin: 20px 2px 6px; }
.filter-select {
    padding: 9px 12px; border: 1px solid #dde3ee; border-radius: 12px; background: #fff;
    font-size: 14px; color: #2c3e50; outline: none; box-shadow: 0 3px 10px rgba(44,62,80,.05);
}
.filter-select:focus { border-color: #667eea; }
.list-count { font-size: 13px; color: #8a94a6; }
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 22px 0 8px; flex-wrap: wrap;
}
.page-btn {
    min-width: 36px; padding: 7px 12px; border: 1px solid #e2e7f1; background: #fff;
    color: #4a5568; border-radius: 8px; font-size: 13px; transition: all .15s;
}
.page-btn:hover:not(:disabled) { border-color: #667eea; color: #667eea; }
.page-btn.on { background: linear-gradient(135deg, #667eea, #764ba2); border-color: transparent; color: #fff; }
.page-btn:disabled { opacity: .45; cursor: not-allowed; }
