/**
 * 考试管理系统统一布局样式
 * 适用于所有使用 student_top_bar 组件的页面
 */

/* ==================== 页面基础样式 ==================== */
html, body {
    background-color: #EEF3F5 !important;
}

body.sticky-header {
    background-color: #EEF3F5 !important;
}

section {
    background-color: #EEF3F5 !important;
}

/* ==================== 主内容区域 ==================== */
.main-content {
    background-color: #EEF3F5 !important;
    margin-left: 180px !important;
    width: calc(100% - 180px) !important;
    margin-top: 60px !important;
}

/* 提高选择器优先级 */
section .main-content {
    margin-left: 180px !important;
    width: calc(100% - 180px) !important;
}

.main-content #page-wrapper {
    padding-left: 30px !important;
    padding-right: 30px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.main-content #page-wrapper .panel {
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100% !important;
    padding-left: 30px !important;
    padding-right: 30px !important;
}

.main-content #page-wrapper .panel .panel-body {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ==================== 左侧菜单样式 ==================== */
.left-side {
    top: 60px !important;
    height: calc(100vh - 60px) !important;
}

/* ==================== 表格样式 ==================== */
/* 表格宽度100%,移除所有边框 - 使用最强选择器 */
html body section .main-content #page-wrapper .panel .panel-body .table.table-striped,
html body section .main-content #page-wrapper .panel .panel-body table.table.table-striped {
    width: 100% !important;
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-collapse: collapse !important;
}

/* 移除表格所有单元格的边框 */
html body section .main-content #page-wrapper .panel .panel-body .table.table-striped thead tr th,
html body section .main-content #page-wrapper .panel .panel-body .table.table-striped tbody tr td,
html body section .main-content #page-wrapper .panel .panel-body table.table.table-striped thead tr th,
html body section .main-content #page-wrapper .panel .panel-body table.table.table-striped tbody tr td {
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

/* 确保表格行背景覆盖完整宽度,移除行的边框 */
html body section .main-content #page-wrapper .panel .panel-body .table.table-striped tbody tr {
    width: 100% !important;
    border: none !important;
}

/* 去掉表格第一行的背景色 */
html body section .main-content #page-wrapper .panel .panel-body .table.table-striped thead tr.warning {
    background-color: transparent !important;
    border: none !important;
}

html body section .main-content #page-wrapper .panel .panel-body .table.table-striped thead tr.warning th {
    background-color: transparent !important;
    border: none !important;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .main-content #page-wrapper {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .main-content #page-wrapper .panel {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* 移动端表格调整 */
    html body section .main-content #page-wrapper .panel .panel-body .table.table-striped,
    html body section .main-content #page-wrapper .panel .panel-body table.table.table-striped {
        width: 100% !important;
        border: none !important;
    }
    
    html body section .main-content #page-wrapper .panel .panel-body .table.table-striped thead tr th,
    html body section .main-content #page-wrapper .panel .panel-body .table.table-striped tbody tr td {
        border: none !important;
    }
}

/* ==================== 顶部导航栏样式 ==================== */
.header-section {
    padding: 0 20px 0 0 !important;
    margin: 0 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 1000 !important;
    background: #fff !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1) !important;
}

.top-navigation {
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 20px;
    width: 100%;
}

.site-logo {
    flex-shrink: 0;
    margin: 0 50px 0 10px;
}

.site-logo img {
    display: block;
    width: auto;
    height: 50px;
}

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-menu li {
    position: relative;
}

.nav-menu li a {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 20px 12px;
    height: 100%;
    color: #000;
    text-decoration: none;
    font-size: 15px;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-menu li a:hover {
    background-color: #f5f9f9;
    color: #2D95FB;
    height: 100%;
    box-sizing: border-box;
    border-bottom: 3px solid #2D95FB;
}

.nav-menu li.active a {
    background-color: #f5f9f9;
    color: #2D95FB;
    height: 100%;
    box-sizing: border-box;
    border-bottom: 3px solid #2D95FB;
}

.nav-menu li.nav-active a {
    background-color: #f5f9f9;
    color: #2D95FB;
    font-weight: 500;
    height: 100%;
    box-sizing: border-box;
    border-bottom: 3px solid #2D95FB;
}

.nav-menu li a i {
    font-size: 16px;
}

.user-info-display {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #000;
    font-size: 14px;
    height: 32px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
    margin-left: auto;
}

.dropdown-menu.drp-mnu {
    border: none;
    border-radius: 0;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    padding: 15px 0;
    margin-top: 0px;
    min-width: 240px !important;
    background: white;
    animation: slideDown 0.3s ease;
    display: none;
}

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

.dropdown-menu.drp-mnu li {
    margin: 0;
}

.dropdown-menu.drp-mnu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.dropdown-menu.drp-mnu li a:hover {
    background-color: #f5f9f9;
    color: #2D95FB;
}

.dropdown-menu.drp-mnu li a:active,
.dropdown-menu.drp-mnu li a:focus {
    background-color: #f5f9f9;
    color: #2D95FB;
}

.dropdown-menu.drp-mnu li a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.dropdown-menu.drp-mnu li:not(:last-child) {
    border-bottom: 1px solid #f0f0f0;
}

.profile_img {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    background: none;
    color: #4d94ff;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    height: 35px;
    justify-content: center;
    font-size: 14px;
    text-decoration: none;
    border: none;
}

.profile_img span {
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #000;
}

.profile_img::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #4d94ff;
    margin-left: 5px;
    vertical-align: middle;
}

.login-link a {
    padding: 8px 20px;
    background-color: #4d94ff;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    transition: background-color 0.3s ease;
}

.login-link a:hover {
    background-color: #66B1FF;
}

/* 顶部导航栏 - 移动端响应式 */
@media (max-width: 768px) {
    .header-section {
        padding: 0 !important;
    }

    .top-navigation {
        flex-wrap: wrap;
        height: auto;
        min-height: 50px;
        padding: 8px 15px;
        gap: 8px;
    }
    
    .site-logo {
        order: 1;
        margin-right: 0;
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    
    .site-logo img:first-child {
        height: 36px;
    }
    
    .site-logo img:last-child {
        height: 24px;
        margin-top: 6px;
    }
    
    .nav-menu {
        order: 2;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    
    .nav-menu li a {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .nav-menu li.nav-active a {
        background-color: #8BC34A;
        color: white;
        font-weight: 500;
    }
    
    .user-actions {
        order: 3;
        gap: 8px;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .user-info-display {
        order: 1;
        height: auto;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
        width: 100%;
        padding: 4px 0;
        font-size: 12px;
    }
    
    .user-info-display span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
        display: inline-block;
    }
    
    .profile_img {
        order: 2;
        padding: 6px 10px;
        font-size: 12px;
        line-height: 1;
        width: auto;
        min-width: 90px;
        max-width: 130px;
        height: 32px;
        justify-content: center;
        align-items: center;
        border-radius: 18px;
        gap: 5px;
    }
    
    .profile_img span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        max-width: 100px;
        font-size: 12px;
    }

    .dropdown-menu.drp-mnu {
        min-width: 160px;
        margin-top: 5px;
        border-radius: 0;
        padding: 10px 0;
    }
    
    .dropdown-menu.drp-mnu li a {
        padding: 10px 18px;
        font-size: 13px;
    }
}
