/* 全局样式 */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffe6e6; /* 粉红色背景 */
    margin: 0;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

/* 导航栏样式 */
header {
    background-color: #ffd1dc; /* 保留原来的背景色作为备用 */
    background-image: url('images/3b77eb4683b3d0ae64c9ceea4820dddb.jpg'); /* 添加背景图片 */
    background-size: cover; /* 确保图片覆盖整个header区域 */
    background-position: center; /* 图片居中 */
    padding: 1rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(255, 182, 193, 0.3);
}

/* 为了确保文字可读性，可以添加一个半透明的遮罩 */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 209, 220, 0.7); /* 半透明的粉色遮罩 */
    z-index: -1;
}

nav ul {
    list-style-type: none;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative; /* 确保导航在遮罩之上 */
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: #ff69b4;
    text-decoration: none;
    font-size: 1.2em;
    font-family: 'Fredoka One', cursive;
    padding: 10px 15px;
    border: 2px solid #ff69b4;
    border-radius: 25px;
    transition: all 0.3s ease;
    background-color: rgba(255, 255, 255, 0.8); /* 半透明的白色背景 */
    box-shadow: 0 2px 10px rgba(255, 105, 180, 0.2);
}

nav ul li a:hover {
    background-color: #ff69b4;
    color: #fff;
    transform: scale(1.05) rotate(2deg);
}

/* 主要内容区样式 */
main {
    max-width: 1200px;
    margin: 80px auto 0; /* 增加顶部边距，为固定的导航栏留出空间 */
    padding: 2rem;
}

/* 照片轮播样式 */
.carousel {
    width: 100%;
    height: 500px;
    overflow: hidden;
    position: relative;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.carousel-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-image.active {
    opacity: 1;
}

/* 关于我部分样式 */
#about {
    display: flex;
    align-items: center;
    margin: 4rem 0;
    background-color: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.avatar {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.bio {
    flex: 1;
}

/* 品集样式 */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
}

.portfolio-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.portfolio-item h3 {
    padding: 1rem;
    margin: 0;
    text-align: center;
}

/* AI对话界面样式 */
.chat-container {
    border: 2px solid #ffd1dc;
    border-radius: 20px;
    overflow: hidden;
    background-color: #fff;
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.3);
}

.chat-history {
    height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background-color: #fff5f7;
}

.chat-input {
    display: flex;
    padding: 1rem;
    border-top: 2px solid #ffd1dc;
    background-color: #fff;
}

.chat-input textarea {
    flex-grow: 1;
    margin-right: 1rem;
    padding: 0.8rem;
    border: 2px solid #ffd1dc;
    border-radius: 15px;
    resize: none;
    font-size: 1em;
    transition: all 0.3s ease;
}

.chat-input textarea:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(255, 182, 193, 0.5);
}

#send-btn {
    background-color: #ff69b4;
    color: #fff;
    border: none;
    padding: 0.8rem 1.2rem;
    border-radius: 15px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: all 0.3s ease;
}

#send-btn:hover {
    background-color: #ff1493;
    transform: scale(1.05);
}

.message {
    margin-bottom: 10px;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
}

.user-message {
    background-color: #ffd1dc;
    align-self: flex-end;
    margin-left: auto;
}

.ai-message {
    background-color: #e6f3ff;
    align-self: flex-start;
    display: flex;
    align-items: center;
}

/* 页脚样式 */
footer {
    background-color: #ffd1dc;
    color: #ff69b4;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

.social-links {
    margin-bottom: 1rem;
}

.social-icon {
    color: #ff69b4;
    margin: 0 0.5rem;
    text-decoration: none;
    font-size: 1.2em;
    transition: all 0.3s ease;
    display: inline-block;
}

.social-icon:hover {
    color: #ff1493;
    transform: scale(1.1);
}

.social-icon:active {
    transform: scale(1.2);
}

/* 返回顶部按钮样式 */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .carousel {
        height: 300px;
    }

    #about {
        flex-direction: column;
        text-align: center;
    }

    .avatar {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .portfolio-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* 粉红色泡泡背景 */
#bubble-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.bubble {
    position: absolute;
    background-color: rgba(255, 192, 203, 0.3);
    border-radius: 50%;
    animation: rise 10s infinite ease-in;
}

@keyframes rise {
    0% {
        bottom: -50px;
        transform: translateX(0);
    }
    50% {
        transform: translateX(100px);
    }
    100% {
        bottom: 100vh;
        transform: translateX(-20px);
    }
}

@keyframes animatedBackground {
    from { background-position: 0 0; }
    to { background-position: 100% 0; }
}

/* 加载动画样式 */
.loading-dots {
    display: inline-block;
    text-align: center;
    margin-left: 10px;
}

.loading-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ff69b4;
    margin: 0 3px;
    animation: dots 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes dots {
    0%, 80%, 100% { 
        transform: scale(0);
    } 40% { 
        transform: scale(1.0);
    }
}
