/* --- 基础重置 --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    /*font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;*/
    /* 或者使用更具设计感的字体，如： */
     font-family: 'Noto Serif SC', serif;
    /*font-family: "Microsoft YaHei", "SimHei", sans-serif;*/
    background-color: #f5f0e8; /* 备用底色（与县份页面一致） */
    /*background-image: linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3)), url("../images/ShouYe/背景.png");*/
    background-repeat: no-repeat; /* 禁止重复 */
    background-size: cover; /* 覆盖整个屏幕 */
    background-position: center center; /* 居中显示 */
    background-attachment: fixed; /* 固定背景，滚动页面不移动 */
    color: #000000;
    line-height: 1.6;
}
body {
    overflow-x: hidden;
    width: 100%;
}
/* 强制移动端与电脑显示布局完全一致，等比例缩放 */
html {
    font-size: 14px;
    overflow-x: hidden;
    width: 100%;
}

/* 设置 body 固定宽度基准，防止移动端重排 */
body {
    min-width: 375px;
    /* 原有样式保留 */
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* --- 极简配色：红黑白 --- */
:root {
    --red: #c91f1f;     /* 正红（简约高级） */
    --black: #000000;   /* 纯黑 */
    --white: #ffffff;   /* 纯白 */
    --gray: #666666;    /* 浅灰文字 */
    --light-gray: #f5f5f580; /* 浅灰背景（加半透明，透出底图） */
}

/* 容器样式 */
.container {
    width: 1400px;
    max-width: 96%;
    margin: 0 auto;
    padding: 0 20px;
}

@media (max-width: 1400px) {
    .container {
        width: 96%;
        padding: 0 15px;
    }
}

/* --- 吸顶头部 --- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--white);
    box-shadow: 0 1px 5px rgba(0,0,0,0.08);
}

/* --- 顶部信息栏 --- */
.top-bar {
    background-color: var(--light-gray);
    height: 30px;
    font-size: 12px;
    color: var(--gray);
    padding: 8px 0;
    line-height: 1.4;
    /* 清除浮动，让高度正常显示 */
    overflow: hidden;
    clear: both;
}
.top-bar .left { float: left; }
.top-bar .right { float: right; }
.top-bar .left { float: left; }
.top-bar .right { float: right; }

/* --- 头部 Logo + 导航 合并 --- */
.navbar .container {
    padding: 15px 20px; /* 减少上下内边距 */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    flex-wrap: nowrap;
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-size: 20px; /* 减小网站名字大小 */
    font-weight: bold;
    color: var(--black);
    flex-shrink: 0;
}

.logo-img {
    width: 40px; /* 减小logo大小 */
    height: 40px;
    background-color: var(--red);
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--white);
    font-size: 16px; /* 减小logo文字大小 */
}

.navbar-links {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 8px 0 4px;
    scrollbar-width: thin;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    margin-left: 40px;
    flex-wrap: nowrap;
}

.nav-link {
    white-space: nowrap;
    padding: 5px 8px; /* 减小内边距 */
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px; /* 减小字体大小 */
    font-weight: 500;
    color: var(--black);
}

.nav-link:hover {
    color: var(--red);
    font-weight: bold;
    background-color: #f0f0f0;
}

/* --- 核心大图区域 --- */
/* --- 核心大图区域 --- */
.hero-section {
    width: 100%;
    height: 750px; /* 视口高度 */
    background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.2)), url("../images/ShouYe/背景.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover; /* 覆盖全屏，可能会裁剪边缘 */
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin: 0;
    padding: 0;
    border-radius: 0;
}

.hero-section::before {
    content: "";
    position: absolute;
    top:0;left:0;right:0;bottom:0;
    background: rgba(0,0,0,0.15);
    z-index: 1;
    border-radius: 8px;
}

/* --- 文字 --- */
.hero {
    position: relative;
    z-index: 2;
    text-align: center;
    color: var(--white);
    animation: fadeInUp 0.8s ease-out;
}

