/* --- 全局基础 --- */
body.modal-open {
    overflow: hidden; /* 弹窗打开时禁止背景滚动 */
}

.imgBlock>div img {
    height: 12rem;
    object-fit: cover;
}

/* 移动端适配调整 */
@media screen and (max-width: 500px) {
    #swiper1 p,
    .topic .newsList h3 a,
    .topic .newsList h4 a,
    #swiper3 .swiper-slide p,
    .newsBlock h3 a,
    .cgzs h3,
    .mtgz ul li {
        height: auto;
    }
    .imgBlock>div {
        width: 48%
    }
}

@media screen and (max-width: 768px) {
    #introContent {
        overflow: hidden;
    }

    #audioToggleBtn {
        display: none !important;
    }
}

/* --- 地图容器与热区样式 --- */
.regions-container {
    margin-bottom: 20px;
    position: relative; /* 确保子元素absolute定位是相对于本容器 */
    /* 去除移动端默认的点击高亮背景色 */
    -webkit-tap-highlight-color: transparent; 
}

svg {
    width: 100%;
    height: auto;
    display: block;
}

.hotspot {
    fill: transparent; /* 完全透明 */
    cursor: pointer;
    /* 确保没有任何边框或轮廓 */
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* --- 音频开关按钮 (图片版样式优化) --- */
.audio-toggle-btn {
    position: absolute; /* 绝对定位，相对于regions-container */
    top: 20px;          /* 距离地图顶部 */
    right: 10px;        /* 距离地图右侧 */
    width: 40px;        /* 按钮尺寸 */
    height: 40px;
    background: #fff;   /* 默认白色背景 */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;        /* 保证在svg之上 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* 柔和阴影 */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* 弹性过渡 */
    -webkit-tap-highlight-color: transparent;
}

.audio-toggle-btn:active {
    transform: scale(0.9); /* 点击时轻微缩小 */
}

/* 开启状态样式：背景变为指定绿色 */
.audio-toggle-btn.active {
    background: #bdd54f; 
    box-shadow: 0 4px 15px rgba(189, 213, 79, 0.5); /* 绿色光晕 */
}

/* 图片通用样式 */
.audio-toggle-btn img {
    width: 24px;  /* 图片宽度 */
    height: 24px; /* 图片高度 */
    pointer-events: none; /* 防止图片被拖拽 */
}

/* --- 状态切换逻辑 --- */

/* 默认状态：显示静音图，隐藏有声图 */
.icon-sound-off { display: block; }
.icon-sound-on { display: none; }

/* 激活状态 (.active)：显示有声图，隐藏静音图 */
.audio-toggle-btn.active .icon-sound-on { display: block; }
.audio-toggle-btn.active .icon-sound-off { display: none; }

/* --- 弹窗核心样式 --- */
.popup-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px); /* 磨砂效果 */
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
.popup-mask.active {
    opacity: 1;
    visibility: visible;
}

.city-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 550px;
    height: 70vh; /* 固定高度，内部滚动 */
    background: #fff;
    border-radius: 12px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.city-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* --- 弹窗头部导航栏 --- */
.popup-header {
    height: 50px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    flex-shrink: 0;
}

.header-left {
    width: 60px;
    display: flex;
    align-items: center;
}

/* 返回按钮 */
.back-btn {
    display: none; /* 默认隐藏 */
    align-items: center;
    background: none;
    border: none;
    color: #007bff;
    font-size: 14px;
    cursor: pointer;
    padding: 5px;
}
.back-btn.show {
    display: flex;
}
.back-btn svg {
    width: 16px;
    height: 16px;
    margin-right: 2px;
    fill: currentColor;
}

.popup-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.close-btn {
    width: 60px;
    text-align: right;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 0 10px;
}

/* --- 弹窗内容区域 --- */
.popup-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    background: #fff;
    position: relative;
}

/* 视图1：九宫格列表样式 */
.subitem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 一行3个 */
    gap: 15px;
    padding-bottom: 20px;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    position: relative; /* 为标记做定位参考 */
    -webkit-tap-highlight-color: transparent;
}

.grid-img-box {
    width: 100%;
    aspect-ratio: 1 / 1; /* 保持正方形 */
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid #eee;
    position: relative;
    transition: all 0.2s;
}

.grid-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.grid-item:active .grid-img-box img {
    transform: scale(0.95); /* 点击反馈 */
}

.grid-text {
    font-size: 13px;
    color: #333;
    text-align: center;
    line-height: 1.3;
}

/* --- 有资讯时的标记样式 (随机颜色圆点) --- */
.grid-item.has-news .grid-img-box::after {
    content: "";
    position: absolute;
    top: 8px;       /* 距离顶部 */
    right: 8px;     /* 距离右侧 */
    width: 14px;    /* 点的大小 */
    height: 14px;
    border-radius: 50%;
    background-color: var(--dot-color, #e60012); /* 使用变量颜色，默认红 */
    border: 2px solid #fff; /* 白色描边，增强识别度 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* 轻微阴影 */
    z-index: 2;
    pointer-events: none;
}

/* 视图2：详情页样式 */
.detail-view {
    animation: fadeIn 0.3s ease;
}

.detail-cover {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
    background-color: #f0f0f0;
}

.detail-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    border-left: 4px solid #c00;
    padding-left: 10px;
}

.detail-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 25px;
    text-align: justify;
}

.detail-link-btn {
    display: block;
    width: 100%;
    padding: 12px 0;
    background-color: #c00;
    color: #fff;
    text-align: center;
    text-decoration: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    transition: background 0.3s;
}
.detail-link-btn:active {
    background-color: #a00;
}

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

.empty-state {
    text-align: center;
    color: #999;
    padding-top: 50px;
}

/* --- 轻提示 (Toast) 样式 --- */
.toast-msg {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    z-index: 10000;
    pointer-events: none;
    text-align: center;
    animation: toastAnim 2s ease forwards;
}

@keyframes toastAnim {
    0% { opacity: 0; transform: translate(-50%, -40%); }
    10% { opacity: 1; transform: translate(-50%, -50%); }
    80% { opacity: 1; transform: translate(-50%, -50%); }
    100% { opacity: 0; transform: translate(-50%, -50%); }
}