body {
    font-family: 'Roboto', sans-serif;
}

.navbar {
    margin-bottom: 20px;
}

.card {
    margin-bottom: 20px;
}

footer {
    margin-top: 40px;
}

/* AI助手对话框样式 */
/* AI助手对话框样式 */
#ai-assistant {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

#ai-button {
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 16px;
}

#ai-chat-window {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 90vw; /* 改为视窗宽度单位 */
    max-width: 1100px; /* 保留PC端最大宽度 */
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: opacity 0.3s ease;
    transform: translateX(0); /* 防止溢出 */
}

/* 移动端适配 */
@media (max-width: 768px) {
    #ai-assistant {
        right: 20px; /* 覆盖居中设置，强制右下角 */
        transform: none; /* 清除居中偏移 */
    }

    #ai-chat-window {
        right: 10px; /* 对话框与屏幕右侧间距 */
        width: calc(100vw - 40px); /* 宽度 = 屏幕宽度 - 左右边距 */
        max-width: none; /* 清除PC端最大宽度 */
        bottom: 70px;    /* 按钮上方间距 */
    }

    .chat-messages {
        height: 60vh;    /* 根据屏幕高度自适应 */
        max-height: 420px;
    }
}

/* 以下原有样式保持不变 */
#ai-chat-window.d-none {
    opacity: 0;
    pointer-events: none;
}

.card-header {
    background-color: #007bff;
    color: white;
    border-radius: 15px 15px 0 0;
    padding: 15px;
}

.card-body {
    padding: 10px;
}

.chat-messages {
    height: 420px;
    overflow-y: auto;
    padding: 10px;
}

.message {
    display: flex;
    margin-bottom: 10px;
}

.message .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.message .content {
    max-width: 70%;
    padding: 10px;
    border-radius: 10px;
    position: relative;
}

.message.user-message .content {
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message.ai-message .content {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message .timestamp {
    font-size: 12px;
    color: #666;
    display: block;
    margin-top: 5px;
}




/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, #007bff, #00bfff); /* 渐变背景 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    padding: 10px 0;
    z-index: 999;
}

.navbar-brand {
    color: white !important;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

.navbar-brand i {
    margin-right: 10px;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 16px;
    margin: 0 10px;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(180deg, #f5faff, #ffffff); /* 渐变背景 */
    color: #333;
}

.navbar {
    background: linear-gradient(135deg, #007bff, #00bfff); /* 渐变背景 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    padding: 10px 0;
}

.navbar-brand {
    color: white !important;
    font-size: 24px;
    font-weight: bold;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 16px;
    margin: 0 10px;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1); /* 悬停背景色 */
    transform: translateY(-2px); /* 悬停时轻微上移 */
}

.navbar-nav .nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.2); /* 激活状态背景色 */
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.floating-card {
    margin-top: -10px; /* 将卡片向上移动，使其悬浮在页面上方 */
    position: relative;
    z-index: 10;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.card {
    margin-bottom: 20px;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.card-header {
    background-color: #007bff;
    color: white;
    border-radius: 10px 10px 0 0;
}

.card-body {
    padding: 20px;
}

.btn-primary {
    background-color: #007bff;
    border: none;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: scale(1.05);
}

.btn-outline-primary {
    color: #007bff;
    border-color: #007bff;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    color: white;
}

.form-control {
    border: 1px solid #ddd;
    border-radius: 5px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.img-fluid {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 20px;
    }

    .navbar-nav .nav-link {
        margin: 5px 0;
        padding: 10px 15px;
    }

    .card-body {
        padding: 10px;
    }
}


.navbar-nav .nav-link i {
    margin-right: 8px;
}

.navbar-nav .nav-link:hover {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1); /* 悬停背景色 */
    transform: translateY(-2px); /* 悬停时轻微上移 */
}

.navbar-nav .nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.2); /* 激活状态背景色 */
}

/* 响应式设计：小屏幕下的导航栏 */
@media (max-width: 768px) {
    .navbar-nav .nav-link {
        margin: 5px 0;
        padding: 10px 15px;
    }

    .navbar-brand {
        font-size: 20px;
    }
}



/* 文字阴影效果 */
.text-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* 悬浮卡片效果 */
.floating-card {
    margin-top: -10px; /* 将卡片向上移动，使其悬浮在页面上方 */
    position: relative;
    z-index: 10;
    animation: float 3s ease-in-out infinite;
}

/* 悬浮动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 卡片悬停效果 */
.card:hover {
    transform: translateY(-10px);
    transition: transform 0.3s ease;
}

/* 评论区容器 */
.comments-container {
    position: relative;
    height: 300px; /* 设置评论区的固定高度 */
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 10px;
}

/* 可滚动的评论列表 */
.comments-scrollable {
    height: 100%;
    overflow-y: scroll;
    padding-right: 20px; /* 为滚动条留出空间 */
}


/* 滑栏 */
.scrollbar {
    width: 10px;
    height: 50px; /* 初始高度 */
    background-color: #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: height 0.3s ease;
}

/* 滑栏悬停效果 */
.scrollbar:hover {
    background-color: #aaa;
}

/* 滑栏拖动效果 */
.scrollbar.dragging {
    background-color: #888;
}



/* 天气页面容器 */

.weather-container h1 {
    font-family: 'Montserrat', sans-serif; /* 使用自定义字体 */
    font-size: 2.5rem;
    font-weight: 600;
    color: #fff;
    text-shadow:
        2px 2px 4px rgba(0, 0, 0, 0.5), /* 黑色文字阴影 */
        0 0 10px #ffeb3b, /* 黄色发光效果 */
        0 0 20px #ffd700, /* 更亮的黄色发光效果 */
        0 0 30px #ffcc00; /* 更亮的黄色发光效果 */
    text-align: center;
    margin-top: 50px;
    margin-bottom: 30px;
    letter-spacing: 2px;
    animation: float 3s ease-in-out infinite; /* 浮动动画 */
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.weather-container h1 i {
    margin-right: 10px;
    font-size: 2.5rem;
    color: #ffeb3b; /* 图标颜色 */
}

.weather-container {
    background-size: cover; /* 背景图片始终覆盖整个容器 */
    background-position: center; /* 背景图片居中 */
    background-attachment: fixed; /* 固定背景图片，防止滚动时变化 */
    padding: 50px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #333;
}




/* 查询栏样式 */
#search {
    background-color: rgba(255, 255, 255, 0.9); /* 白色半透明背景 */
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    margin-bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#search input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
}

#search button {
    margin-top: 10px;
    width: 100%;
    padding: 10px;
    background-color: #ffc107; /* 黄色按钮 */
    color: #333;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#search button:hover {
    background-color: #e0a800; /* 深黄色悬停效果 */
}

