/* 认证容器 - 极简黑白设计 */
.auth-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: authBackdropFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 认证表单主容器 */
.auth-form {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 40px 35px;
    width: 100%;
    max-width: 420px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.37),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: authFormSlideIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

/* 表单装饰背景 - 简化为纯黑白 */
.auth-form::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, 0.03), transparent, rgba(255, 255, 255, 0.03), transparent);
    animation: authFormRotate 20s linear infinite;
    z-index: -1;
}

.auth-form::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border-radius: 20px;
    z-index: -1;
}

/* 标题样式 */
.auth-form h2 {
    color: rgba(255, 255, 255, 0.95);
    text-align: center;
    margin-bottom: 35px;
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* 表单组样式 */
.form-group {
    margin-bottom: 25px;
    position: relative;
    z-index: 1;
}

.form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* 输入框样式 */
.form-group input {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 400;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 0 0 3px rgba(255, 255, 255, 0.1),
        inset 0 1px 3px rgba(0, 0, 0, 0.2),
        0 8px 25px rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

/* 提交按钮样式 */
.submit-btn {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.1) 100%);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.6s ease;
}

.submit-btn:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn i {
    margin-right: 8px;
    font-size: 14px;
}

/* 切换按钮样式 */
.switch-btn {
    width: 100%;
    padding: 14px 20px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.switch-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
}

/* 错误消息样式 */
.error-message {
    color: rgba(255, 255, 255, 0.9);
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 400;
    display: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 消息通知样式 */
.message {
    position: fixed;
    top: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 2001;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: messageSlideIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-width: 320px;
}

.success-message {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.error-message.notification {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.info-message {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* 关闭按钮 */
.auth-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

/* 动画定义 */
@keyframes authBackdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes authFormSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes authFormRotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .auth-form {
        margin: 20px;
        padding: 30px 25px;
        max-width: none;
    }
    
    .auth-form h2 {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .form-group input,
    .submit-btn,
    .switch-btn {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .message {
        top: 20px;
        right: 20px;
        left: 20px;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .auth-form {
        margin: 15px;
        padding: 25px 20px;
    }
    
    .auth-form h2 {
        font-size: 22px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

/* 新的模态框样式 */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    animation: authBackdropFadeIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: auto;
}

.auth-modal {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 420px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.37),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: authFormSlideIn 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto;
    box-sizing: border-box;
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.auth-modal-header h2 {
    color: rgba(255, 255, 255, 0.95);
    font-size: 28px;
    font-weight: 300;
    letter-spacing: 1px;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.auth-close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.auth-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.auth-submit-btn {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px 20px;
    margin-bottom: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.1) 100%);
    color: rgba(255, 255, 255, 0.95);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-sizing: border-box;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.auth-submit-btn:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.2) 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.3);
}

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

.auth-submit-btn i {
    margin-right: 8px;
    font-size: 14px;
}

.form-switch {
    text-align: center;
    margin-top: 15px;
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.form-switch span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.switch-link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 5px;
    transition: color 0.3s ease;
}

.switch-link:hover {
    color: rgba(255, 255, 255, 1);
}

.form-actions {
    margin-top: 25px;
    width: 100%;
    box-sizing: border-box;
}

/* 防止模态框内任何元素水平滚动 */
.auth-modal * {
    box-sizing: border-box;
    max-width: 100%;
}

.auth-modal form {
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.auth-modal .auth-form {
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* 模态框内的表单元素样式 */
.auth-modal .form-group {
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.auth-modal .form-group label {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-modal .form-group input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    font-weight: 400;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
    user-select: auto;
    -webkit-user-select: auto;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-modal .form-group input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

.auth-modal .form-group input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 
        0 0 0 3px rgba(255, 255, 255, 0.1),
        inset 0 1px 3px rgba(0, 0, 0, 0.2),
        0 8px 25px rgba(255, 255, 255, 0.05);
    transform: translateY(-1px);
}

.auth-error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    text-align: center;
}

/* 确保模态框完全居中且不可拖动 */
.auth-modal-overlay {
    box-sizing: border-box;
    overflow: hidden !important;
    position: fixed !important;
    inset: 0 !important;
}

.auth-modal {
    box-sizing: border-box;
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    touch-action: none;
}

.auth-modal *, .auth-modal *::before, .auth-modal *::after {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
}

.auth-modal input, .auth-modal textarea {
    -webkit-user-select: auto;
    -khtml-user-select: auto;
    -moz-user-select: auto;
    -ms-user-select: auto;
    user-select: auto;
    touch-action: auto;
}

/* 模态框响应式调整 */
@media (max-width: 768px) {
    .auth-modal {
        width: 95%;
        padding: 25px 20px;
        margin: 20px auto;
    }
    
    .auth-modal-header h2 {
        font-size: 24px;
    }
    
    .auth-modal .form-group input,
    .auth-submit-btn {
        padding: 12px 16px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .auth-modal {
        width: 98%;
        padding: 20px 15px;
        margin: 10px auto;
    }
    
    .auth-modal-header h2 {
        font-size: 22px;
    }
    
    .auth-modal .form-group {
        margin-bottom: 18px;
    }
    
    .auth-modal .form-group input,
    .auth-submit-btn {
        padding: 12px 14px;
        font-size: 14px;
    }
}