/* 客户端检查更新入口（2026-09-06）：所有后台页共用的顶栏按钮 + 弹窗。
   与登录页 login.html 里的内联卡片（.client-update-block）视觉风格呼应，但
   DOM/样式完全独立，避免和宿主页面已有类名冲突。
   —— 醒目、不透明；不是右下角半透明小字。 */

.ac-cu-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px;
    border-radius: 9px;
    border: 1px solid var(--skin-border, #e6e8f0);
    background: var(--skin-surface, #ffffff);
    color: var(--skin-text-muted, #4c5570);
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, color .15s, border-color .15s;
}
.ac-cu-nav-btn:hover {
    background: var(--skin-surface-hover, #f4f5fa);
    color: #356be5;
    border-color: #c7ccdc;
}
.ac-cu-nav-btn svg { width: 15px; height: 15px; flex-shrink: 0; }
@media (max-width: 1366px) {
    .ac-cu-nav-btn span { display: none; }
    .ac-cu-nav-btn { padding: 0 9px; }
    .ac-ls-badge { max-width: 88px; overflow: hidden; text-overflow: ellipsis; }
}
.ac-cu-nav-btn.has-update {
    background: #fff2df;
    border-color: #f0c27a;
    color: #a5610b;
}
.ac-cu-nav-btn.has-update:hover { background: #ffe8c2; color: #8a5209; }

/* navbar 找不到时的兜底：固定在窗口左上角（logout 兜底用右上角，避免重叠） */
.ac-cu-fixed {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 9998;
    box-shadow: 0 6px 18px -8px rgba(30, 34, 74, 0.28);
}

/* 邮件页顶栏 Logo 旁：紧贴"版本 vX.X.X"徽标正上方的主入口（2026-09-06） */
.ac-cu-top-slot { display: flex; }
.ac-cu-top-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 18px;
    padding: 0 7px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--skin-text-muted, #8b93a7);
    font: inherit;
    font-size: 10.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color .15s, color .15s;
}
.ac-cu-top-trigger:hover {
    background: var(--skin-surface-soft, #f4f5fa);
    color: #356be5;
}
.ac-cu-top-trigger svg { width: 11px; height: 11px; flex-shrink: 0; }
.ac-cu-top-trigger.has-update {
    background: #fff2df;
    color: #a5610b;
}
.ac-cu-top-trigger.has-update:hover { background: #ffe8c2; color: #8a5209; }

/* 主动推送横幅：远程客户端壳检测到新版本时，不等用户点开就顶部弹出 */
.ac-cu-banner {
    display: none;
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translate(-50%, -14px);
    z-index: 10003;
    align-items: flex-start;
    gap: 12px;
    max-width: min(560px, calc(100vw - 32px));
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #f0c27a;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(20, 25, 45, 0.22);
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
    font-family: inherit;
}
.ac-cu-banner.show { display: flex; opacity: 1; transform: translate(-50%, 0); }
.ac-cu-banner__icon {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fff2df;
    color: #a5610b;
}
.ac-cu-banner__icon svg { width: 16px; height: 16px; }
.ac-cu-banner__body { flex: 1; min-width: 0; }
.ac-cu-banner__title { font-size: 13.5px; font-weight: 800; color: #1c2233; }
.ac-cu-banner__sub { margin-top: 2px; font-size: 12px; color: #5a6376; }
.ac-cu-banner__notes {
    margin-top: 6px;
    padding: 7px 9px;
    background: #f7f8fb;
    border-radius: 8px;
    font-size: 12px;
    color: #4c5570;
    line-height: 1.55;
    white-space: pre-wrap;
}
.ac-cu-banner__actions {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}
.ac-cu-banner__btn {
    border: 1px solid #d5dae4;
    background: #fff;
    color: #4c5570;
    padding: 6px 13px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font: inherit;
    white-space: nowrap;
}
.ac-cu-banner__btn:hover { background: #f4f6fa; color: #1c2233; }
.ac-cu-banner__btn:disabled { opacity: .55; cursor: not-allowed; }
.ac-cu-banner__btn--primary {
    border-color: #356be5;
    background: #356be5;
    color: #fff;
}
.ac-cu-banner__btn--primary:hover { background: #2a5cd3; }
.ac-cu-banner__close {
    border: none;
    background: transparent;
    color: #98a1b3;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}
.ac-cu-banner__close:hover { color: #4c5570; }

@media (max-width: 640px) {
    .ac-cu-banner { flex-wrap: wrap; }
    .ac-cu-banner__actions { width: 100%; justify-content: flex-end; }
}

#acCuModal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 25, 45, .42);
    z-index: 10002;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: inherit;
}
#acCuModal.open { display: flex; }
.ac-cu-dialog {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(20, 25, 45, .22);
    width: min(440px, 100%);
    padding: 20px 22px 18px;
    animation: acCuPop .16s ease;
}
@keyframes acCuPop { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
.ac-cu-dialog h3 {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 800;
    color: #1c2233;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ac-cu-dialog h3 svg { width: 18px; height: 18px; color: #356be5; flex-shrink: 0; }
.ac-cu-body { font-size: 13px; color: #4c5570; line-height: 1.6; min-height: 24px; }
.ac-cu-foot { display: flex; justify-content: flex-end; margin-top: 16px; }
.ac-cu-close-btn {
    border: 1px solid #d5dae4;
    background: #fff;
    color: #4c5570;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    font: inherit;
}
.ac-cu-close-btn:hover { background: #f4f6fa; color: #1c2233; }

/* renderResult() 输出的共用块，登录页内联卡片与弹窗都会用到这些类 */
.cu-row { padding: 7px 0; border-bottom: 1px solid #f1f3f7; }
.cu-row:last-child { border-bottom: none; }
.cu-row b { color: #1c2233; }
.cu-row.cu-ok { color: #18794e; font-weight: 700; }
.cu-row.cu-warn { color: #a5610b; font-weight: 700; }
.cu-row.cu-err { color: #b42d29; font-weight: 700; }
.cu-notes {
    margin: 8px 0;
    padding: 9px 11px;
    background: #f7f8fb;
    border-radius: 9px;
    font-size: 12.5px;
    color: #4c5570;
    line-height: 1.6;
    white-space: pre-wrap;
}
.cu-hint { margin-top: 8px; font-size: 12px; color: #8b93a7; line-height: 1.55; }
.cu-apply-btn, .cu-check-btn {
    border: 1px solid #356be5;
    background: #356be5;
    color: #fff;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    font: inherit;
    margin-top: 6px;
}
.cu-apply-btn:hover, .cu-check-btn:hover { background: #2a5cd3; }
.cu-apply-btn:disabled, .cu-check-btn:disabled { opacity: .55; cursor: not-allowed; }
.cu-err { color: #b42d29; }
.cu-ok { color: #18794e; }

/* 登录页内联卡片（templates/login.html #acClientUpdateBlock）：
   醒目、不透明、常驻可见，不是右下角半透明小字。 */
.client-update-block {
    margin-top: 22px;
    padding: 14px 16px;
    border: 1px solid #e6e8f0;
    border-radius: 12px;
    background: #f8f9fd;
}
.client-update-block .cu-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.client-update-block .cu-head svg { width: 16px; height: 16px; color: #356be5; flex-shrink: 0; }
.client-update-block .cu-title {
    flex: 1;
    font-size: 13px;
    font-weight: 700;
    color: #1c2233;
}
.client-update-block .cu-check-btn { margin-top: 0; padding: 5px 12px; }
.client-update-block .cu-body { font-size: 12.5px; color: #5a6376; line-height: 1.6; }

/* 轻量能力自检：当前是远程壳 / 纯网页 / 本机桌面 */
.ac-ls-badge {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid var(--skin-border, #e6e8f0);
    background: var(--skin-surface-soft, #f4f5fa);
    color: var(--skin-text-muted, #5a6376);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1;
    user-select: none;
}
.ac-ls-badge.is-shell {
    background: #e8f6ee;
    border-color: #b7e0c4;
    color: #18794e;
}
.ac-ls-badge.is-web {
    background: #fff2df;
    border-color: #f0c27a;
    color: #8a5209;
}
.ac-ls-badge.is-local {
    background: #eef3ff;
    border-color: #c7d4f5;
    color: #2a5cd3;
}
/* 磁盘壳文件比运行中的进程新：本机接口以旧进程为准，必须重启 */
.ac-ls-badge.is-stale {
    background: #fdecec;
    border-color: #f1b3b3;
    color: #b42318;
}
.ac-ls-fixed {
    position: fixed;
    top: 12px;
    left: 120px;
    z-index: 9997;
}
