﻿/* 学生管理页面 - 卡片网格布局 */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

/* 学生管理主网格：桌面端固定每行 4 张卡片，紧凑布局（2026-09-02） */
.student-grid.students-main-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
@media (max-width: 1024px) and (min-width: 641px) {
    .student-grid.students-main-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.student-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 11px 12px 9px;
    cursor: pointer;
    transition: all .15s;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.student-card:hover {
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.08);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.student-card .sc-card-header {
    display: flex;
    align-items: center;
    gap: 9px;
}

.sc-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}
.sc-male { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.sc-female { background: linear-gradient(135deg, #f472b6, #db2777); }

.sc-card-name-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}
.sc-card-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text);
    line-height: 1.3;
    white-space: nowrap;
}
.sc-gender {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 999px;
    color: #fff;
    flex-shrink: 0;
}
.sc-gender-m { background: #3b82f6; }
.sc-gender-f { background: #ec4899; }
.sc-card-id {
    font-size: 10px;
    color: var(--text3);
    font-family: 'Courier New', monospace;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.sc-card-edit-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: none;
    background: #f1f5f9;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 2;
    transition: .15s;
}
.sc-card-edit-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

/* 卡片中的徽章区 */
.sc-card-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.sc-pos-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 5px;
    font-weight: 600;
    line-height: 1.3;
    display: inline-flex;
    align-items: center;
}
.sc-pos-banzhong { background: #ede9fe; color: #6d28d9; }
.sc-pos-fubanzhang { background: #dbeafe; color: #1d4ed8; }
.sc-pos-xuewei { background: #cffafe; color: #0e7490; }
.sc-pos-jilv { background: #fee2e2; color: #b91c1c; }
.sc-pos-wenyi { background: #fce7f3; color: #be185d; }
.sc-pos-tiyu { background: #d1fae5; color: #047857; }
.sc-pos-weisheng { background: #fef3c7; color: #b45309; }
.sc-pos-shenghuo { background: #fef3c7; color: #b45309; }
.sc-pos-laodong { background: #fef3c7; color: #b45309; }
.sc-pos-zuzhi { background: #ede9fe; color: #6d28d9; }
.sc-pos-default { background: #f1f5f9; color: #475569; }

.sc-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 5px;
    font-weight: 500;
    line-height: 1.3;
}
.sc-tag-excellent { background: #d1fae5; color: #047857; }
.sc-tag-improve { background: #fed7aa; color: #c2410c; }
.sc-tag-liushou { background: #dbeafe; color: #1d4ed8; }
.sc-tag-danqin { background: #fce7f3; color: #be185d; }
.sc-tag-techang { background: #fef9c3; color: #a16207; }
.sc-tag-xinli { background: #fee2e2; color: #b91c1c; }
.sc-tag-default { background: #f1f5f9; color: #475569; }

/* 卡片信息行 */
.sc-card-info {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 10px;
    font-size: 11px;
    color: var(--text3);
}
.sc-card-info .sc-info-item {
    display: flex;
    align-items: center;
    gap: 3px;
    min-height: 18px;
}
.sc-card-info .sc-info-item i {
    font-size: 12px;
    color: #94a3b8;
}
.sc-card-info .sc-info-item span {
    color: var(--text2);
    font-weight: 500;
}

/* 可点击拨打 */
.sc-card-info .sc-info-item.sc-callable {
    cursor: pointer;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    padding: 1px 8px;
    font-size: 11px;
    transition: background .2s, border-color .2s;
}
.sc-card-info .sc-info-item.sc-callable:hover {
    background: #dcfce7;
    border-color: #86efac;
}

/* 卡片备注预览 */
.sc-card-note {
    font-size: 11px;
    color: var(--text3);
    background: #f8fafc;
    border-radius: 8px;
    padding: 4px 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 卡片底部统计 */
.sc-card-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid #f1f5f9;
}
.sc-card-footer .sc-stat-item {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
}
.sc-card-footer .sc-stat-item i {
    font-size: 12px;
}
.sc-card-footer .sc-stat-val {
    font-weight: 700;
    font-size: 12px;
}

.text-red-500 { color: #ef4444; }
.text-green-500 { color: #22c55e; }
.text-amber-500 { color: #f59e0b; }
.text-purple-500 { color: #8b5cf6; }

/* 移动端适配 */
@media (max-width: 640px) {
    .student-grid,
    .student-grid.students-main-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .student-card { padding: 10px 10px 8px; gap: 5px; }
    .sc-avatar { width: 36px; height: 36px; font-size: 15px; }
    .sc-card-name { font-size: 14px; }
    .sc-card-footer { gap: 8px; }
}

/* 学生详情弹窗 */
.sc-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.sc-detail-avatar {
    width: 52px;
    height: 52px;
    font-size: 22px;
}
.sc-detail-sub {
    font-size: 12px;
    color: var(--text3);
    margin-top: 2px;
}
.sc-detail-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}
.sc-stat-card {
    flex: 1;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
}
.sc-stat-val {
    font-size: 18px;
    font-weight: 700;
}
.sc-stat-label {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}
.text-amber-500 { color: #f59e0b; }
.text-purple-500 { color: #8b5cf6; }

/* 编辑表单行内布局 */
.form-group-row {
    display: flex;
    gap: 12px;
}
@media (max-width: 480px) {
    .form-group-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ===== 一人一档档案概览 ===== */
.sc-idc-card {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    color: #475569;
    margin-bottom: 12px;
    align-items: center;
}
.detail-sec {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.detail-sec-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.detail-sec-empty {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    padding: 8px 0;
}
.detail-rec {
    font-size: 12px;
    color: #475569;
    padding: 6px 0;
    border-bottom: 1px dashed #eef2f7;
    line-height: 1.5;
}
.detail-rec:last-child {
    border-bottom: none;
}
.detail-rec-date {
    color: #94a3b8;
    font-size: 11px;
}
.rec-tag {
    display: inline-block;
    background: #f1f5f9;
    border-radius: 4px;
    padding: 0 5px;
    margin-left: 4px;
    font-size: 10px;
    color: #64748b;
}
.detail-chart-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
    overflow: hidden;
}
.detail-chart-labels span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
    padding: 0 2px;
}
.detail-exam-list {
    max-height: 160px;
    overflow: auto;
    margin-top: 6px;
}
.detail-exam-item {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    padding: 5px 0;
    border-bottom: 1px dashed #eef2f7;
}
.detail-exam-item:last-child {
    border-bottom: none;
}
.dex-name {
    flex: 1;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dex-date {
    color: #94a3b8;
    font-size: 11px;
}
.dex-score {
    color: var(--primary-strong);
    font-weight: 700;
}
.dex-rank {
    color: #64748b;
    font-size: 11px;
}
.detail-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.detail-actions .btn {
    flex: 1;
    padding: 8px 6px;
    font-size: 13px;
}
@media (max-width: 480px) {
    .sc-idc-card {
        gap: 4px 10px;
        font-size: 11px;
    }
    .detail-actions {
        flex-wrap: wrap;
    }
    .detail-actions .btn {
        flex: 1 1 45%;
    }
}
