/**
 * 统一认证系统样式
 * 用于登录、注册、找回密码的统一UI
 */

/* 模态框背景 */
.unified-auth-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: transparent;
    /* display由JS控制，不使用!important */
    display: flex;
    justify-content: center !important;
    align-items: center !important;
    z-index: 10000 !important;
}

/* 模态框内容 */
.unified-auth-content {
    background: #1a1a2e !important;
    border: 3px solid #FFD700 !important;
    border-radius: 20px !important;
    box-shadow: 
        0 0 40px rgba(255, 215, 0, 0.2),
        0 20px 60px rgba(0, 0, 0, 0.5) !important;
    max-width: 540px !important;
    width: 540px !important;
    min-height: auto !important;
    height: auto !important;
    margin: 0 auto !important;
    opacity: 1 !important;
    box-sizing: border-box !important;
    animation: none !important;
    transition: none !important;
    transform: none !important;
}

/* 表单容器 */
.auth-form-container {
    width: 100%;
}

/* 标题 */
.auth-title {
    color: #FFD700;
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

/* 输入组 */
.auth-input-group {
    margin-bottom: 8px;
}

.auth-input-group label {
    display: block;
    color: #ccc;
    font-size: 0.95rem;
    margin-bottom: 8px;
    font-weight: 500;
}

/* 密保问题选择框文本居中 */
.auth-input-group select {
    text-align: center;
    text-align-last: center;
}

/* 输入框包装器 */
.auth-input-wrapper {
    position: relative;
}

/* 输入框 */
.auth-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    transition: all 0.3s;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: #FFD700;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.2);
}

.auth-input::placeholder {
    color: #666;
}

/* 下拉选择框 */
select.auth-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23FFD700' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select.auth-input option {
    background: #1a1a2e;
    color: #fff;
}

/* 复选框组 */
.auth-checkbox-group {
    margin-bottom: 20px;
}

.auth-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ccc;
    font-size: 0.95rem;
    cursor: pointer;
}

.auth-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #FFD700;
}

/* 提示文字 */
.auth-hint {
    text-align: center;
    color: #FFD700;
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.5;
    font-weight: 500;
    white-space: nowrap;
}

/* 按钮容器 */
.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

/* 按钮基础样式 */
.auth-btn {
    width: 100%;
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 主按钮 */
.auth-btn-primary {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    margin-left: -9px;
}

body.share-page-mode.edit-mode .auth-btn-primary {
    position: relative;
    top: -1.5px;
}

.auth-btn-primary:hover:not(:disabled) {
    background: linear-gradient(45deg, #FFA500, #FFD700);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
    transform: translateY(-2px);
}

/* 次要按钮（注册新账号） */
.auth-btn-secondary {
    background: linear-gradient(45deg, #FF8C00, #FFA500);
    color: #000;
    border: 1px solid rgba(255, 140, 0, 0.5);
    box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
    margin-left: -9px;
}

.auth-btn-secondary:hover:not(:disabled) {
    background: linear-gradient(45deg, #FFA500, #FF8C00);
    border-color: #FF8C00;
    box-shadow: 0 6px 20px rgba(255, 140, 0, 0.5);
    transform: translateY(-2px);
}

/* 文本按钮（忘记密码、取消） */
.auth-btn-text {
    background: transparent;
    color: #00FF7F;
    border: none;
    font-size: 0.9rem;
    padding: 10px;
    margin-left: -4px;
}

.auth-btn-text:hover:not(:disabled) {
    color: #00FF00;
    text-shadow: 0 0 10px rgba(0, 255, 127, 0.5);
}

/* 清除按钮 */
.auth-btn-clear {
    background: transparent;
    border: 1px solid rgba(255, 69, 0, 0.5);
    color: #FF6347;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.auth-btn-clear:hover {
    background: rgba(255, 69, 0, 0.1);
    border-color: #FF6347;
}

/* Toast提示样式 */
.unified-toast {
    position: fixed;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 260px;
    max-width: 420px;
    animation: toastSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    /* 半透明背景 + 毛玻璃效果 */
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* 纯金色字体 */
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    text-align: center;
}

@media (max-width: 768px) {
    .unified-toast {
        font-size: 0.9rem;
        padding: 8px 16px;
        min-width: 200px;
    }

    .unified-toast span {
        white-space: nowrap !important;
    }

    .unified-toast::before {
        width: 20px;
        height: 20px;
        font-size: 0.9rem;
    }
}

/* 成功提示 */
.unified-toast-success {
    /* 霓虹绿色边框 */
    border: 2px solid #00FF7F;
    box-shadow: 
        0 0 20px rgba(0, 255, 127, 0.6),
        0 0 40px rgba(0, 255, 127, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.6);
}

.unified-toast-success::before {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0, 255, 127, 0.2);
    border: 2px solid #00FF7F;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: bold;
    color: #00FF7F;
    text-shadow: 0 0 10px rgba(0, 255, 127, 0.8);
}

/* 错误提示 */
.unified-toast-error {
    /* 霓虹红色边框 */
    border: 2px solid #FF1744;
    box-shadow: 
        0 0 20px rgba(255, 23, 68, 0.6),
        0 0 40px rgba(255, 23, 68, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.6);
}

.unified-toast-error::before {
    content: "✕";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 23, 68, 0.2);
    border: 2px solid #FF1744;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: bold;
    color: #FF1744;
    text-shadow: 0 0 10px rgba(255, 23, 68, 0.8);
}

/* 警告提示 */
.unified-toast-warning {
    /* 霓虹橙色边框 */
    border: 2px solid #FF9800;
    box-shadow: 
        0 0 20px rgba(255, 152, 0, 0.6),
        0 0 40px rgba(255, 152, 0, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.6);
}

.unified-toast-warning::before {
    content: "⚠";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 152, 0, 0.2);
    border: 2px solid #FF9800;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: bold;
    color: #FF9800;
    text-shadow: 0 0 10px rgba(255, 152, 0, 0.8);
}

/* 确认弹窗动画 */
@keyframes confirmBoxIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Toast动画 */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.9);
    }
}

