/* 🔐 登录和注册模态框样式 */

/* 模态框基础样式 */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.auth-modal.show {
    display: flex;
}

.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.auth-modal-content {
    position: relative;
    background: linear-gradient(135deg, #2c1810, #1a1a1a);
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 20px;
    max-width: 450px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

/* 模态框头部 */
.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(218, 165, 32, 0.2);
}

.auth-modal-title {
    font-size: 1.5em;
    font-weight: 700;
    color: #FFD700;
    margin: 0;
    font-family: 'Cinzel', serif;
}

.auth-modal-close {
    background: none;
    border: none;
    color: #FFD700;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
    line-height: 1;
}

.auth-modal-close:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: rotate(90deg);
}

/* 模态框主体 */
.auth-modal-body {
    padding: 30px;
}

/* 表单样式 */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #FFD700;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input {
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(218, 165, 32, 0.3);
    border-radius: 10px;
    color: #FFD700;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: 'Noto Serif SC', serif;
}

.form-group input:focus {
    outline: none;
    border-color: rgba(218, 165, 32, 0.6);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 15px rgba(218, 165, 32, 0.2);
}

.form-group input::placeholder {
    color: rgba(255, 215, 0, 0.5);
}

/* 密码输入框 */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255, 215, 0, 0.7);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
}

/* 复选框样式 */
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #DAA520;
    margin: 0;
}

.form-checkbox label {
    margin: 0;
    cursor: pointer;
    font-size: 14px;
    color: rgba(255, 215, 0, 0.9);
    line-height: 1.4;
}

.form-checkbox a {
    color: #FFD700;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.form-checkbox a:hover {
    color: #FFA500;
}

/* 提交按钮 */
.auth-submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 25px;
    background: linear-gradient(45deg, #DAA520, #FFD700);
    color: #8B4513;
    border: none;
    border-radius: 25px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
    position: relative;
    overflow: hidden;
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(218, 165, 32, 0.5);
}

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

.btn-loading {
    display: none;
}

.auth-submit-btn.loading .btn-text {
    display: none;
}

.auth-submit-btn.loading .btn-loading {
    display: inline;
}

/* 社交登录 */
.social-login {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid rgba(218, 165, 32, 0.2);
}

.social-login-title {
    text-align: center;
    color: rgba(255, 215, 0, 0.8);
    font-size: 14px;
    margin-bottom: 15px;
}

.social-buttons {
    display: flex;
    gap: 10px;
}

.social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #FFD700;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

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

.social-btn.google {
    border-color: rgba(219, 68, 55, 0.5);
}

.social-btn.google:hover {
    background: rgba(219, 68, 55, 0.1);
    border-color: rgba(219, 68, 55, 0.7);
}

.social-btn.wechat {
    border-color: rgba(7, 193, 96, 0.5);
}

.social-btn.wechat:hover {
    background: rgba(7, 193, 96, 0.1);
    border-color: rgba(7, 193, 96, 0.7);
}

/* 切换链接 */
.auth-switch {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(218, 165, 32, 0.2);
}

.auth-switch-text {
    color: rgba(255, 215, 0, 0.8);
    font-size: 14px;
}

.auth-switch-link {
    color: #FFD700;
    text-decoration: none;
    font-weight: 600;
    margin-left: 5px;
    transition: color 0.3s ease;
}

.auth-switch-link:hover {
    color: #FFA500;
    text-decoration: underline;
}

/* 错误和成功消息 */
.auth-message {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.auth-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.auth-message.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

.auth-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

/* 忘记密码 */
.forgot-password {
    text-align: center;
    margin-top: 15px;
}

.forgot-password-link {
    color: rgba(255, 215, 0, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.forgot-password-link:hover {
    color: #FFD700;
    text-decoration: underline;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .auth-modal {
        padding: 10px;
    }
    
    .auth-modal-content {
        max-width: none;
        width: 100%;
        border-radius: 15px;
    }
    
    .auth-modal-header {
        padding: 20px 25px;
    }
    
    .auth-modal-title {
        font-size: 1.3em;
    }
    
    .auth-modal-body {
        padding: 25px;
    }
    
    .form-group input {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .social-buttons {
        flex-direction: column;
    }
    
    .social-btn {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .auth-modal-header {
        padding: 15px 20px;
    }
    
    .auth-modal-body {
        padding: 20px;
    }
    
    .auth-form {
        gap: 15px;
    }
    
    .auth-submit-btn {
        padding: 18px 25px;
        font-size: 18px;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 加载动画 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(139, 69, 19, 0.3);
    border-top-color: #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 无障碍支持 */
.auth-modal-content:focus {
    outline: 2px solid #FFD700;
    outline-offset: 2px;
}

.form-group input:focus {
    outline: none;
}

.auth-submit-btn:focus {
    outline: 2px solid #8B4513;
    outline-offset: 2px;
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .auth-modal-content {
        border-width: 3px;
    }
    
    .form-group input {
        border-width: 3px;
    }
    
    .auth-submit-btn {
        border: 3px solid #8B4513;
    }
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
    .auth-modal,
    .auth-modal-content,
    .auth-message,
    .auth-submit-btn,
    .social-btn,
    .password-toggle {
        animation: none;
        transition: none;
    }
}
