/**
 * 功能按钮和弹窗样式
 */

/* 紧凑功能按钮容器（标题右侧） */
.function-buttons-compact {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

/* 紧凑功能按钮 */
/* 紧凑功能按钮 */
.function-button-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #4a5568;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-family: system-ui, -apple-system, sans-serif;
}

.function-button-compact:hover {
    background: #fff;
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(78, 91, 240, 0.15);
    transform: translateY(-1px);
}

.function-button-compact:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}



/* 紧凑按钮文字 */
.function-button-compact-text {
    font-size: 13px;
    font-weight: 500;
}

/* 弹窗遮罩层（功能按钮专用，避免与其他modal-overlay冲突） */
.function-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.function-modal-overlay.show {
    display: block;
    opacity: 1;
}

/* 确保学生分析弹窗能正常显示（不受上面样式影响） */
#studentAnalysisModal {
    z-index: 10000 !important;
}

#studentAnalysisModal.modal-overlay {
    display: none;
}

#studentAnalysisModal.modal-overlay[style*="display: flex"],
#studentAnalysisModal.modal-overlay[style*="display:flex"] {
    display: flex !important;
}

/* 弹窗容器 */
.modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.modal-container.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* 弹窗内容 */
.modal-content {
    background: #ffffff;
    border-radius: 12px;
    width: 90%;
    max-width: 1200px;
    max-height: 85vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 弹窗头部 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8f9fa;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* 关闭按钮 */
.modal-close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #666;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
    padding: 0;
}

.modal-close-btn:hover {
    background: #e5e7eb;
    color: #333;
}

/* 弹窗主体 */
.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-body .card {
    margin: 0;
    box-shadow: none;
}

.modal-body .card-header {
    padding: 16px 0;
}

.modal-body .card-content {
    padding: 16px 0;
}

/* 弹窗内的卡片默认展开 */
.modal-body .card.collapsible {
    /* 移除collapsed状态，让内容默认显示 */
}

.modal-body .card.collapsible .card-content {
    display: block !important;
}

.modal-body .card.collapsible .card-toggle-icon {
    display: none; /* 隐藏折叠图标，因为弹窗内不需要折叠功能 */
}

/* 响应式设计 */
@media (max-width: 768px) {
    .function-buttons-compact {
        flex-direction: column;
        gap: 8px;
        margin-left: 0;
        margin-top: 12px;
        width: 100%;
    }

    .function-button-compact {
        width: 100%;
        justify-content: center;
    }

    .analysis-title {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 16px 20px;
    }

    .modal-body {
        padding: 20px;
    }
}

