/* ============================================================
   全站通用 UI：顶部加载进度、轻提示、登录引导半层弹窗、复制按钮
   仅使用原生 CSS，兼容移动端与 ES5
   ============================================================ */

/* ---------- 顶部加载进度条 ---------- */
#uiTopBar {
    position: fixed; left: 0; top: 0; height: 3px; width: 0; z-index: 9999;
    background: linear-gradient(90deg, #3b6ef5, #6ea8ff);
    box-shadow: 0 0 8px rgba(59,110,245,.5);
    opacity: 0; transition: width .2s ease, opacity .2s ease;
    pointer-events: none;
}
#uiTopBar.on { opacity: 1; }

/* ---------- 轻提示 ---------- */
.ui-toast {
    position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 8px);
    background: rgba(23, 32, 48, .9); color: #fff; font-size: 14px; line-height: 1.5;
    padding: 10px 18px; border-radius: 10px; z-index: 9998; max-width: 76vw;
    opacity: 0; transition: opacity .18s ease, transform .18s ease; pointer-events: none;
    text-align: center;
}
.ui-toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 半层弹窗（登录引导） ---------- */
.ui-mask {
    position: fixed; inset: 0; background: rgba(16, 24, 40, .5); z-index: 9000;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .22s ease, visibility .22s;
}
.ui-mask.on { opacity: 1; visibility: visible; pointer-events: auto; }
.ui-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9001; background: #fff;
    border-radius: 20px 20px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
    max-width: 640px; margin: 0 auto;
    transform: translateY(100%); transition: transform .24s ease;
    visibility: hidden; pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.ui-sheet.on { transform: translateY(0); visibility: visible; pointer-events: auto; }
.ui-sheet .ui-sheet-title { font-size: 17px; font-weight: 700; color: #1f2329; text-align: center; }
.ui-sheet .ui-sheet-desc { font-size: 13px; color: #6b7280; text-align: center; margin-top: 10px; line-height: 1.7; }
.ui-sheet .ui-sheet-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.ui-sheet .ui-btn {
    display: flex; align-items: center; justify-content: center; height: 48px; border-radius: 12px;
    font-size: 16px; font-weight: 600; text-decoration: none; border: none; cursor: pointer;
    background: #3b6ef5; color: #fff; width: 100%;
}
.ui-sheet .ui-btn.ghost { background: #f4f6fa; color: #4e5560; font-weight: 500; }
.ui-sheet .ui-btn:active { opacity: .9; }

/* ---------- 一键复制 ---------- */
.ui-copy {
    display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px;
    border: 1px solid #dbe3f6; background: #f2f6ff; color: #2f6bff; font-size: 12px;
    border-radius: 8px; cursor: pointer; vertical-align: middle; line-height: 1;
}
.ui-copy:active { background: #e6eeff; }
.ui-copy svg { width: 13px; height: 13px; stroke: #2f6bff; }

/* ---------- 按钮加载态 ---------- */
.ui-busy { position: relative; opacity: .72; }
.ui-busy::after {
    content: ''; position: absolute; width: 14px; height: 14px; right: 10px; top: 50%; margin-top: -7px;
    border: 2px solid rgba(255,255,255,.55); border-top-color: #fff; border-radius: 50%;
    animation: uiSpin .7s linear infinite;
}
.ui-busy.light::after { border-color: rgba(47,107,255,.35); border-top-color: #2f6bff; }
@keyframes uiSpin { to { transform: rotate(360deg); } }

/* ---------- 后台错误提示条 ---------- */
.ui-alert {
    position: fixed; left: 50%; top: 18px; transform: translateX(-50%);
    background: #fdeef0; color: #c0303a; border: 1px solid #f7d2d5;
    padding: 10px 16px; border-radius: 10px; font-size: 13px; z-index: 9998;
    max-width: 88vw; box-shadow: 0 8px 20px rgba(20,38,66,.12);
}

/* ---------- 移动端触控热区 ---------- */
@media (max-width: 768px) {
    a.back, .setting, .logout, .modal-x, .sheet-head .close, button.close,
    .topbar .close, a.back-home, .sec-title .more, .admin a, .menu-btn {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    a.back { margin: -10px 0 -10px -10px; padding: 0 10px; }
    .setting, .logout, .modal-x, .sheet-head .close, button.close, .topbar .close,
    a.back-home { margin: -10px -10px -10px 0; padding: 0 10px; }
    .sec-title .more { margin-left: auto; padding: 0 6px; }
    .btn, a.btn, button.btn, .btn.sm, a.btn.sm, button.btn.sm { min-height: 44px; min-width: 44px; }
    .pager button, .pager .jump input { min-height: 44px; min-width: 44px; }
    .sidebar nav a { min-height: 44px; }
    .topbar .user a, .tip a, .contact-row .val a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; padding: 0 4px; }
    a.go, a.go.trial { min-height: 44px; }
    .ui-copy { min-height: 44px; min-width: 44px; }
}
