/* ═══ 登录/注册弹框 ═══ */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
}

.auth-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 400px;
    padding: 32px 32px 24px;
    position: relative;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .15);
    animation: amIn .25s ease;
}

@keyframes amIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #9aa3b2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.auth-modal-close:hover {
    background: #f0f2f5;
    color: #1e2533;
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1e2533;
}

.auth-modal-tabs {
    display: flex;
    background: #f0f2f5;
    border-radius: 8px;
    padding: 3px;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    height: 34px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: #5b6778;
    background: transparent;
    cursor: pointer;
    transition: all .2s;
}

.auth-tab.active {
    background: #fff;
    color: #09519b;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.auth-modal-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-tab-panel {
    display: none;
    flex-direction: column;
    gap: 14px;
}

.auth-tab-panel.active {
    display: flex;
}

.auth-mf {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.auth-mf label {
    font-size: 13px;
    font-weight: 500;
    color: #1e2533;
}

.auth-mf input,
.auth-mf select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e6e8ec;
    border-radius: 8px;
    font-size: 14px;
    color: #1e2533;
    font-family: inherit;
    transition: all .2s;
    box-sizing: border-box;
}

.auth-mf input:focus,
.auth-mf select:focus {
    outline: none;
    border-color: #09519b;
    box-shadow: 0 0 0 3px rgba(9, 81, 155, .08);
}

.auth-mf input::placeholder {
    color: #c5c9d0;
}

.auth-modal-error {
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 13px;
    color: #d84040;
    line-height: 1.5;
}

.auth-modal-error.success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}

.auth-modal-btn {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    background: #09519b;
    color: #fff;
    cursor: pointer;
    transition: all .2s;
}

.auth-modal-btn:hover {
    background: #0a6dad;
    box-shadow: 0 4px 12px rgba(9, 81, 155, .25);
}

.auth-modal-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    box-shadow: none;
}

/* ═══ 顶栏登录按钮 ═══ */
.auth-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 14px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    background: transparent;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    vertical-align: middle;
}

.auth-login-btn:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.auth-user-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    color: #09519b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.auth-user-name {
    font-size: 14px;
    color: rgba(255, 255, 255, .8);
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
}

.auth-user-name:hover {
    color: #fff;
}
/* ═══ 顶栏用户菜单（模式A：整合主体切换） ═══ */
.auth-user-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    position: relative;
}