.hero h1 {
    font-size: 60px; /* 减小字体大小 */
    color: var(--red);
    font-weight: 900;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.hero .sub-title {
    font-size: 24px; /* 减小字体大小 */
    color: var(--white);
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 16px;
    color: var(--white);
    margin-bottom: 40px;
}

/* --- 极简按钮 --- */
.btn-group {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn {
    padding: 10px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: 0.2s;
}

.btn-red {
    background: oklch(0.65 0.18 200 / 0.6);
    color: var(--white);
}

.btn-black {
    background: oklch(0.65 0.18 200 / 0.6);
    color: var(--white);
}

.btn-outline {
    background: oklch(0.65 0.18 200 / 0.6);
    color: var(--white);
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* --- 向下滚动 --- */
.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--white);
    font-size: 14px;
    text-align: center;
    cursor: pointer;
    z-index: 2;
}

.scroll-down i {
    display: block;
    width: 18px;
    height: 18px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg);
    margin: 8px auto 0;
}

/* 主要内容样式 */
.main-content {
    padding: 60px 0;
    background: var(--light-gray); /* 半透明背景，透出底图 */
    border-radius: 8px;
    margin: 20px auto;
}

.page-title {
    font-size: 28px;
    text-align: center; /* 标题居中更协调 */
    margin-bottom: 10px;
    color: var(--black);
}

.page-subtitle {
    font-size: 16px;
    text-align: center; /* 副标题居中 */
    margin-bottom: 15px; /* 增加间距，使整体更疏朗 */
    color: var(--gray);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 县份卡片网格 */
.county-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); /* 增加卡片宽度 */
    gap: 35px; /* 增加间距，使整体更疏朗 */
    padding: 0 20px;
}

.county-card {
    width: 100%;
    border-radius: 8px;
    transition: 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); /* 加阴影，突出卡片 */
    overflow: hidden;
    display: block;
    height: 400px; /* 设置卡片高度，为背景图片留出空间 */
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}/* --- 县份卡片网格（优化间距） --- */
.county-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px; /* 减小间隙，增加紧凑感 */
    padding: 0 20px;
}

/* --- 县份卡片（核心样式） --- */
.county-card {
    position: relative;
    width: 100%;
    height: 320px; /* 适当减小高度，避免页面过长 */
    border-radius: 12px; /* 增加圆角，更现代 */
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-size: cover;
    background-position: center;
    cursor: pointer;
}

/* 悬停效果：增加一点微交互 */
.county-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* --- 卡片内容区域（磨砂玻璃效果） --- */
/* 使用 backdrop-filter 模糊背景，使文字更清晰 */
.county-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    height: 60%; /* 占据卡片底部 60% */
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: var(--white);

    /* 磨砂玻璃背景：半透明白色 + 模糊 */
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(0px);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
}

/* --- 卡片文字美化 --- */

/* 县名：加大字号，使用红色强调 */
.county-name {
    font-size: 28px;
    font-weight: 800; /* 极粗体，增加力量感 */
    margin-bottom: 8px;
    color: var(--red);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3); /* 增加文字阴影，防止背景太亮时看不清 */
}

