/* style.css */

/* 基本样式，重置浏览器默认样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6; /* 浅灰色背景 */
    color: #333;
    line-height: 1.6;
}

/* 头部样式 */
header {
    text-align: center;
    padding: 40px 20px;
    background-color: #2c3e50; /* 深蓝色背景 */
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    /* 确保内容垂直堆叠并居中 */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* 圆形头像 */
    object-fit: cover; /* 确保图片不变形 */
    border: 5px solid #fff; /* 白色边框 */
    margin-bottom: 15px;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

header h1 {
    margin: 10px 0 5px;
    font-size: 2.5em;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
    margin-bottom: 20px; /* 为AI按钮留出空间 */
}

/* AI按钮的样式 */
.ai-header-button {
    background-color: #e74c3c; /* 醒目的红色 */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.1em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 10px; /* 与p标签的间距 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.ai-header-button:hover {
    background-color: #c0392b; /* 悬停变色 */
    transform: translateY(-2px); /* 悬停上浮 */
}


/* 导航栏样式 */
.main-nav {
    text-align: center; /* 确保按钮居中 */
    background-color: #34495e; 
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.main-nav button {
    background-color: #3498db; 
    color: white;
    border: none;
    padding: 12px 25px;
    margin: 0 10px; 
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.0em;
    transition: background-color 0.3s ease, transform 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.main-nav button:hover {
    background-color: #2980b9; 
    transform: translateY(-2px); 
}

/* 主要内容区样式 */
main {
    max-width: 900px;
    margin: 30px auto;
    padding: 0 20px;
}

.content-section {
    background-color: #fff;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.content-section h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-bottom: 25px;
    font-size: 2em;
}

.card {
    background-color: #ecf0f1;
    padding: 20px;
    margin-bottom: 20px;
    border-left: 5px solid #3498db;
    border-radius: 5px;
}

.card h3 {
    margin-top: 0;
    color: #34495e;
    margin-bottom: 15px; /* 为其下的内容提供间距 */
}
.card ul {
    list-style: none;
    padding: 0;
    margin-bottom: 15px; /* 提供统一的列表底部间距 */
}

.card ul li {
    margin-bottom: 8px;
    color: #555;
}

.card h4 {
    margin-top: 25px; 
    margin-bottom: 10px;
    color: #34495e;
    font-size: 1.2em; 
    border-bottom: 1px dashed #ccc; 
    padding-bottom: 5px;
}
/* 分隔线样式 */
.card hr {
    border: 0;
    border-top: 1px solid #ccc;
    margin: 30px 0;
}


.skills-list ul {
    list-style: disc; 
    padding-left: 20px;
}

.skills-list h3 {
    color: #34495e;
    margin-top: 25px;
    margin-bottom: 10px;
}

/* 底部样式 */
footer {
    text-align: center;
    padding: 25px 20px;
    background-color: #2c3e50;
    color: #fff; /* 底部文字颜色为白色 */
    font-size: 0.9em;
    margin-top: 50px;
}

/* 备案号和版权信息在同一行 */
footer p {
    display: flex;          /* 使用Flexbox */
    justify-content: center; /* 水平居中 */
    align-items: center;     /* 垂直居中 */
    flex-wrap: wrap;         /* 小屏幕允许换行 */
    gap: 10px;              /* 项目间距 */
    line-height: 1.2;       /* 调整行高，让内容更紧凑 */
}

/* 分隔符样式 */
.footer-separator {
    color: #fff; /* 分隔符颜色 */
    font-size: 1.1em;
    margin: 0 5px; /* 左右间距 */
}


/* ICP备案号链接样式 - 确保白色且无下划线，覆盖所有状态 */
footer a,
footer a:visited,   /* 已访问链接 */
footer a:active {   /* 点击时链接 */
    color: white;       /* 字体颜色为白色 */
    text-decoration: none; /* 去掉下划线 */
    transition: color 0.3s ease; /* 添加悬停过渡效果 */
}

footer a:hover {
    color: #3498db; /* 鼠标悬停时变为蓝色 (保持不变) */
}


/* AI 聊天窗口样式 */
.ai-chat-window {
    position: fixed; 
    bottom: 20px;
    right: 20px;
    width: 350px;
    height: 500px; 
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: none; 
    flex-direction: column; 
    z-index: 1000; 
    overflow: hidden; 
}

.ai-chat-window.active {
    display: flex; 
}

.chat-header {
    background-color: #3498db;
    color: white;
    padding: 12px 15px;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 9px;
    border-top-right-radius: 9px;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.2em;
    cursor: pointer;
    padding: 0 5px;
    transition: color 0.2s;
}

.close-chat:hover {
    color: #ecf0f1;
}

.chat-messages {
    flex-grow: 1; 
    padding: 15px;
    overflow-y: auto; 
    background-color: #f9f9f9;
    display: flex; 
    flex-direction: column;
    gap: 10px; 
}

.message {
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
    line-height: 1.5;
    word-wrap: break-word; 
}

.user-message {
    background-color: #e0f7fa; 
    align-self: flex-end; 
}

.bot-message {
    background-color: #f0f0f0; 
    align-self: flex-start; 
}

.chat-input {
    display: flex;
    padding: 15px;
    border-top: 1px solid #eee;
    background-color: #fff;
    border-bottom-left-radius: 9px;
    border-bottom-right-radius: 9px;
}

.chat-input input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1em;
    margin-right: 10px;
}

.chat-input button {
    background-color: #2ecc71; 
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
    text-transform: uppercase;
}

.chat-input button:hover {
    background-color: #27ae60;
}

/* 新增：AI加载指示器样式 */
.message.loading-indicator {
    font-style: italic;
    color: #777;
    background-color: #f0f0f0; 
}

/* 新增：AI错误消息样式 */
.message.error {
    background-color: #ffebee; 
    color: #d32f2f; 
    border: 1px solid #ef9a9a; 
}

/* 响应式设计：手机等小屏幕适应 */
@media (max-width: 768px) {
    .main-nav {
        flex-direction: column; /* 小屏幕上导航按钮垂直排列 */
        padding-left: 10px;
        padding-right: 10px;
    }
    .main-nav button {
        margin: 5px 0; 
        padding: 10px 15px;
        font-size: 0.9em;
        width: 90%; /* 让导航按钮更宽 */
    }

    header h1 {
        font-size: 2em;
    }
    
    /* 调整小屏幕上AI按钮的位置 */
    .ai-header-button {
        position: static; /* 恢复静态定位，让它在流中自然排布 */
        margin-top: 15px; /* 提供一些间距 */
        width: 80%; /* 按钮宽度 */
        font-size: 1em;
    }

    .ai-chat-window {
        width: 90%; 
        height: 80%;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        bottom: unset;
        right: unset;
    }
}
