/* 全局样式 */
:root {
    /* 全新活力配色 */
    --primary-color: #0d6efd;   /* Bootstrap蓝色 */
    --secondary-color: #6c757d; /* Bootstrap灰色 */
    --accent-color: #ffd93d;    /* 活力黄色 */
    --success-color: #4caf50;
    --danger-color: #ff4e50;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    
    /* 渐变色定义 */
    --gradient-primary: linear-gradient(135deg, #0d6efd, #0b5ed7);
    --gradient-secondary: linear-gradient(135deg, #6c757d, #5c636a);
    --gradient-success: linear-gradient(135deg, #4caf50, #2e7d32);
    --gradient-danger: linear-gradient(135deg, #ff4e50, #c9184a);
    --gradient-warning: linear-gradient(135deg, #ff9800, #ef6c00);
    --gradient-info: linear-gradient(135deg, #3bc9db, #228be6);
    --gradient-purple: linear-gradient(135deg, #9c27b0, #7b1fa2);
    --gradient-pink: linear-gradient(135deg, #e91e63, #c2185b);
    --gradient-teal: linear-gradient(135deg, #009688, #00796b);
    
    /* 图标背景色定义 - 更美观的配色 */
    --icon-bg-primary: #e3f2fd;
    --icon-bg-secondary: #f5f5f5;
    --icon-bg-success: #e8f5e9;
    --icon-bg-danger: #fff8f8;
    --icon-bg-warning: #fff8eb;
    --icon-bg-info: #e6f7ff;
    --icon-bg-light: #f8f9fa;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 2rem;
}

.container {
    flex: 1;
}

/* 现代化 - 透明模糊导航栏 */
.navbar {
    backdrop-filter: blur(10px);
}

/* 导航栏样式 */
.navbar-dark.bg-primary {
    background: var(--gradient-primary) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

/* 卡片样式 */
.card {
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
    border: none;
    perspective: 1000px; /* 提供3D空间感 */
}

.card::before {
    /* 伪元素实现柔和光晕 */
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.05);
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.card:hover::before {
    opacity: 1;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: rgba(0, 0, 0, 0.03);
    font-weight: 600;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding: 1rem 1.25rem;
}

/* 卡片头部渐变色样式 */
.card-header.bg-primary {
    background: var(--gradient-primary) !important;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: none;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
}

.card-header.bg-secondary {
    background: var(--gradient-secondary) !important;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: none;
}

.card-header.bg-success {
    background: var(--gradient-success) !important;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: none;
}

.card-header.bg-danger {
    background: var(--gradient-danger) !important;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: none;
}

.card-header.bg-warning {
    background: var(--gradient-warning) !important;
    color: #212529;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: none;
}

.card-header.bg-info {
    background: var(--gradient-info) !important;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    border-bottom: none;
}

/* 卡片内容颜色 */
.bg-primary {
    background: var(--gradient-primary) !important;
}

.bg-secondary {
    background: var(--gradient-secondary) !important;
}

.bg-success {
    background: var(--gradient-success) !important;
}

.bg-danger {
    background: var(--gradient-danger) !important;
}

.bg-warning {
    background: var(--gradient-warning) !important;
}

.bg-info {
    background: var(--gradient-info) !important;
}

/* 按钮样式 */
.btn {
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #1976d2;
    border-color: #1976d2;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* 表单样式 */
.form-control {
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(30, 136, 229, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

/* 页脚样式 */
.footer {
    background-color: #f8f9fa;
    padding: 2rem 0;
    margin-top: auto;
}

.footer h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer a {
    color: #495057;
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* 活动卡片样式 */
.activity-card {
    transition: transform 0.3s;
    height: 100%;
}

.activity-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.activity-card .card-body {
    flex: 1;
}

.activity-card .card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

.activity-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* 活动详情页样式 */
.activity-detail-header {
    background-color: #f8f9fa;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.activity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.activity-meta-item {
    display: flex;
    align-items: center;
    color: #6c757d;
}

.activity-meta-item i {
    margin-right: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .activity-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
}

/* 数据统计图表容器 */
.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 2rem;
}

/* 通知样式 */
.notification-badge {
    position: relative;
    display: inline-block;
}

.notification-badge .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    padding: 0.25rem 0.5rem;
    border-radius: 50%;
    background-color: var(--danger-color);
    color: white;
    font-size: 0.75rem;
}

/* 表格样式 */
.table-responsive {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
}

/* 分页样式 */
.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link {
    color: var(--primary-color);
}

/* 首页轮播图样式 */
.carousel-item img {
    height: 500px;
    object-fit: cover;
    width: 100%;
}

.carousel-caption {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
}

/* 加载动画 */
.spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    border-width: 0.2rem;
    aspect-ratio: 1/1;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 移动端优化 */
@media (max-width: 576px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.9rem;
    }
    
    .btn-group .btn {
        padding: 0.375rem 0.5rem;
    }
    
    h1, .h1 {
        font-size: 1.8rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .table td, .table th {
        padding: 0.5rem;
    }
    
    /* 确保按钮在小屏幕上有足够的间距 */
    .btn {
        margin-bottom: 0.5rem;
        margin-right: 0.5rem;
    }
    
    /* 确保表单在小屏幕上正确显示 */
    .form-control {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 改进移动端的导航栏 */
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .navbar-toggler {
        padding: 0.25rem 0.5rem;
    }
}

/* 标签样式 */
.tag-badge {
    margin-right: 5px;
    margin-bottom: 5px;
    display: inline-block;
    padding: 5px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 30px;
    color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.tag-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 标签颜色 */
.badge-primary, .bg-primary.tag-badge {
    background: var(--gradient-primary);
    border: none;
}

.badge-secondary, .bg-secondary.tag-badge {
    background: var(--gradient-secondary);
    border: none;
}

.badge-success, .bg-success.tag-badge {
    background: var(--gradient-success);
    border: none;
}

.badge-danger, .bg-danger.tag-badge {
    background: var(--gradient-danger);
    border: none;
}

.badge-warning, .bg-warning.tag-badge {
    background: var(--gradient-warning);
    border: none;
    color: #212529; /* 黄色背景使用深色文字 */
}

.badge-info, .bg-info.tag-badge {
    background: var(--gradient-info);
    border: none;
}

.badge-purple, .bg-purple.tag-badge {
    background: var(--gradient-purple);
    border: none;
}

.badge-pink, .bg-pink.tag-badge {
    background: var(--gradient-pink);
    border: none;
}

.badge-teal, .bg-teal.tag-badge {
    background: var(--gradient-teal);
    border: none;
}

/* 常规badge样式更新 */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 0.35em 0.65em;
    border-radius: 30px;
}

/* 给普通的badge也添加渐变效果 */
.badge.bg-primary {
    background: var(--gradient-primary) !important;
}

.badge.bg-secondary {
    background: var(--gradient-secondary) !important;
}

.badge.bg-success {
    background: var(--gradient-success) !important;
}

.badge.bg-danger {
    background: var(--gradient-danger) !important;
}

.badge.bg-warning {
    background: var(--gradient-warning) !important;
    color: #212529;
}

.badge.bg-info {
    background: var(--gradient-info) !important;
}

/* 签到二维码样式 */
.qrcode-container {
    background-color: #fff;
    display: inline-block;
    padding: 15px;
    border-radius: 8px;
}

/* 按钮组样式优化 */
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* 表格内容垂直居中 */
.table td {
    vertical-align: middle;
}

/* 活动描述样式 */
.activity-description img {
    max-width: 100%;
    height: auto;
}

/* 确保页脚始终在底部 */
html, body {
    height: 100%;
}

.wrapper {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

.content {
    flex: 1;
}

footer {
    margin-top: auto;
}

/* 移动端适配 */
@media (max-width: 767px) {
    /* 表格响应式处理 */
    .table-responsive {
        overflow-x: auto;
    }
    
    /* 管理面板中的按钮优化 */
    .card-body .btn {
        margin-bottom: 8px;
        width: 100%;
    }
    
    /* 最近活动表格中的按钮调整 */
    .card .table td .btn {
        display: block;
        width: 100%;
        margin-bottom: 5px;
    }
    
    /* 表格列宽度控制 */
    .table-responsive table th,
    .table-responsive table td {
        white-space: nowrap;
    }
    
    /* 统计卡片在小屏幕上全宽显示 */
    .col-md-3 {
        margin-bottom: 15px;
    }
    
    /* 标题和内容区域调整 */
    .container h2, .container h3, .container h4 {
        font-size: 1.5rem;
    }
    
    /* 移动端内容间距优化 */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* 移动端表格内容优化 */
    .table td, .table th {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    /* 确保移动端的卡片内边距合理 */
    .card-body {
        padding: 1rem;
    }
    
    /* 优化面包屑导航 */
    .breadcrumb {
        font-size: 0.85rem;
        margin-bottom: 0.5rem;
    }
}

/* AI聊天框样式优化 */
.ai-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0 8px;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.ai-chat-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.ai-chat-close:active {
    background-color: rgba(255, 255, 255, 0.3);
}

/* 确保聊天框在移动设备上也能正常显示 */
@media (max-width: 576px) {
    .ai-chat-container {
        width: 90vw;
        height: 70vh;
        right: 5%;
        left: auto;
        bottom: 90px; /* 留白避免与浏览器底栏重叠 */
    }
    .ai-chat-messages{
        flex:1;
        overflow-y:auto;
    }
    .ai-chat-input {
        display: flex;
        gap: 6px;
    }
    .ai-chat-input input {
        flex: 1 1 auto;
        min-width: 0;
    }
    .ai-chat-input button {
        flex: 0 0 56px;
        max-width: 56px;
    }
}

/* AI聊天加载动画 */
.loading-indicator {
    color: #666;
    font-style: italic;
}

.dot-animation {
    display: inline-block;
    animation: dotAnimation 1.5s infinite;
}

@keyframes dotAnimation {
    0% { content: '.'; }
    33% { content: '..'; }
    66% { content: '...'; }
    100% { content: '.'; }
}

/* 聊天消息动画效果 */
.ai-message {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 聊天框错误提示样式 */
.ai-message.error {
    background-color: #ffebee;
    border-left: 3px solid #f44336;
}

/* 修改图标背景颜色，使用更美观的单色背景 */
.bg-primary.bg-opacity-10 {
    background-color: var(--icon-bg-primary) !important;
    background-image: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.bg-secondary.bg-opacity-10 {
    background-color: var(--icon-bg-secondary) !important;
    background-image: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.bg-success.bg-opacity-10 {
    background-color: var(--icon-bg-success) !important;
    background-image: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.bg-danger.bg-opacity-10 {
    background-color: var(--icon-bg-danger) !important;
    background-image: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.bg-warning.bg-opacity-10 {
    background-color: var(--icon-bg-warning) !important;
    background-image: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.bg-info.bg-opacity-10 {
    background-color: var(--icon-bg-info) !important;
    background-image: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.bg-light.bg-opacity-10 {
    background-color: var(--icon-bg-light) !important;
    background-image: none !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

/* 图标悬停效果 */
.bg-opacity-10:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 移动端图标优化 */
@media (max-width: 576px) {
    .bg-opacity-10 {
        min-width: 32px;
        min-height: 32px;
        padding: 6px;
    }
    
    .bg-opacity-10 i {
        font-size: 0.9rem;
    }
    
    .d-flex.align-items-center .bg-opacity-10 {
        margin-right: 8px;
    }
}

/* 模态框过渡效果优化 */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out, opacity 0.3s ease;
    transform: translateY(-20px);
    opacity: 0;
}

.modal.show .modal-dialog {
    transform: translateY(0);
    opacity: 1;
}

.modal-backdrop.fade {
    transition: opacity 0.3s ease;
}

.modal-content {
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-close:focus {
    box-shadow: none;
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* 添加通知相关样式 */
.notification-banner {
    position: relative;
    padding: 15px 20px;
    margin-bottom: 20px;
    background-color: rgba(25, 135, 84, 0.1);
    border: 1px solid #198754;
    border-radius: 8px;
    overflow: hidden;
    animation: fadeIn 0.5s ease-in-out;
}

.notification-banner.important {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: #dc3545;
}

.notification-banner .close-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #495057;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.notification-banner .close-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.notification-banner .notification-content {
    padding-right: 30px;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 未读通知标记 */
.notification-item.unread {
    border-left: 3px solid #0d6efd;
    padding-left: 15px;
    background-color: rgba(13, 110, 253, 0.05);
}

/* 消息样式 */
.message-item {
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.message-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.message-item.unread {
    border-left-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

.message-item .message-sender {
    font-weight: 600;
}

.message-item .message-time {
    color: #6c757d;
    font-size: 0.85rem;
}

.message-item .message-preview {
    color: #6c757d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80%;
}

/* 通知计数器徽章 */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 18px;
    height: 18px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* 通知图标容器 */
.notification-icon {
    position: relative;
}

/* 轮播图修复样式 */
.carousel-item img {
    height: 500px;
    object-fit: cover;
    width: 100%;
}

.carousel-inner {
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    overflow: hidden;
}

.carousel-caption {
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 8px;
    max-width: 80%;
    margin: 0 auto;
    bottom: 40px;
    backdrop-filter: blur(5px);
}

/* 首页布局优化 */
.container-fluid.px-0 {
    padding: 0 15px !important;
    margin-bottom: 2rem;
}

/* 首页卡片修复 */
.card-img-top {
    height: 200px;
    object-fit: cover;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background-color: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

/* 首页标题样式 */
.section-title {
    position: relative;
    text-align: center;
    margin-bottom: 2.5rem;
    font-weight: 700;
}

.section-title:after {
    content: '';
    position: absolute;
    width: 80px;
    height: 3px;
    background: var(--primary-color);
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px;
}

/* 首页活动卡片标签 */
.card .badge {
    font-weight: 500;
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

/* 移动端轮播图适配 */
@media (max-width: 768px) {
    .carousel-item img {
        height: 300px;
    }
    
    .carousel-inner {
        border-radius: 8px;
    }
    
    .carousel-caption {
        display: block !important;
        padding: 10px;
    }
    
    .carousel-caption h2 {
        font-size: 1.5rem;
    }
    
    .carousel-caption p {
        font-size: 0.9rem;
    }
    
    .carousel-caption .btn {
        font-size: 0.8rem;
        padding: 0.25rem 0.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
}

/* 全局加载动画 - 书本翻页效果 */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    flex-direction: column;
}

.global-loading.show {
    opacity: 1;
    visibility: visible;
}

/* 书本翻页加载动画 */
.global-loading .loader {
    --background: linear-gradient(135deg, #23C4F8, #275EFE);
    --shadow: rgba(39, 94, 254, 0.28);
    --text: #6C7486;
    --page: rgba(255, 255, 255, 0.36);
    --page-fold: rgba(255, 255, 255, 0.52);
    --duration: 3s;
    width: 200px;
    height: 140px;
    position: relative;
}

.global-loading .loader:before, .global-loading .loader:after {
    --r: -6deg;
    content: "";
    position: absolute;
    bottom: 8px;
    width: 120px;
    top: 80%;
    box-shadow: 0 16px 12px var(--shadow);
    transform: rotate(var(--r));
}

.global-loading .loader:before {
    left: 4px;
}

.global-loading .loader:after {
    --r: 6deg;
    right: 4px;
}

.global-loading .loader div {
    width: 100%;
    height: 100%;
    border-radius: 13px;
    position: relative;
    z-index: 1;
    perspective: 600px;
    box-shadow: 0 4px 6px var(--shadow);
    background-image: var(--background);
}

.global-loading .loader div ul {
    margin: 0;
    padding: 0;
    list-style: none;
    position: relative;
}

.global-loading .loader div ul li {
    --r: 180deg;
    --o: 0;
    --c: var(--page);
    position: absolute;
    top: 10px;
    left: 10px;
    transform-origin: 100% 50%;
    color: var(--c);
    opacity: var(--o);
    transform: rotateY(var(--r));
    -webkit-animation: var(--duration) ease infinite;
    animation: var(--duration) ease infinite;
}

.global-loading .loader div ul li:nth-child(2) {
    --c: var(--page-fold);
    -webkit-animation-name: page-2;
    animation-name: page-2;
}

.global-loading .loader div ul li:nth-child(3) {
    --c: var(--page-fold);
    -webkit-animation-name: page-3;
    animation-name: page-3;
}

.global-loading .loader div ul li:nth-child(4) {
    --c: var(--page-fold);
    -webkit-animation-name: page-4;
    animation-name: page-4;
}

.global-loading .loader div ul li:nth-child(5) {
    --c: var(--page-fold);
    -webkit-animation-name: page-5;
    animation-name: page-5;
}

.global-loading .loader div ul li svg {
    width: 90px;
    height: 120px;
    display: block;
}

.global-loading .loader div ul li:first-child {
    --r: 0deg;
    --o: 1;
}

.global-loading .loader div ul li:last-child {
    --o: 1;
}

.global-loading .loader span {
    display: block;
    left: 0;
    right: 0;
    top: 100%;
    margin-top: 20px;
    text-align: center;
    color: var(--text);
}

@keyframes page-2 {
    0% {
        transform: rotateY(180deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    35%, 100% {
        opacity: 0;
    }
    50%, 100% {
        transform: rotateY(0deg);
    }
}

@keyframes page-3 {
    15% {
        transform: rotateY(180deg);
        opacity: 0;
    }
    35% {
        opacity: 1;
    }
    50%, 100% {
        opacity: 0;
    }
    65%, 100% {
        transform: rotateY(0deg);
    }
}

@keyframes page-4 {
    30% {
        transform: rotateY(180deg);
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    65%, 100% {
        opacity: 0;
    }
    80%, 100% {
        transform: rotateY(0deg);
    }
}

@keyframes page-5 {
    45% {
        transform: rotateY(180deg);
        opacity: 0;
    }
    65% {
        opacity: 1;
    }
    80%, 100% {
        opacity: 0;
    }
    95%, 100% {
        transform: rotateY(0deg);
    }
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #0d6efd;
    animation: spin 1s ease-in-out infinite;
    margin: 20px auto;
}

.loading-container {
    text-align: center;
    padding: 20px;
}

.loading-text {
    margin-top: 10px;
    color: #6c757d;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 按钮加载状态 - 简化版本 */
.btn-loading-active {
    pointer-events: none;
    opacity: 0.8;
    min-width: 6rem; /* 根据设计酌情调整 */
}

/* 旧的btn-loading类保持兼容性 */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading:after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: calc(50% - 0.5rem);
    left: calc(50% - 0.5rem);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spinner 0.6s linear infinite;
    z-index: 10;
}

/* 改进的加载动画，更稳定，不闪烁 */
@keyframes spinner {
    to {transform: rotate(360deg);}
}

/* 按钮加载状态的过渡效果 */
.btn {
    transition: all 0.2s ease-in-out;
}

/* 为按钮加载状态添加更多样式 */
.btn-primary.btn-loading:after,
.btn-success.btn-loading:after,
.btn-info.btn-loading:after,
.btn-warning.btn-loading:after,
.btn-danger.btn-loading:after {
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-top-color: #fff;
}

.btn-outline-primary.btn-loading:after,
.btn-outline-success.btn-loading:after,
.btn-outline-info.btn-loading:after,
.btn-outline-warning.btn-loading:after,
.btn-outline-danger.btn-loading:after,
.btn-outline-secondary.btn-loading:after {
    border: 2px solid rgba(108, 117, 125, 0.5);
    border-top-color: #6c757d;
}

/* 确保旋转动画稳定 */
@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* 确保旋转动画流畅 */
.spinner-border {
    animation: spinner-border 0.75s linear infinite;
    border-width: 0.15em;
}

/* 提高按钮加载状态的可见度 */
.btn.disabled, .btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* 链接按钮加载状态 */
a.btn.disabled {
    pointer-events: none;
    opacity: 0.8;
    position: relative;
    overflow: hidden;
}

a.btn.disabled::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    to {
        left: 100%;
    }
}

/* 下拉菜单按钮现代化样式 */
.dropdown-toggle {
    position: relative;
    transition: all 0.2s ease;
}

.dropdown-toggle::after {
    transition: all 0.2s ease;
    margin-left: 0.5em;
    vertical-align: middle;
}

.dropdown-toggle:hover::after {
    transform: translateY(2px);
}

.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    animation: dropdownFadeIn 0.2s ease;
}

.dropdown-item {
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(30, 136, 229, 0.1);
}

.dropdown-item:active {
    background-color: var(--primary-color);
}

.dropdown-item i {
    margin-right: 0.5rem;
    opacity: 0.7;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 登录按钮特殊样式 */
.login-btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #1e88e5, #1565c0);
}

.login-btn:hover {
    background: linear-gradient(135deg, #1976d2, #0d47a1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 现代化 - 透明模糊导航栏 */
.navbar {
    backdrop-filter: blur(10px);
}

/* 暗黑模式已取消，如需再次启用，请在此处补充相关样式 */

/* 提升AI聊天容器层级，避免被其他元素覆盖 */
.ai-chat-container {
    z-index: 1050;
}

/* AI按钮确保可点击 */
.ai-chat-button {
    pointer-events: auto !important;
    user-select: none;
}

/* 小优化：减少卡片倾斜渲染开销 */
.card[data-tilt] {
    will-change: transform;
}

/* 移动端禁用卡片hover效果 */
@media (max-width: 767.98px) {
    .card:hover {
        transform: none;
        box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    }
}

/* 移动端搜索表单适配 */
@media (max-width: 767.98px) {
    .navbar .search-form {
        flex: 1 1 100%;
        margin-top: 0.5rem;
        margin-right: 0 !important;
    }
    .navbar .search-form input {
        width: 100%;
    }
}

/* 折叠导航(移动端)内搜索框占满宽度 */
@media (max-width: 991.98px) {
    .navbar-collapse {
        max-height: 100vh;
        overflow-y: auto;
    }
    .navbar-collapse.show {
        display: flex !important;
        flex-direction: column;
    }
    .bottom-area {
        order: 2;
        margin-top: auto;
        width: 100%;
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .bottom-area .search-form {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
    }
    .bottom-area .search-form .form-control {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
        flex: 1 1 auto;
    }
    .bottom-area .search-form .btn {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
        flex: 0 0 auto;
    }
    .bottom-area .search-form .form-control,
    .bottom-area .search-form .btn {
        height: 44px;
    }
}

/* 确保下拉菜单层级高于卡片 */
.navbar {
    z-index: 1080;
}
.dropdown-menu {
    z-index: 1081;
}

/* 导航搜索框对齐 */
.navbar .search-form .input-group {
    align-items: center;
}
.navbar .search-form .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    min-width: 220px;
    height: calc(1.5em + 0.75rem + 2px);
}
.navbar .search-form .btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    height: calc(1.5em + 0.75rem + 2px);
    display: flex;
    align-items: center;
}

/* 桌面端导航栏右侧对齐 */
.navbar .bottom-area {
    align-items: center;
}

/* 导航链接防止文字换行 */
.navbar .nav-item .nav-link {
    white-space: nowrap;
}

/* ==================== 天气卡片样式 ==================== */
/* 现代化天气卡片样式 */
.weather-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 24px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.weather-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.weather-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.weather-main {
    position: relative;
    z-index: 2;
}

.weather-temp {
    display: flex;
    align-items: baseline;
    margin-bottom: 12px;
}

.temp-value {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.temp-unit {
    font-size: 1.4rem;
    font-weight: 300;
    margin-left: 6px;
    opacity: 0.9;
}

.weather-desc {
    font-size: 1.2rem;
    margin-bottom: 6px;
    opacity: 0.95;
    font-weight: 400;
}

.weather-location {
    opacity: 0.85;
    font-size: 0.95rem;
    font-weight: 300;
}

.weather-icon {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.weather-details {
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-detail-item {
    text-align: center;
}

.weather-detail-item i {
    font-size: 1.4rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.weather-detail-item .small {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-bottom: 4px;
    font-weight: 300;
}

.weather-detail-item .fw-bold {
    font-size: 1.1rem;
    font-weight: 500;
}

.weather-note {
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,0.12);
    border-radius: 12px;
    padding: 10px 16px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-forecast-badge {
    position: relative;
    z-index: 2;
}

.weather-forecast-badge .badge {
    background: rgba(255,255,255,0.15) !important;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    font-weight: 400;
    padding: 6px 12px;
    border-radius: 20px;
}

/* 不同天气类型的卡片颜色 */
.weather-card.sunny {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.weather-card.cloudy {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.weather-card.rainy {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.weather-card.snowy {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.weather-card.foggy {
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
}

.weather-card.thunderstorm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.weather-card.night {
    background: linear-gradient(135deg, #2c3e50 0%, #4a6741 100%);
}

/* 响应式设计改进 */
@media (max-width: 768px) {
    .weather-card {
        padding: 20px;
    }
    
    .temp-value {
        font-size: 2.5rem;
    }
    
    .weather-icon {
        width: 70px;
        height: 70px;
        font-size: 2.8rem;
    }
    
    .weather-details {
        padding: 16px;
    }
}

/* Weather Icons库提供专业天气图标，无需自定义CSS图标 */



.weather-details {
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 15px;
    backdrop-filter: blur(10px);
}

.weather-detail-item {
    text-align: center;
}

.weather-detail-item i {
    font-size: 1.2rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

.weather-detail-item .small {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-bottom: 2px;
}

.weather-detail-item .fw-bold {
    font-size: 1rem;
    font-weight: 600;
}

.weather-note {
    position: relative;
    z-index: 2;
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 8px 12px;
    backdrop-filter: blur(5px);
}

.weather-forecast-badge {
    position: relative;
    z-index: 2;
}

.weather-forecast-badge .badge {
    background: rgba(255,255,255,0.2) !important;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    backdrop-filter: blur(5px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .weather-card {
        padding: 15px;
    }
    
    .temp-value {
        font-size: 2rem;
    }
    
    .weather-icon {
        width: 60px;
        height: 60px;
    }
    
    .weather-details {
        padding: 12px;
    }
}
