/* 登录前的样式 */
.widget-login {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 6px 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.widget-login .login-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 8px 4px;
}

.widget-login .login-text {
    text-align: center;
    font-size: 13px;
    color: #333;
    margin-bottom: 10px;
}

.widget-login .login-btns {
    display: flex;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.widget-login .btn-login,
.widget-login .btn-register {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    font-size: 14px;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s ease;
    max-width: 120px;
}

.widget-login .btn-login {
    background: #1a73e8;
    color: #fff !important;
    border: none;
}

.widget-login .btn-register {
    background: #f8f9fa;
    color: #666 !important;
    border: 1px solid #e5e5e5;
}

.widget-login .btn-login i,
.widget-login .btn-register i {
    margin-right: 5px;
}

/* 登录后的样式 */
.widget-userinfo {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 6px 8px 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.widget-userinfo .user-box {
    padding-top: 4px;
    padding-bottom: 4px;
}

.widget-userinfo .user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 8px;
    width: 100%;
}

/* 头像样式 */
.widget-userinfo .avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 6px;
    border-radius: 50%;
    overflow: hidden;
}

.widget-userinfo .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 用户名样式 */
.widget-userinfo .name {
    font-size: 14px;
    margin-bottom: 4px;
    text-align: center;
}

/* VIP标签样式 */
.widget-userinfo .vip {
    text-align: center;
    margin-bottom: 6px;
}

.widget-userinfo .vip-tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    background: #fff8e6;
    border: 1px solid #ffd666;
    border-radius: 12px;
    font-size: 12px;
    color: #d4b106;
}

.widget-userinfo .vip-tag i {
    margin-right: 4px;
    font-size: 12px;
}

/* 按钮组样式 */
.widget-userinfo .user-links {
    width: 100%;
    padding: 0 8px;
    margin-top: 8px;
}

.widget-userinfo .link-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
}

.widget-userinfo .link-row:last-child {
    margin-bottom: 0;
}

.widget-userinfo .link-item {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none !important;
    color: #666 !important;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
}

/* 第一行按钮样式 */
.widget-userinfo .link-row:first-child .link-item {
    background: #1a73e8;
    color: #fff !important;
    border: none;
}

/* 会员升级按钮样式 */
.widget-userinfo .link-row:first-child .link-item[href*="vip-prices"] {
    background: #2e7d32 !important;
}

/* 退出登录按钮样式 */
.widget-userinfo .link-item.logout {
    color: #ff4d4f !important;
    border-color: #ffccc7;
    background: #fff1f0;
}

/* 按钮图标 */
.widget-userinfo .link-item i {
    margin-right: 4px;
    font-size: 12px;
}

/* 工单按钮样式 */
.widget-userinfo .ticket-row {
    justify-content: center;
    margin-top: 4px;
}

.widget-userinfo .ticket-row .link-item {
    max-width: 120px;
    background: #001337;
    color: #fff !important;
    border: none;
}

.widget-userinfo .ticket-row .link-item:hover {
    background: #001d4e;
    opacity: 0.9;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .widget-login .login-btns {
        justify-content: center;
        gap: 15px;
    }
    
    .widget-login .btn-login,
    .widget-login .btn-register {
        max-width: 100px;
    }
    
    .widget-userinfo .link-row {
        justify-content: center;
        gap: 12px;
    }
    
    .widget-userinfo .link-item {
        min-width: 100px;
        max-width: 120px;
    }
    
    .widget-userinfo .ticket-row .link-item {
        min-width: 100px;
        max-width: 120px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .widget-login .btn-login,
    .widget-login .btn-register,
    .widget-userinfo .link-item {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .widget-login .btn-login:active,
    .widget-login .btn-register:active,
    .widget-userinfo .link-item:active {
        opacity: 0.8;
    }
}

/* 添加按钮悬停效果 */
.widget-userinfo .link-row:first-child .link-item:hover {
    background: #1557b0;
    opacity: 0.9;
}

.widget-userinfo .link-row:first-child .link-item[href*="vip-prices"]:hover {
    background: #1b5e20 !important;
    opacity: 0.9;
}

.widget-userinfo .link-item:hover {
    background: #f2f2f2;
    border-color: #d5d5d5;
}

.widget-userinfo .link-item.logout:hover {
    background: #fff1f0;
    border-color: #ff4d4f;
    opacity: 0.9;
}

/* 登录按钮悬停效果 */
.widget-login .btn-login:hover {
    background: #1557b0;
    opacity: 0.9;
}

.widget-login .btn-register:hover {
    background: #f2f2f2;
    border-color: #d5d5d5;
}

/* 移动端文章页面顶部显示样式 */
.ripro-login-widget-mobile {
    display: none;
}

@media (max-width: 768px) {
    .ripro-login-widget-mobile {
        display: block;
        margin-bottom: 20px;
        background: #f8f9fa;
        border-radius: 4px;
        padding: 2px;
    }

    /* 在文章页面隐藏侧边栏的登录小部件 */
    .single-post .widget-area .ripro-login-widget {
        display: none;
    }

    /* 确保移动端顶部显示的小部件样式与原来一致 */
    .ripro-login-widget-mobile .widget-login,
    .ripro-login-widget-mobile .widget-userinfo {
        margin: 0;
        box-shadow: none;
        background: transparent;
    }
}