/* 县介绍：正文字体适中，增加行高 */
/* 将原来的 .county-desc 修改为如下代码： */
.county-card-content .county-desc {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 12px;
    color: #000 !important; /* 加上 !important 确保生效 */
    opacity: 0.9;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 县特色：使用图标感文字 */
.county-feature {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 15px;
    color: #fff;
    background: rgba(255, 255, 255, 0.4);
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

/* 探索更多：悬停变色动画 */
.explore-more {
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--white);
}

.explore-more:hover {
    color: var(--red);
    transform: translateX(5px);
}

/* 1. 基础卡片样式 */
/*.county-card {*/
/*    position: relative;*/
/*    display: block;*/
/*    width: 100%;*/
/*    height: 400px;*/
/*    border-radius: 8px;*/
/*    overflow: hidden;*/
/*    background-size: cover;*/
/*    background-position: center;*/
/*    background-repeat: no-repeat;*/
/*    filter: brightness(1.1) contrast(0.8); !* 可选：降低背景对比度 *!*/
/*}*/

/* 2. 半透明遮罩（核心弱化效果） */
/*.county-card::before {*/
/*    content: "";*/
/*    position: absolute;*/
/*    inset: 0; !* 等同于top/left/right/bottom:0 *!*/
/*    !*background-color: rgba(255, 255, 255, 0.1); !* 白色半透明遮罩 *!*!*/
/*    z-index: 1;*/
/*}*/

/* 3. 确保文字在最上层 */
.county-card-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
/* ====================== 阿坝州13个县/市 独立背景图 ====================== */
/* 1. 小金县 */
.county-card-xiaojin {
    background-image: url("../images/XiaoJin/xj.jpg");
}
/* 2. 理县 */
.county-card-li {
    background-image: url("../images/lixian/banner.jpg");
}
/* 3. 茂县 */
.county-card-mao {
    background-image: url("../images/XiaoJin/mx.jpg");
}
/* 4. 汶川县 */
.county-card-wenchuan {
    background-image: url("../static/img/WenChuan/背景图.jpg");
}
/* 5. 九寨沟县 */
.county-card-jiuzhaigou {
    background-image: url("../static/img/JiuZhaiGou/背景图.jpg");
}
/* 6. 松潘县 */
.county-card-songpan {
    background-image: url("../images/songpan/banner.jpg");
}
/* 7. 若尔盖县 */
.county-card-ruoergai {
    background-image: url("../static/img/RuoErGai/若尔盖背景.png");
}
/* 8. 红原县 */
.county-card-hongyuan {
    background-image: url("../images/hongyuan/hy.jpg");
}
/* 9. 阿坝县 */
.county-card-aba {
    background-image: url("../images/aba/aba.jpg");
}
/* 10. 壤塘县 */
.county-card-rangtang {
    background-image: url("../images/rangtang/rangtang.jpg");
}
/* 11. 马尔康市（州府） */
.county-card-maerkang {
    background-image: url("../images/maerkang/马尔康首页.jpg");
}
/* 12. 金川县 */
.county-card-jinchuan {
    background-image: url("../images/jinchuan/banner.jpg");
}
/* 13. 黑水县 */
.county-card-heishui {
    background-image: url("../images/heishui/banner.jpg");
}
/* 其他县同理添加 */

.county-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.county-card-content {
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.3); /* 半透明背景，使文字更清晰 */
}

/* 背景图片样式 */
.county-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.2;
    z-index: 1;
}

/* 县名样式 */
.county-name {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--red);
}

