/* 导师卡片UI样式 */

/* CSS变量定义 */
:root {
    --primary-color: #1f5eff;
    --accent-yellow: #f5c400;
    --direction-bg: #fff3c4;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-field: #8a6a00;
    --bg-page: #f5f6f8;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

/* 页面背景 */
body {
    background-color: var(--bg-page);
}

/* 确保导师列表正确显示的强制样式 */
main .team-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 24px !important;
    padding: 20px 0 !important;
    max-width: 1200px;
    margin: 0 auto;
}

/* 导师卡片样式 */
.teacher-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.teacher-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* 头像样式 */
.teacher-avatar {
    width: 90px;
    height: 90px;
    min-width: 90px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 3px solid #fff;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.teacher-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.teacher-avatar-fallback {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 800;
    color: var(--text-secondary);
    background: #e5e7eb;
}

/* 主要信息区域 */
.teacher-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 头部：姓名 + 咨询按钮 */
.teacher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.teacher-name {
    font-size: 22px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.consult-btn {
    background: var(--accent-yellow);
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.consult-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(245, 196, 0, 0.3);
}

/* 学历信息 */
.teacher-degree {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.icon-degree {
    font-size: 16px;
}

/* 研究方向标签 */
.teacher-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.field-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--direction-bg);
    color: var(--text-field);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
}

/* 简介区域 */
.teacher-bio-container {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 4px;
}

.bio-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.bio-header h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.bio-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.bio-toggle:hover {
    background: rgba(31, 94, 255, 0.1);
}

.toggle-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.teacher-bio {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.teacher-bio.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 4.8em;
}

.teacher-bio:not(.collapsed) {
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main .team-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
        padding: 16px !important;
    }

    .teacher-card {
        padding: 16px;
        gap: 16px;
        flex-direction: column;
        text-align: center;
    }

    .teacher-avatar {
        width: 80px;
        height: 80px;
        min-width: 80px;
        align-self: center;
    }

    .teacher-avatar-fallback {
        font-size: 28px;
    }

    .teacher-name {
        font-size: 20px;
    }

    .consult-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .teacher-degree {
        font-size: 13px;
        justify-content: center;
    }

    .field-tag {
        font-size: 12px;
        padding: 3px 10px;
    }

    .bio-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .category-pills {
        gap: 8px;
    }

    .category-pill {
        padding: 6px 12px;
        font-size: 13px;
    }

    .pagination {
        flex-wrap: wrap;
        gap: 6px;
    }

    .page-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .teacher-avatar {
        width: 70px;
        height: 70px;
        min-width: 70px;
    }

    .teacher-card {
        padding: 12px;
        gap: 12px;
    }

    .consult-btn {
        padding: 5px 12px;
        font-size: 12px;
    }
}