/* 弹窗背景层 */
#nationalModal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 9999999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: nationalFadeIn 0.4s ease;
}

#nationalModal.show {
    display: flex;
}

/* 图片容器：控制整体大小 */
#nationalModal .national-inner {
    position: relative;
    width: auto;
    height: auto;
    max-width: 520px;   /* 👈 电脑端最大宽度，改小一点 */
    max-height: 420px;  /* 👈 电脑端最大高度，改小一点 */
    transform: scale(0.85);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

#nationalModal.show .national-inner {
    transform: scale(1);
}

/* 图片本体：保持比例，居中 */
#nationalModal img {
    max-width: 100%;
    max-height: 420px;  /* 👈 和容器高度保持一致 */
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.5));
    border-radius: 12px;
}

/* 关闭按钮 */
#nationalModal .national-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid rgba(255, 215, 0, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 300;
    color: #ffd700;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    user-select: none;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#nationalModal .national-close:hover {
    background: #e10045;
    border-color: #ffd700;
    color: #fff;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
}

@keyframes nationalFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* 移动端适配（更小一点） */
@media (max-width: 768px) {
    #nationalModal .national-inner {
        max-width: 85vw;
        max-height: 55vh;
    }
    #nationalModal img {
        max-height: 55vh;
        border-radius: 8px;
    }
    #nationalModal .national-close {
        top: -10px;
        right: -10px;
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    #nationalModal .national-inner {
        max-width: 90vw;
        max-height: 45vh;
    }
    #nationalModal img {
        max-height: 45vh;
        border-radius: 6px;
    }
    #nationalModal .national-close {
        top: -8px;
        right: -8px;
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}