/* style.css - Opus on Swain V2 */

:root {
    --primary-bg: #121212;      /* 深黑色 */
    --secondary-bg: #ffffff;    /* 白色 */
    --accent-color: #d4af37;    /* 香槟金 */
    --text-dark: #333333;       /* 深灰文字 */
    --text-light: #f4f4f4;      /* 浅白文字 */
    --gray-bg: #f9f9f9;         /* 浅灰背景 */
}

html { scroll-behavior: smooth; }
body { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; margin: 0; padding: 0; line-height: 1.7; color: var(--text-dark); background-color: var(--secondary-bg); }
h1, h2, h3, h4 { font-family: 'Georgia', 'Times New Roman', serif; font-weight: normal; }
a { text-decoration: none; transition: all 0.3s ease; color: inherit; }
section { padding: 80px 8%; } /* 稍微减少左右padding，留给内容 */

/* --- 导航栏 --- */
nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 5%; background: rgba(255, 255, 255, 0.98); box-shadow: 0 2px 10px rgba(0,0,0,0.05); position: sticky; top: 0; z-index: 1000; }
.logo { font-family: 'Georgia', serif; font-size: 1.4rem; font-weight: bold; letter-spacing: 1px; color: var(--primary-bg); border: 2px solid var(--primary-bg); padding: 5px 15px; }
.nav-links a { color: var(--text-dark); margin-left: 30px; font-size: 0.9rem; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }
.nav-links a:hover, .nav-links a.active { color: var(--accent-color); }

/* --- 按钮与通用组件 --- */
.btn { display: inline-block; padding: 12px 30px; background-color: var(--accent-color); color: white; border-radius: 2px; letter-spacing: 1px; font-size: 0.9rem; border: 1px solid var(--accent-color); cursor: pointer;}
.btn:hover { background-color: transparent; color: var(--accent-color); }
.btn-small { padding: 8px 20px; font-size: 0.8rem; border: 1px solid var(--text-dark); color: var(--text-dark); }
.btn-small:hover { background: var(--text-dark); color: white; }
.divider { width: 60px; height: 3px; background-color: var(--accent-color); margin: 15px auto 30px auto; }
.section-header { text-align: center; margin-bottom: 70px; } /* 增加底部距离 */
.section-header h2 { font-size: 2.5rem; margin-bottom: 5px; }