/* 查询结果显示区域 */
#search-result {
    background-color: rgba(255, 255, 255, 0.9); /* 白色半透明背景 */
    border-radius: 10px;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 天气卡片样式 */
.weather-card {
    background-color: rgba(255, 255, 255, 0.8); /* 半透明背景 */
    backdrop-filter: blur(3px); /* 背景模糊效果 */
    color: #333;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
}

.weather-card:hover {
    background-color: rgba(255, 255, 255, 0.95); /* 悬停时稍微增加透明度 */
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.weather-card h5 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.weather-details p {
    font-size: 1rem;
    margin: 0;
}

.weather-details strong {
    color: #ffc107; /* 黄色强调文字 */
}

/* 优化侧边栏样式 */
.col-md-3 {
    max-height: 80vh; /* 设置侧边栏的最大高度 */
    overflow-y: auto; /* 添加垂直滚动条 */
    padding-right: 20px; /* 增加右侧内边距 */
    background-color: #f9f9f9; /* 浅灰色背景 */
    border-radius: 10px; /* 圆角 */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* 阴影效果 */
    transition: box-shadow 0.3s ease; /* 阴影过渡效果 */
}

/* 悬停时侧边栏阴影加深 */
.col-md-3:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15); /* 更深的阴影 */
}

/* 滚动条样式 */
.col-md-3::-webkit-scrollbar {
    width: 8px; /* 滚动条宽度 */
}

.col-md-3::-webkit-scrollbar-track {
    background: #f1f1f1; /* 滚动条轨道背景色 */
    border-radius: 4px; /* 轨道圆角 */
}

.col-md-3::-webkit-scrollbar-thumb {
    background: #ccc; /* 滚动条滑块背景色 */
    border-radius: 4px; /* 滑块圆角 */
}

.col-md-3::-webkit-scrollbar-thumb:hover {
    background: #aaa; /* 滑块悬停时的背景色 */
}

/* 侧边栏列表项样式 */
.list-group-item {
    cursor: pointer;
    font-size: 5rem; /* 字体大小 */
    padding: 12px 15px; /* 上下左右内边距 */
    margin-bottom: 8px; /* 项目之间的间距 */
    border: none; /* 移除默认边框 */
    border-radius: 8px; /* 圆角 */
    background-color: #ffffff; /* 白色背景 */
    transition: background-color 0.3s ease, transform 0.3s ease; /* 过渡效果 */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* 轻微的阴影 */
    text-align: center; /* 文字居中 */
    font-weight: bold; /* 文字加粗 */
}

/* 悬停效果 */
.list-group-item:hover {
    background-color: #e9ecef; /* 浅灰色背景 */
    transform: translateX(5px); /* 轻微向右移动 */
}

/* 选中效果 */
.list-group-item.active {
    background-color: #007bff; /* 蓝色背景 */
    color: white; /* 白色文字 */
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2); /* 蓝色阴影 */
}

/* 选中项悬停效果 */
.list-group-item.active:hover {
    background-color: #0056b3; /* 更深的蓝色 */
}

/* 分隔线 */
.list-group-item + .list-group-item {
    border-top: 3px solid #e9ecef; /* 上边框分隔线 */
}


/* 论坛评论列表样式 */
.forum-comments {
    padding: 10px;
    border-radius: 8px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    max-height: 300px; /* 设置评论区域的最大高度 */
    overflow-y: auto; /* 添加滚动条 */
}