/* 旧的fadeIn/fadeOut动画保留兼容性 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* 自定义确认弹窗 */
.unified-confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100001;
    /* 不使用动画，避免位置偏移 */
}

.unified-confirm-box {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid #FFD700;
    border-radius: 16px;
    padding: 30px 40px;
    min-width: 360px;
    max-width: 480px;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.6),
        0 0 60px rgba(255, 215, 0, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.6);
    animation: confirmBoxIn 0.3s ease-out forwards;
    /* 确保弹窗不会移动位置 */
    transform-origin: center center;
}

.unified-confirm-title {
    color: #FFD700;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.unified-confirm-message {
    color: #FFD700;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.6;
}

.unified-confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.unified-confirm-btn {
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid;
    min-width: 120px;
}

.unified-confirm-btn-yes {
    background: rgba(255, 23, 68, 0.2);
    color: #FF1744;
    border-color: #FF1744;
    box-shadow: 
        0 0 15px rgba(255, 23, 68, 0.4),
        0 0 30px rgba(255, 23, 68, 0.2);
}

.unified-confirm-btn-yes:hover {
    background: rgba(255, 23, 68, 0.3);
    box-shadow: 
        0 0 20px rgba(255, 23, 68, 0.6),
        0 0 40px rgba(255, 23, 68, 0.4);
    transform: translateY(-2px);
}

.unified-confirm-btn-no {
    background: rgba(0, 255, 127, 0.2);
    color: #00FF7F;
    border-color: #00FF7F;
    box-shadow: 
        0 0 15px rgba(0, 255, 127, 0.4),
        0 0 30px rgba(0, 255, 127, 0.2);
}

.unified-confirm-btn-no:hover {
    background: rgba(0, 255, 127, 0.3);
    box-shadow: 
        0 0 20px rgba(0, 255, 127, 0.6),
        0 0 40px rgba(0, 255, 127, 0.4);
    transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .unified-auth-content {
        width: 90% !important;
        max-width: 90% !important;
        min-height: auto !important;
    }
    
    .auth-title {
        font-size: 1.5rem;
    }
    
    .auth-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .unified-confirm-box {
        width: 90%;
        min-width: auto;
        padding: 25px 30px;
    }
}
