/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    color: #343A40;
    background-color: var(--light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    padding-right: 1rem;
    padding-left: 1rem;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 640px) {
    .container { max-width: 640px; }
}

@media (min-width: 768px) {
    .container { max-width: 768px; }
}

@media (min-width: 1024px) {
    .container { max-width: 1024px; }
}

@media (min-width: 1280px) {
    .container { max-width: 1280px; }
}

/* 颜色变量 */
:root {
    --primary: #0F3460;      /* 深蓝主色 */
    --secondary: #FF7A00;    /* 橙色辅助色 */
    --light: #F5F7FA;        /* 浅色背景 */
    --gray-50: #F8F9FA;
    --gray-300: #DEE2E6;
    --gray-600: #6C757D;
    --gray-800: #343A40;
}

/* 核心动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 平滑滚动 */
html { scroll-behavior: smooth; }

/* 解决导航栏遮挡锚点内容的关键样式 */
section[id] {
    scroll-margin-top: 80px; /* 预留导航栏高度的空间 */
}

/* 导航栏样式 */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    transition: all 300ms ease;
    background-color: transparent;
    padding: 1.25rem 0;
}

.navbar-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    white-space: nowrap;
}

.logo-img {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.desktop-nav {
    display: none;
    gap: 2rem;
}

@media (min-width: 992px) {
    .desktop-nav { display: flex; }
    #navbar .container { max-width: 1280px; }
}

.desktop-nav a {
    color: white;
    font-weight: 500;
    font-size: 1.15rem;
    transition: color 300ms ease;
}

.desktop-nav a:hover {
    color: var(--secondary);
    text-decoration: underline;
    text-underline-offset: 4px;
}

.mobile-menu-btn {
    display: block;
    color: white;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    margin-right: auto;
    padding: 0.3rem;
}

@media (max-width: 991px) {
    .navbar-container { gap: 1rem; }
    .logo-img { width: 2.5rem; height: 2.5rem; }
}

@media (min-width: 992px) {
    .mobile-menu-btn { display: none; }
}

.mobile-menu {
    display: none;
    background-color: rgba(15, 52, 96, 0.98);
    padding: 1.2rem 0;
    animation: fadeIn 0.3s ease-in-out;
    margin-top: 0.8rem;
    border-radius: 0.5rem;
}

.mobile-menu.active { display: block; }

.mobile-menu nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-menu a {
    color: white;
    padding: 0.8rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: color 300ms ease, padding-left 300ms ease;
    font-size: 1.1rem;
}

.mobile-menu a:last-child { border-bottom: none; }
.mobile-menu a:hover { color: var(--secondary); padding-left: 1rem; }

/* 导航栏滚动效果 */
.nav-scrolled {
    background-color: rgba(15, 52, 96, 0.95) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* 英雄区样式 */
.hero {
    position: relative;
    height: 100vh;
    overflow: hidden;
    padding-top: 6rem;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* 桌面端背景图 */
    background: url('./img/yxpc.jpg') center/cover no-repeat;
}

/* 关键修改：添加移动端媒体查询以更换壁纸 */
@media (max-width: 767px) {
    .hero-bg {
        /* 移动端背景图，请确保路径正确 */
        background-image: url('./img/mobile-bg.jpg');
    }
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 52, 96, 0.5);
}

@media (min-width: 768px) {
    .hero-overlay { background-color: rgba(15, 52, 96, 0.4); }
}

.hero-content {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 1rem;
    color: white;
    animation: fadeIn 0.8s ease-in-out;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    max-width: 600px;
    margin-bottom: 2.5rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    animation: bounce 1s infinite;
    font-size: 1.875rem;
}

/* 学校历史板块 - 左右布局时间线 */
.history-section {
    padding: 4rem 0;
    background-color: white;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 1rem;
    animation: slideIn 0.6s ease-out;
}

.section-desc {
    color: var(--gray-600);
    max-width: 700px;
    margin: 0 auto;
}

/* 左右布局时间线核心样式 */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* 中间主线 */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    background-color: var(--gray-300);
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
    width: 50%;
    opacity: 0;
    animation: fadeIn 0.6s ease-out forwards;
}