.forum-comment {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 8px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.forum-comment .avatar {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    color: #666;
    background: #f1f1f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
}

.forum-comment .media-body {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.4;
}

/* 评论区域的滚动条样式 */
.forum-comments::-webkit-scrollbar {
    width: 8px;
}

.forum-comments::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.forum-comments::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.forum-comments::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 评论按钮样式 */
.btn-success {
    background: linear-gradient(135deg, #28a745, #218838); /* 渐变背景 */
    border: none;
    transition: transform 0.3s ease;
}

.btn-success:hover {
    transform: scale(1.05); /* 悬停时放大 */
    background: linear-gradient(135deg, #218838, #1e7e34); /* 加深颜色 */
}


/* 论坛容器 */
/* 论坛容器 */
body {
    background: linear-gradient(180deg, #f5faff, #ffffff); /* 渐变背景 */
    font-family: 'Roboto', Arial, sans-serif; /* 选用现代化字体 */
}

.forum-container {
    max-width: 1000px;
    padding: 20px;
    background: #ffffff; /* 白色背景 */
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05); /* 柔和阴影 */
    margin: 40px auto; /* 居中 */
}


/* 分类导航 */
.forum-categories .nav-link {
    font-weight: 600;
    color: #666;
    border-radius: 20px;
    margin-right: 8px;
    padding: 8px 16px; /* 增加内边距 */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden; /* 为渐变效果做准备 */
}

.forum-categories .nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #007bff, #00bfff);
    transition: all 0.3s ease;
    z-index: -1;
}

.forum-categories .nav-link:hover::before {
    left: 0;
}

.forum-categories .nav-link.active {
    color: white;
    background: linear-gradient(135deg, #007bff, #00bfff);
    box-shadow: 0 4px 6px rgba(0, 123, 255, 0.2);
}


/* 帖子卡片 */
.forum-post {
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(180deg, #ffffff, #f9fbff); /* 轻微渐变背景 */
    margin-bottom: 20px;
    padding: 20px;
}

.forum-post:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.15); /* 更明显的阴影 */
    border: 1px solid rgba(0, 123, 255, 0.1); /* 光晕效果 */
}

.forum-post .post-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #000; /* 黑色标题 */
}



.forum-post .card-text {
    font-size: 1rem;
    color: #666;
    line-height: 1.6;
}


/* 用户头像 */
.forum-user-avatar img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 2px solid #fff; /* 白色边框 */
}

.forum-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.forum-user-info .username {
    font-weight: 600;
    color: #333;
}

.forum-user-info .timestamp {
    font-size: 0.9rem;
    color: #999;
}


/* 互动按钮 */
.btn-like,
.btn-comment {
    padding: 8px 16px;
    border-radius: 24px;
    background: #f0f8ff;
    color: #666;
    border: 1px solid #dfe9f5;
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
}

.btn-like:hover {
    color: #007bff;
    background: rgba(0, 123, 255, 0.05);
    border-color: rgba(0, 123, 255, 0.1);
}

.btn-comment:hover {
    color: #28a745;
    background: rgba(40, 167, 69, 0.05);
    border-color: rgba(40, 167, 69, 0.1);
}


/* 评论输入框 */
.forum-comments .input-group {
    border-radius: 30px;
    overflow: hidden;
    background: #f0f8ff;
    border: 1px solid #dfe9f5;
}

.forum-comments input[type="text"] {
    border: none;
    padding: 14px 24px;
    font-size: 1rem;
    width: 100%;
    background: transparent;
}

.forum-comments button[type="submit"] {
    padding: 14px 24px;
    font-size: 1rem;
    background: linear-gradient(135deg, #007bff, #00bfff);
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.forum-comments button[type="submit"]:hover {
    background: linear-gradient(135deg, #0056b3, #00a3e0);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
}


/* 响应式设计 */
@media (max-width: 768px) {
    .forum-post {
        padding: 16px;
    }

    .forum-user-info {
        flex-direction: column;
        align-items: start;
        gap: 8px;
    }

    .btn-like, .btn-comment {
        margin: 8px 0 !important;
        width: 100%;
    }

    .forum-comments .input-group {
        flex-direction: column;
    }

    .forum-comments button[type="submit"] {
        margin-top: 8px;
    }
}

.example-image-container {
    padding: 20px;
    margin-bottom: 30px;
}

/* 在您的CSS中添加或修改以下样式 */
.input-group-lg {
    border-radius: 10px;
    overflow: visible; /* 允许内容溢出显示 */
}

.input-group-text {
    min-width: 48px; /* 确保图标容器足够宽 */
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-gradient-icon {
    padding-right: 1rem !important; /* 确保右侧有足够间距 */
    min-width: 48px; /* 最小宽度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-floating > label {
    padding-left: 0.5rem; /* 标签左侧留出空间 */
}

:root {
  --bs-primary: #007bff;  /* Bootstrap默认的主色 */
  --bs-info: #17a2b8;     /* Bootstrap默认的信息色 */
}



