/**
 * 认证和用户界面样式
 * 用于登录、注册、用户资料等界面
 */

/* 通用按钮样式 */
.auth-btn {
    padding: 8px 15px;
    background-color:  rgba(79, 172, 254, 0.15);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.auth-btn:hover {
    background-color: rgba(18, 36, 64, 0.95);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

/* 登录、注册、用户信息等认证相关模态框样式 */
.login-modal .modal-content,
.register-modal .modal-content,
.user-profile-modal .modal-content,
.change-password-modal .modal-content,
#login-modal .modal-content,
#register-modal .modal-content,
#user-profile-modal .modal-content, 
#change-password-modal .modal-content {
    background-color: rgba(22, 28, 36, 0.95);
    margin: auto;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    color: #e0e0e0;
    border: 1px solid rgba(114, 129, 151, 0.2);
    animation: modalFadeIn 0.3s ease-in-out;
}

/* 联系方式 */
.contact-content {
    max-width: 600px;
    width: 80%;
}

/* 功能特点、隐私政策、服务条款等内容类模态框 */
.features-content,
.privacy-content,
.terms-content {
    max-width: 900px;
    width: 80%;
}

/* 基础模态框样式 - 适用于所有模态框共有的属性 */
.modal-content {
    background-color: rgba(22, 28, 36, 0.95);
    margin: auto;
    padding: 25px;
    border-radius: 10px;
    position: relative;
    color: #e0e0e0;
    border: 1px solid rgba(114, 129, 151, 0.2);
    animation: modalFadeIn 0.3s ease-in-out;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #888;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: #fff;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ccc;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(114, 129, 151, 0.4);
    border-radius: 6px;
    background-color: rgba(30, 38, 50, 0.6);
    color: #fff;
    font-size: 16px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #2c72d9;
    background-color: rgba(30, 38, 50, 0.9);
}

.password-hint {
    font-size: 12px;
    color: #888;
    margin-left: 5px;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.submit-btn {
    padding: 10px 20px;
    background-color: #2c72d9;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.submit-btn:hover {
    background-color: #3683f0;
}

.switch-btn {
    /* background: none;
    border: none;
    color: #2c72d9;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.3s ease; */
    padding: 10px 20px;
    background-color: #2c72d9;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.switch-btn:hover {
    /* color: #3683f0;
    text-decoration: underline; */
    background-color: #3683f0;
}

/* OAuth登录选项样式 */
.oauth-options {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(114, 129, 151, 0.2);
    padding-bottom: 0px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px;
    margin-bottom: 5px;
    border-radius: 6px;
    border: none;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.oauth-btn i {
    margin-right: 10px;
    font-size: 18px;
}

.google-btn {
    background-color: #fff;
    color: #333;
}

.google-btn:hover {
    background-color: #f1f1f1;
}

.github-btn {
    background-color: #24292e;
    color: #fff;
}

.github-btn:hover {
    background-color: #3a3f46;
}

.oauth-divider {
    position: relative;
    text-align: center;
    margin: 5px 0;
}

.oauth-divider span {
    background-color: rgba(22, 28, 36, 0.95);
    padding: 0 15px;
    position: relative;
    color: #888;
    font-size: 14px;
}

.oauth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgba(114, 129, 151, 0.2);
    z-index: -1;
}

/* 用户资料样式 */
.user-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.user-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 20px;
    border: 3px solid rgba(114, 129, 151, 0.4);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    width: 100%;
    margin-bottom: 25px;
}

.user-info p {
    margin: 8px 0;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid rgba(114, 129, 151, 0.2);
    padding-bottom: 8px;
}

.user-info p span:first-child {
    color: #888;
    font-weight: 500;
}

.user-info p span:last-child {
    color: #e0e0e0;
    font-weight: 600;
}

.user-actions {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.action-btn {
    padding: 10px 15px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#logout-btn {
    background-color: #d93535;
    color: #fff;
}

#logout-btn:hover {
    background-color: #c52c2c;
}

#change-password-btn {
    background-color: #2c72d9;
    color: #fff;
}

#change-password-btn:hover {
    background-color: #215db2;
}

/* 响应式样式 */
@media screen and (max-width: 600px) {
    #login-modal .modal-content,
    #register-modal .modal-content,
    #user-profile-modal .modal-content, 
    #change-password-modal .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    /* 移动端用户信息模态框专门缩小样式 */
    #user-profile-modal .modal-content {
        max-width: 320px;
        padding: 16px;
        width: 90%;
    }
    
    /* 缩小用户头像 */
    #user-profile-modal .user-avatar {
        width: 70px;
        height: 70px;
        margin-bottom: 15px;
        border-width: 2px;
    }
    
    /* 缩小用户信息字体和间距 */
    #user-profile-modal .user-info {
        margin-bottom: 20px;
    }
    
    #user-profile-modal .user-info p {
        margin: 6px 0;
        padding-bottom: 6px;
        font-size: 13px;
    }
    
    #user-profile-modal .user-info p span:first-child {
        font-size: 12px;
    }
    
    #user-profile-modal .user-info p span:last-child {
        font-size: 13px;
    }
    
    /* 缩小操作按钮 */
    #user-profile-modal .user-actions {
        gap: 8px;
    }
    
    #user-profile-modal .action-btn {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1;
    }
    
    /* 缩小关闭按钮 */
    #user-profile-modal .close-modal {
        top: 10px;
        right: 15px;
        font-size: 18px;
    }
    
    #features-modal .modal-content,
    #contact-modal .modal-content,
    #privacy-modal .modal-content,
    #terms-modal .modal-content {
        width: 95%;
        max-width: 95%;
    }

    .form-actions {
        flex-direction: column;
        gap: 15px;
    }

    .submit-btn, .switch-btn {
        width: 100%;
    }

    .user-actions {
        flex-direction: column;
        gap: 10px;
    }

    .action-btn {
        width: 100%;
    }
}

/* Dark Mode覆盖 */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background-color: rgba(22, 28, 36, 0.95);
        color: #e0e0e0;
    }

    .form-group input {
        background-color: rgba(30, 38, 50, 0.6);
        color: #fff;
    }

    .form-group input:focus {
        background-color: rgba(30, 38, 50, 0.9);
    }
}

/* 标题样式 */
#login-title, #register-title, #profile-title, #change-password-title {
    text-align: center;
    margin-bottom: 25px;
    color: #fff;
    text-shadow: 0 0 10px rgba(44, 114, 217, 0.3);
}

/* 内容型模态框标题样式 */
.features-title, .contact-title, .privacy-title, .terms-title {
    margin-bottom: 20px;
}

/* OAuth回调页面样式 */
.oauth-callback-container {
    text-align: center;
    padding: 40px;
}

.oauth-callback-container h2 {
    margin-bottom: 15px;
    color: #fff;
}

.oauth-callback-container p {
    color: #ccc;
}


/* 模态框开启时禁止滚动 */
body.modal-open {
    overflow: hidden;
}