/* --- 首页 Hero --- */
header { height: 85vh; background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1552422535-c45813c61732?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80'); background-size: cover; background-position: center; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; color: var(--text-light); }
header h1 { font-size: 4rem; margin: 0; letter-spacing: 2px; }
header .subtitle { font-size: 1.2rem; font-weight: 300; letter-spacing: 4px; margin-top: 10px; text-transform: uppercase; color: var(--accent-color); }
header .cta-group { margin-top: 40px; }

/* --- Bio 页面 --- */
.bio-full-container { max-width: 1000px; margin: 0 auto; }
.bio-profile { display: flex; gap: 50px; margin-bottom: 80px; align-items: flex-start; }
.bio-img { flex: 1; border-radius: 4px; overflow: hidden; box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.bio-img img { width: 100%; height: auto; display: block; }
.bio-text { flex: 2; }
.bio-text h3 { font-size: 2.5rem; margin-top: 0; margin-bottom: 10px; color: var(--primary-bg); }
.bio-title { color: var(--accent-color); font-size: 1.1rem; font-weight: bold; margin-bottom: 20px; display: block; text-transform: uppercase; }

/* --- 学生页面 (已优化：更加宽松) --- */
.student-grid { 
    display: grid; 
    /* 增加 minmax 的宽度到 280px，这样一行显示的卡片会变少，更宽松 */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 50px; /* 增加卡片之间的间距 */
    max-width: 1200px; /* 限制最大宽度，防止在大屏幕上太散 */
    margin: 0 auto; 
}
.student-card { background: #fff; border: 1px solid #eee; border-radius: 8px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.03); transition: transform 0.3s; }
.student-card:hover { transform: translateY(-8px); box-shadow: 0 15px 30px rgba(0,0,0,0.08); }
.student-photo { height: 260px; /* 照片稍微调高一点 */ overflow: hidden; }
.student-photo img { width: 100%; height: 100%; object-fit: cover; }
.student-info { padding: 30px 25px; /* 增加内部填充 */ text-align: center; }
.student-name { font-family: 'Georgia', serif; font-size: 1.4rem; margin: 0 0 5px 0; color: var(--primary-bg); }
.student-level { font-size: 0.85rem; color: var(--accent-color); font-weight: bold; text-transform: uppercase; margin-bottom: 15px; display: block; }
.student-bio { font-size: 0.95rem; color: #666; }

/* --- Policy 页面样式 --- */
.policy-container { max-width: 800px; margin: 0 auto; }
.policy-block { margin-bottom: 50px; padding-bottom: 30px; border-bottom: 1px solid #eee; }
.policy-block:last-child { border-bottom: none; }
.policy-block h3 { color: var(--primary-bg); font-size: 1.6rem; margin-bottom: 20px; }
.policy-list { padding-left: 20px; }
.policy-list li { margin-bottom: 12px; color: #555; }
.tuition-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.tuition-table th, .tuition-table td { text-align: left; padding: 15px; border-bottom: 1px solid #eee; }
.tuition-table th { color: var(--accent-color); font-weight: normal; font-family: 'Georgia', serif; font-size: 1.1rem; }

/* --- Gallery 页面样式 --- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 40px; max-width: 1200px; margin: 0 auto; }
.video-card { background: white; border-radius: 4px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.video-wrapper { position: relative; padding-bottom: 56.25%; /* 16:9 Aspect Ratio */ height: 0; overflow: hidden; }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.video-info { padding: 20px; }
.video-title { font-weight: bold; font-size: 1.1rem; margin-bottom: 5px; display: block; }
.video-desc { font-size: 0.9rem; color: #777; }

/* --- 首页组件 --- */
.events-container { max-width: 900px; margin: 0 auto 60px auto; }
.event-card { display: flex; justify-content: space-between; align-items: center; background: white; border: 1px solid #eee; padding: 25px; margin-bottom: 20px; border-left: 5px solid var(--accent-color); box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.event-date { text-align: center; min-width: 80px; color: var(--accent-color); }
.event-date .day { font-size: 2rem; font-weight: bold; line-height: 1; display: block; }
.event-info { flex-grow: 1; padding: 0 30px; }
.event-info h4 { margin: 0 0 5px 0; font-size: 1.3rem; }
.calendar-wrapper { max-width: 900px; margin: 0 auto; text-align: center; }
.calendar-frame { width: 100%; height: 600px; border: none; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
footer { background-color: var(--primary-bg); color: var(--text-light); text-align: center; padding: 60px 20px; margin-top: 50px; }
.contact-info p { margin: 5px 0; }

/* --- 移动端 --- */
@media (max-width: 768px) {
    header h1 { font-size: 2.5rem; }
    .bio-profile { flex-direction: column; }
    .event-card { flex-direction: column; text-align: center; gap: 15px; }
    .nav-links { display: none; } /* 手机端简化处理：隐藏菜单 */
    .logo { margin: 0 auto; }
    .gallery-grid { grid-template-columns: 1fr; }
}

/* --- Modal (弹窗) 样式 --- */
.modal-overlay {
    display: none; /* 默认隐藏 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8); /* 深色半透明背景 */
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #fff;
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* 防止超出屏幕高度 */
}

.modal-header {
    background-color: var(--primary-bg);
    color: var(--secondary-bg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.modal-header img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--accent-color);
    object-fit: cover;
}

.modal-header-text h3 {
    margin: 0;
    font-size: 1.8rem;
    color: #fff;
}

.modal-header-text span {
    color: var(--accent-color);
    font-size: 1rem;
    font-weight: bold;
}

.modal-body {
    padding: 30px;
    overflow-y: auto; /* 内容太长时可滚动 */
    line-height: 1.8;
    color: #444;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--accent-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 让鼠标放上去时显示可点击 */
.student-card {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

/* --- 移动端适配 (Responsive Design) --- */

/* 默认隐藏汉堡按钮 */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: 0.3s;
}

/* 当屏幕宽度小于 768px (手机/平板) 时应用 */
@media screen and (max-width: 768px) {
    
    /* 1. 调整整体内边距，防止手机上字太靠边 */
    section {
        padding: 40px 5%; 
    }
    
    h1 { font-size: 2.5rem; } /* 标题稍微改小一点 */

    /* 2. 显示汉堡按钮 */
    .hamburger {
        display: flex;
    }

    /* 3. 改造导航链接区域 */
    .nav-links {
        display: none; /* 默认隐藏 */
        position: absolute;
        top: 100%; /* 在导航栏正下方 */
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.98);
        flex-direction: column; /* 垂直排列 */
        align-items: center;
        padding: 20px 0;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
    }

    .nav-links a {
        margin: 15px 0; /* 增加垂直间距 */
        font-size: 1.1rem;
        display: block;
        width: 100%;
        text-align: center;
    }

    /* 当添加了 .active 类时，显示菜单 */
    .nav-links.active {
        display: flex;
    }
    
    /* 4. 修复学生卡片在手机上的显示 (变为一列) */
    .student-grid, .gallery-grid, .bio-full-container {
        grid-template-columns: 1fr; /* 强制单列 */
    }
    
    .event-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .event-info {
        padding: 0;
        border: none;
    }
}