/* 下拉面板 */
.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: -4px;
    min-width: 140px;
    background: #fff;
    border: 1px solid #e6e8ec;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0,0,0,.13);
    z-index: 10000;
    padding: 6px;
    margin-top: 6px;
}
.user-dropdown.open {
    display: block;
}
.auth-user-avatar-main{
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.auth-user-avatar-sub{
   
    width: 24px;
    height: 24px;
    font-size: 10px;
    background: #dbeafe;
    color: #09519b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
}

/* 下拉面板各区块 */
.ud-section {
    padding: 8px 10px 4px;
    font-size: 11px;
    color: #9aa3b2;
    letter-spacing: .3px;
}

.ud-divider {
    height: 1px;
    background: #f3f4f6;
    margin: 0 6px;
}

/* 当前主体行 */
.ud-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 8px;
}
.ud-current .auth-user-avatar {
    width: 28px;
    height: 28px;
    font-size: 12px;
}
.ud-current-info {
    flex: 1;
    min-width: 0;
}
.ud-current-name {
    font-size: 13px;
    font-weight: 600;
    color: #1e2533;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ud-current-badge {
    font-size: 11px;
}
.ud-current-badge.owner {
    color: #09519b;
}
.ud-current-badge.sub {
    color: #8b5cf6;
}
.ud-current-check {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* 切换列表项 */
.ud-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    color: #374151;
    transition: background .15s;
}
.ud-item:hover {
    background: #f5f5f5;
}
.ud-item.self {
    background: #f5f9ff;
    color: #09519b;
    font-weight: 500;
}
.ud-item.self .auth-user-avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
    background: #dbeafe;
    color: #09519b;
}
.ud-item .auth-user-avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
}
.ud-item .check-icon {
    margin-left: auto;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.ud-item .item-label {
    flex: 1;
}

/* 操作按钮行 */
.ud-action {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s;
}
.ud-action:hover {
    background: #f5f5f5;
}
.ud-action.primary {
    color: #09519b;
}
.ud-action.danger {
    color: #d84040;
}
.ud-action.neutral {
    color: #374151;
}

/* ═══ 忘记密码 · 发送验证码按钮 ═══ */
.auth-forgot-send {
    height: 38px;
    box-sizing: border-box;
    padding: 0 14px;
    font-size: 13px;
    border: 1.5px solid #09519b;
    color: #09519b;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .2s;
    font-family: inherit;
}
.auth-forgot-send:hover:not(:disabled) {
    background: #09519b;
    color: #fff;
}
.auth-forgot-send:disabled {
    border-color: #c5c9d0;
    color: #9aa3b2;
    background: #f5f6f8;
    cursor: not-allowed;
}

/* 加载中 / 加载失败 */
.ud-loading {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #9aa3b2;
}
.ud-error {
    padding: 16px;
    text-align: center;
    font-size: 13px;
    color: #d84040;
}

/* 箭头图标（触发器旁） */
.user-arrow {
    width: 10px;
    height: 10px;
    color: #9ca3af;
    flex-shrink: 0;
}

/* ═══ 新增主体弹框 ═══ */
.ud-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    animation: udmFadeIn .2s ease;
}
@keyframes udmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ud-modal {
    background: #fff;
    border-radius: 14px;
    width: 100%;
    max-width: 380px;
    padding: 28px 28px 20px;
    position: relative;
    box-shadow: 0 16px 48px rgba(0,0,0,.15);
    animation: udmSlideIn .25s ease;
}
@keyframes udmSlideIn {
    from { opacity: 0; transform: translateY(16px) scale(.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ud-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    border-radius: 8px;
    color: #9aa3b2;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}
.ud-modal-close:hover {
    background: #f0f2f5;
    color: #1e2533;
}

.ud-modal-title {
    font-size: 17px;
    font-weight: 700;
    color: #1e2533;
    margin: 0 0 20px;
}

/* 弹窗内提示说明 */
.ud-tip {
    margin: -12px 0 16px;
    padding: 10px 12px;
    background: #fff8e6;
    border: 1px solid #f3d27a;
    border-radius: 8px;
    font-size: 12.5px;
    color: #9a6b00;
    line-height: 1.7;
}

.ud-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ud-modal-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.ud-modal-field label {
    font-size: 13px;
    font-weight: 500;
    color: #1e2533;
}
.ud-modal-field label .required {
    color: #d84040;
}

.ud-modal-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e6e8ec;
    border-radius: 8px;
    font-size: 14px;
    color: #1e2533;
    font-family: inherit;
    transition: all .2s;
    box-sizing: border-box;
}
.ud-modal-input:focus {
    outline: none;
    border-color: #09519b;
    box-shadow: 0 0 0 3px rgba(9,81,155,.08);
}
.ud-modal-input::placeholder { color: #c5c9d0; }

.ud-modal-select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #e6e8ec;
    border-radius: 8px;
    font-size: 14px;
    color: #1e2533;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    transition: all .2s;
    box-sizing: border-box;
    appearance: auto;
    -webkit-appearance: auto;
}
.ud-modal-select:focus {
    outline: none;
    border-color: #09519b;
    box-shadow: 0 0 0 3px rgba(9,81,155,.08);
}

.ud-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}
.ud-modal-btn {
    flex: 1;
    height: 40px;
    border: 1px solid #e6e8ec;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all .2s;
    background: #fff;
    color: #374151;
}
.ud-modal-btn.primary {
    background: #09519b;
    color: #fff;
    border-color: #09519b;
}
.ud-modal-btn.primary:hover {
    background: #0a6dad;
    box-shadow: 0 4px 12px rgba(9,81,155,.25);
}
.ud-modal-btn.primary:disabled {
    opacity: .6;
    cursor: not-allowed;
    box-shadow: none;
}
.ud-modal-btn.cancel:hover {
    background: #f5f5f5;
}

.ud-modal-error {
    display: none;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 13px;
    color: #d84040;
    line-height: 1.5;
}

/* ═══ 主账户访问注册页守卫提示条 ═══ */
.parent-guard-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 99999;
    height: 52px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 14px;
    padding: 0 20px;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #fff;
    box-shadow: 0 4px 18px rgba(245, 124, 0, .28);
}
.parent-guard-banner .pgb-text {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.parent-guard-banner .pgb-text::before {
    content: "⚠";
    font-size: 15px;
}
.parent-guard-banner .pgb-btn {
    background: #fff;
    color: #e65100;
    padding: 6px 16px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.parent-guard-banner .pgb-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