/* 奇数项居左，偶数项居右 */
.timeline-item:nth-child(odd) {
    left: 0;
    padding-right: 2rem;
    animation-delay: 0.2s;
}

.timeline-item:nth-child(even) {
    left: 50%;
    padding-left: 2rem;
    animation-delay: 0.4s;
}

/* 时间点样式 */
.timeline-dot {
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: var(--secondary);
    border: 4px solid white;
    box-shadow: 0 0 0 4px rgba(255, 122, 0, 0.1);
    z-index: 10;
    top: 0;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -0.75rem;
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -0.75rem;
}

/* 日期样式 */
.timeline-date {
    font-weight: bold;
    color: var(--secondary);
    background-color: rgba(255, 122, 0, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    display: inline-block;
    margin-bottom: 0.75rem;
}

/* 内容卡片 */
.timeline-content {
    background-color: var(--gray-50);
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

.timeline-title {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
}

.timeline-desc {
    color: var(--gray-600);
    font-size: 1rem;
    line-height: 1.7;
}

/* 移动端时间线堆叠布局 */
@media (max-width: 767px) {
    .timeline::before {
        left: 1.5rem;
    }
    
    .timeline-item {
        width: 100%;
        left: 0 !important;
        padding-left: 3.5rem !important;
        padding-right: 0 !important;
    }
    
    .timeline-item .timeline-dot {
        left: 1.5rem !important;
        right: auto !important;
        transform: translateX(-50%);
    }
}

/* 学校地图板块 */
.map-section {
    padding: 4rem 0;
    background-color: var(--light);
}

.map-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.map-image {
    width: 100%;
    height: auto;
    border-radius: 0.75rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.map-image:hover { transform: scale(1.02); }

.map-location {
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-top: 20px;
}

.map-location h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.map-features { 
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.map-features h4 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.map-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
}

.map-feature-icon {
    color: var(--secondary);
    margin-top: 0.25rem;
}

/* 地图详情布局调整 */
.map-details {
    margin-top: 1rem;
}

@media (min-width: 768px) {
    .map-details {
        display: flex;
        gap: 2rem;
    }
    
    .map-features, .map-location {
        flex: 1;
        margin-top: 0;
    }
}

/* 公交路线板块 - 紧凑布局 */
.bus-routes-section {
    padding: 4rem 0;
    background-color: white;
}

.bus-routes-container {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.bus-route-card {
    background-color: var(--gray-50);
    border-radius: 0.75rem;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    align-items: center;
}

.bus-route-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.bus-number {
    background-color: var(--primary);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 2rem;
    font-weight: bold;
    font-size: 1.2rem;
}

/* 校园墙板块 */
.campus-wall-section {
    padding: 3rem 0;
    background-color: white;
    text-align: center;
}

.campus-wall-link {
    display: inline-block;
    background-color: var(--secondary);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.campus-wall-link:hover {
    background-color: #e06a00;
    transform: translateY(-3px);
}

/* 学校社团板块 */
.clubs-section {
    padding: 4rem 0;
    background-color: var(--light);
}

.clubs-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.club-card {
    background-color: var(--gray-50);
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.club-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.club-name {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.1rem;
}

/* 页脚样式 */
.footer {
    background-color: var(--primary);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}
/* 系部介绍板块样式 */
.departments-section {
    padding: 4rem 0;
    background-color: var(--light);
}

.departments-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.department-card {
    background-color: white;
    border-radius: 0.75rem;
    padding: 1.8rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.department-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.department-name {
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary);
}

.department-desc {
    color: var(--gray-600);
    line-height: 1.7;
}

.icon-bars::before { content: '☰'; font-size: 1.5rem; }
.icon-times::before { content: '✕'; font-size: 1.5rem; }
.icon-angle-down::before { content: '▼'; }
.icon-map-marker::before { content: '📍'; }
.icon-clock::before { content: '⏰'; }