/* common.css - 通用样式定义 */

:root {
    --primary-color: #4e73df;
    --secondary-color: #858796;
    --three-color: #f7f8fa;
    --success-color: #1cc88a;
    --info-color: #36b9cc;
    --warning-color: #f6c23e;
    --danger-color: #e74a3b;
    --light-color: #f8f9fc;
    --dark-color: #5a5c69;
    --border-color: #e3e6f0;
    --text-light: #86909c;
    --text-dark: #4e5969;
    --sidebar-width: 280px;
    --navbar-height: 70px;
    --text-light: #86909c;
     --sidebar-collapsed-width: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background-color: #f8f9fc;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}


/* 消息提示框样式 */
.message-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: auto;
    max-width: 500px;
    min-width: 300px;
}

.alert-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    animation: slideDown 0.3s ease-out;
    border: none;
    font-weight: 500;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: var(--success-color);
    color: white;
}

.alert-error {
    background-color: var(--danger-color);
    color: white;
}

.alert-warning {
    background-color: var(--warning-color);
    color: #333;
}

.alert-info {
    background-color: var(--info-color);
    color: white;
}

.alert-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.8;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.alert-close:hover {
    opacity: 1;
}
/* 自定义导航条样式 */
.navbar-custom {
    background-color: white;
   
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border-bottom:3px solid var(--primary-color);
}
.navbar-custom .navbar-container {
    max-width: 1400px; /* 与页面内容宽度一致 */
    margin: 0px auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.navbar-custom .navbar-brand {
          display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--dark-color);
    font-weight: 700;
    font-size: 1.5rem;
    transition: all 0.3s;
}

.navbar-custom .logo {
    height: 40px;
    width: auto;
    margin-right: 10px;
}
.navbar-brand:hover {
    color: var(--primary-color);
}

.logo-icon {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-right: 10px;
    background: linear-gradient(135deg, var(--primary-color), #6a82fb);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-main {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-sub {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--secondary-color);
}

.navbar-custom .nav-link {
    color: #333;
    font-weight: 500;
    padding: 0.5rem 1rem;
    margin: 0 2px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.navbar-custom .nav-link:hover, 
.navbar-custom .nav-link.active {
    background: linear-gradient(135deg, #4e73df 0%, #6a82fb 100%);
    color: white;
    border-color: #4e73df;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(78, 115, 223, 0.25);
}
        
.navbar-custom .dropdown-menu {
    border: none;
    padding: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.navbar-custom .dropdown-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 0;
    color: #495057;
    transition: all 0.3s ease;
    white-space: nowrap;
    width: 100%;
    border-left: 3px solid transparent;
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
}
        
.navbar-custom .dropdown-item:hover {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
     border-left-color: var(--primary-color);
}
.navbar-custom .dropdown-item i {
    width: 18px;
    min-width: 18px;
    margin-right: 12px;
    text-align: center;
    font-size: 1.1em;
    line-height: 1.5;
    color: inherit;
}
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 8px;
}

/* 移动端用户中心样式 */
.mobile-user-menu .dropdown-menu {
    border: none;
    box-shadow: none;
    padding: 0;
    background-color: transparent;
}

.mobile-user-menu .dropdown-item {
    padding: 0.75rem 1.5rem;
    border-radius: 0;
}



/* 响应式调整 */
@media (max-width: 991.98px) {
    .navbar-custom .navbar-nav {
        padding: 1rem 0;
    }
    
    .navbar-custom .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .navbar-custom .dropdown-menu {
        box-shadow: none;
        border: 1px solid #eee;
        margin-left: 1rem;
    }
    
    /* 移动端用户下拉菜单 */
    .mobile-user-menu {
        margin-top: 0.5rem;
    }
    
    .mobile-user-menu .dropdown-toggle {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        background-color: transparent;
        border: none;
        color: #333;
        font-weight: 500;
    }
    
    .mobile-user-menu .dropdown-toggle::after {
        float: right;
        margin-top: 0.5rem;
    }
    
    .mobile-user-menu .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
        border: none;
        padding-left: 1.5rem;
    }
}

@media (max-width: 576px) {
    .navbar-custom .navbar-brand span {
        font-size: 1.2rem;
    }
    
    .navbar-custom .logo {
        height: 32px;
    }
}

/* 状态指示器 */
.status-indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
}

.status-logged-in {
    background-color: #28a745;
}

.status-logged-out {
    background-color: #dc3545;
}

/* 主要内容包装器 */
.main-wrapper {
    display: flex;
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 20px;
   padding-top: calc(var(--navbar-height) + 20px) !important;
}

