/* 全局样式 */
:root {
    --primary-color: #1e88e5; /* 主要蓝色 */
    --secondary-color: #64b5f6; /* 次要蓝色 */
    --accent-color: #0d47a1; /* 强调蓝色 */
    --light-color: #e3f2fd; /* 浅蓝色 */
    --white-color: #ffffff; /* 白色 */
    --gray-color: #f5f5f5; /* 灰色 */
    --text-color: #333333; /* 文本颜色 */
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    --transition: all 0.3s ease; /* 过渡效果 */
}

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

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    color: var(--text-color);
    background-color: var(--gray-color);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 加载动画 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(30, 136, 229, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 头部样式 */
.header {
    background-color: var(--white-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-img {
    height: 40px;
    margin-right: 10px;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.nav-list {
    display: flex;
}

.nav-item {
    margin: 0 15px;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after, .nav-link.active::after {
    width: 100%;
}

.ai-btn {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.ai-btn i {
    margin-right: 5px;
}

.ai-btn:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 2px 0;
    transition: var(--transition);
}

/* 主要内容区域 */
.main {
    padding: 20px 0;
}

/* 轮播图区域 */
.banner-section {
    margin-bottom: 30px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.banner-slider {
    position: relative;
    height: 400px;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.banner-slide.active {
    opacity: 1;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    color: var(--white-color);
}

.banner-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease 0.2s;
}

.banner-content p {
    font-size: 1.1rem;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s ease 0.4s;
}

.banner-slide.active .banner-content h2,
.banner-slide.active .banner-content p {
    transform: translateY(0);
    opacity: 1;
}

.banner-dots {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    cursor: pointer;
    transition: var(--transition);
}

.dot.active {
    background-color: var(--white-color);
    transform: scale(1.2);
}

/* 通知区域 */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.5rem;
    color: var(--primary-color);
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.section-date {
    color: var(--text-color);
    font-size: 0.9rem;
}

.notification-section, .news-section {
    background-color: var(--white-color);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.5s ease;
}

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

.tab-header {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    font-size: 1rem;
    color: var(--text-color);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 500;
}

.tab-btn.active::after {
    width: 100%;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 学生名单容器 - 限制最大高度并支持滚动 */
.notification-tabs .tab-content {
    max-height: 320px; /* 根据每条的高度和 5 条计算 */
    overflow: hidden; /* 隐藏滚动条 */
    position: relative;
}

/* 学生列表容器 - 用于动画 */
.student-list-wrapper {
    max-height: 320px; /* 固定最大高度 */
    height: 320px; /* 明确设置高度 */
    overflow-y: auto; /* 允许垂直滚动 */
    overflow-x: hidden; /* 隐藏水平滚动条 */
    position: relative;
}

/* 隐藏滚动条但保留滚动功能 */
.student-list-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.student-list-wrapper {
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.student-list {
    padding: 10px 0;
}

.student-list li {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

/* 学生内容区域 - 限制最大宽度，超出换行 */
.student-content {
    max-width: 62%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.4;
    margin-left: auto;
    padding-left: 15px;
    flex-shrink: 0;
}

.student-list li:last-child {
    border-bottom: none;
}

.student-list li:hover {
    background-color: var(--light-color);
}

.student-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    /* background-color: var(--secondary-color); */
    color: var(--white-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
    font-size: 1.2rem;
    /* 支持背景图片 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 确保有背景图片时文字隐藏 */
.student-avatar[style*="background-image"] {
    color: transparent;
}

.student-info {
    flex: 1;
}

.student-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.student-class {
    font-size: 0.85rem;
    color: #666;
}

.student-reason {
    font-size: 0.9rem;
    color: #444;
    margin-top: 5px;
}

/* 展示数量提示信息样式 */
.display-tip {
    padding: 12px 15px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
    background-color: rgba(30, 136, 229, 0.05);
    border-top: 1px dashed #ddd;
    font-style: italic;
}

/* 新闻区域 */
.more-link {
    color: var(--primary-color);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.more-link i {
    margin-left: 5px;
    transition: var(--transition);
}

.more-link:hover {
    color: var(--accent-color);
}

.more-link:hover i {
    transform: translateX(3px);
}

.news-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.news-card {
    background-color: var(--white-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.news-image {
    height: 180px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-image img {
    transform: scale(1.05);
}

.news-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text-color);
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-excerpt {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
}

.news-date {
    display: flex;
    align-items: center;
}

.news-date i {
    margin-right: 5px;
}

/* AI助手样式 */
.ai-assistant {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    background-color: var(--white-color);
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    display: none;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.ai-assistant.active {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.ai-header {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-header h3 {
    font-size: 1.1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.ai-header h3 i {
    margin-right: 8px;
}

.close-btn {
    background: none;
    border: none;
    color: var(--white-color);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    transform: scale(1.1);
}

.ai-body {
    height: 400px;
    display: flex;
    flex-direction: column;
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.ai-message {
    display: flex;
    margin-bottom: 15px;
}

.ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--light-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.user-avatar {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.message-content {
    background-color: var(--light-color);
    padding: 10px 15px;
    border-radius: 18px;
    border-top-left-radius: 5px;
    max-width: 80%;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 18px;
    border-top-right-radius: 5px;
}

.ai-input {
    display: flex;
    padding: 10px 15px;
    border-top: 1px solid #eee;
}

.ai-input input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
}

.ai-input input:focus {
    border-color: var(--primary-color);
}

.ai-input button {
    background-color: var(--primary-color);
    color: var(--white-color);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    transition: var(--transition);
}

.ai-input button:hover {
    background-color: var(--accent-color);
    transform: scale(1.05);
}

/* 遮罩层 */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.overlay.active {
    display: block;
    opacity: 1;
}

/* 页脚样式 */
.footer {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-logo {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.footer-logo img {
    height: 40px;
    margin-right: 10px;
    filter: brightness(0) invert(1);
}

.footer-logo h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.footer-info p {
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer-links h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links ul li a:hover {
    opacity: 0.8;
    padding-left: 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .banner-slider {
        height: 350px;
    }
    
    .banner-content h2 {
        font-size: 1.8rem;
    }
    
    .news-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header .container {
        height: 60px;
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .nav {
        position: fixed;
        top: 60px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 60px);
        background-color: var(--white-color);
        box-shadow: var(--shadow);
        transition: var(--transition);
        z-index: 100;
    }
    
    .nav.active {
        left: 0;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 20px;
    }
    
    .nav-item {
        margin: 10px 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    .banner-slider {
        height: 300px;
    }
    
    .banner-content h2 {
        font-size: 1.5rem;
    }
    
    .banner-content p {
        font-size: 1rem;
    }
    
    .news-container {
        grid-template-columns: 1fr;
    }
    
    .ai-assistant {
        width: 90%;
        max-width: 350px;
    }
}

@media (max-width: 576px) {
    .logo-img {
        height: 30px;
    }
    
    .logo h1 {
        font-size: 1.1rem;
    }
    
    .ai-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .banner-slider {
        height: 250px;
    }
    
    .banner-content h2 {
        font-size: 1.3rem;
    }
    
    .banner-content p {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .tab-btn {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
}