/* 全局样式 */
:root {
    --primary-color: #9370DB; /* 紫苑色 */
    --secondary-color: #483D8B; /* 深岩色 */
    --light-color: #ffffff; /* 白色 */
    --text-color: #333333;
    --border-color: #e0e0e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-color);
    overflow: hidden; /* 防止页面滚动 */
    transition: background-color 0.5s ease;
}

/* 粒子背景效果 */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: -1;
    background: linear-gradient(135deg, #f5f0ff, #e6e0ff);
}

/* 鼠标拖尾效果 */
.cursor-trail {
    position: fixed;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: rgba(147, 112, 219, 0.8);
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease-out;
    box-shadow: 0 0 12px rgba(147, 112, 219, 0.9);
    backdrop-filter: blur(2px);
}

/* 点击特效 */
.click-effect {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: rgba(147, 112, 219, 0.7);
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%) scale(0);
    animation: clickEffect 0.6s ease-out forwards;
    box-shadow: 0 0 10px rgba(147, 112, 219, 0.8);
}

@keyframes clickEffect {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(3);
        opacity: 0;
    }
}

/* 页面加载动画 */
.page-loading {
    opacity: 0;
    animation: pageFadeIn 1s ease-out forwards;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-color);
    padding: 0.3rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

header h1 {
    font-size: 1.2rem;
    margin: 0 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

nav ul li {
    margin: 0 0.5rem;
}

nav ul li a {
    color: var(--light-color);
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    position: relative;
    display: block;
}

nav ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.5s;
    opacity: 0;
}

nav ul li a:hover::before {
    opacity: 1;
    transform: translateX(100%);
}

nav ul li a:hover,
nav ul li a.active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 页面切换动画 */
main {
    height: calc(100vh - 60px); /* 减去header的高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    transition: opacity 0.3s ease;
}

/* 淡入淡出动画类 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 页面内容区域样式 */
.info-content {
    padding: 1rem;
    height: calc(100vh - 60px);
    overflow-y: auto;
    width: 100%;
    animation: slideIn 0.5s ease-out;
}

.gallery-content {
    padding: 1rem;
    height: calc(100vh - 60px);
    overflow-y: auto;
    width: 100%;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 主页样式 */
.hero {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    transform-style: preserve-3d;
    overflow: hidden;
}

.character-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 800px;
    padding: 1rem;
    transform-style: preserve-3d;
    animation: fadeInUp 1s ease-out;
    position: relative;
    z-index: 2;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.character-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 2rem;
    max-height: 70vh;
    object-fit: contain;
    animation: imageAppear 1s ease-out 0.3s both;
    position: relative;
    z-index: 1;
    transition: transform 0.05s linear;
}

@keyframes imageAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.character-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: infoAppear 1s ease-out 0.6s both;
    transition: transform 0.05s linear;
}

@keyframes infoAppear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.character-name {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    animation: titleGlow 2s ease-in-out infinite alternate;
    transition: transform 0.05s linear;
}

@keyframes titleGlow {
    from {
        text-shadow: 0 0 5px rgba(72, 61, 139, 0.3);
    }
    to {
        text-shadow: 0 0 15px rgba(72, 61, 139, 0.6);
    }
}

.mengniang-link {
    color: var(--primary-color);
    font-size: 1.2rem;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    transition: all 0.3s ease;
    transition: transform 0.05s linear;
}

.mengniang-link:hover {
    background-color: var(--primary-color);
    color: var(--light-color);
    transform: scale(1.1);
    box-shadow: 0 5px 15px rgba(147, 112, 219, 0.4);
}

/* 资料页面样式 */
.info-content {
    padding: 2rem;
    height: calc(100vh - 60px);
    overflow-y: auto;
    width: 100%;
    animation: slideIn 0.5s ease-out;
    background: linear-gradient(to bottom, rgba(245, 240, 255, 0.8), rgba(230, 224, 255, 0.8));
    backdrop-filter: blur(5px);
}

.info-content h2 {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.info-section h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.info-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: linear-gradient(135deg, rgba(147, 112, 219, 0.1), rgba(72, 61, 139, 0.1));
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, rgba(147, 112, 219, 0.15), rgba(72, 61, 139, 0.15));
}

.info-card h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
}

.info-card p {
    margin-bottom: 0.5rem;
    line-height: 1.6;
    color: #444;
}

.quote-card {
    background: linear-gradient(135deg, rgba(147, 112, 219, 0.2), rgba(72, 61, 139, 0.2));
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--secondary-color);
    border-left: 4px solid var(--primary-color);
}

.quote-card p {
    margin: 0;
    line-height: 1.8;
}

/* 时间线样式 */
.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-date {
    position: absolute;
    left: -2.5rem;
    top: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.timeline-content {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.12);
}

.timeline-content h4 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.timeline-content p {
    margin-bottom: 0.8rem;
    line-height: 1.6;
    color: #444;
}

/* 插画页面样式 */
.gallery-content h2 {
    text-align: center;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    font-size: 2rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--light-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* 图片模态框样式 */
.image-modal {
    display: block;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    margin: auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover,
.close:focus {
    color: var(--primary-color);
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

/* 响应式设计 */
@media (min-width: 768px) {
    .hero {
        align-items: center;
    }
    
    .character-intro p {
        font-size: 1.1rem;
    }
}