/* ==========================================================================
   认证模块前端样式（登录页 + 个人中心/用户管理/登录日志/系统设置 + 组件）
   与 app.css 并存，冲突类名统一加 nb-/auth- 前缀。
   ========================================================================== */

:root {
    --nb-bg: #f5f6f7;
    --nb-card: #ffffff;
    --nb-line: #e7e7e9;
    --nb-line-strong: #d5d5d8;
    --nb-field: #fafafa;
    --nb-text: #18181b;
    --nb-text-soft: #52525b;
    --nb-muted: #a1a1aa;
    --nb-danger: #dc2626;
    --nb-ok: #15803d;
    --nb-warn: #b45309;
    --nb-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

[hidden] { display: none !important; }

/* ============================ 登录 / 注册 / 找回页 ============================ */
.auth-page {
    --bg: #f4f4f2;
    --surface: #ffffff;
    --side: #f8f8f6;
    --text: #171717;
    --text-2: #525252;
    --muted: #9a9a96;
    --line: #e6e6e2;
    --line-strong: #d4d4cf;
    --field: #fbfbfa;
    --danger: #c9362b;
    --ok: #2f7d4a;
    --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.auth-page * { box-sizing: border-box; margin: 0; padding: 0; }
.auth-page button, .auth-page input { font: inherit; }
.auth-page button { -webkit-tap-highlight-color: transparent; }

.auth-page .shell { width: min(430px, 100%); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.auth-page .auth-card { display: flex; align-items: center; min-height: 450px; padding: 42px 44px; background: var(--surface); }
.auth-page .card-inner { width: 100%; max-width: 340px; margin: 0 auto; }

.auth-page .forms-wrapper { position: relative; overflow: hidden; transition: height .38s cubic-bezier(.22, 1, .36, 1); will-change: height; }
.auth-page .forms-wrapper.no-anim { transition: none; }
.auth-page .form-box { position: absolute; top: 0; left: 0; width: 100%; opacity: 0; visibility: hidden; pointer-events: none; transform: translate3d(0, 10px, 0); transition: opacity .26s cubic-bezier(.22, 1, .36, 1), transform .36s cubic-bezier(.22, 1, .36, 1); will-change: opacity, transform; }
.auth-page .form-box.active { z-index: 2; opacity: 1; visibility: visible; pointer-events: auto; transform: translate3d(0, 0, 0); }
.auth-page .form-box.pre-enter { z-index: 2; opacity: 0; visibility: visible; pointer-events: none; transform: translate3d(0, 10px, 0); }
.auth-page .form-box.leaving { z-index: 1; opacity: 0; visibility: visible; pointer-events: none; transform: translate3d(0, -7px, 0); }

.auth-page .form-title { font-size: 24px; font-weight: 650; line-height: 1.3; letter-spacing: -.025em; }
.auth-page .form-caption { margin-top: 7px; margin-bottom: 24px; color: var(--muted); font-size: 12.5px; line-height: 1.65; }
.auth-page .field { margin-bottom: 14px; }
.auth-page .field label { display: block; margin-bottom: 7px; color: var(--text-2); font-size: 12px; font-weight: 500; }
.auth-page .input-wrap { position: relative; }
.auth-page .field input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; outline: none; background: var(--field); color: var(--text); font-size: 13.5px; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.auth-page .field input[type="password"]::-ms-reveal,
.auth-page .field input[type="password"]::-ms-clear { display: none; }
.auth-page .field input::placeholder { color: #b1b1ac; }
.auth-page .field input:hover { border-color: #c4c4bf; }
.auth-page .field input:focus { border-color: var(--text); background: #fff; box-shadow: 0 0 0 3px rgba(23, 23, 23, .045); }

.auth-page .captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: 10px; }
.auth-page .captcha-image { width: 112px; height: 44px; display: block; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--field); object-fit: cover; cursor: pointer; user-select: none; transition: opacity .16s ease, border-color .16s ease, background .16s ease; }
.auth-page .captcha-image:hover { border-color: #bdbdb8; background: #fff; }
.auth-page .captcha-image.refreshing { opacity: .42; }
.auth-page .input-wrap.has-toggle input { padding-right: 52px; }
.auth-page .toggle-pass { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); padding: 5px 6px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11.5px; cursor: pointer; transition: color .16s ease, background .16s ease; }
.auth-page .toggle-pass:hover { color: var(--text); background: #f1f1ee; }
.auth-page .meta-row { min-height: 20px; display: flex; align-items: center; justify-content: flex-end; margin: -1px 0 12px; }
.auth-page .link-btn { border: 0; background: transparent; color: var(--muted); font-size: 12px; cursor: pointer; transition: color .16s ease; }
.auth-page .link-btn:hover { color: var(--text); }
.auth-page .message { min-height: 18px; margin-bottom: 10px; font-size: 12px; line-height: 1.5; }
.auth-page .msg-error { color: var(--danger); }
.auth-page .msg-ok { color: var(--ok); }

.auth-page .auth-submit { position: relative; width: 100%; height: 44px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--text); border-radius: 8px; background: var(--text); color: #fff; font-size: 13.5px; font-weight: 600; cursor: pointer; overflow: hidden; transition: background .16s ease, border-color .16s ease, transform .08s ease; }
.auth-page .auth-submit:hover:not(.loading) { background: #2b2b2b; border-color: #2b2b2b; }
.auth-page .auth-submit:active:not(.loading) { transform: translateY(1px); }
.auth-page .submit-text { position: relative; z-index: 1; transform: translateX(0); transition: opacity .18s ease, transform .22s ease; }
.auth-page .auth-submit.loading { background: #777772; border-color: #777772; cursor: wait; pointer-events: none; }
.auth-page .auth-submit.loading .submit-text, .auth-page .auth-submit.success .submit-text, .auth-page .auth-submit.error .submit-text { opacity: 1; transform: translateX(11px); }
.auth-page .auth-submit.success, .auth-page .auth-submit.error { pointer-events: none; }
.auth-page .auth-submit.success { background: #2a7a4c; border-color: #2a7a4c; }
.auth-page .auth-submit.error { background: #a23c37; border-color: #a23c37; }

.auth-page .loader { --status-size: 19px; --status-dot: 1.75px; position: absolute; top: 50%; left: calc(50% - 40px); width: var(--status-size); height: var(--status-size); border: 0 !important; border-radius: 0; opacity: 0; animation: none !important; transform: translate(-50%, -50%); transition: opacity .16s ease, left .24s ease; color: #fff; }
.auth-page .auth-submit.loading .loader, .auth-page .auth-submit.success .loader, .auth-page .auth-submit.error .loader { opacity: 1; }

.auth-page .foot { margin-top: 17px; text-align: center; color: var(--muted); font-size: 12px; }
.auth-page .foot .link-btn { margin-left: 3px; color: var(--text); font-weight: 500; }
.auth-page .back-row { margin-top: 17px; text-align: center; }

/* ============================ 主应用：视图与组件 ============================ */
.nb-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tab-page#tab-users.active { display: grid; gap: 14px; }
.nb-stat { min-height: 86px; padding: 16px 20px; border: 1px solid var(--nb-line); border-radius: 12px; background: var(--nb-card); }
.nb-stat-num { font-size: 24px; font-weight: 680; line-height: 1.15; font-variant-numeric: tabular-nums; }
.nb-stat-label { margin-top: 6px; color: var(--nb-muted); font-size: 12px; }

.panel { overflow: hidden; border: 1px solid var(--nb-line); border-radius: 12px; background: var(--nb-card); }
.panel-head { min-height: 58px; padding: 11px 14px 11px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--nb-line); }
.panel-head h2 { flex: none; font-size: 14px; font-weight: 650; }
.panel-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.panel-actions input { height: 34px; padding: 0 10px; border: 1px solid var(--nb-line-strong); border-radius: 8px; outline: none; background: var(--nb-field); color: var(--nb-text); font-size: 12.5px; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.panel-actions input::placeholder { color: #a8a8b0; }
.panel-actions input:focus { border-color: #a9a9af; background: #fff; box-shadow: 0 0 0 3px rgba(24,24,27,.045); }
#userKw { width: 220px; }
#logKw { width: 180px; }

.custom-select { position: relative; width: 124px; flex: 0 0 124px; }
.select-trigger { width: 100%; height: 34px; padding: 0 34px 0 12px; display: inline-flex; align-items: center; justify-content: space-between; border: 1px solid var(--nb-line-strong); border-radius: 8px; outline: none; background: var(--nb-field); color: var(--nb-text); font-size: 12.5px; line-height: 1; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.select-trigger:hover { background: #fff; }
.custom-select.is-open .select-trigger, .select-trigger:focus-visible { border-color: #a9a9af; background: #fff; box-shadow: 0 0 0 3px rgba(24,24,27,.045); }
.select-label { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.select-icon { position: absolute; right: 11px; top: 50%; width: 14px; height: 14px; pointer-events: none; transform: translateY(-50%); opacity: .78; transition: opacity .18s linear; }
.select-icon line { fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.custom-select.is-open .select-icon { opacity: 1; }
.select-menu { position: absolute; top: calc(100% + 8px); left: 0; width: 100%; padding: 6px; border: 1px solid var(--nb-line); border-radius: 10px; background: #fff; box-shadow: 0 14px 28px rgba(17,24,39,.08), 0 2px 6px rgba(17,24,39,.04); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s linear, transform .16s linear, visibility .16s linear; z-index: 24; }
.custom-select.is-open .select-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.custom-select .select-option {
    width: 100%;
    height: 30px;
    min-height: 30px;
    margin: 0;
    padding: 0 10px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--nb-text-soft);
    font: inherit;
    font-size: 12.5px;
    line-height: 1;
    text-align: left;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: background .14s linear, color .14s linear;
}
.custom-select .select-option:hover,
.custom-select .select-option:focus-visible {
    background: #f4f4f5;
    color: var(--nb-text);
    outline: none;
    box-shadow: none;
    transform: none;
}
.custom-select .select-option.is-selected { background: #f2f2f3; color: var(--nb-text); font-weight: 600; }
.custom-select .select-option.is-selected::after { content: ''; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: #23232a; opacity: .72; }
/* 下拉触发器不跟随旧版 toolbar/button 的蓝色 hover、focus、active 规则变化。 */
.custom-select .select-trigger:hover,
.custom-select .select-trigger:focus,
.custom-select .select-trigger:focus-visible,
.custom-select.is-open .select-trigger {
    border-color: #a9a9af;
    background: #fff;
    color: var(--nb-text);
    outline: none;
    box-shadow: none;
    transform: none;
}
.custom-select .select-trigger:active { transform: none; }
.native-select-source { display: none !important; }
.sel:has(.custom-select) { display: block; }
.sel:has(.custom-select)::after { display: none; }
.sel > .custom-select { width: 100%; flex: none; }
.field .custom-select { width: 100%; flex: none; }
.field .select-trigger { height: 40px; font-size: 13px; }
.field .select-menu { min-width: 100%; }
.custom-select.is-disabled .select-trigger { opacity: .5; cursor: not-allowed; background: var(--nb-field); box-shadow: none; }
.custom-select.is-disabled .select-icon { opacity: .38; }
.panel:has(.custom-select.is-open),
.card:has(.custom-select.is-open),
.settings-panel:has(.custom-select.is-open),
.filter-bar:has(.custom-select.is-open) { overflow: visible; }

.nb-btn { height: 34px; padding: 0 13px; border: 1px solid var(--nb-line-strong); border-radius: 8px; background: #fff; color: var(--nb-text-soft); font-size: 12.5px; cursor: pointer; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .08s ease; }
.nb-btn:hover:not(:disabled) { border-color: #c7c7cb; background: #fafafa; color: var(--nb-text); }
.nb-btn:active:not(:disabled) { transform: translateY(1px); }
.nb-btn.primary { border-color: var(--nb-text); background: var(--nb-text); color: #fff; }
.nb-btn.primary:hover:not(:disabled) { border-color: #2b2b30; background: #2b2b30; color: #fff; }
.nb-btn.sm { height: 30px; padding: 0 10px; font-size: 12px; }
.nb-btn:disabled { opacity: .42; cursor: not-allowed; }

.table-wrap { width: 100%; overflow-x: auto; }
.app table { width: 100%; min-width: 1120px; border-collapse: collapse; table-layout: auto; font-size: 12.5px; }
.app table.log-table { min-width: 860px; }
.app th, .app td { height: 50px; padding: 9px 12px; border-bottom: 1px solid #ededee; text-align: left; vertical-align: middle; white-space: nowrap; }
.app th { height: 40px; background: #fafafa; color: #62626b; font-size: 11.5px; font-weight: 600; }
.app tbody tr:last-child td { border-bottom: 0; }
.app tbody tr { transition: background .14s ease; }
.app tbody tr:hover { background: #fbfbfb; }

.user-cell { display: flex; align-items: center; gap: 9px; min-width: 150px; }
.user-cell-main { min-width: 0; }
.user-cell-name { display: flex; align-items: center; min-width: 0; font-weight: 500; }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-sm.letter { display: inline-grid; place-items: center; background: var(--nb-text); color: #fff; font-size: 11px; font-weight: 600; }
.tag-self { display: inline-flex; align-items: center; height: 19px; margin-left: 6px; padding: 0 6px; border-radius: 5px; background: #eef0f2; color: #4b5563; font-size: 10px; font-weight: 500; }
.nb-badge { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 999px; background: #f3f3f4; color: var(--nb-text-soft); font-size: 10.5px; white-space: nowrap; }
.nb-badge.admin { background: var(--nb-text); color: #fff; }
.nb-badge.ok { background: #ecfdf3; color: var(--nb-ok); }
.nb-badge.off { background: #fef2f2; color: var(--nb-danger); }
.nb-badge.warn { background: #fff8e8; color: var(--nb-warn); }

.cell-2 { line-height: 1.45; }
.cell-wrap { min-width: 240px; white-space: normal; word-break: break-word; }
.muted { color: var(--nb-muted); font-size: 10.5px; }
.ops { display: flex; align-items: center; gap: 2px; min-width: max-content; }
.nb-op { height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: var(--nb-text-soft); font-size: 11.5px; cursor: pointer; transition: background .14s ease, color .14s ease; }
.nb-op:hover { background: #f1f1f2; color: var(--nb-text); }
.nb-op.danger:hover { background: #fef2f2; color: var(--nb-danger); }
.nb-empty { height: 110px; text-align: center; color: var(--nb-muted); font-size: 12.5px; }

.nb-pager { min-height: 52px; padding: 9px 14px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--nb-line); color: var(--nb-muted); font-size: 11.5px; }
.nb-pager-info { margin-right: 3px; }

.nb-modal-back { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(24,24,27,.34); animation: nbModalBackIn .16s ease both; }
.nb-modal { width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow: hidden; display: flex; flex-direction: column; border: 1px solid rgba(0,0,0,.05); border-radius: 12px; background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.15); animation: nbModalIn .18s ease both; }
@keyframes nbModalBackIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes nbModalIn { from { opacity: 0; transform: translateY(5px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
.nb-modal-head { min-height: 54px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--nb-line); }
.nb-modal-head h3 { font-size: 14px; font-weight: 650; }
.nb-modal-close { width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: var(--nb-muted); font-size: 19px; line-height: 1; cursor: pointer; }
.nb-modal-close:hover { background: #f4f4f5; color: var(--nb-text); }
.nb-modal-body { padding: 18px; overflow-y: auto; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #c5c6cb transparent; }
.nb-modal-body::-webkit-scrollbar { width: 9px; height: 9px; }
.nb-modal-body::-webkit-scrollbar-track { background: transparent; }
.nb-modal-body::-webkit-scrollbar-thumb { min-height: 36px; border: 2px solid transparent; border-radius: 999px; background: #c5c6cb; background-clip: padding-box; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { display: block; margin-bottom: 6px; color: var(--nb-text-soft); font-size: 12px; }
.field input, .field select { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--nb-line-strong); border-radius: 8px; outline: none; background: var(--nb-field); color: var(--nb-text); font-size: 13px; transition: border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.field input:focus, .field select:focus { border-color: #a9a9af; background: #fff; box-shadow: 0 0 0 3px rgba(24,24,27,.045); }
.field input:disabled, .field select:disabled { opacity: .5; cursor: not-allowed; }
.msg-error { min-height: 16px; margin-top: 12px; color: var(--nb-danger); font-size: 12px; line-height: 1.5; }
.nb-modal-foot { min-height: 56px; padding: 10px 18px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--nb-line); }

.profile { padding: 20px 22px; border: 1px solid var(--nb-line); border-radius: 12px; background: var(--nb-card); }
.profile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.profile-head h2 { font-size: 14px; font-weight: 650; }
.profile-actions { display: flex; align-items: center; gap: 8px; }
.profile-note { color: var(--nb-muted); font-size: 11.5px; }
.profile-main { display: grid; grid-template-columns: 245px minmax(0, 1fr); align-items: stretch; gap: 24px; }
.profile-identity { display: flex; align-items: center; gap: 14px; min-width: 0; padding-right: 24px; border-right: 1px solid var(--nb-line); }
.avatar-lg { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-lg.letter { display: grid; place-items: center; background: var(--nb-text); color: #fff; font-size: 20px; font-weight: 650; }
.profile-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 650; }
.profile-sub { margin-top: 4px; color: var(--nb-muted); font-size: 12px; white-space: nowrap; }
.profile-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 22px; align-content: center; }
.pf-item { min-width: 0; }
.pf-item label { display: block; margin-bottom: 4px; color: var(--nb-muted); font-size: 11px; line-height: 1.2; }
.pf-item .pf-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; line-height: 1.45; }

.profile-avatar-field { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding: 12px; border: 1px solid var(--nb-line); border-radius: 10px; background: #fcfcfc; }
.profile-avatar-preview { width: 64px; height: 64px; flex: 0 0 64px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--nb-text); color: #fff; font-size: 22px; font-weight: 650; outline: 1px solid rgba(0,0,0,.1); }
.profile-avatar-preview img { width: 100%; height: 100%; display: block; object-fit: cover; }
.profile-avatar-preview .avatar-lg.letter { width: 100%; height: 100%; border-radius: inherit; }
.profile-avatar-copy { min-width: 0; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 6px 10px; }
.profile-avatar-title { font-size: 13px; font-weight: 650; }
.profile-avatar-help { grid-column: 1 / -1; color: var(--nb-muted); font-size: 11.5px; line-height: 1.45; }
.profile-avatar-status { color: var(--nb-muted); font-size: 11px; }

.avatar-crop-modal { max-width: 480px; }
.avatar-crop-body { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.avatar-crop-stage { position: relative; width: min(360px, 100%); aspect-ratio: 1; overflow: hidden; border-radius: 12px; background: #16181d; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.avatar-crop-stage canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.avatar-crop-stage canvas.is-dragging { cursor: grabbing; }
.avatar-crop-shade { position: absolute; inset: 0; pointer-events: none; background: rgba(9,11,15,.58); -webkit-mask: radial-gradient(circle 142px at center, transparent 0 141px, #000 142px); mask: radial-gradient(circle 142px at center, transparent 0 141px, #000 142px); }
.avatar-crop-ring { position: absolute; inset: 50%; width: 284px; height: 284px; transform: translate(-50%, -50%); border: 1px solid rgba(255,255,255,.88); border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.18); pointer-events: none; }
.avatar-crop-help { color: var(--nb-muted); font-size: 11.5px; text-align: center; }
.avatar-zoom-control { width: 100%; display: grid; grid-template-columns: 34px minmax(0, 1fr) 46px; align-items: center; gap: 10px; color: var(--nb-text-soft); font-size: 11.5px; }
.avatar-zoom-control input { width: 100%; accent-color: var(--nb-text); }
.avatar-zoom-control output { color: var(--nb-muted); text-align: right; font-variant-numeric: tabular-nums; }

/* 头像几何尺寸统一：避免旧布局或 flex 收缩后出现轻微椭圆。 */
.who-ava {
  width: 36px !important;
  min-width: 36px !important;
  max-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  flex: 0 0 36px !important;
  aspect-ratio: 1 / 1 !important;
  padding: 0 !important;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 50% !important;
}
.who-ava > .who-avatar-image,
.who-ava > .who-avatar-image img {
  width: 100% !important;
  height: 100% !important;
  min-width: 100%;
  min-height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50% !important;
}
.who-ava > .who-avatar-image.letter {
  display: grid;
  place-items: center;
}
.avatar-lg {
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  flex: 0 0 52px !important;
  aspect-ratio: 1 / 1 !important;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 50% !important;
}
.avatar-lg:not(.letter) {
  display: block;
  object-fit: cover;
}
.avatar-lg.letter {
  display: grid;
  place-items: center;
}
.profile-avatar-preview {
  width: 64px !important;
  min-width: 64px !important;
  max-width: 64px !important;
  height: 64px !important;
  min-height: 64px !important;
  max-height: 64px !important;
  flex: 0 0 64px !important;
  aspect-ratio: 1 / 1 !important;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 50% !important;
}
.profile-avatar-preview > img,
.profile-avatar-preview > .avatar-lg {
  width: 100% !important;
  height: 100% !important;
  min-width: 100%;
  min-height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50% !important;
}
.profile-avatar-preview > .avatar-lg.letter {
  display: grid;
  place-items: center;
}

.settings-panel { overflow: hidden; border: 1px solid var(--nb-line); border-radius: 12px; background: var(--nb-card); }
.tab-page#tab-settings.active { display: grid; gap: 14px; }
.settings-head { position: relative; height: 46px; padding: 0; border-bottom: 1px solid var(--nb-line); background: #fbfbfc; overflow: hidden; }
.settings-head h2 { position: absolute; left: 0; bottom: 0; z-index: 2; min-width: 128px; height: 46px; margin: 0; padding: 0 34px 0 20px; display: flex; align-items: center; background: #f5f5f7; clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 100%, 0 100%); font-size: 14px; font-weight: 650; line-height: 1; letter-spacing: .01em; }
.settings-head p { position: absolute; left: 112px; right: 0; top: 50%; z-index: 1; height: 26px; margin: 0; padding: 0 18px 0 32px; display: flex; align-items: center; transform: translateY(-50%); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--nb-muted); background: #fafafa; border-top: 1px solid rgba(24,24,27,.018); border-bottom: 1px solid rgba(24,24,27,.014); font-size: 12px; line-height: 1; }
.settings-head p::before { content: ''; position: absolute; left: 0; top: 0; width: 26px; height: 100%; background: #fafafa; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.setting-row { min-height: 68px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #ededee; }
.setting-row:last-child { border-bottom: 0; }
.setting-row.child { padding-left: 34px; }
.setting-copy { min-width: 0; }
.setting-name { font-size: 13px; font-weight: 550; }
.setting-desc { margin-top: 4px; color: var(--nb-muted); font-size: 11.5px; line-height: 1.5; }
.setting-row.child.disabled .setting-copy { opacity: .48; }
.switch-wrap { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.switch-state { width: 36px; text-align: right; color: var(--nb-muted); font-size: 11.5px; }
.switch { position: relative; width: 42px; height: 24px; display: inline-block; flex: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: absolute; inset: 0; border-radius: 999px; background: #d7d7da; cursor: pointer; transition: background .18s ease, opacity .18s ease; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.16); transition: transform .2s cubic-bezier(.2,.8,.2,1); }
.switch input:checked + .switch-track { background: var(--nb-text); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid #52525b; outline-offset: 2px; }
.switch input:disabled + .switch-track { opacity: .42; cursor: not-allowed; }
.settings-foot { min-height: 60px; padding: 12px 20px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--nb-line); }
.settings-note { margin-right: auto; color: var(--nb-muted); font-size: 11.5px; }
.settings-body { padding: 18px 20px 20px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.settings-grid .field.full { grid-column: 1 / -1; }
.settings-inline-switch { min-height: 58px; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #ededee; }
.settings-help { margin-top: 6px; color: var(--nb-muted); font-size: 11.5px; line-height: 1.55; }

/* 全局加载 / 进度条 / 操作反馈 / Toast */
.page-loader { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: var(--nb-bg); opacity: 1; visibility: visible; transition: opacity .26s ease, visibility .26s ease; }
.page-loader.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.page-loader-inner { display: inline-flex; align-items: center; gap: 9px; color: var(--nb-muted); font-size: 12px; }
.page-loader-spinner { --status-size: 22px; --status-dot: 1.8px; position: relative; width: var(--status-size); height: var(--status-size); flex: 0 0 var(--status-size); color: var(--nb-text-soft); }
.page-loader-spinner .dot-ring { animation: dottedRingRotate .92s linear infinite; }
.page-loader-spinner .dot-ring .status-dot { animation: dottedRingPulse .92s linear infinite; animation-delay: calc(var(--i) * -0.051s); }

.global-activity { position: fixed; top: 0; left: 0; z-index: 1200; width: 100%; height: 2px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .16s ease; }
.global-activity::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 34%; background: var(--nb-text); transform: translateX(-110%); }
.global-activity.active { opacity: 1; }
.global-activity.active::before { animation: activityMove .95s cubic-bezier(.4,0,.2,1) infinite; }
.global-activity.done::before { width: 100%; transform: translateX(0); animation: none; transition: width .15s ease, transform .15s ease; }
@keyframes activityMove { 0% { transform: translateX(-110%); } 55% { transform: translateX(125%); } 100% { transform: translateX(300%); } }

.nb-btn.feedback, .nb-op.feedback { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.nb-btn.feedback:disabled, .nb-op.feedback:disabled { opacity: 1; cursor: wait; }
.feedback-icon { --status-size: 18px; --status-dot: 1.65px; position: relative; width: var(--status-size); height: var(--status-size); flex: 0 0 var(--status-size); opacity: .94; color: currentColor; }
.status-dot { position: absolute; width: var(--status-dot); height: var(--status-dot); border-radius: 50%; background: currentColor; transform: translate(-50%, -50%) scale(1); transform-origin: center; }
.dot-ring, .dot-mark { position: absolute; inset: 0; transform-origin: 50% 50%; }
.dot-mark { opacity: 0; transform: scale(.84); transition: opacity .16s ease, transform .23s cubic-bezier(.2,.85,.2,1); }
.dot-mark .status-dot { opacity: 0; transform: translate(-50%, -50%) scale(.45); }
.feedback.loading .feedback-icon .dot-ring { animation: dottedRingRotate .86s linear infinite; }
.feedback.loading .feedback-icon .dot-ring .status-dot { animation: dottedRingPulse .86s linear infinite; animation-delay: calc(var(--i) * -0.048s); }
.feedback.success .feedback-icon .dot-ring .status-dot, .feedback.error .feedback-icon .dot-ring .status-dot { opacity: .7; transform: translate(-50%, -50%) scale(.92); transition: opacity .18s ease, transform .18s ease; }
.feedback.success .feedback-icon .dot-check, .feedback.error .feedback-icon .dot-cross { opacity: 1; transform: scale(1); }
.feedback.success .feedback-icon .dot-check .status-dot, .feedback.error .feedback-icon .dot-cross .status-dot { animation: dottedMarkIn .22s cubic-bezier(.2,.85,.2,1) forwards; animation-delay: calc(var(--i) * 27ms + 38ms); }
@keyframes dottedRingRotate { to { transform: rotate(360deg); } }
@keyframes dottedRingPulse { 0%, 100% { opacity: .24; transform: translate(-50%, -50%) scale(.78); } 42% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); } }
@keyframes dottedMarkIn { to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.nb-btn.feedback.success:not(.primary), .nb-op.feedback.success { color: #2a7a4c; border-color: #cfe7d8; background: #f6fbf8; }
.nb-btn.primary.feedback.success { color: #fff; border-color: #2a7a4c; background: #2a7a4c; }
.nb-btn.feedback.error:not(.primary), .nb-op.feedback.error { color: var(--nb-danger); border-color: #f0caca; background: #fff7f7; }
.nb-btn.primary.feedback.error { color: #fff; border-color: #a23c37; background: #a23c37; }

.toast { position: fixed; left: 50%; bottom: 30px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); padding: 9px 14px; border-radius: 8px; background: var(--nb-text); color: #fff; font-size: 12.5px; opacity: 0; transform: translate(-50%, 6px); pointer-events: none; transition: opacity .18s ease, transform .18s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: #1f6f46; }
.toast.error { background: #9f3430; }

@keyframes viewIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ======================================================================
   LOGIN REFERENCE SKIN
   认证页沿用待合并模块的原始布局；只在 #authPage 内生效，避免被工单
   工作台的旧 body / .card / .field 规则污染。
   ====================================================================== */
html:has(#authPage),
body:has(#authPage) {
    min-height: 100%;
}

body:has(#authPage) {
    display: block;
    padding: 0;
    background: #f4f4f2;
    color: #171717;
    line-height: normal;
}

body:has(.auth-wrap) {
    display: block;
    padding: 0;
    background: #f4f4f2;
    color: #171717;
    line-height: normal;
}

body:has(.auth-wrap) .auth-wrap {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 22px;
}

body:has(.auth-wrap) .auth-card {
    width: min(430px, 100%);
    min-height: 450px;
    padding: 42px 44px;
    border: 1px solid #e6e6e2;
    border-radius: 14px;
    background: #fff;
    box-shadow: none;
}

body:has(.auth-wrap) .auth-card::before {
    display: none;
}

body:has(.auth-wrap) .auth-card h2 {
    color: #171717;
    font-size: 24px;
    font-weight: 650;
    line-height: 1.3;
}

body:has(.auth-wrap) .auth-card .sub {
    color: #9a9a96;
    font-size: 12.5px;
}

body:has(.auth-wrap) .auth-card input {
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d4d4cf;
    border-radius: 8px;
    background: #fbfbfa;
}

body:has(.auth-wrap) .auth-card button {
    min-height: 44px;
    margin-top: 20px;
    padding: 0 12px;
    border: 1px solid #171717;
    border-radius: 8px;
    background: #171717;
}

body:has(.auth-wrap) .auth-card button:hover {
    background: #2b2b2b;
}

#authPage.auth-page {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    background: #f4f4f2;
    color: #171717;
}

#authPage .shell {
    width: min(430px, 100%);
    overflow: hidden;
    background: #fff;
    border: 1px solid #e6e6e2;
    border-radius: 14px;
}

#authPage .card {
    display: flex;
    align-items: center;
    min-height: 450px;
    padding: 42px 44px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
}

#authPage .card-inner {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}

#authPage .form-title {
    color: #171717;
    font-size: 24px;
    font-weight: 650;
    line-height: 1.3;
    letter-spacing: -.025em;
}

#authPage .form-caption {
    margin-top: 7px;
    margin-bottom: 24px;
    color: #9a9a96;
    font-size: 12.5px;
    line-height: 1.65;
}

#authPage .field {
    margin-bottom: 14px;
}

#authPage .field label {
    display: block;
    margin: 0 0 7px;
    color: #525252;
    font-size: 12px;
    font-weight: 500;
}

#authPage .field input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #d4d4cf;
    border-radius: 8px;
    outline: none;
    background: #fbfbfa;
    color: #171717;
    font-size: 13.5px;
}

#authPage .field input:focus {
    border-color: #171717;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(23, 23, 23, .045);
}

#authPage .submit {
    position: relative;
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid #171717;
    border-radius: 8px;
    background: #171717;
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    overflow: hidden;
}

#authPage .submit:hover:not(.loading) {
    background: #2b2b2b;
    border-color: #2b2b2b;
}

#authPage .submit:active:not(.loading) {
    transform: translateY(1px);
}

#authPage .submit.loading {
    background: #777772;
    border-color: #777772;
    cursor: wait;
    pointer-events: none;
}
#authPage .submit.success,
#authPage .submit.error { pointer-events: none; }
#authPage .submit.success { background: #2a7a4c; border-color: #2a7a4c; }
#authPage .submit.error { background: #a23c37; border-color: #a23c37; }

/* 登录按钮沿用点阵状态动画；当前登录页使用 .submit，兼容旧版 .auth-submit 的动画结构。 */
#authPage .submit .loader {
    --status-size: 19px;
    --status-dot: 1.75px;
    position: absolute;
    top: 50%;
    left: calc(50% - 40px);
    width: var(--status-size);
    height: var(--status-size);
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity .16s ease, left .24s ease;
    color: #fff;
}
#authPage .submit.loading .loader,
#authPage .submit.success .loader,
#authPage .submit.error .loader { opacity: 1; }
#authPage .submit.loading .submit-text,
#authPage .submit.success .submit-text,
#authPage .submit.error .submit-text { transform: translateX(11px); }
#authPage .submit.loading .loader .dot-ring { animation: dottedRingRotate .86s linear infinite; }
#authPage .submit.loading .loader .dot-ring .status-dot {
    animation: dottedRingPulse .86s linear infinite;
    animation-delay: calc(var(--i) * -0.048s);
}
#authPage .submit.success .loader .dot-ring .status-dot,
#authPage .submit.error .loader .dot-ring .status-dot {
    opacity: .7;
    transform: translate(-50%, -50%) scale(.92);
    transition: opacity .18s ease, transform .18s ease;
}
#authPage .submit.success .loader .dot-check,
#authPage .submit.error .loader .dot-cross { opacity: 1; transform: scale(1); }
#authPage .submit.success .loader .dot-check .status-dot,
#authPage .submit.error .loader .dot-cross .status-dot {
    animation: dottedMarkIn .22s cubic-bezier(.2,.85,.2,1) forwards;
    animation-delay: calc(var(--i) * 27ms + 38ms);
}

#authPage .foot,
#authPage .back-row {
    color: #9a9a96;
    font-size: 12px;
}

@media (max-width: 520px) {
    #authPage {
        align-items: flex-start;
        padding: 14px;
    }

    #authPage .shell {
        margin: 8px 0;
    }

    #authPage .card {
        min-height: 0;
        padding: 32px 26px 30px;
    }
}

@media (max-width: 420px) {
    #authPage {
        padding: 10px;
    }

    #authPage .shell {
        border-radius: 12px;
    }

    #authPage .card {
        padding: 28px 20px 26px;
    }

    #authPage .form-title {
        font-size: 22px;
    }
}
@media (max-width: 760px) {
    .profile-main { grid-template-columns: 1fr; gap: 18px; }
    .profile-identity { padding: 0 0 16px; border-right: 0; border-bottom: 1px solid var(--nb-line); }
    .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
    .nb-stats { grid-template-columns: 1fr; gap: 8px; }
    .nb-stat { min-height: 74px; padding: 14px 16px; }
    .panel-head { align-items: stretch; flex-direction: column; padding: 14px; }
    .panel-actions { justify-content: flex-start; flex-wrap: wrap; }
    #userKw, #logKw { width: 100%; flex: 1 1 180px; }
    .custom-select { width: 100%; flex: 1 1 140px; }
    .grid2 { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-grid .field.full { grid-column: auto; }
}
