/* 清华大学风格样式重置与基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 清华大学紫色主题色 */
:root {
    --tsinghua-purple: #7b1fa2;
    --tsinghua-purple-light: #9c27b0;
    --tsinghua-purple-dark: #4a0072;
    --tsinghua-gray: #f5f5f5;
    --tsinghua-gray-dark: #757575;
    --tsinghua-white: #ffffff;
    --tsinghua-border: #e0e0e0;
}

/* 顶部导航栏样式 */
.tsinghua-header {
    background: linear-gradient(135deg, var(--tsinghua-purple), var(--tsinghua-purple-light));
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    width: 100%;
    margin: 0;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.brand-logo {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.logo-text {
    background: linear-gradient(45deg, #fff, #e0e0e0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 300;
}

.header-nav {
    display: flex;
    gap: 2rem;
}

.nav-item {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* 顶部透明导航栏 */
.transparent-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.transparent-header .header-container {
    width: 100%;
    margin: 0;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.transparent-header .brand-logo {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.transparent-header .header-nav {
    display: flex;
    gap: 2rem;
}

.transparent-header .nav-item {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.transparent-header .nav-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* 主内容区域 */
.tsinghua-main {
    min-height: 100vh;
}

/* 轮播图区域 */
.hero-banner {
    background: var(--tsinghua-gray);
    padding: 0;
    position: relative;
    width: 100%;
}

.banner-container {
    width: 100%;
    margin: 0;
    padding: 0;
}

.carousel-wrapper {
    position: relative;
    height: 100vh;
    overflow: hidden;
    width: 100%;
}

.carousel-slides {
    height: 100%;
    position: relative;
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #7b1fa2;
}

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

.carousel-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    opacity: 0;
    pointer-events: none; /* 默认禁止点击 */
    transition: opacity 0.5s ease;
}

.carousel-slide-link.is-active {
    opacity: 1;
    pointer-events: auto; /* 活动时允许点击 */
}

.carousel-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: transparent;
    padding: 0.5rem 1rem;
    border-radius: 25px;
}

.carousel-btn {
    background: rgba(255,255,255,0.3);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.carousel-btn:hover {
    background: rgba(255,255,255,0.5);
    transform: scale(1.1);
}

.carousel-dots {
    display: flex;
    gap: 0.5rem;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--tsinghua-purple);
    width: 10px;
    height: 10px;
    box-shadow: 0 0 10px rgba(123, 31, 162, 0.8);
}

.carousel-dot:hover {
    transform: scale(1.3);
}

.carousel-title {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 500;
    max-width: 80%;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* 内容区域通用样式 */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 20px;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    color: var(--tsinghua-purple); /* 模块大标题使用紫色 */
    margin-bottom: 1rem;
    font-weight: 600;
}

.title-icon {
    margin-right: 0.5rem;
    font-size: 2rem;
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--tsinghua-gray-dark);
    font-weight: 300;
}

/* 通知公告区域 */
.news-section {
    background: var(--tsinghua-white);
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.news-item {
    background: var(--tsinghua-white);
    border: 1px solid var(--tsinghua-border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: var(--tsinghua-purple-light);
}

.news-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #000; /* 改为黑色 */
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.news-body {
    color: var(--tsinghua-gray-dark);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.news-meta {
    font-size: 0.9rem;
    color: #999;
    border-top: 1px solid var(--tsinghua-border);
    padding-top: 1rem;
}

/* 案例展示区域 */
.projects-section {
    background: var(--tsinghua-gray);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--tsinghua-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.project-media {
    height: 200px;
    overflow: hidden;
    background-color: #7b1fa2;
}

.project-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    background-color: #7b1fa2;
}

.project-card:hover .project-media img {
    transform: scale(1.05);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #000; /* 改为黑色 */
    margin-bottom: 0.5rem;
}

.project-meta {
    font-size: 0.9rem;
    color: var(--tsinghua-gray-dark);
    margin-bottom: 1rem;
}

.project-body {
    color: #666;
    line-height: 1.6;
}

/* 快速链接区域 */
.quick-links {
    background: var(--tsinghua-white);
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.link-card {
    background: var(--tsinghua-purple);
    color: white;
    padding: 2rem;
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(123, 31, 162, 0.3);
}

.link-card:hover {
    background: var(--tsinghua-purple-light);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(123, 31, 162, 0.4);
}

.link-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.link-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.link-card p {
    opacity: 0.9;
    font-weight: 300;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--tsinghua-gray-dark);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--tsinghua-gray);
    border-top: 4px solid var(--tsinghua-purple);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--tsinghua-gray-dark);
}

.empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.error-state {
    text-align: center;
    padding: 3rem;
    color: #d32f2f;
    background: #ffebee;
    border-radius: 8px;
    margin: 1rem 0;
}

/* 页脚样式 */
.tsinghua-footer {
    background: var(--tsinghua-purple-dark);
    color: white;
    padding: 3rem 0 2rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.footer-info p {
    opacity: 0.8;
    font-weight: 300;
}

.footer-contact p {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-nav {
        gap: 1rem;
    }
    
    .carousel-wrapper {
        height: 300px;
    }
    
    .section-container {
        padding: 2rem 20px;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .news-grid,
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.6s ease-in;
}

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

.slide-in {
    animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}