/* 居中显示弹窗 */
.modal {
    display: none;
    position: fixed;
    z-index: 1;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 400px;
    text-align: center;
}

/* 确认按钮样式 */
.confirm-button {
    padding: 10px 20px;
    margin: 10px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
}

.confirm-button:hover {
    background-color: #45a049;
}

/* 图片自动切换和点击切换样式 */
#img {
    max-width: 100%;
    height: auto;
    transition: all 0.3s ease;
}

/* 导航栏相关样式 */
.navbar-custom.sticky {
    transition: all 0.3s ease-in-out;
}

.navbar-nav .nav-link {
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: #4CAF50 !important;
}

/* 按钮样式 */
.btn-primary {
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 页面区块样式 */
section {
    padding: 80px 0;
    position: relative;
}

.hero-1-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.feather-bg-img {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.footer {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 60px 0 20px;
}

.footer-alt {
    background-color: rgba(0, 0, 0, 0.7);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .modal-content {
        width: 90%;
        margin: 30% auto;
    }
    
    section {
        padding: 60px 0;
    }
    
    .navbar-nav {
        text-align: center;
    }
}

/* 弹窗遮罩层，覆盖整个视口 */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw; /* 用视口宽度单位，适配手机 */
    height: 100vh; /* 用视口高度单位，覆盖全屏 */
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 10px; /* 给边缘留点空隙，避免图片贴边 */
    box-sizing: border-box; /* 让内边距不影响整体尺寸计算 */
}

/* 弹窗内容容器，限制最大宽高 */
.popup-container {
    position: relative;
    max-width: 100%; /* 适应手机宽度 */
    max-height: 80vh; /* 占视口高度 80%，避免太高 */
    overflow: auto; /* 内容超出可滚动 */
    scrollbar-width: none; /* 隐藏火狐滚动条 */
    -ms-overflow-style: none; /* 隐藏 IE/Edge 滚动条 */
}

.popup-container::-webkit-scrollbar {
    display: none; /* 隐藏 Chrome/Safari 滚动条 */
}

/* 关闭按钮容器，粘性定位在弹窗右上角 */
.close-btn-wrapper {
    position: sticky;
    top: 10px; /* 距离弹窗容器顶部距离 */
    display: flex;
    justify-content: flex-end;
    padding-right: 10px; /* 与边缘间距 */
    margin-bottom: -30px; /* 抵消按钮高度，不占额外空间 */
    z-index: 10;
    pointer-events: none; /* 点击穿透，不影响图片交互 */
}

/* 关闭按钮样式，手机上点击更顺手 */
.close-btn {
    width: 30px; 
    height: 30px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.2s;
    pointer-events: auto; /* 恢复按钮点击能力 */
}

.close-btn:hover {
    transform: scale(1.1);
    background-color: rgba(0, 0, 0, 0.9);
}

/* 弹窗图片，自适应且保持原图比例 */
.popup-image {
    display: block;
    width: auto; 
    height: auto;
    max-width: 100%; /* 不超过容器宽度 */
    max-height: none; /* 保留原图高度，超出容器可滚动 */
    cursor: pointer;
    margin: 0 auto; /* 水平居中 */
}