/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', serif;
    background: url('https://upload.wikimedia.org/wikipedia/commons/thumb/0/0c/Marauders_Map.png/1200px-Marauders_Map.png') no-repeat center/cover fixed;
    color: #F5F5F5;
    overflow-x: hidden;
    position: relative;
}



/* 魔法粒子效果 */
#magic-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* 顶部Banner */
.banner {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.hogwarts-castle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=Hogwarts%20castle%20at%20night%2C%20with%20lights%20in%20windows%2C%20starry%20sky%2C%20magical%20aura%2C%20detailed%20illustration&image_size=landscape_16_9') no-repeat center/cover;
    filter: brightness(0.7);
    animation: castleLights 10s ease-in-out infinite;
}

@keyframes castleLights {
    0%, 100% {
        filter: brightness(0.7) saturate(1);
    }
    50% {
        filter: brightness(0.8) saturate(1.2);
    }
}

.banner-content {
    position: relative;
    text-align: center;
    z-index: 3;
}

.main-title {
    font-size: 4rem;
    font-weight: bold;
    color: #FFD700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    margin-bottom: 1rem;
    animation: featherWrite 2s ease-out forwards;
    opacity: 0;
}

.subtitle {
    font-size: 1.5rem;
    color: #F5F5F5;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    animation: featherWrite 2s ease-out 0.5s forwards;
    opacity: 0;
}

@keyframes featherWrite {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 导航栏 */
.navbar {
    background-color: rgba(18, 18, 18, 0.9);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.navbar ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

.navbar li {
    margin: 0 2rem;
}

.nav-link {
    color: #F5F5F5;
    text-decoration: none;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 1rem;
    border-radius: 5px;
}

.nav-link:hover {
    color: #FFD700;
    background-color: rgba(255, 215, 0, 0.1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.nav-link.active {
    color: #FFD700;
    background-color: rgba(255, 215, 0, 0.2);
}

/* 学院入口区 */
.学院入口区 {
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(5px);
}

.section-title {
    font-size: 2.5rem;
    color: #FFD700;
    margin-bottom: 3rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.sorting-hat {
    background-color: rgba(139, 69, 19, 0.8);
    color: #FFD700;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    border: 2px solid #8B4513;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.sorting-hat:hover {
    background-color: rgba(139, 69, 19, 1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    transform: translateY(-2px);
}

.学院-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto;
    height: 900px;
}

.学院-card, .公共聊天室-card {
    border-radius: 15px;
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.学院-card::before, .公共聊天室-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.学院-card:hover::before, .公共聊天室-card:hover::before {
    transform: translateX(100%);
}

.学院-card:hover, .公共聊天室-card:hover {
    transform: translateY(-10px) scale(1.05);
}

.学院徽章, .公共聊天室徽章 {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.学院徽章 img, .公共聊天室徽章 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.学院-card:hover .学院徽章 {
    transform: rotate(360deg) scale(1.1);
}

.公共聊天室-card:hover .公共聊天室徽章 {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
}

.学院-card h3, .公共聊天室-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #FFD700;
}

.学院-card p, .公共聊天室-card p {
    font-size: 1rem;
    color: #F5F5F5;
    opacity: 0.8;
}

/* 布局位置 - 三行布局 */
.学院-card[data学院="格兰芬多"] {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    background-color: rgba(116, 0, 1, 0.2);
    border-color: #740001;
    box-shadow: 0 0 20px rgba(116, 0, 1, 0.3);
}

.学院-card[data学院="赫奇帕奇"] {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    background-color: rgba(0, 71, 27, 0.2);
    border-color: #00471B;
    box-shadow: 0 0 20px rgba(0, 71, 27, 0.3);
}

.公共聊天室-card {
    grid-column: 1 / 3;
    grid-row: 2 / 3;
    background-color: rgba(255, 215, 0, 0.1);
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.学院-card[data学院="斯莱特林"] {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
    background-color: rgba(26, 71, 42, 0.2);
    border-color: #1A472A;
    box-shadow: 0 0 20px rgba(26, 71, 42, 0.3);
}

.学院-card[data学院="拉文克劳"] {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    background-color: rgba(14, 26, 64, 0.2);
    border-color: #0E1A40;
    box-shadow: 0 0 20px rgba(14, 26, 64, 0.3);
}

/* 悬停效果 */
.学院-card[data学院="格兰芬多"]:hover {
    box-shadow: 0 10px 30px rgba(116, 0, 1, 0.5);
}

.学院-card[data学院="赫奇帕奇"]:hover {
    box-shadow: 0 10px 30px rgba(0, 71, 27, 0.5);
}

.学院-card[data学院="拉文克劳"]:hover {
    box-shadow: 0 10px 30px rgba(14, 26, 64, 0.5);
}

.学院-card[data学院="斯莱特林"]:hover {
    box-shadow: 0 10px 30px rgba(26, 71, 42, 0.5);
}

.公共聊天室-card:hover {
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

/* 热门话题区 */
.热门话题区 {
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
    background-color: rgba(18, 18, 18, 0.8);
    backdrop-filter: blur(5px);
}

.魔法报纸 {
    background-color: rgba(245, 245, 220, 0.9);
    border-radius: 10px;
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: newspaperFloat 3s ease-in-out infinite;
    position: relative;
}

@keyframes newspaperFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-5px) rotate(0.5deg);
    }
}

.报纸内容 {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.话题-item {
    border-bottom: 1px solid #ccc;
    padding-bottom: 1rem;
    text-align: left;
}

.话题-item:last-child {
    border-bottom: none;
}

.话题-item h4 {
    color: #333;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
}

.话题-item p {
    color: #666;
    font-size: 1rem;
}

/* 页脚 */
.footer {
    background-color: rgba(18, 18, 18, 0.9);
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
    border-top: 1px solid rgba(255, 215, 0, 0.3);
}

.footer p {
    color: #F5F5F5;
    opacity: 0.8;
}

/* 魔法传送门效果 */
#魔法传送门 {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.8) 0%, rgba(138, 43, 226, 0.6) 50%, rgba(0, 0, 0, 0) 100%);
    z-index: 9999;
    transition: all 0.8s ease;
}

#魔法传送门.active {
    width: 100vw;
    height: 100vh;
}

/* 魔法粒子效果 */
.magic-particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFloat 8s ease-in-out infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-50px) scale(1.2);
        opacity: 0.5;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .学院-grid {
        grid-template-columns: 1fr;
        grid-template-rows: repeat(5, auto);
        height: auto;
        gap: 1.5rem;
    }
    
    .公共聊天室-card,
    .学院-card[data学院="格兰芬多"],
    .学院-card[data学院="赫奇帕奇"],
    .学院-card[data学院="拉文克劳"],
    .学院-card[data学院="斯莱特林"] {
        grid-column: 1 / -1;
        grid-row: auto;
    }
    
    .navbar li {
        margin: 0 1rem;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 0.3rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .学院入口区,
    .热门话题区 {
        padding: 2rem 1rem;
    }
    
    .学院-card,
    .公共聊天室-card {
        padding: 1.5rem;
    }
    
    .魔法报纸 {
        padding: 1.5rem;
    }
}
学院-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

学院-card-link:hover .学院-card {
    transform: scale(1.05);
}
