/* ============================================================
   H2Ning 登录/注册弹窗样式
   登录按钮嵌入导航栏
   ============================================================ */

/* ---- 导航栏内的 auth 元素 ---- */
.auth-nav-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    vertical-align: middle;
    margin-left: 8px;
    font-family: "Inter", "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 13px;
}

/* 登录按钮 */
.auth-btn {
    background: transparent;
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a8a8b3;
    padding: 4px 14px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.25s ease;
    white-space: nowrap;
    position: relative;
    overflow: visible;
}
.auth-btn:before {
    content: "";
    opacity: 0;
    background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(34,211,238,0.08));
    border-radius: 100px;
    transition: opacity 0.25s;
    position: absolute;
    inset: 0;
}
.auth-btn:after {
    content: "";
    position: absolute;
    top: -1px;
    right: -1px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    border: 1.5px solid #04050a;
    box-shadow: 0 0 6px rgba(239,68,68,0.5);
}
.auth-btn:hover {
    color: #e0e0e3;
    border-color: rgba(168, 85, 247, 0.55);
}
.auth-btn:hover:before {
    opacity: 1;
}

/* Hello, {user} 文字 — 与 H2Ning 渐变色一致 */
/* Hello, {user} 文字 — 白色（必须重置 .nav-brand span 的渐变色） */
.auth-hello {
    color: #fff !important;
    background: transparent !important;
    -webkit-text-fill-color: #fff !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    animation: none !important;
    font-weight: 400;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.auth-hello span {
    background: linear-gradient(135deg, var(--neon-purple, #a855f7), var(--neon-cyan, #22d3ee), var(--neon-orange, #f97316));
    -webkit-text-fill-color: transparent;
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    animation: authHoloShimmer 3s ease-in-out infinite;
    font-weight: 700;
}

@keyframes authHoloShimmer {
    0%, to { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* 退出确认弹窗 */
.auth-confirm {
    display: none;
    background: #141518;
    border: 1px solid #25262b;
    border-radius: 16px;
    padding: 36px 40px;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.auth-confirm-text {
    color: #e0e0e3;
    font-size: 15px;
    margin: 0 0 24px;
    font-weight: 500;
}
.auth-confirm-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.auth-confirm-cancel {
    background: transparent;
    border: 1px solid #3a3a45;
    color: #82838b;
    padding: 8px 24px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s;
}
.auth-confirm-cancel:hover {
    border-color: #56575e;
    color: #e0e0e3;
}
.auth-confirm-ok {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
}
.auth-confirm-ok:hover {
    background: #dc2626;
}

/* 注销账号按钮 */
.auth-delete-row {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #1d1e22;
    text-align: center;
}
.auth-delete-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: rgba(239, 68, 68, 0.6);
    padding: 6px 18px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: all 0.2s;
}
.auth-delete-btn:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}
.auth-delete-btn:not(:disabled):hover {
    border-color: rgba(239, 68, 68, 0.5);
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

/* 前往注销按钮（红色） */
.auth-delete-go {
    background: #ef4444;
    color: #fff;
    border: none;
    padding: 8px 24px;
    border-radius: 100px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s;
}
.auth-delete-go:hover {
    background: #dc2626;
}
.auth-delete-go:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: #ef4444;
}

/* ---- Modal 遮罩 ---- */
.auth-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #82838b;
    font-weight: 400;
    letter-spacing: normal;
    user-select: none;
}
.auth-check input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.auth-check .check-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid #3a3a45;
    background: #0d0e10;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.auth-check input:checked + .check-box {
    border-color: #a855f7;
    background: linear-gradient(135deg, #a855f7, #7c3aed);
}
.auth-check input:checked + .check-box:after {
    content: "";
    width: 4px;
    height: 7px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
    display: block;
}
.auth-check input:disabled + .check-box {
    opacity: 0.4;
    cursor: not-allowed;
}
.auth-check:hover .check-box {
    border-color: #56575e;
}
.auth-check input:checked:hover + .check-box {
    border-color: #a855f7;
}

/* 两个记住选项同行 */
.auth-remember-row {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-top: 2px;
}

/* ---- Modal 遮罩 ---- */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.auth-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal {
    position: relative;
    background: #141518;
    border: 1px solid #25262b;
    border-radius: 16px;
    padding: 32px;
    width: 380px;
    max-width: 90vw;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.95) translateY(8px);
    transition: transform 0.25s ease;
}
.auth-overlay.open .auth-modal {
    transform: scale(1) translateY(0);
}

.auth-tip {
    color: #82838b;
    font-size: 12px;
    line-height: 1.5;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid #1d1e22;
    margin-bottom: 4px;
}

.auth-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    color: #56575e;
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}
.auth-close:hover {
    color: #e0e0e3;
    background: rgba(255,255,255,0.06);
}

/* ---- 标签切换 ---- */
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid #1d1e22;
}
.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: #56575e;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    padding: 10px 0;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: -1px;
}
.auth-tab.active {
    color: #e0e0e3;
    border-bottom-color: #a855f7;
}
.auth-tab:hover {
    color: #82838b;
}

/* ---- 表单 ---- */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 14px;
}
.auth-form.active {
    display: flex;
}
.auth-form label {
    color: #82838b;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.02em;
}
.auth-form input[type="text"],
.auth-form input[type="password"] {
    background: #0d0e10;
    border: 1px solid #25262b;
    border-radius: 8px;
    color: #e0e0e3;
    font-size: 14px;
    font-family: inherit;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}
.auth-form input:focus {
    border-color: #a855f7;
}
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:hover,
.auth-form input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px #0d0e10 inset !important;
    -webkit-text-fill-color: #e0e0e3 !important;
    transition: background-color 5000s ease-in-out 0s;
}
.auth-form input::placeholder {
    color: #56575e;
}

.auth-captcha-row {
    display: flex;
    gap: 10px;
    align-items: center;
}
.auth-captcha-row input {
    flex: 1;
}
.auth-captcha-display {
    background: #0d0e10;
    border: 1px solid #25262b;
    border-radius: 8px;
    padding: 10px 16px;
    color: #a855f7;
    font-size: 16px;
    font-weight: 600;
    font-family: "SF Mono", "Cascadia Code", monospace;
    white-space: nowrap;
    letter-spacing: 1px;
    user-select: none;
}
.auth-captcha-refresh {
    background: none;
    border: 1px solid #25262b;
    border-radius: 8px;
    color: #82838b;
    cursor: pointer;
    padding: 8px 10px;
    font-size: 16px;
    transition: all 0.2s ease;
    line-height: 1;
}
.auth-captcha-refresh:hover {
    border-color: #a855f7;
    color: #a855f7;
}

.auth-submit {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 100px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
}
.auth-submit:hover {
    box-shadow: 0 0 24px rgba(168,85,247,0.25);
}
.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-error {
    color: #ef4444;
    font-size: 13px;
    min-height: 0;
    line-height: 1.4;
    display: none;
}
.auth-error.show {
    display: block;
}

.auth-success {
    color: #22d3ee;
    font-size: 13px;
    min-height: 0;
    line-height: 1.4;
    display: none;
}
.auth-success.show {
    display: block;
}

/* ---- 响应式 ---- */
@media (max-width: 640px) {
    .auth-nav-item {
        gap: 6px;
        margin-left: 4px;
    }
    .auth-btn {
        padding: 4px 12px;
        font-size: 12px;
    }
    .auth-hello {
        font-size: 12px;
    }
    .auth-modal {
        padding: 24px 20px;
    }
}