/* 侧边栏样式 */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    margin-right: 20px;
    padding: 25px 0;
    height: fit-content;
    position: sticky;
    top: calc(var(--navbar-height) + 20px);
    max-height: calc(100vh - var(--navbar-height) - 40px);
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 25px 25px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), #6a82fb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(78, 115, 223, 0.3);
}

.profile-info h4 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
}

.profile-info p {
    margin: 5px 0 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
}

.role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-top: 5px;
}

.role-student {
    background-color: rgba(78, 115, 223, 0.1);
    color: var(--primary-color);
}

.role-teacher {
    background-color: rgba(28, 200, 138, 0.1);
    color: var(--success-color);
}

.role-admin {
    background-color: rgba(231, 74, 59, 0.1);
    color: var(--danger-color);
}

.sidebar-menu {
    padding: 0;
}

.menu-section {
    margin-bottom: 25px;
}

.menu-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    /*padding: 0 25px;*/
    margin-bottom: 15px;
}

.menu-list {
    list-style: none;
    padding: 0;
}

.menu-item {
    margin-bottom: 5px;
}

.menu-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 25px;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 4px solid transparent;
    position: relative;
}

.menu-link:hover, .menu-link.active {
    background-color: rgba(78, 115, 223, 0.05);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.menu-icon {
    width: 24px;
    text-align: center;
    font-size: 1.1rem;
}

.menu-text {
    font-weight: 500;
    flex: 1;
}

/* 内容区域 */
.content-area {
    flex: 1;
    min-width: 0;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.page-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-actions {
    display: flex;
    gap: 12px;
}

/* 卡片样式 */
.card-custom {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
    background: white;
}

.card-header-custom {
    background-color: white;
    border-bottom: 1px solid var(--border-color);
    padding: 20px 24px;
    border-radius: 12px 12px 0 0;
}

.card-header-custom h5 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body-custom {
    padding: 24px;
}

/* 按钮样式 */
.btn-primary-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary-custom:hover {
    background-color: #3a56c4;
    border-color: #3a56c4;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 115, 223, 0.2);
}

.btn-outline-primary-custom {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: white;
}

.btn-outline-primary-custom:hover {
    background-color: var(--primary-color);
    color: white;
}

.btn-success-custom {
    background-color: var(--success-color);
    border-color: var(--success-color);
    color: white;
}

.btn-success-custom:hover {
    background-color: #17a673;
    border-color: #17a673;
    color: white;
}

.btn-light-custom {
    background-color: var(--three-color);
    border-color: var(--border-color);
    color: var(--text-dark);
}

.btn-danger-custom {
    background-color: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

.btn-danger-custom:hover {
    background-color: #c12e2c;
    border-color: #c12e2c;
    color: white;
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    color: var(--dark-color);
    margin-bottom: 8px;
}

.form-control-custom, .form-select-custom {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control-custom:focus, .form-select-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
    outline: none;
}

/* 信息卡片样式 */
.info-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 24px;
    border-left: 4px solid var(--primary-color);
}

.info-card h6 {
    color: var(--dark-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-card p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* Select2 自定义样式 */
.select2-container--default .select2-selection--multiple {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-height: 46px;
    padding: 3px;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.1);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    color: white;
    padding: 2px 8px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    font-size: 0px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    font-size: 16px;
}

.select2-search__field {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    min-width: 100px;
    height: 28px !important;
    line-height: 28px !important;
    margin: 2px !important;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 16px;
    color: var(--border-color);
}

/* 移动端优化 */
@media (max-width: 992px) {
    .main-wrapper {
        flex-direction: column;
        padding: 15px;
        padding-top: calc(var(--navbar-height) + 15px);
    }
    
    .sidebar {
        width: 100%;
        margin-right: 0;
        margin-bottom: 20px;
        position: static;
        max-height: none;
        top: auto;
    }
    
    .card-body-custom {
        padding: 20px;
    }
    
    .content-area {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .main-wrapper {
        padding-top: calc(var(--navbar-height) + 10px);
    }
    
    .navbar-container {
        padding: 0 10px;
    }
    
    .logo-text .logo-sub {
        display: none;
    }
    
    .logo-main {
        font-size: 1.2rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .page-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .card-body-custom {
        padding: 16px;
    }
    
    .result-summary {
        grid-template-columns: 1fr;
    }
}
 
        /* 状态指示器 */
        .status-indicator {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-left: 8px;
            vertical-align: middle;
        }
        
        .status-logged-in {
            background-color: #28a745;
        }
        
        .status-logged-out {
            background-color: #dc3545;
        }