/* 县介绍样式 */
.county-desc {
    font-size: 14px;
    color: dimgrey;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* 县特色样式 */
.county-feature {
    font-size: 14px;
    color: #333333;
    font-weight: 500;
    margin-bottom: 20px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* 探索更多样式 */
.explore-more {
    font-size: 14px;
    color: var(--red);
    font-weight: bold;
    text-align: right;
    cursor: pointer;
    transition: color 0.3s ease;
}

.explore-more:hover {
    color: var(--black);
}

/* ==============================================
   AI 浮窗 + 返回顶部（可迁移区块）
   ============================================== */
#ai-float-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    pointer-events: none;
}
@media (max-width: 480px) {
    #ai-float-widget { right: 12px; bottom: 12px; }
    .ai-float-chat {
        width: calc(100vw - 24px);
        height: 70vh;
        right: 0;
        bottom: 72px;
        border-radius: 12px;
        max-width: 400px;  /* 新增：限制最大宽度 */
    }
    .ai-float-toggle { width: 48px; height: 48px; font-size: 22px; }
    .ai-float-backtop { width: 36px; height: 36px; }
}
#ai-float-widget > * { pointer-events: auto; }

/* ---------- 返回顶部 ---------- */
.ai-float-backtop {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.92);
    color: #333;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    pointer-events: none;
    padding: 0;
}
.ai-float-backtop.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.ai-float-backtop:hover {
    background: var(--red, #c91f1f);
    color: #fff;
    box-shadow: 0 4px 16px rgba(201,31,31,0.3);
}

/* ---------- 浮窗切换按钮 ---------- */
.ai-float-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #c91f1f 0%, #a01818 100%);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(201,31,31,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
    z-index: 10;
}
.ai-float-toggle:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(201,31,31,0.45);
}
.ai-float-toggle.active {
    opacity: 0;
    transform: scale(0.5);
    pointer-events: none;
}
/* 面板打开时，返回顶部也隐藏 */
.ai-float-toggle.active ~ .ai-float-backtop {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}
.ai-float-toggle-icon { position: relative; z-index: 1; line-height: 1; }
.ai-float-toggle-pulse {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(201,31,31,0.4);
    animation: aiFloatPulse 2s ease-out infinite;
}
.ai-float-toggle.active .ai-float-toggle-pulse { animation: none; opacity: 0; }
@keyframes aiFloatPulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ---------- 浮窗面板 ---------- */
.ai-float-chat {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 400px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 5;
}
.ai-float-chat.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 浮窗头部 */
.ai-float-header {
    background: linear-gradient(135deg, #c91f1f 0%, #a01818 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.ai-float-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.ai-float-avatar {
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.ai-float-title {
    font-size: 15px;
    font-weight: 600;
}
.ai-float-header-right {
    display: flex;
    gap: 6px;
}
.ai-float-newchat, .ai-float-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.ai-float-newchat:hover, .ai-float-close:hover {
    background: rgba(255,255,255,0.3);
}

/* 浮窗消息区 */
.ai-float-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f9fafb;
    scroll-behavior: smooth;
    position: relative; /* 为scroll-bottom-btn提供定位上下文 */
}
.ai-float-messages::-webkit-scrollbar { width: 4px; }
.ai-float-messages::-webkit-scrollbar-track { background: transparent; }
.ai-float-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* 消息 */
.ai-float-msg {
    display: flex;
    margin-bottom: 14px;
    animation: aiFloatFadeIn 0.3s ease;
}
@keyframes aiFloatFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.ai-float-msg-user { justify-content: flex-end; }
.ai-float-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #fcdce3;
    border: 2px solid #f5576c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}
.ai-float-msg-content {
    max-width: 78%;
    margin-left: 8px;
}
.ai-float-msg-user .ai-float-msg-content {
    margin-right: 8px;
    margin-left: 0;
}
.ai-float-msg-text {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    word-wrap: break-word;
}
.ai-float-msg-ai .ai-float-msg-text {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.ai-float-msg-user .ai-float-msg-text {
    background: linear-gradient(135deg, #c91f1f, #a01818);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* 浮窗输入区 */
.ai-float-input-area {
    background: #fff;
    padding: 14px 16px 12px;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
.ai-float-input-wrap {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}
.ai-float-input {
    flex: 1;
    padding: 10px 16px;
    border: 1.5px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 80px;
    transition: border-color 0.2s;
    line-height: 1.5;
}
.ai-float-input:focus { border-color: #c91f1f; box-shadow: 0 0 0 2px rgba(201,31,31,0.08); }
.ai-float-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #c91f1f, #a01818);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(201,31,31,0.25);
}
.ai-float-send:hover { transform: scale(1.08); box-shadow: 0 4px 14px rgba(201,31,31,0.35); }
.ai-float-send:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.ai-float-tips {
    text-align: center;
    font-size: 11px;
    color: #aaa;
    margin-top: 8px;
}

/* 加载动画 */
.ai-float-loading {
    display: inline-flex;
    gap: 4px;
    padding: 4px 0;
}
.ai-float-loading span {
    width: 6px;
    height: 6px;
    background: #c91f1f;
    border-radius: 50%;
    animation: aiFloatBounce 1.4s infinite ease-in-out both;
}
.ai-float-loading span:nth-child(1) { animation-delay: -0.32s; }
.ai-float-loading span:nth-child(2) { animation-delay: -0.16s; }
@keyframes aiFloatBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* 回到底部按钮 */
.scroll-bottom-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 6px 12px;
    background: rgba(201, 31, 31, 0.9);
    color: #fff;
    border: none;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s;
    z-index: 10;
}
.scroll-bottom-btn:hover {
    background: rgba(201, 31, 31, 1);
    transform: scale(1.05);
}

/* 打字光标 */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: #c91f1f;
    margin-left: 2px;
    animation: typing-blink 1s infinite;
    vertical-align: text-bottom;
}
@keyframes typing-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 浮窗内 markdown 微调 */
.ai-float-msg-text.markdown-content p { margin: 4px 0; }
.ai-float-msg-text.markdown-content ul { padding-left: 18px; list-style: disc; }
.ai-float-msg-text.markdown-content li { margin: 2px 0; }
.ai-float-msg-text.markdown-content strong { color: #c91f1f; }
.ai-float-msg-text.markdown-content code { background: #f3f4f6; padding: 1px 4px; border-radius: 3px; font-size: 0.9em; }
.ai-float-msg-text.markdown-content pre { background: #1f2937; color: #f9fafb; padding: 10px; border-radius: 6px; overflow-x: auto; margin: 6px 0; }
.ai-float-msg-text.markdown-content pre code { background: none; color: inherit; padding: 0; }

/* ---------- 移动端适配 ---------- */
@media (max-width: 480px) {
    #ai-float-widget { right: 12px; bottom: 12px; }
    .ai-float-chat {
        width: calc(100vw - 24px);
        height: 70vh;
        right: 0;
        bottom: 72px;
        border-radius: 12px;
    }
    .ai-float-toggle { width: 48px; height: 48px; font-size: 22px; }
    .ai-float-backtop { width: 36px; height: 36px; font-size: 15px; }
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: #fff;
    padding: 40px 0; /* 增加内边距，使整体更疏朗 */
    margin-top: 60px; /* 增加间距，使整体更疏朗 */
}

.footer .container {
    text-align: center;
}

.footer p {
    margin: 0;
    font-size: 14px;
}

/* --- 动画 --- */
@keyframes fadeInUp {
    from { opacity:0; transform: translateY(20px); }
    to { opacity:1; transform: translateY(0); }
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .container {
        width: 95%;
    }

    .navbar-links {
        gap: 12px;
    }

    .nav-link {
        font-size: 13px;
        padding: 4px 6px;
    }
}

@media (max-width: 1200px) {
    .navbar-brand {
        font-size: 18px;
    }

    .logo-img {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .county-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 30px;
    }
}

@media (max-width: 992px) {
    .navbar .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .navbar-links {
        width: 100%;
        overflow-x: auto;
        padding: 10px 0;
        gap: 10px;
    }

    .hero h1 {
        font-size: 48px;
    }

    .hero .sub-title {
        font-size: 20px;
    }

    .county-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 36px;
    }

    .hero .sub-title {
        font-size: 18px;
    }

    .county-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .page-title {
        font-size: 24px;
    }

    .page-subtitle {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 500px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .county-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 40px 0;
    }
}
/* ========== 卡片层叠轮播系统 ========== */
/* 主容器：固定宽度，居中 */
.timeline-slider {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    position: relative;
}

/* 顶部时间线：均匀分布圆点 */
/* 时间线容器 - 顶部留足够空间给月份 */
.timeline {
    width: 100%;
    height: 70px; /* 调整高度，刚好容纳月份+圆点+时间线 */
    position: relative;
    margin-bottom: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    /*padding-top: 5px; !* 顶部留一点边距，避免月份贴顶 *!*/
}
.time::-webkit-scrollbar{
    display:none;
}
.timeline-track {
    position: absolute;
    top: 50%;
    left: 0; /* 从第一个圆点最左侧开始 */
    right: 0; /* 到最后一个圆点最右侧结束 */
    height: 3px;
    background: #eee;
    transform: translateY(-50%);
    pointer-events: none; /* 防止拦截下方圆点的点击 */
    padding: 0;
    margin: 0;
}
.timeline-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: #A91B2C;
    transition: width 0.5s ease;
}
/* 圆点容器 - 保证13个圆点均匀分布，不挤压 */
.timeline-dots {
    scale: 0.98;
    display: flex;
    justify-content: space-between;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    min-width: 1000px; /* 适配13个圆点+月份，避免挤压 */
    padding: 0 5px;
    /*gap: 5px; !* 圆点之间留最小间距，防止月份重叠 *!*/
}
.dot {
    position: relative; /* 必须保留，作为月份的定位参考 */
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #A91B2C;
    cursor: pointer;
    z-index: 2;
    /* 新增：防止圆点被挤压，保证每个圆点间距均匀 */
    flex-shrink: 0;
}
.dot-month {
    position: absolute;
    top: -24px; /* 精准定位在圆点正上方（数值越小越靠近圆点） */
    left: 50%;
    transform: translateX(-50%); /* 绝对居中，不会偏移 */
    font-size: 11px; /* 缩小字号，避免重叠 */
    color: #666;
    white-space: nowrap; /* 强制不换行，保证"1-2月"完整显示 */
    font-weight: 500;
    line-height: 1; /* 取消行高，避免文字上下偏移 */
    text-align: center; /* 文本自身居中 */
    width: 40px; /* 固定宽度，确保居中稳定 */
}
/* 激活的圆点，月份变黄色加粗 */
.dot.active .dot-month {
    color: #A91B2C;
    font-weight: bold;
}


/* ========== 卡片层叠容器 ========== */
.cards-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 560px;
    background: transparent;
    padding: 10px 0 30px;
    box-sizing: border-box;
}

/* 左右渐变遮罩（淡出效果） */
.cards-container:before {
    background-image: linear-gradient(to right, rgba(210,210,210,0.4), rgba(210, 210, 210, 0));
    left: 0;
    content: '';
    position: absolute;
    z-index: 2;
    top: 0;
    height: 100%;
    width: 80px;
    pointer-events: none;
}
.cards-container:after {
    background-image: linear-gradient(to left, rgba(210,210,210,0.4), rgba(210, 210, 210, 0));
    right: 0;
    content: '';
    position: absolute;
    z-index: 2;
    top: 0;
    height: 100%;
    width: 80px;
    pointer-events: none;
}

/* 单个卡片 wrapper — left:50% 居中保证对称 */
.card-single {
    width: 64%;
    max-width: 700px;
    position: absolute;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.8, 0.25, 1),
                opacity 0.35s ease;
    z-index: 1;
    pointer-events: none;
}

/* 前一个卡片 - 左侧可见（对称偏移） */
.card-single.prev {
    opacity: 0.45;
    transform: translateX(calc(-50% - 85%)) scale(0.92);
    z-index: 0;
    pointer-events: none;
}

/* 当前激活卡片 - 居中高亮 */
.card-single.active {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    z-index: 5;
    pointer-events: auto;
}

/* 后一个卡片 - 右侧可见（对称偏移） */
.card-single.next {
    opacity: 0.45;
    transform: translateX(calc(-50% + 85%)) scale(0.92);
    z-index: 0;
    pointer-events: none;
}

/* ========== 导航箭头 ========== */
.carousel-arrows {
    /* 父容器改为绝对定位，居中在卡片区域 */
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 5%;  /* 控制箭头离左右边的距离 */
    pointer-events: none;
    z-index: 10;
}
.arrow {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: #fff;
    color: #666;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    user-select: none;
    pointer-events: auto; /* 恢复点击 */
}
.arrow:hover {
    border-color: #A91B2C;
    color: #A91B2C;
    box-shadow: 0 4px 14px rgba(45, 100, 100, 0);
    transform: translateY(-2px);
}
.arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 卡片样式：固定宽度，和参考图一致 */
.slide-card {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 15px;
    border: 1px solid #A91B2C;
    cursor: pointer;
    transition: all 0.3s ease;
    position :relative;
    display: flex;
    flex-direction: column;
}
.slide-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.92); /* 白色半透明遮罩，0.9是透明度 */
    border-radius: 12px;
    z-index: -1; /* 遮罩在内容下方、背景图上方 */
}
.slide-year {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #A91B2C;
    margin-bottom: 10px;
    padding-top: 10px;
}
.slide-image1 {
    width: 85%;
    height: 300px;
    background-image: url("../images/ganhanzi.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image2 {
    width: 85%;
    height: 300px;
    background-image: url("../images/jinchuan.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image3 {
    width: 85%;
    height: 300px;
    background-image: url("../images/xiaojin.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image4 {
    width: 85%;
    height: 300px;
    background-image: url("../images/wenchuan.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image5 {
    width: 85%;
    height: 300px;
    background-image: url("../images/lixian.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image6 {
    width: 85%;
    height: 300px;
    background-image: url("../images/maoxian.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image7 {
    width: 85%;
    height: 300px;
    background-image: url("../images/songpan.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image8 {
    width: 85%;
    height: 300px;
    background-image: url("../images/heishui.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image9 {
    width: 85%;
    height: 300px;
    background-image: url("../images/maerkang.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image10 {
    width: 85%;
    height: 300px;
    background-image: url("../images/hongyuan.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image11 {
    width: 85%;
    height: 300px;
    background-image: url("../images/ruoergai.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image12 {
    width: 85%;
    height: 300px;
    background-image: url("../images/aba.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-image13 {
    width: 85%;
    height: 300px;
    background-image: url("../images/rangtang.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    margin-bottom: 10px;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}
.slide-text {
    padding: 10px 15px;
    flex: 1;
    /*padding: 30px; !* 恢复文本内边距 *!*/
    /*max-width: 1200px; !* 文本限制宽度，避免拉伸 *!*/
    /*margin: 0 auto;*/
}
.slide-text h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #333;
}
.slide-text p {
    font-size: 15px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 10px;
}
.slide-profile {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
    border-top: 1px solid #f5f5f5;
    padding-top: 8px;
}
/* ========== 探索更多按钮 ========== */
.explore-more {
    position: absolute;
    bottom: 5px;
    right: 25px;
    font-size: 14px;
    color: #A91B2C;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 5;
}
.explore-more:hover {
    color: #A91B2C;
    transform: translateX(3px);
}

/* 民族文化网格容器：保持弹性布局 */
.culture-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    gap: 40px;
    padding: 0 20px;
}

/* 通用卡片样式 */
.culture-card {
    flex: 0 1 500px;
    width: 600px;
    max-width: 100%;
    height: 450px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

/* 遮罩层：防止文字与背景图混淆 */
.culture-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.7)); /* 底部深色遮罩，便于阅读 */
    z-index: 1;
}

/* 卡片内容层：置于遮罩之上 */
.culture-content {
    position: relative;
    z-index: 2;
    padding: 30px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* 文字靠底部显示 */
    color: white;
}

/* 卡片悬停特效：背景图缩放 */
.culture-card:hover {
    transform: scale(1.03);
}
.culture-card:hover .culture-overlay {
    opacity: 0.9;
}

/* 藏族文化卡片：设置雪山/寺庙背景图 */
.culture-card-tibet {
    background: url('../images/zangzu-bg.jpg') center/cover no-repeat; /* 替换为实际的藏族背景图URL */
}

/* 羌族文化卡片：设置碉楼/彩林背景图 */
.culture-card-qiang {
    background: url('../images/qiangzu-bg.jpg') center/cover no-repeat; /* 替换为实际的羌族背景图URL */
}

/* 文字样式优化 */
.culture-card h3 {
    font-size: 28px;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.culture-feature {
    font-size: 16px;
    margin: 5px 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
@media (max-width: 768px) {
    .card-single {
        width: 85%;  /* 卡片变宽一点，更易读 */
    }
    .card-single.prev {
        transform: translateX(calc(-50% - 70%)) scale(0.9);
    }
    .card-single.next {
        transform: translateX(calc(-50% + 70%)) scale(0.9);
    }
}
/* 移动端：保持布局结构不变，仅等比缩放间距和字体 */
@media (max-width: 768px) {
    .container {
        width: 98%;
        padding: 0 12px;
    }

    .card-single {
        width: 85%;
    }

    .cards-container {
        min-height: 520px;
    }

    .culture-grid {
        flex-wrap: wrap;
        gap: 24px;
    }

    .culture-card {
        width: 90%;
        flex: 0 1 auto;
    }

    .navbar-links {
        margin-left: 0;
        gap: 8px;
    }

    .hero-section {
        height: 65vh;
    }

    /* 保持卡片遮罩可读性，不改变布局 */
    .slide-card::before {
        background: rgba(255, 255, 255, 0.92);
    }

    /* 文字适当缩小，保持比例 */
    .page-title {
        font-size: 24px;
    }

    .hero .sub-title {
        font-size: 20px;
    }
}

/* 极小屏（< 480px）只微调内边距，不改变布局结构 */
@media (max-width: 480px) {
    .hero-section {
        height: 55vh;
    }

    .btn {
        padding: 8px 20px;
        font-size: 14px;
    }

    .culture-card h3 {
        font-size: 24px;
    }
}