/* ============ 全局公告弹窗（移动端优先：灰/白/蓝） ============ */
:root{
    --nm-bg: rgba(10, 18, 28, .62);
    --nm-card: #ffffff;
    --nm-text: #0f172a;
    --nm-subtext: #475569;
    --nm-border: rgba(15, 23, 42, .10);
    --nm-blue: #2563eb;
    --nm-blue-2: #1d4ed8;
    --nm-graybtn: #f1f5f9;
    --nm-graybtn-2: #e2e8f0;
    --nm-shadow: 0 20px 70px rgba(2, 6, 23, .25);
}

/* 遮罩层 */
#nm-overlay{
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    background: var(--nm-bg);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* 显示状态 */
#nm-overlay.nm-show{
    display: flex;
}

/* 弹窗卡片 */
#nm-modal{
    width: 100%;
    max-width: 520px;
    background: var(--nm-card);
    color: var(--nm-text);
    border: 1px solid var(--nm-border);
    border-radius: 18px;
    box-shadow: var(--nm-shadow);
    overflow: hidden; /* 只用于圆角裁切，按钮不再超出 */
}

/* 顶部区域 */
#nm-head{
    padding: 16px 16px 10px 16px;
    position: relative;
}

/* 关闭按钮（右上角） */
#nm-close{
    position: absolute;
    right: 10px;
    top: 10px;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid var(--nm-border);
    background: #fff;
    color: var(--nm-subtext);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
#nm-close:active{
    transform: scale(0.98);
}
#nm-close svg{
    width: 18px;
    height: 18px;
}

/* 标题 */
#nm-title{
    font-size: 18px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: .2px;
    margin: 2px 44px 0 0; /* 给关闭按钮让位 */
}

/* 内容区 */
#nm-body{
    padding: 0 16px 16px 16px;
}

#nm-desc{
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--nm-subtext);
}

#nm-domainBox{
    margin-top: 12px;
    border: 1px solid var(--nm-border);
    border-radius: 14px;
    padding: 12px;
    background: #f8fafc;
}

#nm-domainLabel{
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

#nm-domainRow{
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* 关键：按钮自适应不溢出 */
}

#nm-domain{
    font-size: 16px;
    font-weight: 900;
    color: var(--nm-text);
    letter-spacing: .4px;
    word-break: break-all;
    flex: 1 1 220px; /* 让域名占更多空间 */
    min-width: 180px;
}

/* 按钮通用 */
.nm-btn{
    appearance: none;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;

    /* 关键：自适应长度 & 不溢出 */
    width: auto;
    max-width: 100%;
    white-space: nowrap;
}

.nm-btn:active{
    transform: scale(0.99);
}

/* 复制按钮（灰） */
#nm-copy{
    background: var(--nm-graybtn);
    border-color: var(--nm-graybtn-2);
    color: #0f172a;
    flex: 0 0 auto;
}

/* 下载区域 */
#nm-actions{
    margin-top: 12px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* 关键：按钮自适应不溢出 */
}

#nm-download{
    background: var(--nm-blue);
    color: #fff;
    border-color: rgba(37, 99, 235, .25);
    flex: 1 1 240px; /* 自适应宽度 */
    min-width: 200px;
}
#nm-download:hover{
    background: var(--nm-blue-2);
}

/* 提示小字 */
#nm-tip{
    margin-top: 10px;
    font-size: 12px;
    color: #94a3b8;
}

/* toast 提示 */
#nm-toast{
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    z-index: 2147483001;
    background: rgba(15, 23, 42, .92);
    color: #fff;
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 14px;
    display: none;
    max-width: calc(100% - 24px);
    text-align: center;
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

/* PC 上稍微更精致一点 */
@media (min-width: 768px){
    #nm-head{ padding: 18px 18px 10px 18px; }
    #nm-body{ padding: 0 18px 18px 18px; }
    #nm-title{ font-size: 19px; }
}
