/*
 * 班级管理（授课班级）分栏布局：左栏班级列表 + 右栏学生详情。
 * 仅包含班级管理与学生表格相关样式，复用 teacher-core.css 的紫色设计令牌。
 * 载入顺序在 teacher-readable.css 之后，因此文本尺寸遵循可读基线（16px）。
 */

/* ---- 分栏布局 ---- */
.class-split {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.class-mgmt-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- 左栏：班级列表 ---- */
.class-list-panel,
.class-detail-panel {
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.class-list-panel { overflow: hidden; }

.class-list-head {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
}
.class-list-head strong { color: var(--ink); }
.class-list-head span { color: var(--muted); }

.class-list {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 640px;
    overflow-y: auto;
}
.class-list .empty-state { padding: 28px 16px; }

.class-list-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    text-align: left;
    transition: .18s ease;
}
.class-list-item:hover { background: #f7f6ff; border-color: #e7e3fb; }
.class-list-item.active { background: var(--purple-soft); border-color: #d8d2f8; }

.class-list-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: var(--purple);
    background: var(--purple-soft);
    font-weight: 800;
}
.class-list-item.active .class-list-avatar {
    color: #fff;
    background: linear-gradient(135deg, #6656e8, #8878f2);
}

.class-list-copy { display: flex; min-width: 0; flex-direction: column; gap: 2px; }
.class-list-copy strong { color: var(--ink); }
.class-list-copy small { color: var(--muted); }

.class-list-item > em { margin-left: auto; color: #b9bdcb; font-style: normal; }

/* ---- 右栏：学生详情 ---- */
.class-detail-head {
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}
.class-detail-head h3 { margin: 0; color: var(--ink); }
.class-detail-head small { display: block; margin-top: 2px; color: var(--muted); }
.invite-chip {
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--purple);
    background: var(--purple-soft);
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.student-toolbar {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--line);
}
.student-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.student-search {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: #9da2b1;
}
.student-search input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

/* ---- 学生表格 ---- */
.student-table { width: 100%; }
.student-row {
    display: grid;
    grid-template-columns: 36px minmax(150px, 1.3fr) minmax(120px, 1fr) minmax(150px, 1.2fr) minmax(120px, .9fr) 176px;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 18px;
    border-bottom: 1px solid #f0f0f4;
    color: var(--ink);
}
.student-row.header {
    min-height: 44px;
    color: #8b96a9;
    background: #f6f7fb;
    font-weight: 700;
}
.student-row:last-child { border-bottom: 0; }
.student-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--purple); }

.student-name { display: flex; min-width: 0; flex-direction: column; }
.student-name strong { color: var(--ink); }
.student-name small { color: var(--purple); }
.student-id { color: #596175; }

.student-ops { position: relative; display: flex; align-items: center; gap: 6px; }
.row-op {
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--purple);
    background: var(--purple-soft);
    white-space: nowrap;
}
.row-op.more { color: #596175; background: #f1f2f6; }
.row-op.remove { color: var(--red); background: #fdeff0; }

.row-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
    min-width: 124px;
    padding: 6px;
    display: none;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow);
}
.row-menu.open { display: flex; }
.row-menu button {
    width: 100%;
    padding: 8px 10px;
    border-radius: 7px;
    background: transparent;
    text-align: left;
    color: var(--ink);
}
.row-menu button:hover { background: #f4f3fb; }
.row-menu button.danger { color: var(--red); }

/* ---- 批量操作栏 ---- */
.batch-bar {
    padding: 12px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--line);
    background: #faf9ff;
}
.batch-bar span { color: var(--ink); font-weight: 600; }
.batch-bar button { padding: 8px 12px; border-radius: 8px; }
.batch-bar button.danger { color: #fff; background: var(--red); }
.batch-bar button.plain { color: var(--muted); background: #f1f2f6; }

/* ---- 分组管理弹窗 ---- */
.group-create { display: flex; gap: 8px; }
.group-create input { flex: 1; }
.group-create button {
    padding: 0 18px;
    border-radius: 9px;
    color: #fff;
    background: var(--purple);
    box-shadow: 0 8px 18px rgba(86, 71, 203, .18);
    font-weight: 700;
}

.group-list { display: flex; flex-direction: column; gap: 8px; }
.group-item {
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.group-item > div { display: flex; flex-direction: column; min-width: 0; }
.group-item strong { color: var(--ink); }
.group-item small { color: var(--muted); }
.group-item-ops { display: flex; gap: 6px; flex-direction: row !important; }
.group-item-ops button { padding: 6px 10px; border-radius: 7px; color: var(--purple); background: var(--purple-soft); }
.group-item-ops button.danger { color: var(--red); background: #fdeff0; }

.group-member-checks {
    max-height: 220px;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
}
.group-member-check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.group-member-check input { width: 16px; height: 16px; accent-color: var(--purple); }

/* ---- 响应式 ---- */
@media (max-width: 1050px) {
    .class-split { grid-template-columns: 1fr; }
    .class-list { max-height: 320px; }
}

@media (max-width: 760px) {
    .student-toolbar { align-items: stretch; flex-direction: column; }
    .student-search { min-width: 0; }
    .student-row { grid-template-columns: 36px 1fr 1fr 148px; }
    .student-row > :nth-child(3),
    .student-row > :nth-child(5) { display: none; }
}
