/**
 * B2 OAuth Login - 前端样式
 */

/* OAuth按钮容器 */
.b2-oauth-buttons {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.b2-oauth-buttons h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* OAuth按钮基础样式 */
.b2-oauth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    margin: 8px;
    min-width: 200px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.b2-oauth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-decoration: none;
}

.b2-oauth-btn:active {
    transform: translateY(0);
}

.b2-oauth-btn img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 3px;
}

.b2-oauth-btn span {
    color: inherit;
}

/* Linux Do按钮 - 兼容B2主题样式 */
.b2-oauth-btn-linuxdo,
.b2-oauth-btn.linuxdo {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.b2-oauth-btn-linuxdo:hover,
.b2-oauth-btn.linuxdo:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b4999 100%);
}

/* Linux Do主题增强样式 */
.icon.b2-linuxdo::before {
    content: "🐧";
    margin-right: 5px;
}

/* 通用按钮样式（为其他平台预留） */
.b2-oauth-btn-qq {
    background: #1890ff;
    color: #fff;
}

.b2-oauth-btn-qq:hover {
    background: #40a9ff;
}

.b2-oauth-btn-weixin {
    background: #07c160;
    color: #fff;
}

.b2-oauth-btn-weixin:hover {
    background: #00a854;
}

.b2-oauth-btn-weibo {
    background: #e6162d;
    color: #fff;
}

.b2-oauth-btn-weibo:hover {
    background: #cf1322;
}

/* 加载状态 */
.b2-oauth-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.b2-oauth-btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #fff;
    border-radius: 50%;
    animation: b2-oauth-spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

@keyframes b2-oauth-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .b2-oauth-buttons {
        padding: 15px;
        margin: 15px 0;
    }

    .b2-oauth-btn {
        display: flex;
        width: 100%;
        max-width: 280px;
        margin: 5px auto;
    }

    .b2-oauth-buttons h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .b2-oauth-btn {
        min-width: 160px;
        padding: 10px 20px;
        font-size: 13px;
    }

    .b2-oauth-btn img {
        width: 18px;
        height: 18px;
    }
}

/* 与B2主题的集成样式 */
.b2-login-box .b2-oauth-buttons {
    background: transparent;
    border-top: 1px solid #e5e5e5;
    margin-top: 20px;
    padding-top: 20px;
}

.b2-register-box .b2-oauth-buttons {
    background: transparent;
    border-top: 1px solid #e5e5e5;
    margin-top: 20px;
    padding-top: 20px;
}

/* 深色主题支持 */
@media (prefers-color-scheme: dark) {
    .b2-oauth-buttons {
        background: #2c3e50;
        color: #ecf0f1;
    }

    .b2-oauth-buttons h3 {
        color: #ecf0f1;
    }

    .b2-login-box .b2-oauth-buttons,
    .b2-register-box .b2-oauth-buttons {
        background: transparent;
    }
}

/* 错误和成功状态提示 */
.b2-oauth-message {
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.b2-oauth-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.b2-oauth-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.b2-oauth-message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* 用户中心OAuth信息显示 */
.b2-oauth-user-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.b2-oauth-user-info h4 {
    margin: 0 0 15px 0;
    color: #495057;
}

.b2-oauth-user-platform {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 10px;
}

.b2-oauth-user-platform img {
    width: 24px;
    height: 24px;
    margin-right: 12px;
}

.b2-oauth-user-platform .platform-name {
    font-weight: 500;
    color: #495057;
}

.b2-oauth-user-platform .platform-date {
    margin-left: auto;
    font-size: 12px;
    color: #6c757d;
}

.b2-oauth-unlink-btn {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.b2-oauth-unlink-btn:hover {
    background: #c82333;
}

/* 登录表单增强 */
.b2-oauth-divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
}

.b2-oauth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e5e5;
}

.b2-oauth-divider span {
    background: #fff;
    padding: 0 15px;
    color: #6c757d;
    font-size: 14px;
    position: relative;
    z-index: 1;
}

/* 动画效果 */
.b2-oauth-btn {
    animation: b2-oauth-fadeIn 0.5s ease-in-out;
}

@keyframes b2-oauth-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}